大理访客登记h5待测试
diff --git a/src/main/java/com/supwisdom/dlpay/api/controller/DoorApiAction.java b/src/main/java/com/supwisdom/dlpay/api/controller/DoorApiAction.java
new file mode 100644
index 0000000..6211967
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/api/controller/DoorApiAction.java
@@ -0,0 +1,129 @@
+package com.supwisdom.dlpay.api.controller;
+
+import com.supwisdom.dlpay.api.bean.BaseResp;
+import com.supwisdom.dlpay.customer.bean.CustomerSearchBean;
+import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
+import com.supwisdom.dlpay.framework.data.SystemDateTime;
+import com.supwisdom.dlpay.framework.service.SystemUtilService;
+import com.supwisdom.dlpay.framework.util.DateUtil;
+import com.supwisdom.dlpay.framework.util.PageResult;
+import com.supwisdom.dlpay.mainservice.service.WebInterfaceService;
+import com.supwisdom.dlpay.system.domain.TDept;
+import com.supwisdom.dlpay.system.service.SystemService;
+import com.supwisdom.dlpay.visitormanage.domain.EVisitorCheckDtl;
+import com.supwisdom.dlpay.visitormanage.domain.VisitorCheckBean;
+import com.supwisdom.dlpay.visitormanage.service.VisitormanageService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Controller //将所有方法标识@ResponseBody注解
+@RequestMapping("/api/doorapi")
+public class DoorApiAction {
+ @Autowired
+ private SystemUtilService systemUtilService;
+ @Autowired
+ private SystemService systemService;
+ @Autowired
+ private WebInterfaceService webInterfaceService;
+ @Autowired
+ private VisitormanageService visitormanageService;
+
+ @RequestMapping("/checkonline")
+ @ResponseBody
+ public BaseResp checkonline() {
+ SystemDateTime dt = systemUtilService.getSysdatetime();
+
+ BaseResp resp = new BaseResp();
+ resp.setRetcode("0");
+ resp.setRetmsg("连接成功");
+ resp.setData(dt);
+ return resp;
+ }@RequestMapping("/getdeptlist")
+ @ResponseBody
+ public BaseResp getdeptlist() {
+ BaseResp resp = new BaseResp();
+
+ List<TDept> deptlist=null;
+ try{
+ deptlist=systemService.findAllDept();
+ }catch (Exception e){
+ e.printStackTrace();
+ resp.setRetcode("99");
+ resp.setRetmsg("系统错误");
+ }
+ if(deptlist==null){
+ deptlist=new ArrayList<>();
+ }
+ resp.setRetcode("0");
+ resp.setRetmsg("查询成功");
+ resp.setData(deptlist);
+ return resp;
+ }@RequestMapping("/getcustlist")
+ @ResponseBody
+ public BaseResp getcustlist(@RequestParam(value = "deptcode",required = true,defaultValue = "")String deptcode) {
+ List<TCustomerInfo> custlist =null;
+ BaseResp resp = new BaseResp();
+
+ try{
+ CustomerSearchBean searchBean = new CustomerSearchBean();
+ searchBean.setDeptcode(deptcode);
+ PageResult<TCustomerInfo> bean= webInterfaceService.getCustomerInfoPage(searchBean);
+ custlist = bean.getData();
+
+ }catch (Exception e){
+ e.printStackTrace();
+ resp.setRetcode("99");
+ resp.setRetmsg("系统错误");
+ }
+ if(custlist==null){
+ custlist=new ArrayList<>();
+ }
+ resp.setRetcode("0");
+ resp.setRetmsg("OK");
+ resp.setData(custlist);
+ return resp;
+ }
+ @RequestMapping(value = "/visitorcheck", method = {RequestMethod.POST})
+ @ResponseBody
+ public BaseResp visitorcheck(@RequestBody VisitorCheckBean postData) {
+ BaseResp resp = new BaseResp();
+
+ SystemDateTime dt = systemUtilService.getSysdatetime();
+ try{
+ String time = DateUtil.getNow("yyyyMMddhhmmss");
+ EVisitorCheckDtl eVisitorCheckDtl=new EVisitorCheckDtl();
+ eVisitorCheckDtl.setCompany(postData.getCompany());
+ eVisitorCheckDtl.setCustid(postData.getCustid());
+ eVisitorCheckDtl.setDeptcode(postData.getDeptcode());
+ eVisitorCheckDtl.setPhone(postData.getPhone());
+ eVisitorCheckDtl.setRemarks(postData.getRemarks());
+ eVisitorCheckDtl.setVisitorname(postData.getVisitorname());
+ eVisitorCheckDtl.setTransdate(time.substring(0,8));
+ eVisitorCheckDtl.setStatus(1);
+ eVisitorCheckDtl.setIdno(postData.getIdno());
+ eVisitorCheckDtl.setSex(postData.getSex());
+ eVisitorCheckDtl.setTranstime(time.substring(8));
+
+ boolean b = visitormanageService.saveVisitorCheck(eVisitorCheckDtl);
+ if(b){
+ resp.setRetcode("0");
+ resp.setRetmsg("保存成功");
+ }else {
+ resp.setRetcode("99");
+ resp.setRetmsg("保存失败");
+
+ }
+ }catch (Exception e){
+ e.printStackTrace();
+ resp.setRetcode("99");
+ resp.setRetmsg("系统错误");
+ }
+ return resp;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/app/controller/AppController.java b/src/main/java/com/supwisdom/dlpay/app/controller/AppController.java
index d4f440a..92179ac 100644
--- a/src/main/java/com/supwisdom/dlpay/app/controller/AppController.java
+++ b/src/main/java/com/supwisdom/dlpay/app/controller/AppController.java
@@ -9,15 +9,16 @@
import com.supwisdom.dlpay.ncmgr.domain.TNcDevice;
import com.supwisdom.dlpay.ncmgr.service.NcService;
import com.supwisdom.dlpay.util.RedisUtil;
+import com.supwisdom.dlpay.visitormanage.domain.EVisitorCheckDtl;
+import com.supwisdom.dlpay.visitormanage.domain.VisitorCheckBean;
+import com.supwisdom.dlpay.visitormanage.service.VisitormanageService;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -39,20 +40,31 @@
private NcService ncService;
@Autowired
private VisitorConfig visitorConfig;
+ @Autowired
+ private VisitormanageService visitormanageService;
private String wechatURL, redirect, appid, appsecret;
+
@RequestMapping("/appindex")
- public String impdevindex(@RequestParam(value = "userid")String userId,Model model){
+ public String impdevindex(@RequestParam(value = "userid") String userId, Model model) {
model.addAttribute("userId", userId);
return "apph5/remoteH5";
}
+
@RequestMapping("/doorappindex")
- public String doorappindex(@RequestParam(value = "custid")String custid,Model model){
+ public String doorappindex(@RequestParam(value = "custid") String custid, Model model) {
model.addAttribute("userId", custid);
return "apph5/doorappindex";
}
+ @RequestMapping("/doorappvisitor")
+ public String doorappvisitor(@RequestParam(value = "custid") String custid, Model model) {
+
+ model.addAttribute("custid", custid);
+ model.addAttribute("deptcode", 0);
+ return "apph5/applyforvisitor";
+ }
@RequestMapping("/qrcodevisitor")
- public String qrcodevisitor(@RequestParam(value = "inoutflag")String inoutflag,HttpServletRequest request, HttpServletResponse response,Model model){
+ public String qrcodevisitor(@RequestParam(value = "inoutflag") String inoutflag, HttpServletRequest request, HttpServletResponse response, Model model) {
String code = request.getParameter("code");
String state = request.getParameter("state");
getWechatConfig();
@@ -64,10 +76,10 @@
if (!StringUtils.isEmpty(state) && state.contains("login")) {
needinfor = true;
}
- int issuccess=0;
+ int issuccess = 0;
String appid = visitorConfig.getAppid();
String appsecret = visitorConfig.getSecret();
- String redirect=visitorConfig.getRedirect();
+ String redirect = visitorConfig.getRedirect();
logger.error("appid=" + appid);
logger.error("appsecret=" + appsecret);
logger.error("redirect=" + redirect);
@@ -77,8 +89,8 @@
if (resp != null) {
logger.error("openid=" + resp.getOpenid());
- if(resp.getOpenid()==null){
- issuccess=1;
+ if (resp.getOpenid() == null) {
+ issuccess = 1;
}
session.setAttribute("wx_openid", resp.getOpenid());
if (!StringUtils.isEmpty(resp.getWxid())) {
@@ -87,41 +99,55 @@
}
}
- session.setAttribute("openmsg",resp);
- session.setAttribute("inoutflag",inoutflag);
+ session.setAttribute("openmsg", resp);
+ session.setAttribute("inoutflag", inoutflag);
model.addAttribute("issuccess", issuccess);
- if(issuccess==1){
+ if (issuccess == 1) {
return "apph5/attention";
}
+ //WechatResp openmsg = new WechatResp();
+ //openmsg.setCity("上海");
+ boolean b = appService.saveOpenmsg(resp, Integer.parseInt(inoutflag));
+ model.addAttribute("issuccess", b);
+ if (b) {
- return "apph5/appvisitor";
+ model.addAttribute("msg", "欢迎");
+ } else {
+ model.addAttribute("msg", "您还未关注公众号,请先关注");
+
+ }
+ return "apph5/visitorresult";
+
}
+
@RequestMapping("/qrcodemanage")
- public String qrcodemanage(Model model){
- String qrcode="";
+ public String qrcodemanage(Model model) {
+ String qrcode = "";
String appid = visitorConfig.getAppid();
- qrcode="1";
+ qrcode = "1";
model.addAttribute("qrcode", qrcode);
return "apph5/getinoutflag";
}
+
@RequestMapping("/appvisitor")
- public String appvisitor(Model model){
+ public String appvisitor(Model model) {
return "apph5/applyforvisitor";
}
+
@RequestMapping("/getqrcode")
- public String getcode(@RequestParam(value = "inoutflag")String inoutflag,Model model){
- String qrcode="";
+ public String getcode(@RequestParam(value = "inoutflag") String inoutflag, Model model) {
+ String qrcode = "";
String appid = visitorConfig.getAppid();
String redirect = visitorConfig.getRedirect();
//qrcode="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appid+"&redirect_uri="+redirect+"%2fapp%2fqrcodevisitor%3finoutflag%3d"+inoutflag+"&response_type=code&scope=snsapi_userinfo&state=&connect_redirect=1#wechat_redirect";
- qrcode="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appid+"&redirect_uri="+redirect+"%2fapp%2fqrcodevisitor%3finoutflag%3d"+inoutflag+"&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
+ qrcode = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + appid + "&redirect_uri=" + redirect + "%2fapp%2fqrcodevisitor%3finoutflag%3d" + inoutflag + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
model.addAttribute("qrcode", qrcode);
return "apph5/visitorcode";
}
@RequestMapping("/getvisitor")
- public String getvistorin(HttpServletRequest request, Model model){
+ public String getvistorin(HttpServletRequest request, Model model) {
HttpSession session = request.getSession();
WechatResp openmsg = (WechatResp) session.getAttribute("openmsg");
logger.error("openid=" + openmsg);
@@ -130,12 +156,12 @@
//WechatResp openmsg = new WechatResp();
//openmsg.setCity("上海");
boolean b = appService.saveOpenmsg(openmsg, Integer.parseInt(inoutflag));
- model.addAttribute("issuccess",b );
- if(b){
+ model.addAttribute("issuccess", b);
+ if (b) {
- model.addAttribute("msg","欢迎" );
- }else {
- model.addAttribute("msg","您还未关注公众号,请先关注" );
+ model.addAttribute("msg", "欢迎");
+ } else {
+ model.addAttribute("msg", "您还未关注公众号,请先关注");
}
return "apph5/visitorresult";
@@ -146,10 +172,11 @@
//Map<String, String> map = payMethodService.getPaymethodConfigMap("wechat_ykt");
appid = visitorConfig.getAppid();
appsecret = visitorConfig.getSecret();
- redirect=visitorConfig.getRedirect();
+ redirect = visitorConfig.getRedirect();
}
+
@RequestMapping("/appMintUIindex")
- public String appMintUIindex(@RequestParam(value = "userid")String userId,Model model){
+ public String appMintUIindex(@RequestParam(value = "userid") String userId, Model model) {
model.addAttribute("userId", userId);
return "apph5/remoteMintUIH5";
}
@@ -157,27 +184,64 @@
//根据用户使用次数加载用户有权限开门的设备---常使用设备优先的排序原则
@ResponseBody
@RequestMapping("/loadAppDevList")
- public Map loadAppDevList(@RequestParam(value = "userId",required = true,defaultValue = "")String userId){
+ public Map loadAppDevList(@RequestParam(value = "userId", required = true, defaultValue = "") String userId) {
Map map = new HashMap();
- try{
+ try {
List<TNcDevice> devList = appService.findAllDevByUserId(userId);
map.put("devList", devList);
- }catch (Exception e){
+ } catch (Exception e) {
e.printStackTrace();
}
return map;
}
+ @ResponseBody
+ @RequestMapping(value = "/apply", method = {RequestMethod.POST})
+ public Map applyforvisitor(@RequestBody VisitorCheckBean postData) {
+ Map map = new HashMap();
+
+
+ try {
+ String time = DateUtil.getNow("yyyyMMddhhmmss");
+ EVisitorCheckDtl eVisitorCheckDtl = new EVisitorCheckDtl();
+ eVisitorCheckDtl.setCompany(postData.getCompany());
+ eVisitorCheckDtl.setCustid(postData.getCustid());
+ eVisitorCheckDtl.setDeptcode(postData.getDeptcode());
+ eVisitorCheckDtl.setPhone(postData.getPhone());
+ eVisitorCheckDtl.setRemarks(postData.getRemarks());
+ eVisitorCheckDtl.setVisitorname(postData.getVisitorname());
+ eVisitorCheckDtl.setTransdate(time.substring(0, 8));
+ eVisitorCheckDtl.setStatus(1);
+ eVisitorCheckDtl.setIdno(postData.getIdno());
+ eVisitorCheckDtl.setSex(postData.getSex());
+ eVisitorCheckDtl.setTranstime(time.substring(8));
+
+ boolean b = visitormanageService.saveVisitorCheck(eVisitorCheckDtl);
+ if(b){
+ map.put("errStr", "");
+ }else {
+ map.put("errStr", "保存失败");
+
+ }
+ }catch (Exception e){
+ e.printStackTrace();
+ map.put("errStr", "保存失败!");
+ }
+
+ return map;
+ }
+
+
//根据设备名称模糊查询
@ResponseBody
@RequestMapping("/searchByDevName")
- public Map searchByDevName(@RequestParam(value = "userId",required = true,defaultValue = "")String userId,
- @RequestParam(value = "devName",required = true,defaultValue = "")String devName ){
+ public Map searchByDevName(@RequestParam(value = "userId", required = true, defaultValue = "") String userId,
+ @RequestParam(value = "devName", required = true, defaultValue = "") String devName) {
Map map = new HashMap();
- try{
- List<TNcDevice> devList = appService.findAllDevByUserIdAndDevName(userId,devName);
+ try {
+ List<TNcDevice> devList = appService.findAllDevByUserIdAndDevName(userId, devName);
map.put("devNameList", devList);
- }catch (Exception e){
+ } catch (Exception e) {
e.printStackTrace();
}
return map;
@@ -197,26 +261,27 @@
/**
* App远程开门
+ *
* @param devId
* @return
*/
@ResponseBody
@RequestMapping("/openDoorById")
- public Map openDoorById(@RequestParam(value = "devId",required = true,defaultValue = "")String devId,
- @RequestParam(value = "userId",required = true,defaultValue = "")String userId){
+ public Map openDoorById(@RequestParam(value = "devId", required = true, defaultValue = "") String devId,
+ @RequestParam(value = "userId", required = true, defaultValue = "") String userId) {
Map map = new HashMap();
String message = "";
try {
String ctrlcode = "1"; //---开门code 1指 开一次门
TNcDevice ncDevice = ncService.getDevInfoByDevid(Integer.parseInt(devId));
- if (ncDevice!=null && "C".equals(ncDevice.getDevtype())){
+ if (ncDevice != null && "C".equals(ncDevice.getDevtype())) {
message = "请选择要开门的门锁!";
map.put("message", message);
return map;
}
int devNo = ncDevice.getDevno();
- String rmtDev = RedisUtil.get("remote_"+ncDevice.getDevphyid());
- if ("-5".equals(rmtDev)){ //数据库连接池异常 返回数据为 -5
+ String rmtDev = RedisUtil.get("remote_" + ncDevice.getDevphyid());
+ if ("-5".equals(rmtDev)) { //数据库连接池异常 返回数据为 -5
message = "缓存数据异常,请联系管理员!";
map.put("message", message);
return map;
@@ -224,10 +289,10 @@
if (StringUtil.isEmpty(rmtDev)) {
rmtDev = "----------------";
- }else {
+ } else {
boolean flag = judgeRemoteStr(rmtDev, devNo, ctrlcode);
- if (flag){
- message="门已被开!";
+ if (flag) {
+ message = "门已被开!";
map.put("message", message);
return map;
}
@@ -237,17 +302,17 @@
RedisUtil.set("remote_" + ncDevice.getDevphyid(), tmpVal);
//每次开门成功记录 此用户开门设备 次数 以便查询时根据经常使用设备进行 查询
boolean a = appService.recordFre(userId, Integer.parseInt(devId));
- if (a=false){
- message="记录开门次数失败!";
+ if (a = false) {
+ message = "记录开门次数失败!";
}
//存储流水
boolean b = appService.saveAppTDoorDtlByUserIdAndDevId(devId, userId);
- if (b=false){
- message=message+"流水存储失败!";
+ if (b = false) {
+ message = message + "流水存储失败!";
}
- }catch (Exception e){
+ } catch (Exception e) {
e.printStackTrace();
message = "手机开门失败!";
}
@@ -255,9 +320,9 @@
return map;
}
- private boolean judgeRemoteStr(String rmtDev,int devNo,String ctrlCode){
- String rmtStr = rmtDev.substring(devNo-1, devNo);
- if (rmtStr.equals(ctrlCode)){
+ private boolean judgeRemoteStr(String rmtDev, int devNo, String ctrlCode) {
+ String rmtStr = rmtDev.substring(devNo - 1, devNo);
+ if (rmtStr.equals(ctrlCode)) {
return true;
}
return false;
diff --git a/src/main/java/com/supwisdom/dlpay/app/domain/EWechatAccount.java b/src/main/java/com/supwisdom/dlpay/app/domain/EWechatAccount.java
index b2980df..33d4d63 100644
--- a/src/main/java/com/supwisdom/dlpay/app/domain/EWechatAccount.java
+++ b/src/main/java/com/supwisdom/dlpay/app/domain/EWechatAccount.java
@@ -12,6 +12,7 @@
@Table(name = "E_WECHAT_ACCOUNT")
public class EWechatAccount implements Serializable {
+ private Integer id;
private String wxid;
private String userid;
private Double appkey;
@@ -28,10 +29,18 @@
private String privilege;
private String unionid;
private String cardcode;
-
@Id
- @Column(name = "WXID", unique = true, nullable = false, length = 32)
+ @Column(name = "ID", unique = true, nullable = false, length = 32)
@GeneratedValue(strategy = GenerationType.AUTO)
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ @Column(name = "WXID", length = 32)
public String getWxid() {
return wxid;
}
diff --git a/src/main/java/com/supwisdom/dlpay/app/service/impl/AppServiceImpl.java b/src/main/java/com/supwisdom/dlpay/app/service/impl/AppServiceImpl.java
index b8aa93c..1cc093b 100644
--- a/src/main/java/com/supwisdom/dlpay/app/service/impl/AppServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/app/service/impl/AppServiceImpl.java
@@ -223,6 +223,7 @@
eVisitorDtl.setCountry(openmsg.getCountry());
eVisitorDtl.setHeadimgurl(openmsg.getHeadimgurl());
eVisitorDtl.setUnionid(openmsg.getUnionid());
+ eVisitorDtl.setStatus(1);
eVisitorDtl.setTransdate(DateUtil.getNow().substring(0,8));
eVisitorDtl.setTranstime(DateUtil.getNow().substring(8));
boolean b = appDao.saveVisitor(eVisitorDtl);
diff --git a/src/main/java/com/supwisdom/dlpay/conference/api/controller/ConerenceApiController.java b/src/main/java/com/supwisdom/dlpay/conference/api/controller/ConerenceApiController.java
index 7d655e4..d443871 100644
--- a/src/main/java/com/supwisdom/dlpay/conference/api/controller/ConerenceApiController.java
+++ b/src/main/java/com/supwisdom/dlpay/conference/api/controller/ConerenceApiController.java
@@ -137,7 +137,7 @@
Integer confid = req.getConfid();
String timestamp = req.getTimestamp();
String devphyid = req.getDevphyid();
- if (null == confid || StringUtil.isEmpty(timestamp) || StringUtil.isEmpty(devphyid)) {
+ /*if (null == confid || StringUtil.isEmpty(timestamp) || StringUtil.isEmpty(devphyid)) {
mov.addObject("msg", "签到失败");
mov.addObject("errorMsg", "参数传递错误");
mov.setViewName("apph5/confresult");
@@ -171,7 +171,7 @@
mov.addObject("errorMsg", "时间误差过大");
mov.setViewName("apph5/confresult");
return mov;
- }
+ }*/
if(StringUtil.isEmpty(userid)){
mov.addObject("confid",confid);
@@ -186,7 +186,7 @@
return mov;
}
- String atttime = DateUtil.getNow("HHmm");
+ /*String atttime = DateUtil.getNow("HHmm");
int compareAttend = DateUtil.compareDatetime(atttime, conference.getAttendtime(), "HHmm");
int compareStart = DateUtil.compareDatetime(atttime, conference.getStarttime(), "HHmm");
@@ -248,7 +248,7 @@
mov.addObject("msg", "签到成功");
mov.addObject("remarkTitle", "会议概要");
- mov.addObject("remark", conference.getRemark());
+ mov.addObject("remark", conference.getRemark());*/
mov.setViewName("apph5/confresult");
return mov;
}
diff --git a/src/main/java/com/supwisdom/dlpay/visitormanage/domain/EVisitorCheckDtl.java b/src/main/java/com/supwisdom/dlpay/visitormanage/domain/EVisitorCheckDtl.java
index c40e224..3125c7a 100644
--- a/src/main/java/com/supwisdom/dlpay/visitormanage/domain/EVisitorCheckDtl.java
+++ b/src/main/java/com/supwisdom/dlpay/visitormanage/domain/EVisitorCheckDtl.java
@@ -33,6 +33,16 @@
//备注
private String remarks;
+ private String isqrcode;
+ private String qrcodetime;
+ private String lastopentime;
+
+ private Integer totalcount;
+
+ private Integer usecount;
+
+ private String qrcode;
+
@@ -142,4 +152,65 @@
public void setRemarks(String remarks) {
this.remarks = remarks;
}
+ @Column(name = "ISQRCODE", length = 1)
+
+ public String getIsqrcode() {
+ return isqrcode;
+ }
+
+ public void setIsqrcode(String isqrcode) {
+ this.isqrcode = isqrcode;
+ }
+ @Column(name = "QRCODETIME", length = 14)
+
+ public String getQrcodetime() {
+ return qrcodetime;
+ }
+
+ public void setQrcodetime(String qrcodetime) {
+ this.qrcodetime = qrcodetime;
+ }
+ @Column(name = "LASTOPENTIME", length = 14)
+
+ public String getLastopentime() {
+ return lastopentime;
+ }
+
+ public void setLastopentime(String lastopentime) {
+ this.lastopentime = lastopentime;
+ }
+ @Column(name = "TOTALCOUNT", length = 1)
+
+ public Integer getTotalcount() {
+ return totalcount;
+ }
+
+ public void setTotalcount(Integer totalcount) {
+ this.totalcount = totalcount;
+ }
+
+
+
+
+
+
+
+ @Column(name = "QRCODE", length = 255)
+
+ public String getQrcode() {
+ return qrcode;
+ }
+
+ public void setQrcode(String qrcode) {
+ this.qrcode = qrcode;
+ }
+ @Column(name = "USECOUNT", length = 1)
+
+ public Integer getUsecount() {
+ return usecount;
+ }
+
+ public void setUsecount(Integer usecount) {
+ this.usecount = usecount;
+ }
}
diff --git a/src/main/kotlin/com/supwisdom/dlpay/security.kt b/src/main/kotlin/com/supwisdom/dlpay/security.kt
index c264b71..65bcb2c 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/security.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/security.kt
@@ -123,6 +123,7 @@
.antMatcher("/api/**")
.authorizeRequests()
.antMatchers("/api/auth/**").permitAll()
+ .antMatchers("/api/doorapi/**").permitAll()
.antMatchers("/api/conference/**").permitAll()
.antMatchers("/api/notify/**").permitAll()
.antMatchers("/api/common/**").hasAnyRole("THIRD_COMMON", "THIRD_ADMIN")
diff --git a/src/main/resources/templates/apph5/applyforvisitor.html b/src/main/resources/templates/apph5/applyforvisitor.html
index b4513c4..aba7390 100644
--- a/src/main/resources/templates/apph5/applyforvisitor.html
+++ b/src/main/resources/templates/apph5/applyforvisitor.html
@@ -27,69 +27,64 @@
<body>
<div id="app">
- <div class="block" style="background:#ffffff;">
- <br>
- <span class="demonstration" style="text-align: center;display:block; font-size: 20px;color: #9932CC">访客申请</span><br><br>
- <!--动态将图片轮播图的容器高度设置成与图片一致-->
- <div class="el-message-box__input">
- <el-row>
- <table>
- <tr>
- <td>
- <el-label class="label-fade-enter">访问人姓名</el-label>
- <input type="text" class="el-input" id="visitorname"></td>
- </tr>
- <tr>
- <td>
- <el-label class="label-fade-enter">访问人身份证号</el-label>
- <input type="text" class="el-input" id="idno">
- </td>
+ <div class="page-title" style="text-align:center; font-size: 24px;color: #FF8247;margin-top:7%">请登记访客信息</div><br>
- </tr>
- <tr>
- <td>
- <el-label class="label-fade-enter">访问人性别</el-label>
- <input type="text" class="el-input" id="sex">
- </td>
- </tr>
- <tr>
- <td>
- <el-label class="label-fade-enter">访问人联系方式</el-label>
- <input type="text" class="el-input" id="phone">
- </td>
- </tr>
- <tr>
- <td>
- <el-label class="label-fade-enter">访问人单位</el-label>
- <input type="text" class="el-input" id="company">
- </td>
- </tr>
- <tr>
- <td>
- <el-label class="label-fade-enter">受访人姓名</el-label>
- <input type="text" class="el-input" id="custid">
- </td>
- </tr>
- <tr>
- <td>
- <el-label class="label-fade-enter">受访人部门</el-label>
- <input type="text" class="el-input" id="deptcode"></td>
- </tr>
- <tr>
- <td><el-label class="label-fade-enter">备注</el-label>
- <input type="text" class="el-input" id="remarks"></td>
- </tr>
- </table>
- </el-row>
+ <el-form ref="tempform" :model="tempform" :rules="rules" size="mini" label-width="36%" style="margin-top:7%">
+ <el-form-item label="访客姓名:" prop="custname">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-input v-model="tempform.custname">
+ </el-input>
+ </div>
+ </div>
+ </el-form-item><el-form-item label="访客性别:" prop="sex">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-select v-model="tempform.sex" id="sex" >
+ <el-option
+ v-for="status in sexlist"
+ :key="status.value"
+ :label="status.label"
+ :value="status.value">
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ </el-form-item><el-form-item label="访客身份证号:" prop="idno">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-input v-model="tempform.idno">
+ </el-input>
+ </div>
+ </div>
+ </el-form-item><el-form-item label="访客联系方式:" prop="phone">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-input v-model="tempform.phone">
+ </el-input>
+ </div>
+ </div>
+ </el-form-item>
+ <el-form-item label="访客单位:" prop="company">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-input v-model="tempform.company">
+ </el-input>
+ </div>
+ </div>
+ </el-form-item>
+ <el-form-item label="备注:" prop="remarks">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-input v-model="tempform.remarks">
+ </el-input>
+ </div>
+ </div>
+ </el-form-item>
-
-
- </div>
-
- <el-button type="success" @click="openDoor"
- style=" display:block;margin:0 auto;width:100px;height:100px;border-radius:50px;border:solid rgb(100,100,100) 0px; font-size: 20px">
- 登记
- </el-button>
+ </el-form>
+ <div slot="footer" style="text-align:center; ">
+ <el-button type="primary" @click="saveTemp('tempform')">登 记</el-button>
</div>
</div>
@@ -97,19 +92,22 @@
</body>
<script>
+ var validatePhone = function (rule, value, callback) {
+ if (value == "") {
+ callback(new Error("请输入手机号"));
+ } else if (!isCellPhone(value)) {//引入methods中封装的检查手机格式的方法
+ callback(new Error("请输入正确的手机号!"));
+ } else {
+ callback();
+ }
+ }
+
var app_vue = new Vue({
el: '#app',
data: {
- devNameList: [],
- devIdList: [],
- selectDevName: '',
- selectDevId: '',
- // 图片父容器高度
- bannerHeight: 1000,
- // 浏览器宽度
- screenWidth: 0,
- userId: '',
- searchDoorForm: {
+ dialogFormVisible: true,
+ confName: '1234',
+ tempform: {
visitorname: '',
idno: '',
time: '',
@@ -120,9 +118,46 @@
company: '',
remarks: '',
},
+ sexlist:[],
+ bannerHeight: 1000,
+ screenWidth: 0,
+ userId: '',
+ rules: {
+ visitorname: [
+ {required: true, message: '请输入访客姓名', trigger: 'blur'},
+ ],
+ idno: [
+ {required: true, message: '请输入访客身份证号', trigger: 'blur'}
+ ],
+ sex: [
+ {required: true, message: '请输入访客性别', trigger: 'blur'}
+ ],
+ remarks: [
+ {required: true, message: '请输入备注', trigger: 'blur'}
+ ],
+ phone: [
+ {required: true,validator: validatePhone, trigger: 'blur'}
+ ]
+ },
},
methods: {
+ saveTemp : function (formName) {
+ var _that = this;
+ var vali = false;
+ this.$refs[formName].validate(
+ function (valid) {
+ if (valid) {
+ vali = true;
+ } else {
+ vali = false;
+ }
+ });
+ if (vali == true) {
+ saveTempCustomer(_that, _that.tempform, formName);
+ }
+ },
+
indexChange: function (pre, next) {
var _self = this;
var devIdListTmp = _self.devIdList;
@@ -130,10 +165,6 @@
// console.log(_self.selectDevId)
},
- openDoor: function () {
- var devId = app_vue.selectDevId;
- app_openDoor(devId);
- },
setSize: function () {
// 通过浏览器宽度(图片宽度)计算高度
this.bannerHeight = this.screenWidth;
@@ -144,29 +175,67 @@
// 首次加载时,需要调用一次
_self.screenWidth = window.innerWidth;
_self.setSize();
-
- var userId = '[[${userId}]]';
- _self.userId = userId;
-
+ var confid = '[[${confid}]]';
+ var deptcode = '[[${deptcode}]]';
+ console.log(confid);
+ console.log(deptcode);
+ _self.tempform.custid = confid;
+ _self.tempform.deptcode = deptcode;
+ var sexl = [];
+ sexl.push({
+ value: '',
+ label: '请选择'
+ });
+ sexl.push({
+ value: '1',
+ label: '男'
+ });
+ sexl.push({
+ value: '2',
+ label: '女'
+ });
+ _self.sexlist = sexl;
}
-
})
- function app_openDoor(devId) {
-
- layer.confirm('你确定要登记吗?', {icon: 3, title: '请确认', offset: '30%'}, function (index) {
- window.location.href = "[[@{/app/getvisitor}]]"
- });
-
- }
-
// 窗口大小发生改变时,调用一次
window.onresize = function () {
app_vue.screenWidth = window.innerWidth;
app_vue.setSize();
}
+ function saveTempCustomer(_that, formdata, formName) {
+ $.ajax({
+ type: "post",
+ url: encodeURI("[[@{/app/apply}]]"),
+ dataType: "json",
+ contentType: "application/json",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ data: JSON.stringify(formdata),
+ success: function (data) {
+
+ if (data.errcode != "0") {
+ layer.msg(data.errStr, {icon: 2, time: 2000});
+ } else {
+ layer.msg('登记成功!', {icon: 1, time: 1000});
+ }
+ }
+ });
+ }
+
+
+ function isCellPhone(val) {
+ if (!/^1(3|4|5|6|7|8)\d{9}$/.test(val)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
</script>
diff --git a/src/main/resources/templates/apph5/applyforvisitorcode.html b/src/main/resources/templates/apph5/applyforvisitorcode.html
new file mode 100644
index 0000000..60edccd
--- /dev/null
+++ b/src/main/resources/templates/apph5/applyforvisitorcode.html
@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
+
+<head>
+ <title>首页</title>
+ <!--<meta name="_csrf_header" th:content="${_csrf.headerName}" />
+ <meta name="_csrf_token" th:content="${_csrf.parameterName}" th:value="${_csrf.token}" />-->
+ <meta charset="utf-8"/>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+ <link rel="stylesheet" href="/static/libs/layui/css/layui.css" th:href="@{/static/libs/layui/css/layui.css}"/>
+
+ <link rel="stylesheet" href="/static/res/assets/plugins/element-ui/theme-default/index.css"
+ th:href="@{/static/res/assets/plugins/element-ui/theme-default/index.css}"/>
+ <link rel="stylesheet" href="/static/res/assets/css/wxpage.css"
+ th:href="@{/static/res/assets/css/wxpage.css}"/>
+
+ <!--<script type="text/javascript" th:src="@{/static/libs/jquery/jquery-3.2.1.min.js}"></script>-->
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/jquery/jquery.min.js}"></script>
+ <!--<script type="text/javascript" th:src="@{/static/libs/layui/layui.js}"></script>-->
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/jquery/jquery.form.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/layer/layer.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/js/vue.min.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/js/qrcode.min.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/element-ui/index.js}"></script>
+
+
+</head>
+
+<script type="text/javascript">
+ setInterval(function () {
+ window.location.reload();
+ }, 60000);
+
+ $(function () {
+
+
+ var qcode = $("#myText").val();
+ if (undefined != qcode && null != qcode && "" != qcode) {
+ var qrcode = new QRCode(document.getElementById("qrcode"), {
+ render : "canvas",
+ text: qcode,
+ width: 220,
+ height: 220,
+ colorDark: "#000000",
+ colorLight: "#ffffff",
+ correctLevel: QRCode.CorrectLevel.H
+ });
+ }
+ var inoutflag = $("#inoutflag").val();
+
+ if (inoutflag == 1) {
+ $("#title").text("进门登记码")
+ } else {
+ $("#title").text("出门登记码")
+
+ }
+
+ });
+</script>
+<style>
+ body {
+ background-color: #ffffff;
+ }
+
+</style>
+</html>
+<body class="page" style="text-align: center">
+<div class="topbar">
+ <p id="title" class="el-message-box__title" style="text-align: center"></p>
+ <a href="javascript:window.location.reload();"><span class="refresh"></span></a>
+</div>
+
+<div style="text-align: center;padding: 30px;">
+ <input type="hidden" id="myText" th:value="${qrcode}"/>
+ <input type="hidden" id="inoutflag" th:value="${inoutflag}"/>
+</div>
+<div id="qrcode" class="qrcode-cc" ></div>
+<p style="text-align: center;margin-top:40px;color:#999;font-size: 14px">请将二维码对准扫描设备完成登记(如您使用扫一扫功能,请重新扫码)</p>
+<a href="javascript:window.location.reload();" class="weui-btn weui-btn_primary btn-bg"
+ style="align-content: center;margin: 20px">手动刷新二维码</a>
+
+</body>
+</style>
\ No newline at end of file
diff --git a/src/main/resources/templates/apph5/askforleave.html b/src/main/resources/templates/apph5/askforleave.html
new file mode 100644
index 0000000..f55715c
--- /dev/null
+++ b/src/main/resources/templates/apph5/askforleave.html
@@ -0,0 +1,267 @@
+<!DOCTYPE html>
+<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
+
+<head>
+ <title>首页</title>
+ <!--<meta name="_csrf_header" th:content="${_csrf.headerName}" />
+ <meta name="_csrf_token" th:content="${_csrf.parameterName}" th:value="${_csrf.token}" />-->
+ <meta charset="utf-8"/>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+ <link rel="stylesheet" href="/static/libs/layui/css/layui.css" th:href="@{/static/libs/layui/css/layui.css}"/>
+
+ <link rel="stylesheet" href="/static/res/assets/plugins/element-ui/theme-default/index.css"
+ th:href="@{/static/res/assets/plugins/element-ui/theme-default/index.css}"/>
+
+ <!--<script type="text/javascript" th:src="@{/static/libs/jquery/jquery-3.2.1.min.js}"></script>-->
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/jquery/jquery.min.js}"></script>
+ <!--<script type="text/javascript" th:src="@{/static/libs/layui/layui.js}"></script>-->
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/jquery/jquery.form.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/layer/layer.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/js/vue.min.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/element-ui/index.js}"></script>
+
+
+</head>
+
+<body>
+
+<div id="app">
+ <div class="page-title" style="text-align:center; font-size: 24px;color: #FF8247;margin-top:7%">请登记访客信息</div>
+ <br>
+
+ <el-form ref="tempform" :model="tempform" :rules="rules" size="mini" label-width="36%" style="margin-top:7%">
+ <el-form-item label="请假类型:" prop="rtype">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-select v-model="tempform.rtype" id="rtype">
+ <el-option
+ v-for="status in rtypelist"
+ :key="status.value"
+ :label="status.label"
+ :value="status.value">
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ </el-form-item>
+ <el-form-item label="开始时间:" prop="startdate">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-date-picker type="date" v-model="tempform.startdate" id="time"
+ :picker-options="pickerOptions0" :editable="false"
+ value-format="yyyyMMdd"
+ style="width:100%;"></el-date-picker>
+ </div>
+ </div>
+ </el-form-item>
+ <el-form-item label="结束时间:" prop="enddate">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-date-picker type="date" v-model="tempform.enddate" id="time"
+ :picker-options="pickerOptions0" :editable="false"
+ value-format="yyyyMMdd"
+ style="width:100%;"></el-date-picker>
+ </div>
+ </div>
+ </el-form-item>
+
+
+ <el-form-item label="备注:" prop="remark">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-input v-model="tempform.remark">
+ </el-input>
+ </div>
+ </div>
+ </el-form-item>
+
+ </el-form>
+ <div slot="footer" style="text-align:center; ">
+ <el-button type="primary" @click="saveTemp('tempform')">申 请</el-button>
+ </div>
+
+</div>
+
+</body>
+
+<script>
+ var validatePhone = function (rule, value, callback) {
+ if (value == "") {
+ callback(new Error("请输入手机号"));
+ } else if (!isCellPhone(value)) {//引入methods中封装的检查手机格式的方法
+ callback(new Error("请输入正确的手机号!"));
+ } else {
+ callback();
+ }
+ }
+
+ var app_vue = new Vue({
+ el: '#app',
+ data: {
+ dialogFormVisible: true,
+ confName: '1234',
+ tempform: {
+ rtype: '',
+
+ startdate: '',
+ enddate: '',
+
+ custid: '',
+
+ remark: '',
+ },
+ rtypelist: [],
+ bannerHeight: 1000,
+ screenWidth: 0,
+ userId: '',
+ rules: {
+ visitorname: [
+ {required: true, message: '请输入访客姓名', trigger: 'blur'},
+ ],
+ idno: [
+ {required: true, message: '请输入访客身份证号', trigger: 'blur'}
+ ],
+ sex: [
+ {required: true, message: '请输入访客性别', trigger: 'blur'}
+ ],
+ remarks: [
+ {required: true, message: '请输入备注', trigger: 'blur'}
+ ],
+ phone: [
+ {required: true, validator: validatePhone, trigger: 'blur'}
+ ]
+ },
+ },
+
+ methods: {
+ saveTemp: function (formName) {
+ var _that = this;
+ var vali = false;
+ this.$refs[formName].validate(
+ function (valid) {
+ if (valid) {
+ vali = true;
+ } else {
+ vali = false;
+ }
+ });
+ if (vali == true) {
+ saveTempCustomer(_that, _that.tempform, formName);
+ }
+ },
+
+ indexChange: function (pre, next) {
+ var _self = this;
+ var devIdListTmp = _self.devIdList;
+ _self.selectDevId = devIdListTmp[pre];
+ // console.log(_self.selectDevId)
+
+ },
+ setSize: function () {
+ // 通过浏览器宽度(图片宽度)计算高度
+ this.bannerHeight = this.screenWidth;
+ },
+ },
+ created: function () {
+ var _self = this;
+ // 首次加载时,需要调用一次
+ _self.screenWidth = window.innerWidth;
+ _self.setSize();
+ var confid = '[[${confid}]]';
+ console.log(confid);
+ _self.tempform.custid = confid;
+ var sexl = [];
+ sexl.push({
+ value: '',
+ label: '请选择'
+ });
+ sexl.push({
+ value: '11',
+ label: '事假'
+ });sexl.push({
+ value: '12',
+ label: '病假'
+ });sexl.push({
+ value: '13',
+ label: '年假'
+ });sexl.push({
+ value: '14',
+ label: '调休'
+ });
+ sexl.push({
+ value: '15',
+ label: '其他'
+ });
+ _self.rtypelist = sexl;
+
+ }
+ })
+
+ // 窗口大小发生改变时,调用一次
+ window.onresize = function () {
+ app_vue.screenWidth = window.innerWidth;
+ app_vue.setSize();
+ }
+
+ function saveTempCustomer(_that, formdata, formName) {
+ $.ajax({
+ type: "post",
+ url: encodeURI("[[@{/app/apply}]]"),
+ dataType: "json",
+ contentType: "application/json",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ data: JSON.stringify(formdata),
+ success: function (data) {
+
+ if (data.errcode != "0") {
+ layer.msg(data.errStr, {icon: 2, time: 2000});
+ } else {
+ layer.msg('登记成功!', {icon: 1, time: 1000});
+ }
+ }
+ });
+ }
+
+
+ function isCellPhone(val) {
+ if (!/^1(3|4|5|6|7|8)\d{9}$/.test(val)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+
+</script>
+
+<style>
+
+ .el-carousel__item h3 {
+ color: #ff3366;
+ font-size: 14px;
+ opacity: 0.75;
+ line-height: 300px;
+ margin: 0;
+ /*background-color:#66cccc;
+ border: 0px solid #e5e5e5;
+ width: 50%;
+ left: 10%;
+ height: 100%;*/
+ }
+
+ .el-carousel__item:nth-child(2n) {
+ background-color: #ffffff;
+ }
+
+ .el-carousel__item:nth-child(2n+1) {
+ background-color: #ffffff;
+ }
+
+ .el-carousel__item .Carousel {
+ border-bottom: 1px solid #f1f4f8;
+ }
+</style>
\ No newline at end of file
diff --git a/src/main/resources/templates/apph5/doorappindex.html b/src/main/resources/templates/apph5/doorappindex.html
new file mode 100644
index 0000000..2f067b3
--- /dev/null
+++ b/src/main/resources/templates/apph5/doorappindex.html
@@ -0,0 +1,155 @@
+<!DOCTYPE html>
+<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
+
+<head>
+ <title>首页</title>
+ <!--<meta name="_csrf_header" th:content="${_csrf.headerName}" />
+ <meta name="_csrf_token" th:content="${_csrf.parameterName}" th:value="${_csrf.token}" />-->
+ <meta charset="utf-8"/>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+ <link rel="stylesheet" href="/static/libs/layui/css/layui.css" th:href="@{/static/libs/layui/css/layui.css}"/>
+
+ <link rel="stylesheet" href="/static/res/assets/plugins/element-ui/theme-default/index.css"
+ th:href="@{/static/res/assets/plugins/element-ui/theme-default/index.css}"/>
+
+ <!--<script type="text/javascript" th:src="@{/static/libs/jquery/jquery-3.2.1.min.js}"></script>-->
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/jquery/jquery.min.js}"></script>
+ <!--<script type="text/javascript" th:src="@{/static/libs/layui/layui.js}"></script>-->
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/jquery/jquery.form.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/layer/layer.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/js/vue.min.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/element-ui/index.js}"></script>
+
+
+</head>
+
+<body>
+
+<div id="app">
+ <div class="block" style="background:#ffffff;">
+ <br>
+ <span class="demonstration"
+ style="text-align: center;display:block; font-size: 20px;color: #9932CC">更多功能</span><br><br>
+ <!--动态将图片轮播图的容器高度设置成与图片一致-->
+ <el-button type="success" @click="openDoor"
+ style=" display:block;margin:0 auto;width:100px;height:100px;border-radius:50px;border:solid rgb(100,100,100) 0px; font-size: 20px">
+ 访客登记
+ </el-button>
+ <el-button type="success" @click="openDoor"
+ style=" display:block;margin:0 auto;width:100px;height:100px;border-radius:50px;border:solid rgb(100,100,100) 0px; font-size: 20px">
+ 请假申请
+ </el-button>
+ </div>
+
+</div>
+
+</body>
+
+<script>
+ var app_vue = new Vue({
+ el: '#app',
+ data: {
+ devNameList: [],
+ devIdList: [],
+ selectDevName: '',
+ selectDevId: '',
+ // 图片父容器高度
+ bannerHeight: 1000,
+ // 浏览器宽度
+ screenWidth: 0,
+ userId: ''
+ },
+
+ methods: {
+ indexChange: function (pre, next) {
+ var _self = this;
+ var devIdListTmp = _self.devIdList;
+ _self.selectDevId = devIdListTmp[pre];
+ // console.log(_self.selectDevId)
+
+ },
+ openDoor: function () {
+ var devId = app_vue.selectDevId;
+ app_openDoor(devId);
+ },
+ setSize: function () {
+ // 通过浏览器宽度(图片宽度)计算高度
+ this.bannerHeight = this.screenWidth;
+ },
+ },
+ created: function () {
+ var _self = this;
+ // 首次加载时,需要调用一次
+ _self.screenWidth = window.innerWidth;
+ _self.setSize();
+
+ var userId = '[[${userId}]]';
+ _self.userId = userId;
+
+
+ }
+
+ })
+
+ function app_openDoor(devId) {
+ var userId = app_vue.userId;
+ console.log(userId);
+ layer.confirm('你确定要开启此门吗?', {icon: 3, title: '请确认', offset: '30%'}, function (index) {
+ $.ajax({
+ type: "get",
+ dataType: "json",
+ url: encodeURI("[[@{/app/openDoorById?devId=}]]" + devId + "&userId=" + userId),
+ success: function (ret) {
+ if (ret.message == undefined) {
+ layer.msg('用户认证已过期,请重新登录', {icon: 2, time: 1000});
+ window.location = "[[@{/login}]]";
+ return;
+ }
+ if (ret.message != "") {
+ layer.msg(ret.message, {icon: 2, time: 2000});
+ } else {
+ layer.msg('开门成功', {icon: 1, time: 2000});
+ }
+ }
+ })
+ });
+
+ }
+
+ // 窗口大小发生改变时,调用一次
+ window.onresize = function () {
+ app_vue.screenWidth = window.innerWidth;
+ app_vue.setSize();
+ }
+
+
+</script>
+
+<style>
+
+ .el-carousel__item h3 {
+ color: #ff3366;
+ font-size: 14px;
+ opacity: 0.75;
+ line-height: 300px;
+ margin: 0;
+ /*background-color:#66cccc;
+ border: 0px solid #e5e5e5;
+ width: 50%;
+ left: 10%;
+ height: 100%;*/
+ }
+
+ .el-carousel__item:nth-child(2n) {
+ background-color: #ffffff;
+ }
+
+ .el-carousel__item:nth-child(2n+1) {
+ background-color: #ffffff;
+ }
+
+ .el-carousel__item .Carousel {
+ border-bottom: 1px solid #f1f4f8;
+ }
+</style>
\ No newline at end of file
diff --git a/src/main/resources/templates/apph5/history.html b/src/main/resources/templates/apph5/history.html
new file mode 100644
index 0000000..053c769
--- /dev/null
+++ b/src/main/resources/templates/apph5/history.html
@@ -0,0 +1,92 @@
+<!DOCTYPE html>
+<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
+
+<head>
+ <title>首页</title>
+ <!--<meta name="_csrf_header" th:content="${_csrf.headerName}" />
+ <meta name="_csrf_token" th:content="${_csrf.parameterName}" th:value="${_csrf.token}" />-->
+ <meta charset="utf-8"/>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+ <link rel="stylesheet" href="/static/libs/layui/css/layui.css" th:href="@{/static/libs/layui/css/layui.css}"/>
+
+ <link rel="stylesheet" href="/static/res/assets/plugins/element-ui/theme-default/index.css"
+ th:href="@{/static/res/assets/plugins/element-ui/theme-default/index.css}"/>
+ <link rel="stylesheet" href="/static/res/assets/css/wxpage.css"
+ th:href="@{/static/res/assets/css/wxpage.css}"/>
+
+ <!--<script type="text/javascript" th:src="@{/static/libs/jquery/jquery-3.2.1.min.js}"></script>-->
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/jquery/jquery.min.js}"></script>
+ <!--<script type="text/javascript" th:src="@{/static/libs/layui/layui.js}"></script>-->
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/jquery/jquery.form.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/layer/layer.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/js/vue.min.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/js/qrcode.min.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/element-ui/index.js}"></script>
+
+
+</head>
+
+<script type="text/javascript">
+ setInterval(function () {
+ window.location.reload();
+ }, 60000);
+
+ $(function () {
+
+
+ /*var qcode = $("#myText").val();
+ if (undefined != qcode && null != qcode && "" != qcode) {
+ var qrcode = new QRCode(document.getElementById("qrcode"), {
+ render : "canvas",
+ text: qcode,
+ width: 220,
+ height: 220,
+ colorDark: "#000000",
+ colorLight: "#ffffff",
+ correctLevel: QRCode.CorrectLevel.H
+ });
+ }
+ var inoutflag = $("#inoutflag").val();
+
+ if (inoutflag == 1) {
+ $("#title").text("进门登记码")
+ } else {
+ $("#title").text("出门登记码")
+
+ }*/
+
+ });
+</script>
+<style>
+ body {
+ background-color: #ffffff;
+ }
+
+</style>
+</html>
+<body class="page" style="text-align: center">
+<div class="weui-cells">
+ <a class="weui-cell weui-cell_access" href="javascript:;">
+ <div class="weui-cell__bd">
+ <p>浴室</p>
+ </div>
+ <div class="weui-cell__ft">
+ <input class="weui-input" id="area" type="text" value="" placeholder="请选择">
+ </div>
+ </a>
+ <a class="weui-cell weui-cell_access" href="javascript:;">
+ <div class="weui-cell__bd">
+ <p>时间</p>
+ </div>
+ <div class="weui-cell__ft">
+ <input class="weui-input" id="ordertime" type="text" value="" placeholder="请选择">
+ <input id="endtime" type="hidden">
+ </div>
+ </a>
+
+ <input type="hidden" id="ocnt">
+</div>
+
+</body>
+</style>
\ No newline at end of file
diff --git a/src/main/resources/templates/apph5/leavehistory.html b/src/main/resources/templates/apph5/leavehistory.html
new file mode 100644
index 0000000..d1beb9b
--- /dev/null
+++ b/src/main/resources/templates/apph5/leavehistory.html
@@ -0,0 +1,279 @@
+<!DOCTYPE html>
+<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
+
+<head>
+ <title>首页</title>
+ <!--<meta name="_csrf_header" th:content="${_csrf.headerName}" />
+ <meta name="_csrf_token" th:content="${_csrf.parameterName}" th:value="${_csrf.token}" />-->
+ <meta charset="utf-8"/>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+ <link rel="stylesheet" href="/static/libs/layui/css/layui.css" th:href="@{/static/libs/layui/css/layui.css}"/>
+
+ <link rel="stylesheet" href="/static/res/assets/plugins/element-ui/theme-default/index.css"
+ th:href="@{/static/res/assets/plugins/element-ui/theme-default/index.css}"/>
+
+ <!--<script type="text/javascript" th:src="@{/static/libs/jquery/jquery-3.2.1.min.js}"></script>-->
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/jquery/jquery.min.js}"></script>
+ <!--<script type="text/javascript" th:src="@{/static/libs/layui/layui.js}"></script>-->
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/jquery/jquery.form.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/layer/layer.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/js/vue.min.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/element-ui/index.js}"></script>
+
+
+</head>
+
+<body>
+
+<div id="app">
+ <div class="block" style="background:#ffffff;">
+ <br>
+ <span class="demonstration" style="text-align: center;display:block; font-size: 20px;color: #9932CC">请假申请</span><br><br>
+ <!--动态将图片轮播图的容器高度设置成与图片一致-->
+ <div class="el-message-box__input">
+ <el-row>
+ <table>
+ <tr>
+ <td>
+ <el-label class="label-fade-enter">姓名</el-label>
+ <input type="hidden" class="el-input" id="custid"></td>
+ </tr>
+ <tr>
+ <td>
+ <el-label class="label-fade-enter"></el-label>
+ <input type="text" class="el-input" id="idno">
+ </td>
+
+ </tr>
+ <tr>
+ <td>
+ <el-label class="label-fade-enter">访问人性别</el-label>
+ <input type="text" class="el-input" id="sex">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <el-label class="label-fade-enter">访问人联系方式</el-label>
+ <input type="text" class="el-input" id="phone">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <el-label class="label-fade-enter">访问人单位</el-label>
+ <input type="text" class="el-input" id="company">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <el-label class="label-fade-enter">受访人姓名</el-label>
+ <input type="text" class="el-input" id="custid">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <el-label class="label-fade-enter">受访人部门</el-label>
+ <input type="text" class="el-input" id="deptcode"></td>
+ </tr>
+ <tr>
+ <td><el-label class="label-fade-enter">备注</el-label>
+ <input type="text" class="el-input" id="remarks"></td>
+ </tr>
+ </table>
+ </el-row>
+
+
+
+ </div>
+
+ <el-button type="success" @click="openDoor"
+ style=" display:block;margin:0 auto;width:100px;height:100px;border-radius:50px;border:solid rgb(100,100,100) 0px; font-size: 20px">
+ 登记
+ </el-button>
+ </div>
+
+</div>
+
+</body>
+
+<script>
+ var app_vue = new Vue({
+ el: '#app',
+ data: {
+ devNameList: [],
+ devIdList: [],
+ selectDevName: '',
+ selectDevId: '',
+ // 图片父容器高度
+ bannerHeight: 1000,
+ // 浏览器宽度
+ screenWidth: 0,
+ userId: '',
+ searchDoorForm: {
+ visitorname: '',
+ idno: '',
+ time: '',
+ phone: '',
+ sex: '',
+ custid: '',
+ deptcode: '',
+ company: '',
+ remarks: '',
+ },
+ },
+
+ methods: {
+ indexChange: function (pre, next) {
+ var _self = this;
+ var devIdListTmp = _self.devIdList;
+ _self.selectDevId = devIdListTmp[pre];
+ // console.log(_self.selectDevId)
+
+ },
+ openDoor: function () {
+ app_openDoor();
+ },
+ setSize: function () {
+ // 通过浏览器宽度(图片宽度)计算高度
+ this.bannerHeight = this.screenWidth;
+ },
+ },
+ created: function () {
+ var _self = this;
+ // 首次加载时,需要调用一次
+ _self.screenWidth = window.innerWidth;
+ _self.setSize();
+
+ var userId = '[[${userId}]]';
+ _self.userId = userId;
+
+ $.ajax({
+ type: "get",
+ dataType: "json",
+ url: encodeURI("[[@{/app/getdeptlist}]]"),
+ success: function (ret) {
+ var dlist = [];
+ dlist.push({
+ value: '',
+ label: '请选择'
+ });
+ var rB = ret.deptlist;
+ if (rB != null) {
+ for (var j = 0; j < rB.length; j++) {
+ dlist.push({
+ value: rB[j]["deptcode"],
+ label: rB[j]["deptname"]
+ });
+ }
+ }
+
+ searchDoorlist_vue.deptlist = dlist;
+ var sexl = [];
+ sexl.push({
+ value: '',
+ label: '请选择'
+ });
+ sexl.push({
+ value: '1',
+ label: '男'
+ });
+ sexl.push({
+ value: '2',
+ label: '女'
+ });
+ searchDoorlist_vue.sexlist = sexl;
+ }
+ })
+ }
+
+ })
+
+ function app_openDoor() {
+ var visitorname=$("#visitorname").val();
+ var idno=$("#idno").val();
+ var phone=$("#phone").val();
+ var company=$("#company").val();
+ var sex=$("#sex").val();
+ var deptcode=$("#deptcode").val();
+ var custid=$("#custid").val();
+ var remarks=$("#remarks").val();
+ if(visitorname==null||visitorname.length==0){
+ alert("请输入访客姓名");
+ return;
+ }if(idno==null||idno.length==0){
+ alert("请输入访客身份证号");
+ return;
+ }if(phone==null||phone.length<=11){
+ alert("请输入访客联系方式");
+ return;
+ }if(sex==null||sex.length==0){
+ alert("请选择性别");
+ return;
+ }if(time==null||time.length==0){
+ alert("请输入时间");
+ return;
+ }if(company==null||company.length==0){
+ alert("请输入访客单位");
+ return;
+ }if(deptcode==null||deptcode.length==0){
+ alert("请选择受访者部门");
+ return;
+ }if(custid==null||custid.length==0){
+ alert("请选择受访者姓名");
+ return;
+ }
+ layer.confirm('你确定要登记吗?', {icon: 3, title: '请确认', offset: '30%'}, function (index) {
+
+ $.ajax({
+ type: "get",
+ dataType: "json",
+ url:encodeURI("[[@{/app/apply?visitorname=}]]" +visitorname+"&idno="+idno+"&phone="+phone+"&company="+company+"&sex="+sex+"&deptcode="+deptcode+"&custid="+custid+"&remarks="+remarks),
+ success:function (ret) {
+
+ if (ret.message != "") {
+ layer.msg(ret.message, {icon: 2, time: 2000});
+ } else {
+ layer.msg('登记成功', {icon: 1, time: 2000});
+ }
+ }
+ })
+ });
+
+ }
+
+ // 窗口大小发生改变时,调用一次
+ window.onresize = function () {
+ app_vue.screenWidth = window.innerWidth;
+ app_vue.setSize();
+ }
+
+
+</script>
+
+<style>
+
+ .el-carousel__item h3 {
+ color: #ff3366;
+ font-size: 14px;
+ opacity: 0.75;
+ line-height: 300px;
+ margin: 0;
+ /*background-color:#66cccc;
+ border: 0px solid #e5e5e5;
+ width: 50%;
+ left: 10%;
+ height: 100%;*/
+ }
+
+ .el-carousel__item:nth-child(2n) {
+ background-color: #ffffff;
+ }
+
+ .el-carousel__item:nth-child(2n+1) {
+ background-color: #ffffff;
+ }
+
+ .el-carousel__item .Carousel {
+ border-bottom: 1px solid #f1f4f8;
+ }
+</style>
\ No newline at end of file
diff --git a/src/main/resources/templates/apph5/visitor.html b/src/main/resources/templates/apph5/visitor.html
new file mode 100644
index 0000000..9cb48d3
--- /dev/null
+++ b/src/main/resources/templates/apph5/visitor.html
@@ -0,0 +1,193 @@
+<!DOCTYPE html>
+<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
+
+<head>
+ <title>首页</title>
+ <!--<meta name="_csrf_header" th:content="${_csrf.headerName}" />
+ <meta name="_csrf_token" th:content="${_csrf.parameterName}" th:value="${_csrf.token}" />-->
+ <meta charset="utf-8"/>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+ <link rel="stylesheet" href="/static/libs/layui/css/layui.css" th:href="@{/static/libs/layui/css/layui.css}"/>
+
+ <link rel="stylesheet" href="/static/res/assets/plugins/element-ui/theme-default/index.css"
+ th:href="@{/static/res/assets/plugins/element-ui/theme-default/index.css}"/>
+ <link rel="stylesheet" href="/static/res/assets/css/wxpage.css"
+ th:href="@{/static/res/assets/css/wxpage.css}"/>
+
+ <!--<script type="text/javascript" th:src="@{/static/libs/jquery/jquery-3.2.1.min.js}"></script>-->
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/jquery/jquery.min.js}"></script>
+ <!--<script type="text/javascript" th:src="@{/static/libs/layui/layui.js}"></script>-->
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/jquery/jquery.form.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/layer/layer.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/js/vue.min.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/js/qrcode.min.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/element-ui/index.js}"></script>
+
+
+</head>
+
+<script type="text/javascript">
+
+
+ $(function () {
+
+
+ /* var qcode = $("#myText").val();
+ if (undefined != qcode && null != qcode && "" != qcode) {
+ var qrcode = new QRCode(document.getElementById("qrcode"), {
+ render : "canvas",
+ text: qcode,
+ width: 220,
+ height: 220,
+ colorDark: "#000000",
+ colorLight: "#ffffff",
+ correctLevel: QRCode.CorrectLevel.H
+ });
+ }
+ var inoutflag = $("#inoutflag").val();
+
+ if (inoutflag == 1) {
+ $("#title").text("进门登记码")
+ } else {
+ $("#title").text("出门登记码")
+
+ }*/
+
+ });
+ function sub() {
+ var visitorname = $("#visitorname").val();
+ var idno = $("#idno").val();
+ var phone = $("#phone").val();
+ var company = $("#company").val();
+ var sex = $("#sex").val();
+ var deptcode = $("#deptcode").val();
+ var custid = $("#custid").val();
+ var remarks = $("#remarks").val();
+ if (visitorname == null || visitorname.length == 0) {
+ alert("请输入访客姓名");
+ return;
+ }
+ if (idno == null || idno.length == 0) {
+ alert("请输入访客身份证号");
+ return;
+ }
+ if (phone == null) {
+ alert("请输入访客联系方式");
+ return;
+ }
+ if (sex == null || sex.length == 0) {
+ alert("请选择性别");
+ return;
+ }
+
+ if (company == null || company.length == 0) {
+ alert("请输入访客单位");
+ return;
+ }
+ if (deptcode == null || deptcode.length == 0) {
+ alert("请选择受访者部门");
+ return;
+ }
+ if (custid == null || custid.length == 0) {
+ alert("请选择受访者姓名");
+ return;
+ }
+
+ layer.confirm('你确定要登记吗?', {icon: 3, title: '请确认', offset: '30%'}, function (index) {
+ $.ajax({
+ type: "POST",
+ url: encodeURI("[[@{/app/apply}]]"),
+ dataType: "json",
+ data: $('#applyforvisitorform').serialize(),
+ success: function (data) {
+ if (data.errStr != "") {
+ layer.msg(data.errStr, {icon: 2, time: 1000});
+ } else {
+ layer.msg('保存信息成功!', {icon: 1, time: 1000});
+
+ }
+ }
+ })
+
+ });
+
+ }
+
+
+</script>
+<style>
+ body {
+ background-color: #ffffff;
+ }
+
+</style>
+</html>
+<body class="page" style="text-align: center">
+<div class="topbar">
+ <p id="title" class="el-message-box__title" style="text-align: center">访客申请</p>
+ <a href="javascript:window.location.reload();"><span class="refresh"></span></a>
+</div>
+
+<div style="text-align: center;padding: 30px;">
+
+</div>
+<div id="form" >
+ <form id="applyforvisitorform" style="text-align: center" action="#" name="applyforvisitorform">
+
+ <table style="text-align: center">
+ <tr>
+ <td width="50%">
+ <label class="">访问人姓名</label></td>
+ <td width="50%">
+ <input type="text" id="visitorname"></td>
+ </tr>
+ <tr>
+ <td width="50%">
+ <label class="label">访问人身份证号</label></td>
+ <td>
+ <input type="text" id="idno">
+ </td>
+
+ </tr>
+ <tr>
+ <td>
+ <label class="label-fade-enter">访问人性别</label></td>
+ <td>
+ <select id="sex" name="sex">
+ <option name="0">请选择</option>
+ <option name="1">男</option>
+ <option name="2">女</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <label class="label-fade-enter">访问人联系方式</label></td>
+ <td>
+ <input type="text" class="layui-icon-cellphone" id="phone">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <label class="label-fade-enter">访问人单位</label></td>
+ <td>
+ <input type="text" id="company">
+ </td>
+ </tr>
+
+ <tr>
+ <td><label class="label-fade-enter">备注</label></td>
+ <td>
+ <input type="text"id="remarks"></td>
+ </tr>
+ </table>
+ <input type="hidden" id="deptcode" th:value="${deptcode}">
+ <input type="hidden" id="custid" th:value="${custid}">
+ </form>
+</div>
+<a href="javascript:sub();" class="weui-btn weui-btn_primary btn-bg"
+ style="align-content: center;margin: 20px">提交</a>
+
+</body>
+</style>
\ No newline at end of file
diff --git a/src/main/resources/templates/visitormanage/customer/visitorchecklist.html b/src/main/resources/templates/visitormanage/customer/visitorchecklist.html
index 48c1ddb..192d23b 100644
--- a/src/main/resources/templates/visitormanage/customer/visitorchecklist.html
+++ b/src/main/resources/templates/visitormanage/customer/visitorchecklist.html
@@ -72,8 +72,10 @@
templet: function (item) {
if(item.sex==1){
return "男"
- }else {
+ }else if(item.sex==2){
return "女"
+ }else {
+ return "未知"
}
}
},