导入名单,下发名单,删除名单基本功能完善(没测试) 设备名单查询、流水查询调整完善
diff --git a/build.gradle b/build.gradle
index d1cb98a..2fe4ee1 100644
--- a/build.gradle
+++ b/build.gradle
@@ -17,6 +17,14 @@
doorVersion = gitVersion()
repositories {
mavenCentral()
+
+ maven {
+ url "http://ykt-nx.supwisdom.com/repository/ecard-repo/"
+ credentials {
+ username 'ecard'
+ password 'Ecard4SUP'
+ }
+ }
}
def startClass = 'com.supwisdom.dlpay.DoorApplicationKt'
@@ -76,9 +84,13 @@
implementation 'cn.afterturn:easypoi-web:3.0.3'
implementation 'cn.afterturn:easypoi-base:3.0.3'
+ implementation 'com.github.penggle:kaptcha:2.3.2'
+
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
+ compile 'com.supwisdom:payapi-sdk:e4bf762'
+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.rest-assured:rest-assured:3.3.0'
testImplementation 'io.rest-assured:spring-mock-mvc:3.3.0'
diff --git a/config/application-devel-pg.properties b/config/application-devel-pg.properties
index e95d75d..c5fc85a 100644
--- a/config/application-devel-pg.properties
+++ b/config/application-devel-pg.properties
@@ -10,14 +10,14 @@
spring.datasource.password=123456
database.dbtype=postgresql
# Redis settings
-redis.server=172.28.201.101
-redis.port=16379
-redis.password=kingstar
-redis.database=0
+spring.redis.host=172.28.201.101
+spring.redis.port=16379
+spring.redis.password=kingstar
+spring.redis.database=0
# jwt settings
jwt.secret=Zj5taLomEbrM0lk+NMQZbHfSxaDU1wekjT+kiC3YzDw=
# timeout seconds
jwt.expiration=3600
auth.password.bcrypt.seed=
spring.jackson.serialization.fail-on-empty-beans=false
-server.port=10010
+server.port=8099
diff --git a/src/main/java/com/supwisdom/dlpay/doorlist/bean/CardlistInfoModel.java b/src/main/java/com/supwisdom/dlpay/doorlist/bean/CardlistInfoModel.java
new file mode 100644
index 0000000..fc46079
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/doorlist/bean/CardlistInfoModel.java
@@ -0,0 +1,36 @@
+package com.supwisdom.dlpay.doorlist.bean;
+
+import java.util.List;
+
+public class CardlistInfoModel {
+ private List<TDoordevInfo> tDevgroupdtlInfo;
+ private List<TCustomerInfo> tCustomerInfo;
+ private List<TCustomerInfo> tCustomerInfo_import;
+ private String reason;
+
+ public List<TDoordevInfo> gettDevgroupdtlInfo() {
+ return tDevgroupdtlInfo;
+ }
+ public void settDevgroupdtlInfo(List<TDoordevInfo> tDevgroupdtlInfo) {
+ this.tDevgroupdtlInfo = tDevgroupdtlInfo;
+ }
+ public List<TCustomerInfo> gettCustomerInfo() {
+ return tCustomerInfo;
+ }
+ public void settCustomerInfo(List<TCustomerInfo> tCustomerInfo) {
+ this.tCustomerInfo = tCustomerInfo;
+ }
+ public List<TCustomerInfo> gettCustomerInfo_import() {
+ return tCustomerInfo_import;
+ }
+ public void settCustomerInfo_import(List<TCustomerInfo> tCustomerInfo_import) {
+ this.tCustomerInfo_import = tCustomerInfo_import;
+ }
+ public String getReason() {
+ return reason;
+ }
+ public void setReason(String reason) {
+ this.reason = reason;
+ }
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/doorlist/bean/CustomerListBean.java b/src/main/java/com/supwisdom/dlpay/doorlist/bean/CustomerListBean.java
new file mode 100644
index 0000000..44e9387
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/doorlist/bean/CustomerListBean.java
@@ -0,0 +1,109 @@
+package com.supwisdom.dlpay.doorlist.bean;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+
+import java.io.Serializable;
+
+public class CustomerListBean implements Serializable {
+ @Excel(name = "姓名")
+ private String custname;
+ @Excel(name="市民卡号")
+ private String cardno;
+ @Excel(name = "银行卡号")
+ private String bankcardno;
+ @Excel(name = "物理卡号")
+ private String cardphyid;
+ @Excel(name = "性别")
+ private String sex;
+ @Excel(name = "电子邮箱")
+ private String email;
+ @Excel(name = "手机")
+ private String mobile;
+ @Excel(name = "地址")
+ private String addr;
+ @Excel(name = "注销日期")
+ private String closedate;
+ @Excel(name = "备注")
+ private String remarks;
+
+
+ public String getCustname() {
+ return custname;
+ }
+
+ public void setCustname(String custname) {
+ this.custname = custname;
+ }
+
+ public String getCardno() {
+ return cardno;
+ }
+
+ public void setCardno(String cardno) {
+ this.cardno = cardno;
+ }
+
+ public String getBankcardno() {
+ return bankcardno;
+ }
+
+ public void setBankcardno(String bankcardno) {
+ this.bankcardno = bankcardno;
+ }
+
+ public String getCardphyid() {
+ return cardphyid;
+ }
+
+ public void setCardphyid(String cardphyid) {
+ this.cardphyid = cardphyid;
+ }
+
+ public String getSex() {
+ return sex;
+ }
+
+ public void setSex(String sex) {
+ this.sex = sex;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getMobile() {
+ return mobile;
+ }
+
+ public void setMobile(String mobile) {
+ this.mobile = mobile;
+ }
+
+ public String getAddr() {
+ return addr;
+ }
+
+ public void setAddr(String addr) {
+ this.addr = addr;
+ }
+
+ public String getClosedate() {
+ return closedate;
+ }
+
+ public void setClosedate(String closedate) {
+ this.closedate = closedate;
+ }
+
+ public String getRemarks() {
+ return remarks;
+ }
+
+ public void setRemarks(String remarks) {
+ this.remarks = remarks;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/doorlist/bean/TCustomerInfo.java b/src/main/java/com/supwisdom/dlpay/doorlist/bean/TCustomerInfo.java
new file mode 100644
index 0000000..1e24f4c
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/doorlist/bean/TCustomerInfo.java
@@ -0,0 +1,72 @@
+package com.supwisdom.dlpay.doorlist.bean;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class TCustomerInfo {
+ @Id
+ private String custid;
+ private String custname;
+ private String cardno;
+ private String bankcardno;
+ private String cardphyid;
+ private String expiredate;
+ private String deviceid;
+
+ public String getCustid() {
+ return custid;
+ }
+
+ public void setCustid(String custid) {
+ this.custid = custid;
+ }
+
+ public String getCustname() {
+ return custname;
+ }
+
+ public void setCustname(String custname) {
+ this.custname = custname;
+ }
+
+ public String getCardno() {
+ return cardno;
+ }
+
+ public void setCardno(String cardno) {
+ this.cardno = cardno;
+ }
+
+ public String getBankcardno() {
+ return bankcardno;
+ }
+
+ public void setBankcardno(String bankcardno) {
+ this.bankcardno = bankcardno;
+ }
+
+ public String getCardphyid() {
+ return cardphyid;
+ }
+
+ public void setCardphyid(String cardphyid) {
+ this.cardphyid = cardphyid;
+ }
+
+ public String getExpiredate() {
+ return expiredate;
+ }
+
+ public void setExpiredate(String expiredate) {
+ this.expiredate = expiredate;
+ }
+
+ public String getDeviceid() {
+ return deviceid;
+ }
+
+ public void setDeviceid(String deviceid) {
+ this.deviceid = deviceid;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/doorlist/bean/TDoordevInfo.java b/src/main/java/com/supwisdom/dlpay/doorlist/bean/TDoordevInfo.java
new file mode 100644
index 0000000..4a5bcb2
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/doorlist/bean/TDoordevInfo.java
@@ -0,0 +1,45 @@
+package com.supwisdom.dlpay.doorlist.bean;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class TDoordevInfo {
+ @Id
+ private Integer deviceid;
+ private String devname;
+ private String regionname;
+ private String buildingname;
+
+ public Integer getDeviceid() {
+ return deviceid;
+ }
+
+ public void setDeviceid(Integer deviceid) {
+ this.deviceid = deviceid;
+ }
+
+ public String getDevname() {
+ return devname;
+ }
+
+ public void setDevname(String devname) {
+ this.devname = devname;
+ }
+
+ public String getRegionname() {
+ return regionname;
+ }
+
+ public void setRegionname(String regionname) {
+ this.regionname = regionname;
+ }
+
+ public String getBuildingname() {
+ return buildingname;
+ }
+
+ public void setBuildingname(String buildingname) {
+ this.buildingname = buildingname;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/doorlist/bean/TNcCardlistDeleteInfo.java b/src/main/java/com/supwisdom/dlpay/doorlist/bean/TNcCardlistDeleteInfo.java
new file mode 100644
index 0000000..e68222e
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/doorlist/bean/TNcCardlistDeleteInfo.java
@@ -0,0 +1,99 @@
+package com.supwisdom.dlpay.doorlist.bean;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class TNcCardlistDeleteInfo {
+ @Id
+ private String listid;
+ private String devname;
+ private String custname;
+ private String cardno;
+ private String bankcardno;
+ private String opername;
+ private String syncstatus;
+ private String operflag;
+ private String rectime;
+ private String synctime;
+
+ public String getListid() {
+ return listid;
+ }
+
+ public void setListid(String listid) {
+ this.listid = listid;
+ }
+
+ public String getDevname() {
+ return devname;
+ }
+
+ public void setDevname(String devname) {
+ this.devname = devname;
+ }
+
+ public String getCustname() {
+ return custname;
+ }
+
+ public void setCustname(String custname) {
+ this.custname = custname;
+ }
+
+ public String getCardno() {
+ return cardno;
+ }
+
+ public void setCardno(String cardno) {
+ this.cardno = cardno;
+ }
+
+ public String getBankcardno() {
+ return bankcardno;
+ }
+
+ public void setBankcardno(String bankcardno) {
+ this.bankcardno = bankcardno;
+ }
+
+ public String getOpername() {
+ return opername;
+ }
+
+ public void setOpername(String opername) {
+ this.opername = opername;
+ }
+
+ public String getSyncstatus() {
+ return syncstatus;
+ }
+
+ public void setSyncstatus(String syncstatus) {
+ this.syncstatus = syncstatus;
+ }
+
+ public String getOperflag() {
+ return operflag;
+ }
+
+ public void setOperflag(String operflag) {
+ this.operflag = operflag;
+ }
+
+ public String getRectime() {
+ return rectime;
+ }
+
+ public void setRectime(String rectime) {
+ this.rectime = rectime;
+ }
+
+ public String getSynctime() {
+ return synctime;
+ }
+
+ public void setSynctime(String synctime) {
+ this.synctime = synctime;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/doorlist/controller/DoorlistMgrController.java b/src/main/java/com/supwisdom/dlpay/doorlist/controller/DoorlistMgrController.java
index 27c2fd3..e743968 100644
--- a/src/main/java/com/supwisdom/dlpay/doorlist/controller/DoorlistMgrController.java
+++ b/src/main/java/com/supwisdom/dlpay/doorlist/controller/DoorlistMgrController.java
@@ -1,15 +1,27 @@
package com.supwisdom.dlpay.doorlist.controller;
+import cn.afterturn.easypoi.entity.vo.MapExcelConstants;
import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
+import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
+import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
+import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.view.PoiBaseView;
+import com.supwisdom.dlpay.doorlist.bean.*;
+import com.supwisdom.dlpay.doorlist.service.DoorlistMgrService;
import com.supwisdom.dlpay.framework.domain.TOperator;
+import com.supwisdom.dlpay.framework.util.DateUtil;
import com.supwisdom.dlpay.framework.util.StringUtil;
import com.supwisdom.dlpay.mainservice.bean.TDoorcardlstInfo;
+import com.supwisdom.dlpay.mainservice.domain.TCard;
+import com.supwisdom.dlpay.mainservice.domain.TCustomer;
import com.supwisdom.dlpay.mainservice.domain.TKey;
import com.supwisdom.dlpay.mainservice.service.WebInterfaceService;
import com.supwisdom.dlpay.ncmgr.domain.TBuilding;
+import com.supwisdom.dlpay.ncmgr.domain.TNcAllottime;
+import com.supwisdom.dlpay.ncmgr.domain.TNcAllottimeId;
+import com.supwisdom.dlpay.ncmgr.domain.TNcCardlist;
import com.supwisdom.dlpay.ncmgr.service.NcService;
import com.supwisdom.dlpay.system.domain.TDictionaryId;
import com.supwisdom.dlpay.system.domain.TRegion;
@@ -23,229 +35,820 @@
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import javax.servlet.http.HttpSession;
+import java.io.File;
+import java.text.SimpleDateFormat;
+import java.util.*;
@Controller
@RequestMapping("/doorlistMgr")
public class DoorlistMgrController {
- protected static Logger logger = LoggerFactory.getLogger(DoorlistMgrController.class);
+ protected static Logger logger = LoggerFactory.getLogger(DoorlistMgrController.class);
- @Autowired
- SystemService systemService;
- @Autowired
- WebInterfaceService webInterfaceService;
- @Autowired
- NcService ncService;
+ @Autowired
+ SystemService systemService;
+ @Autowired
+ WebInterfaceService webInterfaceService;
+ @Autowired
+ NcService ncService;
+ @Autowired
+ DoorlistMgrService doorlistMgrService;
- @RequestMapping("/downDoorList")
- public String downDoorList(ModelMap model) {
- return "doorlist/addDoorlist";
- }
-
- @RequestMapping("/deleteDoorList")
- public String deleteDoorList(ModelMap model) {
- return "doorlist/deleteDoorlist";
- }
-
- @RequestMapping("/searchDoorlist")
- public String searchDoorlist(ModelMap model) {
- return "doorlist/searchDoorlist";
- }
-
- /**
- * 填充查询门禁列表下拉菜单
- *
- * @return
- * @throws Exception
- */
- @ResponseBody
- @RequestMapping(value = "/getFillFormList")
- public Map getFillFormList(@AuthenticationPrincipal TOperator operUser) throws Exception {
- Map map = new HashMap();
- try {
- String opertype = operUser.getOpertype();
- //名单状态
- List<TDictionaryId> syncDicts = systemService.findTDictionaryByType(3);
- map.put("syncDicts", syncDicts);
- //厂商id
- List<TKey> allFactoryId = webInterfaceService.getAllKeys();
- map.put("allFactoryId", allFactoryId);
- //操作标记
- List<TDictionaryId> operDicts = new ArrayList<TDictionaryId>();
- operDicts.addAll(systemService.findByType(2, "A"));
- operDicts.addAll(systemService.findByType(2, "D"));
- operDicts.addAll(systemService.findByType(2, "C"));
- map.put("operDicts", operDicts);
-
- List<TRegion> regions = null;
- List<TBuilding> buildings = null;
- if (!StringUtil.isEmpty(opertype) && (opertype.equals("S") || opertype.equals("P"))) {
- regions = systemService.getAllRegions();
- buildings = ncService.getAllBuilding();
- map.put("regions", regions);
- map.put("buildings", buildings);
- } else if (!StringUtil.isEmpty(operUser.getRegionid())) {
- regions = systemService.getRegionListById(operUser.getRegionid());
- map.put("regions", regions);
- buildings = systemService.getBuildingByRegionId(operUser.getRegionid());
- map.put("buildings", buildings);
- }
-
- } catch (Exception e) {
- e.printStackTrace();
+ @RequestMapping("/downDoorList")
+ public String downDoorList(ModelMap model) {
+ return "doorlist/addDoorlist";
}
- return map;
- }
- /**
- * 查询设备名单
- *
- * @param request
- * @param factoryId
- * @param doorName
- * @param custName
- * @param stuempNo
- * @param syncStatus
- * @param operFlag
- * @param buildingid
- * @param regionid
- * @param allocatStartDate
- * @param allocatEndDate
- * @param pageNo
- * @param pageSize
- * @param operUser
- * @return
- */
- @ResponseBody
- @RequestMapping(value = "/getAllCardList")
- public Map getAllCardList(HttpServletRequest request,
- @RequestParam(value = "factoryId", required = false, defaultValue = "all") String factoryId,
- @RequestParam(value = "doorName", required = false, defaultValue = "") String doorName,
- @RequestParam(value = "custName", required = false, defaultValue = "") String custName,
- @RequestParam(value = "stuempNo", required = false, defaultValue = "") String stuempNo,
- @RequestParam(value = "syncStatus", required = false, defaultValue = "all") String syncStatus,
- @RequestParam(value = "operFlag", required = false, defaultValue = "all") String operFlag,
- @RequestParam(value = "buildingid", required = false, defaultValue = "") String buildingid,
- @RequestParam(value = "regionid", required = false, defaultValue = "") String regionid,
- @RequestParam(value = "allocatStartDate", required = false, defaultValue = "") String allocatStartDate,
- @RequestParam(value = "allocatEndDate", required = false, defaultValue = "") String allocatEndDate,
- @RequestParam(value = "pageNo", required = false, defaultValue = "1") int pageNo,
- @RequestParam(value = "pageSize", required = false, defaultValue = "15") int pageSize,
- @AuthenticationPrincipal TOperator operUser) {
-
- Map map = new HashMap();
- try {
- String opertype = operUser.getOpertype();
- boolean flag = true;
- Pagination pResult = new Pagination();
- if (!StringUtil.isEmpty(opertype) && (opertype.equals("S") || opertype.equals("P"))) {
- pResult = webInterfaceService.getSystemCardListFrSearch(factoryId, allocatStartDate, allocatEndDate, doorName, custName, stuempNo, syncStatus, operFlag, buildingid, regionid, pageNo, pageSize);
- } else if (!StringUtil.isEmpty(operUser.getRegionid())) {
- pResult = webInterfaceService.getOperatorCardListFrSearch(factoryId, allocatStartDate, allocatEndDate, doorName, custName, stuempNo, syncStatus, operFlag, buildingid, regionid, pageNo, pageSize, operUser.getRegionid());
- }
- map.put("PageResult", pResult);
- map.put("index", flag);
- map.put("result", "查询设备名单成功!");
- } catch (Exception e) {
- e.printStackTrace();
- map.put("result", "查询设备名单失败!");
- logger.error("查询设备名单失败:" + e.getMessage());
+ @RequestMapping("/deleteDoorList")
+ public String deleteDoorList(ModelMap model) {
+ return "doorlist/deleteDoorlist";
}
- return map;
- }
- /**
- * 注解方式导出设备名单Excel
- *
- * @param modelMap
- * @param request
- * @param response
- * @param factoryId
- * @param doorName
- * @param custName
- * @param stuempNo
- * @param syncStatus
- * @param operFlag
- * @param buildingid
- * @param regionid
- * @param allocatStartDate
- * @param allocatEndDate
- * @param operUser
- */
- @RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
- public void download(ModelMap modelMap, HttpServletRequest request, HttpServletResponse response,
- @RequestParam(value = "factoryId", required = false, defaultValue = "all") String factoryId,
- @RequestParam(value = "doorName", required = false, defaultValue = "") String doorName,
- @RequestParam(value = "custName", required = false, defaultValue = "") String custName,
- @RequestParam(value = "stuempNo", required = false, defaultValue = "") String stuempNo,
- @RequestParam(value = "syncStatus", required = false, defaultValue = "all") String syncStatus,
- @RequestParam(value = "operFlag", required = false, defaultValue = "all") String operFlag,
- @RequestParam(value = "buildingid", required = false, defaultValue = "") String buildingid,
- @RequestParam(value = "regionid", required = false, defaultValue = "") String regionid,
- @RequestParam(value = "allocatStartDate", required = false, defaultValue = "") String allocatStartDate,
- @RequestParam(value = "allocatEndDate", required = false, defaultValue = "") String allocatEndDate,
- @AuthenticationPrincipal TOperator operUser) {
- String opertype = operUser.getOpertype();
- /**
- * 1.查询值
- */
- List<TDoorcardlstInfo> cardList = null;
- if (!StringUtil.isEmpty(opertype) && (opertype.equals("S") || opertype.equals("P"))) {
- cardList = webInterfaceService.getSystemCardListMap(factoryId, allocatStartDate, allocatEndDate,
- doorName, custName, stuempNo, syncStatus, operFlag, buildingid, regionid);
- } else if (!StringUtil.isEmpty(operUser.getRegionid())) {
- cardList = webInterfaceService.getOperatorCardListMap(factoryId, allocatStartDate, allocatEndDate,
- doorName, custName, stuempNo, syncStatus, operFlag, buildingid, regionid, operUser.getRegionid());
+ @RequestMapping("/searchDoorlist")
+ public String searchDoorlist(ModelMap model) {
+ return "doorlist/searchDoorlist";
+ }
+
+ @RequestMapping("/impCustomerlistindex")
+ public String impCustomerlistindex(){
+ return "doorlist/impCustomerlist";
}
/**
- * 2.设置表格属性: title:标题 sheetName:工作簿名 type:表格类型
+ * 填充查询门禁列表下拉菜单
+ *
+ * @return
+ * @throws Exception
*/
- ExportParams params = new ExportParams("设备名单列表", "设备名单", ExcelType.XSSF);
+ @ResponseBody
+ @RequestMapping(value = "/getFillFormList")
+ public Map getFillFormList(@AuthenticationPrincipal TOperator operUser) throws Exception {
+ Map map = new HashMap();
+ try {
+ String opertype = operUser.getOpertype();
+ //名单状态
+ List<TDictionaryId> syncDicts = systemService.findTDictionaryByType(3);
+ map.put("syncDicts", syncDicts);
+ //操作标记
+ List<TDictionaryId> operDicts = new ArrayList<TDictionaryId>();
+ operDicts.addAll(systemService.findByType(2, "A"));
+ operDicts.addAll(systemService.findByType(2, "D"));
+ operDicts.addAll(systemService.findByType(2, "C"));
+ map.put("operDicts", operDicts);
- modelMap.put(NormalExcelConstants.DATA_LIST, cardList);//设置值
- modelMap.put(NormalExcelConstants.PARAMS, params);//设置属性
- modelMap.put(NormalExcelConstants.CLASS, TDoorcardlstInfo.class);
- modelMap.put(NormalExcelConstants.FILE_NAME, "下发设备名单");
- PoiBaseView.render(modelMap, request, response, NormalExcelConstants.EASYPOI_EXCEL_VIEW);
+ List<TRegion> regions = null;
+ List<TBuilding> buildings = null;
+ if (!StringUtil.isEmpty(opertype) && (opertype.equals("S") || opertype.equals("P"))) {
+ regions = systemService.getAllRegions();
+ buildings = ncService.getAllBuilding();
+ map.put("regions", regions);
+ map.put("buildings", buildings);
+ } else if (!StringUtil.isEmpty(operUser.getRegionid()) && opertype.equals("H")) {
+ regions = systemService.getRegionListById(operUser.getRegionid());
+ map.put("regions", regions);
+ buildings = systemService.getBuildingByRegionId(operUser.getRegionid());
+ map.put("buildings", buildings);
+ }else if (opertype.equals("L")){
+ map.put("regions", regions);
+ buildings = systemService.getBuildingOperBuildings(operUser.getOperid());
+ map.put("buildings", buildings);
+ }
- }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return map;
+ }
+
+ /**
+ * 查询设备名单
+ *
+ * @param request
+ * @param buildingid
+ * @param regionid
+ * @param allocatStartDate
+ * @param allocatEndDate
+ * @param pageNo
+ * @param pageSize
+ * @param operUser
+ * @return
+ */
+ @ResponseBody
+ @RequestMapping(value = "/getAllCardList")
+ public Map getAllCardList(HttpServletRequest request,
+ @RequestParam(value = "devname", required = false, defaultValue = "") String devname,
+ @RequestParam(value = "custname", required = false, defaultValue = "") String custname,
+ @RequestParam(value = "cardno", required = false, defaultValue = "") String cardno,
+ @RequestParam(value = "syncflag", required = false, defaultValue = "all") String syncflag,
+ @RequestParam(value = "operflag", required = false, defaultValue = "all") String operflag,
+ @RequestParam(value = "buildingid", required = false, defaultValue = "") String buildingid,
+ @RequestParam(value = "regionid", required = false, defaultValue = "") String regionid,
+ @RequestParam(value = "allocatStartDate", required = false, defaultValue = "") String allocatStartDate,
+ @RequestParam(value = "allocatEndDate", required = false, defaultValue = "") String allocatEndDate,
+ @RequestParam(value = "pageNo", required = false, defaultValue = "1") int pageNo,
+ @RequestParam(value = "pageSize", required = false, defaultValue = "15") int pageSize,
+ @AuthenticationPrincipal TOperator operUser) {
+
+ Map map = new HashMap();
+ try {
+ String opertype = operUser.getOpertype();
+ boolean flag = true;
+ Pagination pResult = new Pagination();
+ if (!StringUtil.isEmpty(opertype) && (opertype.equals("S") || opertype.equals("P"))) {
+ pResult = webInterfaceService.getSystemCardListFrSearch(allocatStartDate, allocatEndDate, devname, custname,cardno, syncflag, operflag, buildingid, regionid, pageNo, pageSize);
+ } else if (!StringUtil.isEmpty(operUser.getRegionid()) && opertype.equals("H")) {
+ pResult = webInterfaceService.getOperatorCardListFrSearch(allocatStartDate, allocatEndDate, devname, custname, cardno, syncflag, operflag, buildingid, regionid, pageNo, pageSize, operUser.getRegionid());
+ }else if (opertype.equals("L")){
+ pResult = webInterfaceService.getBuildingOperCardListFrSearch(allocatStartDate, allocatEndDate, devname, custname, cardno, syncflag, operflag, buildingid, operUser.getOperid(), pageNo, pageSize);
+ }
+ map.put("PageResult", pResult);
+ map.put("index", flag);
+ map.put("result", "查询设备名单成功!");
+ } catch (Exception e) {
+ e.printStackTrace();
+ map.put("result", "查询设备名单失败!");
+ logger.error("查询设备名单失败:" + e.getMessage());
+ }
+ return map;
+ }
+
+ /**
+ * 注解方式导出设备名单Excel
+ *
+ * @param modelMap
+ * @param request
+ * @param response
+ * @param buildingid
+ * @param regionid
+ * @param allocatStartDate
+ * @param allocatEndDate
+ * @param operUser
+ */
+ @RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
+ public void download(ModelMap modelMap, HttpServletRequest request, HttpServletResponse response,
+ @RequestParam(value = "devname", required = false, defaultValue = "") String devname,
+ @RequestParam(value = "custname", required = false, defaultValue = "") String custname,
+ @RequestParam(value = "cardno", required = false, defaultValue = "") String cardno,
+ @RequestParam(value = "syncflag", required = false, defaultValue = "all") String syncflag,
+ @RequestParam(value = "operflag", required = false, defaultValue = "all") String operflag,
+ @RequestParam(value = "buildingid", required = false, defaultValue = "") String buildingid,
+ @RequestParam(value = "regionid", required = false, defaultValue = "") String regionid,
+ @RequestParam(value = "allocatStartDate", required = false, defaultValue = "") String allocatStartDate,
+ @RequestParam(value = "allocatEndDate", required = false, defaultValue = "") String allocatEndDate,
+ @AuthenticationPrincipal TOperator operUser) {
+ String opertype = operUser.getOpertype();
+ /**
+ * 1.查询值
+ */
+ List<TDoorcardlstInfo> cardList = null;
+ if (!StringUtil.isEmpty(opertype) && (opertype.equals("S") || opertype.equals("P"))) {
+ cardList = webInterfaceService.getSystemCardListMap(allocatStartDate, allocatEndDate,
+ devname, custname, cardno, syncflag, operflag, buildingid, regionid);
+ } else if (!StringUtil.isEmpty(operUser.getRegionid()) && opertype.equals("H")) {
+ cardList = webInterfaceService.getOperatorCardListMap( allocatStartDate, allocatEndDate,
+ devname, custname, cardno, syncflag, operflag, buildingid, regionid, operUser.getRegionid());
+ }else if (opertype.equals("L")){
+ cardList = webInterfaceService.getBuildingOperCardListMap(allocatStartDate, allocatEndDate, devname, custname, cardno, syncflag, operflag, buildingid, operUser.getOperid());
+ }
+
+ /**
+ * 2.设置表格属性: title:标题 sheetName:工作簿名 type:表格类型
+ */
+ ExportParams params = new ExportParams("设备名单列表", "设备名单", ExcelType.XSSF);
+
+ modelMap.put(NormalExcelConstants.DATA_LIST, cardList);//设置值
+ modelMap.put(NormalExcelConstants.PARAMS, params);//设置属性
+ modelMap.put(NormalExcelConstants.CLASS, TDoorcardlstInfo.class);
+ modelMap.put(NormalExcelConstants.FILE_NAME, "下发设备名单");
+ PoiBaseView.render(modelMap, request, response, NormalExcelConstants.EASYPOI_EXCEL_VIEW);
+
+ }
+
+ /**
+ * 重新下发名单
+ *
+ * @param request
+ * @param tDoorcardlstInfos
+ * @return
+ */
+ @ResponseBody
+ @RequestMapping(value = "/reSaveDoorCardList", method = {RequestMethod.POST})
+ public Map reSaveDoorCardList(HttpServletRequest request,
+ @RequestBody TDoorcardlstInfo[] tDoorcardlstInfos) {
+ Map map = new HashMap();
+ String msg = "";
+ try {
+ List<Long> listIds = new ArrayList<>();
+ for (TDoorcardlstInfo tDoorcardlstInfo : tDoorcardlstInfos) {
+ listIds.add(Long.valueOf(tDoorcardlstInfo.getListid()));
+ }
+ webInterfaceService.updateDoorcardlstToNoWithIds(listIds);
+ RedisUtil.incr("zcard_max_version");
+ map.put("result", "重新下发设备名单成功!");
+ } catch (Exception e) {
+ e.printStackTrace();
+ map.put("result", "重新下发设备名单失败!");
+ msg = "重新下发设备名单异常";
+ logger.error("重定向出错:" + e.getMessage());
+ }
+ map.put("msg", msg);
+ return map;
+ }
+
+ /**
+ * 人员名单导入模板
+ * @param request
+ * @param response
+ * @param map
+ */
+ @RequestMapping(value = "/downImpTemplate")
+ public void downImpTemplate(HttpServletRequest request, HttpServletResponse response, ModelMap map) {
+ try {
+ List<ExcelExportEntity> entity = new ArrayList<ExcelExportEntity>();
+ /**
+ * 1. 设置列信息:name:列标题 key: 列属性
+ */
+ entity.add(new ExcelExportEntity("姓名", "custname"));
+ entity.add(new ExcelExportEntity("市民卡号", "cardno"));
+ entity.add(new ExcelExportEntity("银行卡号", "bankcarno"));
+ entity.add(new ExcelExportEntity("物理卡号","cardphyid"));
+ entity.add(new ExcelExportEntity("性别", "sex"));
+ entity.add(new ExcelExportEntity("电子邮箱", "email"));
+ entity.add(new ExcelExportEntity("手机", "mobile"));
+ entity.add(new ExcelExportEntity("地址", "addr"));
+ entity.add(new ExcelExportEntity("注销日期", "closedate"));
+ entity.add(new ExcelExportEntity("备注", "remarks"));
+ List<Map> personList = new ArrayList<Map>();
+
+ /**
+ * 3.设置表格属性: title:标题 sheetName:工作簿名 type:表格类型
+ */
+ ExportParams params = new ExportParams(null, "sheet1", ExcelType.HSSF);
+ map.put(MapExcelConstants.MAP_LIST, personList);
+ map.put(MapExcelConstants.ENTITY_LIST, entity);
+ map.put(MapExcelConstants.PARAMS, params);
+ map.put(MapExcelConstants.FILE_NAME, "人员名单导入模板");//文件名
+ map.put("result", "导出excel文件完成");
+ PoiBaseView.render(map, request, response, MapExcelConstants.EASYPOI_MAP_EXCEL_VIEW);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ map.put("result", "导出excel文件失败");
+ }
+ }
/**
- * 重新下发名单
- *
+ * 人员名单导入
+ * @param file
* @param request
- * @param tDoorcardlstInfos
* @return
*/
- @ResponseBody
- @RequestMapping(value = "/reSaveDoorCardList", method = {RequestMethod.POST})
- public Map reSaveDoorCardList(HttpServletRequest request,
- @RequestBody TDoorcardlstInfo[] tDoorcardlstInfos) {
- Map map = new HashMap();
- String msg = "";
- try {
- List<Long> listIds = new ArrayList<>();
- for (TDoorcardlstInfo tDoorcardlstInfo : tDoorcardlstInfos) {
- listIds.add(Long.valueOf(tDoorcardlstInfo.getListid()));
+ @RequestMapping(value = "/impDoorCardList", method = {RequestMethod.POST})
+ public Map impDoorCardList(@RequestParam(value = "impCustomerlist_file", required = false) MultipartFile file,
+ HttpServletRequest request,@AuthenticationPrincipal TOperator operUser) {
+ Map map = new HashMap();
+ try {
+ //String sheetName = request.getParameter("sheetname");
+
+ String path = request.getSession().getServletContext().getRealPath("upload");
+ String fileName = file.getOriginalFilename();
+ File targetFile = new File(path, fileName);
+ if (!targetFile.exists()) {
+ targetFile.mkdirs();
+ }
+ file.transferTo(targetFile);
+ map = impCardList(path+"/"+fileName,operUser.getOperid(),map);
+
+
+ } catch (Exception e) {
+ e.printStackTrace();
+
}
- webInterfaceService.updateDoorcardlstToNoWithIds(listIds);
- RedisUtil.incr("zcard_max_version");
- map.put("result", "重新下发设备名单成功!");
- } catch (Exception e) {
- e.printStackTrace();
- map.put("result", "重新下发设备名单失败!");
- msg = "重新下发设备名单异常";
- logger.error("重定向出错:" + e.getMessage());
+ return map;
}
- map.put("msg", msg);
- return map;
+
+
+ private Map impCardList(String fpath,String operid,Map map) {
+ ImportParams params = new ImportParams();
+ params.setTitleRows(0);
+ List<CustomerListBean> doorList = ExcelImportUtil.importExcel(new File(fpath), CustomerListBean.class, params);
+ int totCnt = doorList.size();
+ int flag =0;
+ if (doorList.size() <= 0) {
+ flag = -1;
+ }
+ try {
+ String now = DateUtil.getNow();
+ List<TNcCardlist> tmpNcCardList = new ArrayList<TNcCardlist>();
+ List<TCard> tmpCardList = new ArrayList<TCard>();
+ int tmpi = 0;
+ int succCnt = 0;
+ int errCnt = 0;
+ long startTime = System.currentTimeMillis();
+ for (CustomerListBean list : doorList) {
+
+ String cardno = list.getCardno();
+ String bankcardno = list.getBankcardno();
+
+ if (StringUtil.isEmpty(cardno)||StringUtil.isEmpty(bankcardno)){
+ errCnt++;
+ continue;
+ }
+ succCnt++;
+ tmpi++;
+ TCustomer customer = webInterfaceService.findCustomerByNo(cardno, bankcardno);
+ if (customer != null) {//此用户已存在
+ TCard card = webInterfaceService.findCardByCustid(customer.getCustid());
+ customer.setStatus("1");
+ customer.setCustname(list.getCustname());
+ customer.setSex(list.getSex());
+ customer.setEmail(list.getEmail());
+ customer.setMobile(list.getMobile());
+ customer.setAddr(list.getAddr());
+ customer.setClosedate(list.getClosedate());
+ customer.setLastsavedtime(now);
+ customer.setAddoperid(operid);
+ customer.setRemark(list.getRemarks());
+ webInterfaceService.saveCustomer(customer);
+
+ card.setCardphyid(list.getCardphyid());
+ card.setExpiredate(list.getClosedate());
+ card.setStatus("1");
+ card.setCardverno(Integer.parseInt(card.getCardverno())+1+"");
+ card.setLastsavedtime(now);
+ webInterfaceService.saveCard(card);
+
+ }else {
+ TCustomer customerTmp = new TCustomer();
+ customerTmp.setStatus("1");
+ customerTmp.setCustname(list.getCustname());
+ customerTmp.setSex(list.getSex());
+ customerTmp.setEmail(list.getEmail());
+ customerTmp.setMobile(list.getMobile());
+ customerTmp.setAddr(list.getAddr());
+ customerTmp.setOpendate(now.substring(0, 7));
+ customerTmp.setClosedate(list.getClosedate());
+ customerTmp.setLastsavedtime(now);
+ customerTmp.setAddoperid(operid);
+ customerTmp.setRemark(list.getRemarks());
+ webInterfaceService.saveCustomer(customerTmp);
+
+ TCard cardTmp = new TCard();
+ cardTmp.setCardno(list.getCardno());
+ cardTmp.setCustid(customerTmp.getCustid());
+ cardTmp.setCardphyid(list.getCardphyid());
+ cardTmp.setExpiredate(list.getClosedate());
+ cardTmp.setStatus("1");
+ cardTmp.setLossflag("0");
+ cardTmp.setLossdate("");
+ cardTmp.setRenewflag("0");
+ cardTmp.setFrozeflag("0");
+ cardTmp.setCardverno("1");
+ cardTmp.setLastsavedtime(now);
+ cardTmp.setBankcardno(list.getBankcardno());
+ webInterfaceService.saveCard(cardTmp);
+ }
+ }
+ //获取结束时间
+ long endTime = System.currentTimeMillis();
+ logger.info("名单导入消耗时间: " + (endTime - startTime) + "ms");
+ flag=1;
+
+ map.put("imp_totCnt",totCnt);
+ map.put("imp_succCnt",succCnt);
+ map.put("imp_errCnt",errCnt);
+ }catch (Exception ex){
+ logger.error("名单导入失败--"+ex.getMessage());
+ flag=-2;
+ }
+ map.put("flag", flag);
+ return map;
}
+
+ /**
+ * 获取要下发的人员名单
+ * @param perName
+ * @param cardno
+ * @param bankcardno
+ * @return
+ */
+ @ResponseBody
+ @RequestMapping(value = "/getAllTCustomerList",method = RequestMethod.POST)
+ public Map getAllTCustomerList(@RequestParam(value = "perName", required = false, defaultValue = "") String perName,
+ @RequestParam(value = "stuempNo", required = false, defaultValue = "") String cardno,
+ @RequestParam(value = "className", required = false, defaultValue = "") String bankcardno) {
+ Map map = new HashMap();
+ try {
+ List<TCustomerInfo> pNotInResult = webInterfaceService.getAllTCustomerList(perName, cardno, bankcardno);
+ Boolean countIndex = false;
+ if (pNotInResult.size() > 4000) {
+ countIndex = true;
+ }
+ map.put("pNotInResult", pNotInResult);
+ map.put("countIndex", countIndex);
+ }catch (Exception e){
+ e.printStackTrace();
+ logger.error("名单查询失败--"+e.getMessage());
+ }
+ return map;
+ }
+
+ /**
+ * 获取设备查询区域和楼栋填充列表
+ * @param operUser
+ * @return
+ */
+ @ResponseBody
+ @RequestMapping(value = "/getRegionAndBuildingList")
+ public Map getRegionAndBuildingList(@AuthenticationPrincipal TOperator operUser){
+ Map map = new HashMap();
+ try{
+ String opertype = operUser.getOpertype();
+ List<TRegion> regions = null;
+ List<TBuilding> buildings = null;
+ if (!StringUtil.isEmpty(opertype) &&(opertype.equals("S")||opertype.equals("P"))){
+ regions = systemService.getAllRegions();
+ buildings = systemService.getAllBuildings();
+
+ }else if (opertype.equals("H") && !StringUtil.isEmpty(operUser.getRegionid())){
+ regions = systemService.getRegionListById(operUser.getRegionid());
+ buildings = systemService.getOperatorBuildings(operUser.getRegionid());
+ }else if (opertype.equals("L")){
+ buildings = systemService.getBuildingOperBuildings(operUser.getOperid());
+ }
+ map.put("regions", regions);
+ map.put("buildings", buildings);
+ }catch (Exception e){
+ e.printStackTrace();
+ logger.error("获取区域和楼栋列表失败!", e.getMessage());
+ }
+ return map;
+ }
+
+ /**
+ * 获取要分配的设备列表 --读头设备
+ * @param request
+ * @param deviceName
+ * @param regionid
+ * @param buildingid
+ * @param usetype
+ * @param operUser
+ * @return
+ */
+ @ResponseBody
+ @RequestMapping(value = "/getAllTDevgroupdtlList")
+ public Map getAllTDevgroupdtlList(HttpServletRequest request,
+ @RequestParam(value = "deviceName", required = false, defaultValue = "") String deviceName,
+ @RequestParam(value = "regionid", required = false, defaultValue = "") String regionid,
+ @RequestParam(value = "buildingid", required = false, defaultValue = "") String buildingid,
+ @RequestParam(value = "usetype", required = false, defaultValue = "MJ") String usetype,
+ @AuthenticationPrincipal TOperator operUser) {
+ Map map = new HashMap();
+ try {
+ String opertype = operUser.getOpertype();
+ List<TDoordevInfo> pResult = null;
+ if (!StringUtil.isEmpty(opertype) &&(opertype.equals("S")||opertype.equals("P"))){
+ pResult = ncService.getSystemDevList();
+ }else if (opertype.equals("H") && !StringUtil.isEmpty(operUser.getRegionid())){
+ pResult = ncService.getOperatorDevList(operUser.getRegionid());
+ }else if (opertype.equals("L")){
+ pResult = ncService.getBuildingOperDevList(operUser.getOperid());
+ }
+ map.put("pResult", pResult);
+ }catch (Exception e){
+ e.printStackTrace();
+ logger.error("获取要分配设备列表失败!", e.getMessage());
+ }
+ return map;
+ }
+
+ /**
+ * 分页获取要分配的时间段信息
+ * @param timeName
+ * @param pageNo
+ * @param pageSize
+ * @return
+ */
+ @ResponseBody
+ @RequestMapping(value = "/getAllTDoortimeList")
+ public Map getAllTDoortimeList(
+ @RequestParam(value = "timeName", required = false, defaultValue = "") String timeName,
+ @RequestParam(value = "pageNo", required = false, defaultValue = "1") int pageNo,
+ @RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize) {
+ Map map = new HashMap();
+ Pagination pResult = ncService.getNcWeekTimeWithPage(timeName, pageNo, pageSize, map);
+ map.put("pResult", pResult);
+ return map;
+ }
+
+
+ /**
+ * 门禁名单下发
+ * @param cardlistInfoModel
+ * @param timeId
+ * @param holidayId
+ * @param devGroupId
+ * @param usetype
+ * @param request
+ * @param operUser
+ * @return
+ */
+ @ResponseBody
+ @RequestMapping(value = "/saveDoorCardlist", method = {RequestMethod.POST})
+ public Map saveDoorCardlist(
+ @RequestBody CardlistInfoModel cardlistInfoModel,
+ @RequestParam(value = "timeId", required = false, defaultValue = "") String timeId,
+ @RequestParam(value = "holidayId", required = false, defaultValue = "") String holidayId,
+ @RequestParam(value = "devGroupId", required = false, defaultValue = "") String devGroupId,
+ @RequestParam(value = "usetype", required = false, defaultValue = "MJ") String usetype,
+ HttpServletRequest request,@AuthenticationPrincipal TOperator operUser) {
+ Map map = new HashMap();
+ String msg = "";
+ boolean okFlag = false;
+ try {
+ String[] timeIdArray = timeId.split(",");
+ String[] holidayIdArray = null;
+ if (!("").equals(holidayId)) {
+ holidayIdArray = holidayId.split(",");
+ }
+ String[] devGroupIdArray = null;
+ if (!("").equals(devGroupId)) {
+ devGroupIdArray = devGroupId.split(",");
+ }
+
+ String reason = cardlistInfoModel.getReason();
+ List<TDoordevInfo> tDevgroupdtlInfos = cardlistInfoModel.gettDevgroupdtlInfo();
+ if (devGroupIdArray != null) {
+ /*List<TDoordevInfo> tDevgroupdtlInfo = webInterfaceService.getTDevgroupdtlByGroupId(factoryId, devGroupIdArray);
+ if (tDevgroupdtlInfo != null && tDevgroupdtlInfo.size() > 0) {
+ if (tDevgroupdtlInfos == null || tDevgroupdtlInfos.size() == 0) {
+ tDevgroupdtlInfos = tDevgroupdtlInfo;
+ } else {
+ tDevgroupdtlInfos.addAll(tDevgroupdtlInfo);
+ }
+ }*/
+ }
+
+ List<TCustomerInfo> tCustomerInfos = cardlistInfoModel.gettCustomerInfo();
+ List<TCustomerInfo> tCustomerInfo_import = cardlistInfoModel.gettCustomerInfo_import();
+ if (tCustomerInfo_import != null && tCustomerInfo_import.size() > 0) {
+ if (tCustomerInfos == null || tCustomerInfos.size() == 0) {
+ tCustomerInfos = cardlistInfoModel.gettCustomerInfo_import();
+ } else {
+ tCustomerInfos.addAll(cardlistInfoModel.gettCustomerInfo_import());
+ }
+ }
+
+ String now = DateUtil.getNow();
+ List<TNcCardlist> tNcCardlists = new ArrayList<TNcCardlist>();
+ List<TNcAllottime> tNcAllottimes = new ArrayList<TNcAllottime>();
+ int tmpi=0;
+ //long listid =0;
+ long startTime=System.currentTimeMillis(); //获取开始时间
+ for (TCustomerInfo card : tCustomerInfos) {
+ for (TDoordevInfo dev : tDevgroupdtlInfos) {
+ //存在则直接更新状态,否则添加新记录
+ for (int i = 0; i < timeIdArray.length; i++) {
+ String timeid = timeIdArray[i];
+ tmpi++;
+ //listid++;
+ TNcCardlist cardlist = doorlistMgrService.getNcCardlist(dev.getDeviceid(), card.getCardphyid(), timeid);
+ if (cardlist != null) {
+ cardlist.setOperflag("A");
+ cardlist.setOperid(operUser.getOperid());
+ cardlist.setSyncflag("N");
+ cardlist.setSynctime("");
+ cardlist.setRectime(now);
+ cardlist.setReason(reason);
+ cardlist.setVersion(cardlist.getVersion()+1);
+ tNcCardlists.add(cardlist);
+ //webInterfaceService.saveTDoorcardlst(doorlst);
+ } else {
+ //long listid = webInterfaceService.getNextSeqTDoorcardlst();
+ //从缓存读取列表值并加1
+ long listid = RedisUtil.incr("seq_cardlist");
+ TNcCardlist tmpCardlist = new TNcCardlist();
+ tmpCardlist.setListid(listid+"");
+ tmpCardlist.setCustid(card.getCustid());
+ tmpCardlist.setCustname(card.getCustname());
+ tmpCardlist.setCardno(card.getCardno());
+ tmpCardlist.setBankcardno(card.getBankcardno());
+ tmpCardlist.setCardphyid(card.getCardphyid());
+ tmpCardlist.setClosedate(card.getExpiredate());
+ tmpCardlist.setDeviceid(dev.getDeviceid());
+ tmpCardlist.setOperflag("A");
+ tmpCardlist.setRectime(now);
+ tmpCardlist.setSynctime("");
+ tmpCardlist.setSyncflag("N");
+ tmpCardlist.setRtnflag("Y");
+ tmpCardlist.setRtntime(now);
+ tmpCardlist.setVersion(1);
+ tmpCardlist.setOperid(operUser.getOperid());
+ tmpCardlist.setReason(reason);
+
+ tNcCardlists.add(tmpCardlist);
+
+ //webInterfaceService.saveTDoorcardlst(tDoorcardlst);
+
+ TNcAllottimeId tNcAllottimeId = new TNcAllottimeId();
+ tNcAllottimeId.setListid(listid+"");
+ tNcAllottimeId.setTimeid(timeIdArray[i]);
+ TNcAllottime tNcAllottime = new TNcAllottime();
+ tNcAllottime.setDeviceid(dev.getDeviceid());
+ tNcAllottime.setId(tNcAllottimeId);
+
+ tNcAllottimes.add(tNcAllottime);
+ //long end1=System.currentTimeMillis(); //获取结束时间
+ //System.out.println("程序运行时间: "+(end1-start1)+"ms");
+ if (tmpi>=500){
+ doorlistMgrService.batchSaveCardList(tNcCardlists);
+ doorlistMgrService.batchSaveAllotTime(tNcAllottimes);
+ RedisUtil.incr("zcard_max_version");
+ tNcCardlists.clear();
+ tNcAllottimes.clear();
+ tmpi=0;
+ }
+
+ //webInterfaceService.saveTAllottime(tAllottime);
+
+ if (holidayIdArray != null) {
+ /* for (int j = 0; j < holidayIdArray.length; j++) {
+ TAllotholidayId tAllotholidayId = new TAllotholidayId();
+ tAllotholidayId.setListid(listid);
+ tAllotholidayId.setHolidayid(holidayIdArray[j]);
+ TAllotholiday tAllotholiday = new TAllotholiday();
+ tAllotholiday.setId(tAllotholidayId);
+ tAllotholiday.setFactoryid(factoryId);
+ webInterfaceService.saveTAllotholiday(tAllotholiday);
+ }*/
+ }
+
+ }
+ }
+
+
+ }
+ }
+ long endTime=System.currentTimeMillis(); //获取结束时间
+ System.out.println("下发名单消耗时间: "+(endTime-startTime)+"ms");
+ if (tNcCardlists.size()>0) {
+ doorlistMgrService.batchSaveCardList(tNcCardlists);
+ RedisUtil.incr("zcard_max_version");
+ }
+ if (tNcAllottimes.size()>0) {
+ doorlistMgrService.batchSaveAllotTime(tNcAllottimes);
+ }
+
+ map.put("result", "下发设备名单成功!");
+ okFlag = true;
+ msg = "下发设备名单成功!";
+ } catch (Exception e) {
+ e.printStackTrace();
+ map.put("result", "下发设备名单失败!");
+ msg = "下发设备名单异常";
+ logger.error("下发设备名单异常:" + e.getMessage());
+ }
+ map.put("okFlag", okFlag);
+ map.put("msg", msg);
+ return map;
+ }
+
+
+ /**
+ * 分页获取要删除的名单列表
+ * @param request
+ * @param devname
+ * @param custname
+ * @param cardno
+ * @param syncstatus
+ * @param regionid
+ * @param allocatStartDate
+ * @param allocatEndDate
+ * @param operflag
+ * @param pageNo
+ * @param pageSize
+ * @param usetype
+ * @param operUser
+ * @return
+ */
+ @ResponseBody
+ @RequestMapping(value = "/getAllCardListFrDelete", method = RequestMethod.POST)
+ public Map getAllCardListFrDelete( HttpServletRequest request,
+ @RequestParam(value = "devname", required = false, defaultValue = "") String devname,
+ @RequestParam(value = "custname", required = false, defaultValue = "") String custname,
+ @RequestParam(value = "cardno", required = false, defaultValue = "") String cardno,
+ @RequestParam(value = "syncstatus", required = false, defaultValue = "all") String syncstatus,
+ @RequestParam(value = "regionid",required = false,defaultValue = "") String regionid,
+ @RequestParam(value = "allocatStartDate", required = false, defaultValue = "") String allocatStartDate,
+ @RequestParam(value = "allocatEndDate", required = false, defaultValue = "") String allocatEndDate,
+ @RequestParam(value = "operflag", required = false, defaultValue = "all") String operflag,
+ @RequestParam(value = "pageNo", required = false, defaultValue = "1") int pageNo,
+ @RequestParam(value = "pageSize", required = false, defaultValue = "15") int pageSize,
+ @RequestParam(value = "usetype", required = false, defaultValue = "MJ") String usetype,
+ @AuthenticationPrincipal TOperator operUser) {
+ Map map = new HashMap();
+ Pagination pResult = null;
+ boolean index = true;
+ try {
+ SimpleDateFormat ymdhms = new SimpleDateFormat("yyyyMMdd");
+ if (("").equals(allocatStartDate)) {
+ Calendar now = Calendar.getInstance();
+ allocatEndDate = ymdhms.format(now.getTime());
+ allocatStartDate = lastWeek();
+ map.put("endDate", allocatEndDate);
+ map.put("startDate", allocatStartDate);
+ index = false;
+ }
+
+ String opertype = operUser.getOpertype();
+ if (!StringUtil.isEmpty(opertype) &&(opertype.equals("S")||opertype.equals("P"))){
+ pResult = doorlistMgrService.getSystemCardList(devname, custname, cardno, syncstatus, regionid, allocatStartDate, allocatEndDate, operflag, pageNo, pageSize);
+ }else if (opertype.equals("H") && !StringUtil.isEmpty(operUser.getRegionid())){
+ pResult = doorlistMgrService.getOperatorCardList(devname, custname, cardno, syncstatus, regionid, allocatStartDate, allocatEndDate, operflag, pageNo, pageSize, operUser.getRegionid());
+ }else if (opertype.equals("L")){
+ pResult = doorlistMgrService.getBuildingOperCardList(devname, custname, cardno, syncstatus, allocatStartDate, allocatEndDate, operflag, pageNo, pageSize, operUser.getOperid());
+ }
+ }catch (Exception e){
+ e.printStackTrace();
+ logger.error("查询删除名单失败!", e.getMessage());
+ }
+ map.put("pResult", pResult);
+ map.put("index", index);
+ return map;
+ }
+
+ private String lastWeek() {
+ Calendar now = Calendar.getInstance();
+ now.add(Calendar.DAY_OF_YEAR, -7);
+ SimpleDateFormat ymd = new SimpleDateFormat("yyyyMMdd");
+ return ymd.format(now.getTime());
+ }
+
+ /**
+ * 获取删除名单填充数据
+ * @param operUser
+ * @return
+ */
+ @ResponseBody
+ @RequestMapping(value = "/getDelFillFormList")
+ public Map getDelFillFormList(@AuthenticationPrincipal TOperator operUser) {
+ Map map = new HashMap();
+ //名单状态
+ List<TDictionaryId> syncDicts = systemService.findTDictionaryByType(3);
+ map.put("syncDicts", syncDicts);
+ //操作标记
+ List<TDictionaryId> operDicts = new ArrayList<TDictionaryId>();
+ operDicts.addAll(systemService.findByType(2, "A"));
+ operDicts.addAll(systemService.findByType(2, "D"));
+ operDicts.addAll(systemService.findByType(2, "C"));
+ map.put("operDicts", operDicts);
+ //区域
+ String opertype = operUser.getOpertype();
+ List<TRegion> regions = null;
+ if (!StringUtil.isEmpty(opertype) &&(opertype.equals("S")||opertype.equals("P"))) {
+ regions = systemService.getAllRegions();
+ map.put("regions", regions);
+ }else if (opertype.equals("H") && !StringUtil.isEmpty(operUser.getRegionid())){
+ regions = systemService.getRegionListById(operUser.getRegionid());
+ map.put("regions", regions);
+ }else if (opertype.equals("L")){
+ map.put("regions", regions);
+ }
+ return map;
+ }
+
+ @ResponseBody
+ @RequestMapping(value = "/saveDoorDeleteCardlist", method = {RequestMethod.POST})
+ public Map saveDoorDeleteCardlist(
+ @RequestBody TNcCardlistDeleteInfo[] tNcCardlistDeleteInfos,
+ @AuthenticationPrincipal TOperator operUser) {
+ Map map = new HashMap();
+ try {
+ String now = DateUtil.getNow();
+ for (TNcCardlistDeleteInfo card:tNcCardlistDeleteInfos) {
+ String listid = card.getListid();
+ TNcCardlist ncCardlist = doorlistMgrService.getNcCardlistById(listid);
+ if (ncCardlist != null) {
+ ncCardlist.setRectime(now);
+ ncCardlist.setOperflag("D");
+ ncCardlist.setSyncflag("N");
+ ncCardlist.setSynctime("");
+ ncCardlist.setOperid(operUser.getOperid());
+ ncCardlist.setVersion(ncCardlist.getVersion()+1);
+ doorlistMgrService.updateNcCardlist(ncCardlist);
+ RedisUtil.incr("zcard_max_version");
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ map.put("result", "删除设备名单失败!");
+ logger.error("删除设备名单失败:" + e.getMessage());
+ }
+ return map;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/doorlist/service/DoorlistMgrService.java b/src/main/java/com/supwisdom/dlpay/doorlist/service/DoorlistMgrService.java
new file mode 100644
index 0000000..e2cad0e
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/doorlist/service/DoorlistMgrService.java
@@ -0,0 +1,36 @@
+package com.supwisdom.dlpay.doorlist.service;
+
+import com.supwisdom.dlpay.ncmgr.domain.TNcAllottime;
+import com.supwisdom.dlpay.ncmgr.domain.TNcCardlist;
+import com.supwisdom.dlpay.system.page.Pagination;
+
+import java.util.List;
+
+public interface DoorlistMgrService {
+ //根据设备编号和物理卡号和时间周id获取名单
+ public TNcCardlist getNcCardlist(int deviceid,String cardphyid,String timeid);
+
+ //批量保存设备名单
+ public boolean batchSaveCardList(List<TNcCardlist> tNcCardlists);
+
+ //批量保存名单分配设备和时间
+ public boolean batchSaveAllotTime(List<TNcAllottime> tNcAllottimes);
+
+ //根据查询条件分页获取系统管理员权限下所有名单
+ public Pagination getSystemCardList(String devname, String custname, String cardno, String syncstatus, String regionid, String allocatStartDate,String allocatEndDate,
+ String operflag, int pageNo, int pageSize);
+
+ //根据查询条件分页获取区域管理员权限下所有名单
+ public Pagination getOperatorCardList(String devname, String custname, String cardno, String syncstatus, String regionid, String allocatStartDate,String allocatEndDate,
+ String operflag, int pageNo, int pageSize,String operRegionid);
+
+ //根据查询条件分页获取楼栋管理员权限下所有名单
+ public Pagination getBuildingOperCardList(String devname, String custname, String cardno, String syncstatus, String allocatStartDate,String allocatEndDate,
+ String operflag, int pageNo, int pageSize,String operid);
+
+ //根据id查询下发设备名单
+ public TNcCardlist getNcCardlistById(String id);
+
+ //修改设备人员名单
+ public boolean updateNcCardlist(TNcCardlist bean);
+}
diff --git a/src/main/java/com/supwisdom/dlpay/doorlist/service/impl/DoorlistMgrServiceImpl.java b/src/main/java/com/supwisdom/dlpay/doorlist/service/impl/DoorlistMgrServiceImpl.java
new file mode 100644
index 0000000..5ce1f9f
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/doorlist/service/impl/DoorlistMgrServiceImpl.java
@@ -0,0 +1,74 @@
+package com.supwisdom.dlpay.doorlist.service.impl;
+
+import com.supwisdom.dlpay.doorlist.service.DoorlistMgrService;
+import com.supwisdom.dlpay.ncmgr.dao.NcAllottimeDao;
+import com.supwisdom.dlpay.ncmgr.dao.NcCardListDao;
+import com.supwisdom.dlpay.ncmgr.domain.TNcAllottime;
+import com.supwisdom.dlpay.ncmgr.domain.TNcCardlist;
+import com.supwisdom.dlpay.system.page.Pagination;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class DoorlistMgrServiceImpl implements DoorlistMgrService {
+ @Autowired
+ NcCardListDao ncCardListDao;
+ @Autowired
+ NcAllottimeDao ncAllottimeDao;
+
+ @Override
+ public TNcCardlist getNcCardlist(int deviceid, String cardphyid, String timeid) {
+ return ncCardListDao.getNcCardlist(deviceid, cardphyid, timeid);
+ }
+
+ @Override
+ public boolean batchSaveCardList(List<TNcCardlist> tNcCardlists) {
+ boolean flag = true;
+ for(TNcCardlist bean:tNcCardlists){
+ boolean b = ncCardListDao.saveCardlist(bean);
+ if (b==false){
+ flag=false;
+ }
+ }
+ return flag;
+ }
+
+ @Override
+ public boolean batchSaveAllotTime(List<TNcAllottime> tNcAllottimes) {
+ boolean flag = true;
+ for (TNcAllottime bean:tNcAllottimes){
+ boolean b = ncAllottimeDao.saveAllottime(bean);
+ if (b==false){
+ flag=false;
+ }
+ }
+ return flag;
+ }
+
+ @Override
+ public Pagination getSystemCardList(String devname, String custname, String cardno, String syncstatus, String regionid, String allocatStartDate, String allocatEndDate, String operflag, int pageNo, int pageSize) {
+ return ncCardListDao.getSystemCardList(devname, custname, cardno, syncstatus, regionid, allocatStartDate, allocatEndDate, operflag, pageNo, pageSize);
+ }
+
+ @Override
+ public Pagination getOperatorCardList(String devname, String custname, String cardno, String syncstatus, String regionid, String allocatStartDate, String allocatEndDate, String operflag, int pageNo, int pageSize, String operRegionid) {
+ return ncCardListDao.getOperatorCardList(devname, custname, cardno, syncstatus, regionid, allocatStartDate, allocatEndDate, operflag, pageNo, pageSize, operRegionid);
+ }
+
+ @Override
+ public Pagination getBuildingOperCardList(String devname, String custname, String cardno, String syncstatus, String allocatStartDate, String allocatEndDate, String operflag, int pageNo, int pageSize, String operid) {
+ return ncCardListDao.getBuildingOperCardList(devname, custname, cardno, syncstatus, allocatStartDate, allocatEndDate, operflag, pageNo, pageSize, operid);
+ }
+
+ @Override
+ public TNcCardlist getNcCardlistById(String id) {
+ return ncCardListDao.getNcCardlistById(id);
+ }
+
+ @Override
+ public boolean updateNcCardlist(TNcCardlist bean) {
+ return ncCardListDao.updateNcCardlist(bean);
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/KaptchaConfig.java b/src/main/java/com/supwisdom/dlpay/framework/KaptchaConfig.java
new file mode 100644
index 0000000..c69dc38
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/framework/KaptchaConfig.java
@@ -0,0 +1,29 @@
+package com.supwisdom.dlpay.framework;
+
+import com.google.code.kaptcha.impl.DefaultKaptcha;
+import com.google.code.kaptcha.util.Config;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.util.Properties;
+
+@Configuration
+public class KaptchaConfig {
+ @Bean
+ public DefaultKaptcha getDefaultKaptcha(){
+ DefaultKaptcha captchaProducer = new DefaultKaptcha();
+ Properties properties = new Properties();
+ properties.setProperty("kaptcha.border", "yes");
+ properties.setProperty("kaptcha.border.color", "105,179,90");
+ properties.setProperty("kaptcha.textproducer.font.color", "blue");
+ properties.setProperty("kaptcha.image.width", "110");
+ properties.setProperty("kaptcha.image.height", "40");
+ properties.setProperty("kaptcha.textproducer.font.size", "30");
+ properties.setProperty("kaptcha.session.key", "code");
+ properties.setProperty("kaptcha.textproducer.char.length", "4");
+ properties.setProperty("kaptcha.textproducer.font.names", "宋体,楷体,微软雅黑");
+ Config config = new Config(properties);
+ captchaProducer.setConfig(config);
+ return captchaProducer;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/filter/CrosXssFilter.java b/src/main/java/com/supwisdom/dlpay/framework/filter/CrosXssFilter.java
new file mode 100644
index 0000000..eafa20c
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/framework/filter/CrosXssFilter.java
@@ -0,0 +1,54 @@
+package com.supwisdom.dlpay.framework.filter;
+
+import com.google.gson.Gson;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.*;
+import javax.servlet.annotation.WebFilter;
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+
+@WebFilter
+public class CrosXssFilter implements Filter {
+ private static final Logger logger = LoggerFactory.getLogger(CrosXssFilter.class);
+
+ @Override
+ public void init(FilterConfig filterConfig) throws ServletException {
+
+ }
+
+ @Override
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
+ request.setCharacterEncoding("utf-8");
+
+ //跨域设置
+// if(response instanceof HttpServletResponse){
+// HttpServletResponse httpServletResponse=(HttpServletResponse)response;
+// //通过在响应 header 中设置 ‘*’ 来允许来自所有域的跨域请求访问。
+// httpServletResponse.setHeader("Access-Control-Allow-Origin", "*");
+// //通过对 Credentials 参数的设置,就可以保持跨域 Ajax 时的 Cookie
+// //设置了Allow-Credentials,Allow-Origin就不能为*,需要指明具体的url域
+// //httpServletResponse.setHeader("Access-Control-Allow-Credentials", "true");
+// //请求方式
+// httpServletResponse.setHeader("Access-Control-Allow-Methods", "*");
+// //(预检请求)的返回结果(即 Access-Control-Allow-Methods 和Access-Control-Allow-Headers 提供的信息) 可以被缓存多久
+// httpServletResponse.setHeader("Access-Control-Max-Age", "86400");
+// //首部字段用于预检请求的响应。其指明了实际请求中允许携带的首部字段
+// httpServletResponse.setHeader("Access-Control-Allow-Headers", "*");
+// }
+
+ //sql,xss过滤
+ HttpServletRequest httpServletRequest = (HttpServletRequest) request;
+ logger.info("CrosXssFilter.......orignal url:{},ParameterMap:{}",httpServletRequest.getRequestURI(), new Gson().toJson(httpServletRequest.getParameterMap()));
+ XssHttpServletRequestWrapper xssHttpServletRequestWrapper = new XssHttpServletRequestWrapper(
+ httpServletRequest);
+ chain.doFilter(xssHttpServletRequestWrapper, response);
+ logger.info("CrosXssFilter..........doFilter url:{},ParameterMap:{}",xssHttpServletRequestWrapper.getRequestURI(), new Gson().toJson(xssHttpServletRequestWrapper.getParameterMap()));
+ }
+
+ @Override
+ public void destroy() {
+
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/filter/ValidateCodeFilter.java b/src/main/java/com/supwisdom/dlpay/framework/filter/ValidateCodeFilter.java
old mode 100755
new mode 100644
index 77242b9..751dfe7
--- a/src/main/java/com/supwisdom/dlpay/framework/filter/ValidateCodeFilter.java
+++ b/src/main/java/com/supwisdom/dlpay/framework/filter/ValidateCodeFilter.java
@@ -4,6 +4,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.supwisdom.dlpay.api.bean.JsonResult;
import com.supwisdom.dlpay.exception.ValidateCodeException;
+import com.supwisdom.dlpay.framework.security.CodeUtil;
import com.supwisdom.dlpay.framework.security.validate.ImageCodeUtil;
import com.supwisdom.dlpay.framework.security.validate.VerifyCode;
import com.supwisdom.dlpay.framework.util.StringUtil;
@@ -43,16 +44,28 @@
protected void doFilterInternal(HttpServletRequest request,
HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
- if (StringUtil.equals("/login/form", request.getRequestURI())
+ String context = request.getContextPath();
+ if (context == null || "" == context.trim()) {
+ context = "/";
+ }
+ if (request.getRequestURI().isEmpty()) {
+ filterChain.doFilter(request, response);
+ return;
+ }
+ String url = request.getRequestURI();
+ if (!"/".equals(context)) {
+ url = url.replace(context, "");
+ }
+ if (StringUtil.equals("/login/form", url)
&& StringUtil.equalsIgnoreCase(request.getMethod(), "post")) {
try {
validate(request);
} catch (ValidateCodeException e) {
- response.setStatus(HttpStatus.OK.value());
- response.setContentType("application/json;charset=UTF-8");
- response.getWriter().write(objectMapper.writeValueAsString(JsonResult.error(400, e.getMessage())));
+ //response.setStatus(HttpStatus.OK.value());
+ //response.setContentType("application/json;charset=UTF-8");
+ //response.getWriter().write(objectMapper.writeValueAsString(JsonResult.error(400, e.getMessage())));
//response.sendError(HttpStatus.UNAUTHORIZED.value(),e.getMessage());
- //myAuthenticationFailureHandler.onAuthenticationFailure(request, response, e);
+ myAuthenticationFailureHandler.onAuthenticationFailure(request, response, e);
return;
}
}
@@ -60,7 +73,12 @@
}
private void validate(HttpServletRequest request) throws ValidateCodeException {
- VerifyCode imageCode = (VerifyCode) request.getSession().getAttribute(ImageCodeUtil.LOGIN_IMAGECODE_SESSIONKEY);
+ if (!CodeUtil.checkVerifyCode(request)) {
+ throw new ValidateCodeException("验证码不匹配");
+ } else {
+ request.getSession().removeAttribute(com.google.code.kaptcha.Constants.KAPTCHA_SESSION_KEY);
+ }
+ /*VerifyCode imageCode = (VerifyCode) request.getSession().getAttribute(ImageCodeUtil.LOGIN_IMAGECODE_SESSIONKEY);
String inputCode;
try {
inputCode = request.getParameter("imageCode");
@@ -80,7 +98,7 @@
if (!StringUtil.equalsIgnoreCase(imageCode.getText(), inputCode)) {
throw new ValidateCodeException("验证码不匹配");
}
- request.getSession().removeAttribute(ImageCodeUtil.LOGIN_IMAGECODE_SESSIONKEY);
+ request.getSession().removeAttribute(ImageCodeUtil.LOGIN_IMAGECODE_SESSIONKEY);*/
}
}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/filter/XssHttpServletRequestWrapper.java b/src/main/java/com/supwisdom/dlpay/framework/filter/XssHttpServletRequestWrapper.java
new file mode 100644
index 0000000..ddc4d15
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/framework/filter/XssHttpServletRequestWrapper.java
@@ -0,0 +1,130 @@
+package com.supwisdom.dlpay.framework.filter;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.StringUtils;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * 防止sql注入,xss攻击
+ * */
+public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
+ private final static Logger log = LoggerFactory.getLogger(XssHttpServletRequestWrapper.class);
+ private final static String key = "'|and|exec|execute|insert|select|delete|update|count|drop|%|chr|mid|master|truncate|" +
+ "char|declare|sitename|net user|xp_cmdshell|;|or|-|+|,|like'|and|exec|execute|insert|create|drop|" +
+ "table|from|grant|use|group_concat|column_name|" +
+ "information_schema.columns|table_schema|union|where|select|delete|update|order|by|count|" +
+ "chr|mid|master|truncate|char|declare|or|;|-|--|,|like|//|/|%|#";
+ private static Set<String> notAllowedKeyWords = new HashSet<String>(0);
+ private static String replacedString="INVALID";
+ static {
+ String keyStr[] = key.split("\\|");
+ for (String str : keyStr) {
+ notAllowedKeyWords.add(str);
+ }
+ }
+
+ private String currentUrl;
+
+ /**
+ * Constructs a request object wrapping the given request.
+ *
+ * @param request the {@link HttpServletRequest} to be wrapped.
+ * @throws IllegalArgumentException if the request is null
+ */
+ public XssHttpServletRequestWrapper(HttpServletRequest request) {
+ super(request);
+ currentUrl = request.getRequestURI();
+ }
+
+ /**覆盖getParameter方法,将参数名和参数值都做xss过滤。
+ * 如果需要获得原始的值,则通过super.getParameterValues(name)来获取
+ * getParameterNames,getParameterValues和getParameterMap也可能需要覆盖
+ */
+ @Override
+ public String getParameter(String parameter) {
+ String value = super.getParameter(parameter);
+ if (value == null) {
+ return null;
+ }
+ return cleanXSS(value);
+ }
+ @Override
+ public String[] getParameterValues(String parameter) {
+ String[] values = super.getParameterValues(parameter);
+ if (values == null) {
+ return null;
+ }
+ int count = values.length;
+ String[] encodedValues = new String[count];
+ for (int i = 0; i < count; i++) {
+ encodedValues[i] = cleanXSS(values[i]);
+ }
+ return encodedValues;
+ }
+
+ @Override
+ public Map<String, String[]> getParameterMap(){
+ Map<String, String[]> values=super.getParameterMap();
+ if (values == null) {
+ return null;
+ }
+ Map<String, String[]> result=new HashMap<>();
+ for(String key:values.keySet()){
+ String encodedKey=cleanXSS(key);
+ int count=values.get(key).length;
+ String[] encodedValues = new String[count];
+ for (int i = 0; i < count; i++){
+ encodedValues[i]=cleanXSS(values.get(key)[i]);
+ }
+ result.put(encodedKey,encodedValues);
+ }
+ return result;
+ }
+
+ /**
+ * 覆盖getHeader方法,将参数名和参数值都做xss过滤。
+ * 如果需要获得原始的值,则通过super.getHeaders(name)来获取
+ * getHeaderNames 也可能需要覆盖
+ */
+ @Override
+ public String getHeader(String name) {
+ String value = super.getHeader(name);
+ if (value == null) {
+ return null;
+ }
+ return cleanXSS(value);
+ }
+
+ private String cleanXSS(String valueP) {
+ // You'll need to remove the spaces from the html entities below
+ String value = valueP.replaceAll("<", "<").replaceAll(">", ">");
+ value = value.replaceAll("<", "& lt;").replaceAll(">", "& gt;");
+ value = value.replaceAll("\\(", "& #40;").replaceAll("\\)", "& #41;");
+ value = value.replaceAll("'", "& #39;");
+ value = value.replaceAll("eval\\((.*)\\)", "");
+ value = value.replaceAll("[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']", "\"\"");
+ value = value.replaceAll("script", "");
+ value = cleanSqlKeyWords(value);
+ return value;
+ }
+
+ private String cleanSqlKeyWords(String value) {
+ String paramValue = value;
+ for (String keyword : notAllowedKeyWords) {
+ if (paramValue.length() > keyword.length() + 4
+ && (paramValue.contains(" "+keyword)||paramValue.contains(keyword+" ")||paramValue.contains(" "+keyword+" "))) {
+ paramValue = StringUtils.replace(paramValue, keyword, replacedString);
+ log.error(this.currentUrl + "已被过滤,因为参数中包含不允许sql的关键词(" + keyword
+ + ")"+";参数:"+value+";过滤后的参数:"+paramValue);
+ }
+ }
+ return paramValue;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/security/CodeUtil.java b/src/main/java/com/supwisdom/dlpay/framework/security/CodeUtil.java
new file mode 100644
index 0000000..ef3b475
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/framework/security/CodeUtil.java
@@ -0,0 +1,45 @@
+package com.supwisdom.dlpay.framework.security;
+
+import javax.servlet.http.HttpServletRequest;
+
+public class CodeUtil {
+ /**
+ * 将获取到的前端参数转为string类型
+ *
+ * @param request
+ * @param key
+ * @return
+ */
+ public static String getString(HttpServletRequest request, String key) {
+ try {
+ String result = request.getParameter(key);
+ if (result != null) {
+ result = result.trim();
+ }
+ if ("".equals(result)) {
+ result = null;
+ }
+ return result;
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ /**
+ * 验证码校验
+ *
+ * @param request
+ * @return
+ */
+ public static boolean checkVerifyCode(HttpServletRequest request) {
+ //获取生成的验证码
+ String verifyCodeExpected = (String) request.getSession()
+ .getAttribute(com.google.code.kaptcha.Constants.KAPTCHA_SESSION_KEY);
+ //获取用户输入的验证码
+ String verifyCodeActual = CodeUtil.getString(request, "verifyCodeActual");
+ if (verifyCodeActual == null || !verifyCodeActual.equals(verifyCodeExpected)) {
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/framework/security/validate/ImageCode.java b/src/main/java/com/supwisdom/dlpay/framework/security/validate/ImageCode.java
old mode 100755
new mode 100644
diff --git a/src/main/java/com/supwisdom/dlpay/framework/security/validate/ValidateCode.java b/src/main/java/com/supwisdom/dlpay/framework/security/validate/ValidateCode.java
old mode 100755
new mode 100644
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/bean/TDoorcardlstInfo.java b/src/main/java/com/supwisdom/dlpay/mainservice/bean/TDoorcardlstInfo.java
index 9eceda6..3ff8472 100644
--- a/src/main/java/com/supwisdom/dlpay/mainservice/bean/TDoorcardlstInfo.java
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/bean/TDoorcardlstInfo.java
@@ -12,64 +12,53 @@
@Id
private String listid;
- private String factoryId;
- @Excel(name = "厂商")
- private String factoryName;
@Excel(name = "设备名称", width = 15)
- private String doorName;
+ private String devname;
@Excel(name = "姓名", width = 15)
- private String custName;
+ private String custname;
@Excel(name = "分配操作员", width = 15)
- private String operName;
- @Excel(name = "学/工号", width = 15)
- private String stuempNo;
+ private String opername;
+ @Excel(name = "卡号", width = 15)
+ private String cardno;
+ @Excel(name = "银行卡号",width = 25)
+ private String bankcardno;
@Excel(name = "楼栋", width = 15)
- private String buildingName;
+ private String buildingname;
@Excel(name = "区域",width = 15)
- private String regionName;
+ private String regionname;
@Excel(name = "名单状态")
- private String syncStatus;
- private String operFlagIndex;
+ private String syncflag;
@Excel(name = "操作标记")
- private String operFlag;
- @Excel(name = "分配时间", databaseFormat = "yyyy-MM-dd", width = 20)
- private String allocatTime;
- @Excel(name = "同步时间", databaseFormat = "yyyy-MM-dd", width = 20)
- private String syncTime;
- @Excel(name = "反馈时间", databaseFormat = "yyyy-MM-dd", width = 20)
- private String feedbackTime;
- @Excel(name = "反馈信息", width = 15)
- private String retmsg;
+ private String operflag;
+ @Excel(name = "分配时间", databaseFormat = "yyyy-MM-dd HH-mm-ss", width = 20)
+ private String rectime;
+ @Excel(name = "同步时间", databaseFormat = "yyyy-MM-dd HH-mm-ss", width = 20)
+ private String synctime;
@Excel(name = "名单备注", width = 15)
private String reason;
- @Excel(name = "设备使用类型", width = 15)
- private String usetype;
+ @Excel(name = "到期时间", databaseFormat = "yyyy-MM-dd", width = 20)
private String closedate;
- public String getRetmsg() {
- return retmsg;
+ public TDoorcardlstInfo() {
}
- public void setRetmsg(String retmsg) {
- this.retmsg = retmsg;
- }
-
- public String getClosedate() {
- return closedate;
- }
-
- public void setClosedate(String closedate) {
+ public TDoorcardlstInfo(String listid, String devname, String custname, String opername, String cardno, String bankcardno, String buildingname, String regionname, String syncflag, String operflag, String rectime, String synctime, String reason, String closedate) {
+ this.listid = listid;
+ this.devname = devname;
+ this.custname = custname;
+ this.opername = opername;
+ this.cardno = cardno;
+ this.bankcardno = bankcardno;
+ this.buildingname = buildingname;
+ this.regionname = regionname;
+ this.syncflag = syncflag;
+ this.operflag = operflag;
+ this.rectime = rectime;
+ this.synctime = synctime;
+ this.reason = reason;
this.closedate = closedate;
}
- public String getOperFlagIndex() {
- return operFlagIndex;
- }
-
- public void setOperFlagIndex(String operFlagIndex) {
- this.operFlagIndex = operFlagIndex;
- }
-
public String getListid() {
return listid;
}
@@ -78,84 +67,92 @@
this.listid = listid;
}
- public String getFactoryId() {
- return factoryId;
+ public String getDevname() {
+ return devname;
}
- public void setFactoryId(String factoryId) {
- this.factoryId = factoryId;
+ public void setDevname(String devname) {
+ this.devname = devname;
}
- public String getFactoryName() {
- return factoryName;
+ public String getCustname() {
+ return custname;
}
- public void setFactoryName(String factoryName) {
- this.factoryName = factoryName;
+ public void setCustname(String custname) {
+ this.custname = custname;
}
- public String getDoorName() {
- return doorName;
+ public String getOpername() {
+ return opername;
}
- public void setDoorName(String doorName) {
- this.doorName = doorName;
+ public void setOpername(String opername) {
+ this.opername = opername;
}
- public String getCustName() {
- return custName;
+ public String getCardno() {
+ return cardno;
}
- public void setCustName(String custName) {
- this.custName = custName;
+ public void setCardno(String cardno) {
+ this.cardno = cardno;
}
- public String getOperName() {
- return operName;
+ public String getBankcardno() {
+ return bankcardno;
}
- public void setOperName(String operName) {
- this.operName = operName;
+ public void setBankcardno(String bankcardno) {
+ this.bankcardno = bankcardno;
}
- public String getStuempNo() {
- return stuempNo;
+ public String getBuildingname() {
+ return buildingname;
}
- public void setStuempNo(String stuempNo) {
- this.stuempNo = stuempNo;
+ public void setBuildingname(String buildingname) {
+ this.buildingname = buildingname;
}
- public String getBuildingName() {
- return buildingName;
+ public String getRegionname() {
+ return regionname;
}
- public void setBuildingName(String buildingName) {
- this.buildingName = buildingName;
+ public void setRegionname(String regionname) {
+ this.regionname = regionname;
}
- public String getRegionName() {
- return regionName;
+ public String getSyncflag() {
+ return syncflag;
}
- public void setRegionName(String regionName) {
- this.regionName = regionName;
+ public void setSyncflag(String syncflag) {
+ this.syncflag = syncflag;
}
- public String getSyncStatus() {
- return syncStatus;
+ public String getOperflag() {
+ return operflag;
}
- public void setSyncStatus(String syncStatus) {
- this.syncStatus = syncStatus;
+ public void setOperflag(String operflag) {
+ this.operflag = operflag;
}
- public String getOperFlag() {
- return operFlag;
+ public String getRectime() {
+ return rectime;
}
- public void setOperFlag(String operFlag) {
- this.operFlag = operFlag;
+ public void setRectime(String rectime) {
+ this.rectime = rectime;
+ }
+
+ public String getSynctime() {
+ return synctime;
+ }
+
+ public void setSynctime(String synctime) {
+ this.synctime = synctime;
}
public String getReason() {
@@ -165,67 +162,14 @@
public void setReason(String reason) {
this.reason = reason;
}
- /*public String getTimeName() {
- return timeName;
- }
- public void setTimeName(String timeName) {
- this.timeName = timeName;
- }*/
- public String getUsetype() {
- return usetype;
+ public String getClosedate() {
+ return closedate;
}
- public void setUsetype(String usetype) {
- this.usetype = usetype;
- }
-
- public String getAllocatTime() {
- return allocatTime;
- }
-
- public void setAllocatTime(String allocatTime) {
- this.allocatTime = allocatTime;
- }
-
- public String getSyncTime() {
- return syncTime;
- }
-
- public void setSyncTime(String syncTime) {
- this.syncTime = syncTime;
- }
-
- public String getFeedbackTime() {
- return feedbackTime;
- }
-
- public void setFeedbackTime(String feedbackTime) {
- this.feedbackTime = feedbackTime;
- }
-
- public TDoorcardlstInfo() {
- }
-
- public TDoorcardlstInfo(String listid, String factoryId, String factoryName, String doorName, String custName, String operName, String stuempNo, String buildingName, String regionName, String syncStatus, String operFlagIndex, String operFlag, String allocatTime, String syncTime, String feedbackTime, String retmsg, String reason, String usetype, String closedate) {
- this.listid = listid;
- this.factoryId = factoryId;
- this.factoryName = factoryName;
- this.doorName = doorName;
- this.custName = custName;
- this.operName = operName;
- this.stuempNo = stuempNo;
- this.buildingName = buildingName;
- this.regionName = regionName;
- this.syncStatus = syncStatus;
- this.operFlagIndex = operFlagIndex;
- this.operFlag = operFlag;
- this.allocatTime = allocatTime;
- this.syncTime = syncTime;
- this.feedbackTime = feedbackTime;
- this.retmsg = retmsg;
- this.reason = reason;
- this.usetype = usetype;
+ public void setClosedate(String closedate) {
this.closedate = closedate;
}
+
+
}
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/bean/TDoordtlInfo.java b/src/main/java/com/supwisdom/dlpay/mainservice/bean/TDoordtlInfo.java
index d40f7d4..9df0b76 100644
--- a/src/main/java/com/supwisdom/dlpay/mainservice/bean/TDoordtlInfo.java
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/bean/TDoordtlInfo.java
@@ -10,22 +10,18 @@
public class TDoordtlInfo implements Serializable{
@Id
private String doorseqno;
- @Excel(name = "厂商名称")
- private String factoryname;
@Excel(name = "设备编号")
- private String doorid;
- @Excel(name = "设备名称")
- private String doorname;
- @Excel(name = "学/工号",width = 20)
- private String stuempno;
+ private String deviceid;
+ @Excel(name = "设备名称",width = 20)
+ private String devname;
@Excel(name = "姓名")
private String custname;
- @Excel(name = "楼栋",width = 30)
- private String buildingname;
- @Excel(name = "区域")
- private String regionname;
- @Excel(name = "物理卡号",width = 30)
+ @Excel(name = "卡号",width = 15)
+ private String cardno;
+ @Excel(name = "物理卡号",width = 25)
private String cardphyid;
+ @Excel(name = "银行卡号",width = 25)
+ private String bankcardno;
@Excel(name = "刷卡时间",databaseFormat = "yyyy-MM-dd",width = 20)
private String transdate;
@Excel(name = "描述")
@@ -43,8 +39,36 @@
this.doorseqno = doorseqno;
}
- public String getDoorid() {
- return doorid;
+ public String getDeviceid() {
+ return deviceid;
+ }
+
+ public void setDeviceid(String deviceid) {
+ this.deviceid = deviceid;
+ }
+
+ public String getDevname() {
+ return devname;
+ }
+
+ public void setDevname(String devname) {
+ this.devname = devname;
+ }
+
+ public String getCustname() {
+ return custname;
+ }
+
+ public void setCustname(String custname) {
+ this.custname = custname;
+ }
+
+ public String getCardno() {
+ return cardno;
+ }
+
+ public void setCardno(String cardno) {
+ this.cardno = cardno;
}
public String getCardphyid() {
@@ -55,72 +79,42 @@
this.cardphyid = cardphyid;
}
- public void setDoorid(String doorid) {
- this.doorid = doorid;
+ public String getBankcardno() {
+ return bankcardno;
}
- public String getDtldesc() {
- return dtldesc;
- }
- public void setDtldesc(String dtldesc) {
- this.dtldesc = dtldesc;
- }
- public String getFactoryname() {
- return factoryname;
- }
- public void setFactoryname(String factoryname) {
- this.factoryname = factoryname;
- }
- public String getDoorname() {
- return doorname;
- }
- public void setDoorname(String doorname) {
- this.doorname = doorname;
- }
- public String getStuempno() {
- return stuempno;
- }
- public void setStuempno(String stuempno) {
- this.stuempno = stuempno;
- }
- public String getCustname() {
- return custname;
- }
- public void setCustname(String custname) {
- this.custname = custname;
- }
-
- public String getBuildingname() {
- return buildingname;
- }
-
- public void setBuildingname(String buildingname) {
- this.buildingname = buildingname;
- }
-
- public String getRegionname() {
- return regionname;
- }
-
- public void setRegionname(String regionname) {
- this.regionname = regionname;
+ public void setBankcardno(String bankcardno) {
+ this.bankcardno = bankcardno;
}
public String getTransdate() {
return transdate;
}
+
public void setTransdate(String transdate) {
this.transdate = transdate;
}
+
+ public String getDtldesc() {
+ return dtldesc;
+ }
+
+ public void setDtldesc(String dtldesc) {
+ this.dtldesc = dtldesc;
+ }
+
public String getStatus() {
return status;
}
+
public void setStatus(String status) {
this.status = status;
}
+
public String getColdate() {
return coldate;
}
+
public void setColdate(String coldate) {
this.coldate = coldate;
}
@@ -128,16 +122,14 @@
public TDoordtlInfo() {
}
- public TDoordtlInfo(String doorseqno, String factoryname, String doorid, String doorname, String stuempno, String custname, String buildingname, String regionname, String cardphyid, String transdate, String dtldesc, String status, String coldate) {
+ public TDoordtlInfo(String doorseqno, String deviceid, String devname, String custname, String cardno, String cardphyid, String bankcardno, String transdate, String dtldesc, String status, String coldate) {
this.doorseqno = doorseqno;
- this.factoryname = factoryname;
- this.doorid = doorid;
- this.doorname = doorname;
- this.stuempno = stuempno;
+ this.deviceid = deviceid;
+ this.devname = devname;
this.custname = custname;
- this.buildingname = buildingname;
- this.regionname = regionname;
+ this.cardno = cardno;
this.cardphyid = cardphyid;
+ this.bankcardno = bankcardno;
this.transdate = transdate;
this.dtldesc = dtldesc;
this.status = status;
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/dao/CardDao.java b/src/main/java/com/supwisdom/dlpay/mainservice/dao/CardDao.java
new file mode 100644
index 0000000..48896f5
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/dao/CardDao.java
@@ -0,0 +1,10 @@
+package com.supwisdom.dlpay.mainservice.dao;
+
+import com.supwisdom.dlpay.mainservice.domain.TCard;
+
+public interface CardDao {
+
+ public TCard findCardByCustid(String custid);
+
+ public boolean saveCard(TCard bean);
+}
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/dao/CardListDao.java b/src/main/java/com/supwisdom/dlpay/mainservice/dao/CardListDao.java
index b7540d9..9317527 100644
--- a/src/main/java/com/supwisdom/dlpay/mainservice/dao/CardListDao.java
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/dao/CardListDao.java
@@ -7,17 +7,23 @@
public interface CardListDao {
- public Pagination getSystemCardListFrSearch(String factoryId, String allocatStartDate, String allocatEndDate,
- String doorName, String custName, String stuempNo, String syncStatus, String operFlag, String buildingid,String regionid, int pageNo, int pageSize);
+ public Pagination getSystemCardListFrSearch( String allocatStartDate, String allocatEndDate,
+ String devname, String custname, String cardno, String syncflag, String operflag, String buildingid,String regionid, int pageNo, int pageSize);
- public Pagination getOperatorCardListFrSearch(String factoryId, String allocatStartDate, String allocatEndDate,
- String doorName, String custName, String stuempNo, String syncStatus, String operFlag, String buildingid,String regionid, int pageNo, int pageSize,String operRegionid);
+ public Pagination getOperatorCardListFrSearch( String allocatStartDate, String allocatEndDate,
+ String devname, String custname, String cardno, String syncflag, String operflag, String buildingid,String regionid, int pageNo, int pageSize,String operRegionid);
- public List<TDoorcardlstInfo> getSystemCardListMap(String factoryId, String allocatStartDate, String allocatEndDate,
- String doorName, String custName, String stuempNo, String syncStatus, String operFlag, String buildingid,String regionid);
+ public Pagination getBuildingOperCardListFrSearch(String allocatStartDate, String allocatEndDate,
+ String devname, String custname, String cardno, String syncflag,String operflag, String buildingid,String operid, int pageNo, int pageSize);
- public List<TDoorcardlstInfo> getOperatorCardListMap(String factoryId, String allocatStartDate, String allocatEndDate,
- String doorName, String custName, String stuempNo, String syncStatus, String operFlag, String buildingid,String regionid,String operRegionid);
+ public List<TDoorcardlstInfo> getSystemCardListMap( String allocatStartDate, String allocatEndDate,
+ String devname, String custname, String cardno, String syncflag, String operflag, String buildingid,String regionid);
+
+ public List<TDoorcardlstInfo> getOperatorCardListMap( String allocatStartDate, String allocatEndDate,
+ String devname, String custname, String cardno, String syncflag, String operflag, String buildingid,String regionid,String operRegionid);
+
+ public List<TDoorcardlstInfo> getBuildingOperCardListMap( String allocatStartDate, String allocatEndDate,
+ String devname, String custname, String cardno, String syncflag, String operflag, String buildingid,String operid);
public void updateDoorcardlstToNoWithIds(List<Long> listIds);
}
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/dao/CustomerDao.java b/src/main/java/com/supwisdom/dlpay/mainservice/dao/CustomerDao.java
new file mode 100644
index 0000000..45bcc9b
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/dao/CustomerDao.java
@@ -0,0 +1,16 @@
+package com.supwisdom.dlpay.mainservice.dao;
+
+import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
+import com.supwisdom.dlpay.mainservice.domain.TCustomer;
+
+import java.util.List;
+
+public interface CustomerDao {
+
+ public TCustomer findCustomerByNo(String cardno, String bankcardno);
+
+ public boolean saveCustomer(TCustomer bean);
+
+ public List<TCustomerInfo> getAllTCustomerList(String perName, String cardno, String bankcardno);
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/dao/DoordtlDao.java b/src/main/java/com/supwisdom/dlpay/mainservice/dao/DoordtlDao.java
index 6e113ae..859c96e 100644
--- a/src/main/java/com/supwisdom/dlpay/mainservice/dao/DoordtlDao.java
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/dao/DoordtlDao.java
@@ -6,18 +6,25 @@
import java.util.List;
public interface DoordtlDao {
- public List<TDoordtlInfo> findSystemExportExcelDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String stuempno,
- String custname, String buildingid, String regionid, String doorName, String factoryId, String streamstatus);
+ public List<TDoordtlInfo> findSystemExportExcelDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno,
+ String custname, String buildingid, String regionid, String devname, String streamstatus);
- public List<TDoordtlInfo> findOperatorExportExcelDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String stuempno,
- String custname, String buildingid, String regionid, String doorName, String factoryId, String streamstatus,String operRegionid);
+ public List<TDoordtlInfo> findOperatorExportExcelDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno,
+ String custname, String buildingid, String regionid, String devname, String streamstatus,String operRegionid);
+
+ public List<TDoordtlInfo> findBuildingOperExportExcelDoorDtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno,
+ String custname, String buildingid,String devname, String streamstatus,String operid);
public Pagination findSystemTDoordtl(
- String startTranDate, String endTranDate,String startTranTime, String endTranTime,String stuempno,
- String custname,String buildingid,String doorName,String factoryId,String streamstatus,int pageNo,int pageSize,String regionid);
+ String startTranDate, String endTranDate,String startTranTime, String endTranTime,String cardno,
+ String custname,String buildingid,String devname,String streamstatus,int pageNo,int pageSize,String regionid);
public Pagination findOperatorTDoordtl(
- String operid,String startTranDate, String endTranDate,String startTranTime, String endTranTime,String stuempno,
- String custname,String buildingid,String doorName,String factoryId,String streamstatus,int pageNo,int pageSize,String regionid,String operRegionid);
+ String startTranDate, String endTranDate,String startTranTime, String endTranTime,String cardno,
+ String custname,String buildingid,String devname,String streamstatus,int pageNo,int pageSize,String regionid,String operRegionid);
+
+ public Pagination findBuildingOperTDoordtl(
+ String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno,
+ String custname, String buildingid, String devname, String streamstatus, int pageNo, int pageSize,String operid);
}
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/CardDaoImpl.java b/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/CardDaoImpl.java
new file mode 100644
index 0000000..2e71868
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/CardDaoImpl.java
@@ -0,0 +1,43 @@
+package com.supwisdom.dlpay.mainservice.dao.impl;
+
+import com.supwisdom.dlpay.mainservice.dao.CardDao;
+import com.supwisdom.dlpay.mainservice.domain.TCard;
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+@Repository
+public class CardDaoImpl implements CardDao {
+ @PersistenceContext
+ EntityManager entityManager;
+
+ @Transactional
+ @Override
+ public TCard findCardByCustid(String custid) {
+ String sql = "select bean from TCard bean where bean.custid = :custid";
+ TypedQuery<TCard> query = entityManager.createQuery(sql, TCard.class);
+ query.setParameter("custid", custid);
+ List<TCard> list = query.getResultList();
+ if (list!=null && list.size()>0){
+ return list.get(0);
+ }
+ return null;
+ }
+
+ @Transactional
+ @Override
+ public boolean saveCard(TCard bean) {
+ boolean flag=false;
+ try {
+ entityManager.persist(bean);
+ flag=true;
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ return flag;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/CardListDaoImpl.java b/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/CardListDaoImpl.java
index ff69c48..ae97d3c 100644
--- a/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/CardListDaoImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/CardListDaoImpl.java
@@ -3,8 +3,10 @@
import com.supwisdom.dlpay.framework.util.StringUtil;
import com.supwisdom.dlpay.mainservice.bean.TDoorcardlstInfo;
import com.supwisdom.dlpay.mainservice.dao.CardListDao;
+import com.supwisdom.dlpay.system.dao.DictionaryDao;
import com.supwisdom.dlpay.system.page.Pagination;
import com.supwisdom.dlpay.util.RedisUtil;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
@@ -21,43 +23,43 @@
@PersistenceContext
EntityManager entityManager;
- @Transactional
+ @Autowired
+ DictionaryDao dictionaryDao;
+
+ @Transactional(readOnly = true)
@Override
- public Pagination getSystemCardListFrSearch(String factoryId, String allocatStartDate, String allocatEndDate, String doorName, String custName, String stuempNo, String syncStatus, String operFlag, String buildingid,String regionid, int pageNo, int pageSize) {
+ public Pagination getSystemCardListFrSearch(String allocatStartDate, String allocatEndDate, String devname, String custname, String cardno, String syncflag, String operflag, String buildingid,String regionid, int pageNo, int pageSize) {
try {
- String queryString = "select a.listid, a.factoryId,d.doorName,a.custName,g.operName,a.stuempNo," +
- "a.syncStatus,a.operFlag operFlagIndex,a.updatetime allocatTime,a.syncTime,a.closedate," +
- "b.updatetime feedbackTime,b.retmsg,a.reason ,a.buildingName,f.regionName" +
- " from t_doorcardlst a " +
- " left join t_rtnresult b on a.listid=b.listid " +
- " left join tb_region f on a.regionid=f.regionid " +
- " left join t_doordev d on a.deviceid=d.doorid" +
- " left join tb_operator g on a.operid=g.operid" +
- " where 1>0 " ;
+ String queryString = "select a.listid,b.devname,a.custname,a.cardno,a.bankcardno,d.opername," +
+ "a.syncflag,a.operflag,a.rectime,a.synctime,a.closedate," +
+ "a.reason ,b.buildingname,c.regionname" +
+ " from t_nc_cardlist a " +
+ " left join tb_operator d on a.operid=d.operid," +
+ " t_nc_device b " +
+ " left join tb_region c on b.regionid=c.regionid " +
+ " where 1>0 and a.deviceid=b.deviceid " ;
if (!"".equals(allocatStartDate)) {
- queryString += " and a.updatetime>=:allocatStartDate ";
+ queryString += " and a.rectime>=:allocatStartDate ";
}
if (!"".equals(allocatEndDate)) {
- queryString += " and a.updatetime<=:allocatEndDate ";
+ queryString += " and a.rectime<=:allocatEndDate ";
}
- if (!("all").equals(syncStatus)) {
- queryString += " and a.syncstatus =:syncStatus";
+ if (!("all").equals(syncflag)) {
+ queryString += " and a.syncflag =:syncflag";
}
- if (!("all").equals(factoryId)) {
- queryString += " and a.factoryid =:factoryId";
+
+ if (!("").equals(devname)) {
+ queryString += " and b.devname like :devname";
}
- if (!("").equals(doorName)) {
- queryString += " and d.doorname like :doorName";
- }
- if (!("all").equals(operFlag)) {
- queryString += " and a.operFlag =:operFlag";
+ if (!("all").equals(operflag)) {
+ queryString += " and a.operflag =:operflag";
}
if (!("").equals(buildingid)) {
- queryString += " and a.buildingid = :buildingid ";
+ queryString += " and b.buildingid = :buildingid ";
}
if (!regionid.equals("")){
- queryString += "and a.regionid in "
+ queryString += "and b.regionid in "
+"("
+ "with recursive tmp as "
+ "("
@@ -66,11 +68,11 @@
+ "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
+ ") select regionid from tmp )";
}
- if (!("").equals(custName)) {
- queryString += " and a.custname like :custName";
+ if (!("").equals(custname)) {
+ queryString += " and a.custname like :custname";
}
- if (!("").equals(stuempNo)) {
- queryString += " and a.stuempno like :stuempNo";
+ if (!("").equals(cardno)) {
+ queryString += " and a.cardno like :cardno";
}
queryString += " ORDER by a.listid DESC";
@@ -84,17 +86,14 @@
}
- if (!("all").equals(syncStatus)) {
- query.setParameter("syncStatus", syncStatus);
+ if (!("all").equals(syncflag)) {
+ query.setParameter("syncflag", syncflag);
}
- if (!("all").equals(factoryId)) {
- query.setParameter("factoryId", factoryId);
+ if (!("").equals(devname)) {
+ query.setParameter("devname", "%" + devname + "%");
}
- if (!("").equals(doorName)) {
- query.setParameter("doorName", "%" + doorName + "%");
- }
- if (!("all").equals(operFlag)) {
- query.setParameter("operFlag", operFlag);
+ if (!("all").equals(operflag)) {
+ query.setParameter("operflag", operflag);
}
if (!("").equals(buildingid)) {
query.setParameter("buildingid", buildingid);
@@ -102,11 +101,11 @@
if (!("").equals(regionid)){
query.setParameter("regionid", regionid);
}
- if (!("").equals(custName)) {
- query.setParameter("custName", "%" + custName + "%");
+ if (!("").equals(custname)) {
+ query.setParameter("custname", "%" + custname + "%");
}
- if (!("").equals(stuempNo)) {
- query.setParameter("stuempNo", stuempNo);
+ if (!("").equals(cardno)) {
+ query.setParameter("cardno", cardno);
}
pageNo = pageNo <= 0 ? 1 : pageNo;
@@ -116,118 +115,71 @@
page.setPageNo(pageNo);
page.setPageSize(pageSize);
- int totalCount = getSystemCardListCount(factoryId, allocatStartDate, allocatEndDate, doorName, custName, stuempNo, syncStatus, operFlag, buildingid, regionid);
+ int totalCount = getSystemCardListCount(allocatStartDate, allocatEndDate, devname, custname, cardno, syncflag, operflag, buildingid, regionid);
page.setTotalCount(totalCount);
List<TDoorcardlstInfo> tDoorcardlstInfos = query.getResultList();
- SimpleDateFormat _ymdhms = new SimpleDateFormat("yyyyMMddHHmmss");
+ /*SimpleDateFormat _ymdhms = new SimpleDateFormat("yyyyMMddHHmmss");
SimpleDateFormat ymdhms = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (TDoorcardlstInfo grp : tDoorcardlstInfos) {
List<String> factory = RedisUtil.lrange("dict_4", 0, -1);
- List<String> operflag = RedisUtil.lrange("dict_2", 0, -1);
+ List<String> operFlag = RedisUtil.lrange("dict_2", 0, -1);
List<String> sync = RedisUtil.lrange("dict_3", 0, -1);
- if(operflag!= null && operflag.size()>0){
- String operFlagIndex = grp.getOperFlagIndex();
- for (String s : operflag) {
+ if(operflag!= null && operFlag.size()>0){
+ String operFlagIndex = grp.getOperflag();
+ for (String s : operFlag) {
String[] split = s.split("_");
if (operFlagIndex.equals(split[0])){
- grp.setOperFlag(split[1]);
+ grp.setOperflag(split[1]);
break;
}
}
}
if(sync!= null && sync.size()>0){
- String syncStatus1 = grp.getSyncStatus();
+ String syncStatus1 = grp.getSyncflag();
for (String s : sync) {
String[] split = s.split("_");
if (syncStatus1.equals(split[0])){
- grp.setSyncStatus(split[1]);
+ grp.setSyncflag(split[1]);
break;
}else {
- grp.setSyncStatus("");
+ grp.setSyncflag("");
}
}
}
- if(factory != null && factory.size()>0){
- String factoryId1 = grp.getFactoryId();
- for (String s : factory) {
- String[] split = s.split("_");
- if (factoryId1.equals(split[0])){
- grp.setFactoryName(split[1]);
- break;
- }else {
- grp.setFactoryName("");
- }
- }
- }else {
- queryString = "select a.id.dictcaption from TDictionary a where a.id.dicttype=:dicttype and a.id.dictval=:dictval";
- query = entityManager.createQuery(queryString);
- query.setParameter("dicttype", 4);
- query.setParameter("dictval", grp.getFactoryId());
- if(null != query.getSingleResult()){
- grp.setFactoryName(query.getSingleResult().toString());
- }else {
- grp.setFactoryName("");
- }
-
- query.setParameter("dicttype", 3);
- query.setParameter("dictval", grp.getSyncStatus());
- if(null != query.getSingleResult()) {
- grp.setSyncStatus(query.getSingleResult().toString());
- }else {
- grp.setSyncStatus("");
- }
- query.setParameter("dicttype", 2);
- if (grp.getOperFlagIndex() != null) {
- query.setParameter("dictval", grp.getOperFlagIndex());
- grp.setOperFlag(query.getSingleResult().toString());
- }
- }
- String time = grp.getAllocatTime();
+ String time = grp.getRectime();
Date date;
String hms = "000000";
if (time != null) {
if (time.length() == 14) {
date = _ymdhms.parse(time);
- grp.setAllocatTime(ymdhms.format(date));
+ grp.setRectime(ymdhms.format(date));
} else {
time += hms.substring(0, 14 - time.length());
date = _ymdhms.parse(time + "");
- grp.setAllocatTime(ymdhms.format(date));
+ grp.setRectime(ymdhms.format(date));
}
}
- time = grp.getSyncTime();
+ time = grp.getSynctime();
if (time != null) {
if (time.length() == 14) {
date = _ymdhms.parse(time);
- grp.setSyncTime(ymdhms.format(date));
+ grp.setSynctime(ymdhms.format(date));
} else {
time += hms.substring(0, 14 - time.length());
date = _ymdhms.parse(time);
- grp.setSyncTime(ymdhms.format(date));
+ grp.setSynctime(ymdhms.format(date));
}
}
- time = grp.getFeedbackTime();
- if (time != null) {
- if (time.length() == 14) {
- date = _ymdhms.parse(time);
- grp.setFeedbackTime(ymdhms.format(date));
- } else {
- time += hms.substring(0, 14 - time.length());
- date = _ymdhms.parse(time);
- grp.setFeedbackTime(ymdhms.format(date));
- }
- }
-
}
-
+*/
page.setList(tDoorcardlstInfos);
return page;
}catch (Exception e){
@@ -236,33 +188,30 @@
return null;
}
- private int getSystemCardListCount(String factoryId, String allocatStartDate, String allocatEndDate, String doorName, String custName, String stuempNo, String syncStatus, String operFlag, String buildingid,String regionid){
+ private int getSystemCardListCount(String allocatStartDate, String allocatEndDate, String devname, String custname, String cardno, String syncflag, String operflag, String buildingid,String regionid){
try {
- String queryString = "select count(*) from T_Doordev d,T_Doorcardlst a" +
- " left join tb_region f on a.regionid=f.regionid " +
- "where a.factoryid=d.factoryid " +
- " and a.deviceid=d.doorid ";
+ String queryString = "select count(*) from t_nc_cardlist a," +
+ " t_nc_device b "+
+ " left join tb_region c on b.regionid=c.regionid " +
+ "where 1>0 and a.deviceid = b.deviceid ";
if (!"".equals(allocatStartDate)) {
- queryString += " and a.updatetime>=:allocatStartDate ";
+ queryString += " and a.rectime>=:allocatStartDate ";
}
if (!"".equals(allocatEndDate)) {
- queryString += " and a.updatetime<=:allocatEndDate ";
+ queryString += " and a.rectime<=:allocatEndDate ";
}
- if (!("all").equals(syncStatus)) {
- queryString += " and a.syncstatus =:syncStatus";
+ if (!("all").equals(syncflag)) {
+ queryString += " and a.syncflag =:syncflag";
}
- if (!("all").equals(factoryId)) {
- queryString += " and a.id.factoryid =:factoryId";
- }
- if (!("all").equals(operFlag)) {
- queryString += " and a.operflag =:operFlag";
+ if (!("all").equals(operflag)) {
+ queryString += " and a.operflag =:operflag";
}
if (!("").equals(buildingid)) {
- queryString += " and a.buildingid = :buildingid ";
+ queryString += " and b.buildingid = :buildingid ";
}
if (!regionid.equals("")){
- queryString += "and a.regionid in "
+ queryString += "and b.regionid in "
+"("
+ "with recursive tmp as "
+ "("
@@ -271,14 +220,14 @@
+ "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
+ ") select regionid from tmp )";
}
- if (!("").equals(doorName)) {
- queryString += " and d.doorname like :doorName";
+ if (!("").equals(devname)) {
+ queryString += " and b.devname like :devname";
}
- if (!("").equals(custName)) {
- queryString += " and a.custname like :custName";
+ if (!("").equals(custname)) {
+ queryString += " and a.custname like :custname";
}
- if (!("").equals(stuempNo)) {
- queryString += " and a.stuempno like :stuempNo";
+ if (!("").equals(cardno)) {
+ queryString += " and a.cardno like :cardno";
}
Query query = entityManager.createNativeQuery(queryString);
if (!"".equals(allocatStartDate)) {
@@ -288,14 +237,12 @@
query.setParameter("allocatEndDate", allocatEndDate + "235959");
}
- if (!("all").equals(syncStatus)) {
- query.setParameter("syncStatus", syncStatus);
+ if (!("all").equals(syncflag)) {
+ query.setParameter("syncflag", syncflag);
}
- if (!("all").equals(factoryId)) {
- query.setParameter("factoryId", factoryId);
- }
- if (!("all").equals(operFlag)) {
- query.setParameter("operFlag", operFlag);
+
+ if (!("all").equals(operflag)) {
+ query.setParameter("operflag", operflag);
}
if (!("").equals(buildingid)) {
query.setParameter("buildingid", buildingid);
@@ -303,14 +250,14 @@
if (!("").equals(regionid)){
query.setParameter("regionid", regionid);
}
- if (!("").equals(doorName)) {
- query.setParameter("doorName", "%" + doorName + "%");
+ if (!("").equals(devname)) {
+ query.setParameter("devname", "%" + devname + "%");
}
- if (!("").equals(custName)) {
- query.setParameter("custName", "%" + custName + "%");
+ if (!("").equals(custname)) {
+ query.setParameter("custname", "%" + custname + "%");
}
- if (!("").equals(stuempNo)) {
- query.setParameter("stuempNo", stuempNo);
+ if (!("").equals(cardno)) {
+ query.setParameter("cardno", cardno);
}
int cnt = 0;
List list = query.getResultList();
@@ -327,41 +274,38 @@
@Transactional
@Override
- public Pagination getOperatorCardListFrSearch(String factoryId, String allocatStartDate, String allocatEndDate, String doorName, String custName, String stuempNo, String syncStatus, String operFlag, String buildingid, String regionid, int pageNo, int pageSize, String operRegionid) {
+ public Pagination getOperatorCardListFrSearch( String allocatStartDate, String allocatEndDate, String devname, String custname, String cardno, String syncflag, String operflag, String buildingid, String regionid, int pageNo, int pageSize, String operRegionid) {
try {
- String queryString = "select a.listid, a.factoryId,d.doorName,a.custName,g.operName,a.stuempNo," +
- "a.syncStatus,a.operFlag operFlagIndex,a.updatetime allocatTime,a.syncTime,a.closedate," +
- "b.updatetime feedbackTime,b.retmsg,a.reason ,a.buildingName,f.regionName" +
- " from t_doorcardlst a left join t_rtnresult b on a.listid=b.listid " +
- " left join tb_region f on a.regionid=f.regionid " +
- " left join t_doordev d on a.deviceid=d.doorid" +
- " left join tb_operator g on a.operid=g.operid" +
- " where 1>0 " ;
+ String queryString = "select a.listid,b.devname,a.custname,a.cardno,a.bankcardno,d.opername," +
+ "a.syncflag,a.operflag,a.rectime,a.synctime,a.closedate," +
+ "a.reason ,b.buildingname,c.regionname" +
+ " from t_nc_cardlist a " +
+ " left join tb_operator d on a.operid=d.operid," +
+ " t_nc_device b " +
+ " left join tb_region c on b.regionid=c.regionid " +
+ " where 1>0 and a.deviceid = b.deviceid " ;
if (!"".equals(allocatStartDate)) {
- queryString += " and a.updatetime>=:allocatStartDate ";
+ queryString += " and a.rectime>=:allocatStartDate ";
}
if (!"".equals(allocatEndDate)) {
- queryString += " and a.updatetime<=:allocatEndDate ";
+ queryString += " and a.rectime<=:allocatEndDate ";
}
- if (!("all").equals(syncStatus)) {
- queryString += " and a.syncstatus =:syncStatus";
+ if (!("all").equals(syncflag)) {
+ queryString += " and a.syncflag =:syncflag";
}
- if (!("all").equals(factoryId)) {
- queryString += " and a.factoryid =:factoryId";
+ if (!("").equals(devname)) {
+ queryString += " and b.devname like :devname";
}
- if (!("").equals(doorName)) {
- queryString += " and d.doorname like :doorName";
- }
- if (!("all").equals(operFlag)) {
- queryString += " and a.operFlag =:operFlag";
+ if (!("all").equals(operflag)) {
+ queryString += " and a.operflag =:operflag";
}
if (!("").equals(buildingid)) {
- queryString += " and a.buildingid = :buildingid ";
+ queryString += " and b.buildingid = :buildingid ";
}
if (!regionid.equals("")){
- queryString += "and a.regionid in "
+ queryString += "and b.regionid in "
+"("
+ "with recursive tmp as "
+ "("
@@ -370,7 +314,7 @@
+ "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
+ ") select regionid from tmp where tmp.regionid=:regionid)";
}else {
- queryString += "and a.regionid in "
+ queryString += "and b.regionid in "
+"("
+ "with recursive tmp as "
+ "("
@@ -379,16 +323,17 @@
+ "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
+ ") select regionid from tmp )";
}
- if (!("").equals(custName)) {
- queryString += " and a.custname like :custName";
+ if (!("").equals(custname)) {
+ queryString += " and a.custname like :custname";
}
- if (!("").equals(stuempNo)) {
- queryString += " and a.stuempno like :stuempNo";
+ if (!("").equals(cardno)) {
+ queryString += " and a.cardno like :cardno";
}
queryString += " ORDER by a.listid DESC";
Query query = entityManager.createNativeQuery(queryString, TDoorcardlstInfo.class);
+ query.setParameter("operRegionid", operRegionid);
if (!"".equals(allocatStartDate)) {
query.setParameter("allocatStartDate", allocatStartDate + "000000");
}
@@ -397,30 +342,26 @@
}
- if (!("all").equals(syncStatus)) {
- query.setParameter("syncStatus", syncStatus);
+ if (!("all").equals(syncflag)) {
+ query.setParameter("syncflag", syncflag);
}
- if (!("all").equals(factoryId)) {
- query.setParameter("factoryId", factoryId);
+ if (!("").equals(devname)) {
+ query.setParameter("devname", "%" + devname + "%");
}
- if (!("").equals(doorName)) {
- query.setParameter("doorName", "%" + doorName + "%");
- }
- if (!("all").equals(operFlag)) {
- query.setParameter("operFlag", operFlag);
+ if (!("all").equals(operflag)) {
+ query.setParameter("operflag", operflag);
}
if (!("").equals(buildingid)) {
query.setParameter("buildingid", buildingid);
}
- query.setParameter("operRegionid", operRegionid);
if (!("").equals(regionid)){
query.setParameter("regionid", regionid);
}
- if (!("").equals(custName)) {
- query.setParameter("custName", "%" + custName + "%");
+ if (!("").equals(custname)) {
+ query.setParameter("custname", "%" + custname + "%");
}
- if (!("").equals(stuempNo)) {
- query.setParameter("stuempNo", stuempNo);
+ if (!("").equals(cardno)) {
+ query.setParameter("cardno", cardno);
}
pageNo = pageNo <= 0 ? 1 : pageNo;
@@ -430,117 +371,11 @@
page.setPageNo(pageNo);
page.setPageSize(pageSize);
- int totalCount = getOperatorCardListCount(factoryId, allocatStartDate, allocatEndDate, doorName, custName, stuempNo, syncStatus, operFlag, buildingid, regionid,operRegionid);
+ int totalCount = getOperatorCardListCount(allocatStartDate, allocatEndDate, devname, custname, cardno, syncflag, operflag, buildingid, regionid,operRegionid);
page.setTotalCount(totalCount);
List<TDoorcardlstInfo> tDoorcardlstInfos = query.getResultList();
- SimpleDateFormat _ymdhms = new SimpleDateFormat("yyyyMMddHHmmss");
- SimpleDateFormat ymdhms = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- for (TDoorcardlstInfo grp : tDoorcardlstInfos) {
- List<String> factory = RedisUtil.lrange("dict_4", 0, -1);
- List<String> operflag = RedisUtil.lrange("dict_2", 0, -1);
- List<String> sync = RedisUtil.lrange("dict_3", 0, -1);
- if(operflag!= null && operflag.size()>0){
- String operFlagIndex = grp.getOperFlagIndex();
- for (String s : operflag) {
- String[] split = s.split("_");
- if (operFlagIndex.equals(split[0])){
- grp.setOperFlag(split[1]);
- break;
- }
- }
- }
- if(sync!= null && sync.size()>0){
- String syncStatus1 = grp.getSyncStatus();
- for (String s : sync) {
- String[] split = s.split("_");
- if (syncStatus1.equals(split[0])){
- grp.setSyncStatus(split[1]);
- break;
- }else {
- grp.setSyncStatus("");
- }
- }
- }
- if(factory != null && factory.size()>0){
- String factoryId1 = grp.getFactoryId();
- for (String s : factory) {
- String[] split = s.split("_");
- if (factoryId1.equals(split[0])){
- grp.setFactoryName(split[1]);
- break;
- }else {
- grp.setFactoryName("");
- }
- }
- }else {
- queryString = "select a.id.dictcaption from TDictionary a where a.id.dicttype=:dicttype and a.id.dictval=:dictval";
- query = entityManager.createQuery(queryString);
- query.setParameter("dicttype", 4);
- query.setParameter("dictval", grp.getFactoryId());
- if(null != query.getSingleResult()){
- grp.setFactoryName(query.getSingleResult().toString());
- }else {
- grp.setFactoryName("");
- }
- query.setParameter("dicttype", 3);
- query.setParameter("dictval", grp.getSyncStatus());
- if(null != query.getSingleResult()) {
- grp.setSyncStatus(query.getSingleResult().toString());
- }else {
- grp.setSyncStatus("");
- }
- query.setParameter("dicttype", 2);
- if (grp.getOperFlagIndex() != null) {
- query.setParameter("dictval", grp.getOperFlagIndex());
- grp.setOperFlag(query.getSingleResult().toString());
- }
- }
-
-
- String time = grp.getAllocatTime();
- Date date;
- String hms = "000000";
- if (time != null) {
- if (time.length() == 14) {
- date = _ymdhms.parse(time);
- grp.setAllocatTime(ymdhms.format(date));
- } else {
-
- time += hms.substring(0, 14 - time.length());
- date = _ymdhms.parse(time + "");
- grp.setAllocatTime(ymdhms.format(date));
- }
-
- }
-
- time = grp.getSyncTime();
- if (time != null) {
- if (time.length() == 14) {
- date = _ymdhms.parse(time);
- grp.setSyncTime(ymdhms.format(date));
- } else {
- time += hms.substring(0, 14 - time.length());
- date = _ymdhms.parse(time);
- grp.setSyncTime(ymdhms.format(date));
- }
-
- }
-
- time = grp.getFeedbackTime();
- if (time != null) {
- if (time.length() == 14) {
- date = _ymdhms.parse(time);
- grp.setFeedbackTime(ymdhms.format(date));
- } else {
- time += hms.substring(0, 14 - time.length());
- date = _ymdhms.parse(time);
- grp.setFeedbackTime(ymdhms.format(date));
- }
- }
-
- }
page.setList(tDoorcardlstInfos);
return page;
@@ -550,33 +385,30 @@
return null;
}
- private int getOperatorCardListCount(String factoryId, String allocatStartDate, String allocatEndDate, String doorName, String custName, String stuempNo, String syncStatus, String operFlag, String buildingid,String regionid,String operRegionid){
+ private int getOperatorCardListCount(String allocatStartDate, String allocatEndDate, String devname, String custname, String cardno, String syncflag, String operflag, String buildingid,String regionid,String operRegionid){
try {
- String queryString = "select count(*) from T_Doordev d,T_Doorcardlst a" +
- " left join tb_region f on a.regionid=f.regionid " +
- "where a.factoryid=d.factoryid " +
- " and a.deviceid=d.doorid ";
+ String queryString = "select count(*) from t_nc_cardlist a," +
+ " t_nc_device b "+
+ " left join tb_region c on b.regionid=c.regionid " +
+ "where 1>0 and a.deviceid = b.deviceid ";
if (!"".equals(allocatStartDate)) {
- queryString += " and a.updatetime>=:allocatStartDate ";
+ queryString += " and a.rectime>=:allocatStartDate ";
}
if (!"".equals(allocatEndDate)) {
- queryString += " and a.updatetime<=:allocatEndDate ";
+ queryString += " and a.rectime<=:allocatEndDate ";
}
- if (!("all").equals(syncStatus)) {
+ if (!("all").equals(syncflag)) {
queryString += " and a.syncstatus =:syncStatus";
}
- if (!("all").equals(factoryId)) {
- queryString += " and a.id.factoryid =:factoryId";
- }
- if (!("all").equals(operFlag)) {
+ if (!("all").equals(operflag)) {
queryString += " and a.operflag =:operFlag";
}
if (!("").equals(buildingid)) {
- queryString += " and a.buildingid = :buildingid ";
+ queryString += " and b.buildingid = :buildingid ";
}
if (!regionid.equals("")){
- queryString += "and a.regionid in "
+ queryString += "and b.regionid in "
+"("
+ "with recursive tmp as "
+ "("
@@ -585,7 +417,7 @@
+ "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
+ ") select regionid from tmp where tmp.regionid=:regionid)";
}else {
- queryString += "and a.regionid in "
+ queryString += "and b.regionid in "
+"("
+ "with recursive tmp as "
+ "("
@@ -594,16 +426,17 @@
+ "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
+ ") select regionid from tmp )";
}
- if (!("").equals(doorName)) {
- queryString += " and d.doorname like :doorName";
+ if (!("").equals(devname)) {
+ queryString += " and b.doorname like :devname";
}
- if (!("").equals(custName)) {
- queryString += " and a.custname like :custName";
+ if (!("").equals(custname)) {
+ queryString += " and a.custname like :custname";
}
- if (!("").equals(stuempNo)) {
- queryString += " and a.stuempno like :stuempNo";
+ if (!("").equals(cardno)) {
+ queryString += " and a.stuempno like :cardno";
}
Query query = entityManager.createNativeQuery(queryString);
+ query.setParameter("operRegionid", operRegionid);
if (!"".equals(allocatStartDate)) {
query.setParameter("allocatStartDate", allocatStartDate + "000000");
}
@@ -611,30 +444,27 @@
query.setParameter("allocatEndDate", allocatEndDate + "235959");
}
- if (!("all").equals(syncStatus)) {
- query.setParameter("syncStatus", syncStatus);
+
+ if (!("all").equals(syncflag)) {
+ query.setParameter("syncflag", syncflag);
}
- if (!("all").equals(factoryId)) {
- query.setParameter("factoryId", factoryId);
+ if (!("").equals(devname)) {
+ query.setParameter("devname", "%" + devname + "%");
}
- if (!("all").equals(operFlag)) {
- query.setParameter("operFlag", operFlag);
+ if (!("all").equals(operflag)) {
+ query.setParameter("operflag", operflag);
}
if (!("").equals(buildingid)) {
query.setParameter("buildingid", buildingid);
}
- query.setParameter("operRegionid", operRegionid);
if (!("").equals(regionid)){
query.setParameter("regionid", regionid);
}
- if (!("").equals(doorName)) {
- query.setParameter("doorName", "%" + doorName + "%");
+ if (!("").equals(custname)) {
+ query.setParameter("custname", "%" + custname + "%");
}
- if (!("").equals(custName)) {
- query.setParameter("custName", "%" + custName + "%");
- }
- if (!("").equals(stuempNo)) {
- query.setParameter("stuempNo", stuempNo);
+ if (!("").equals(cardno)) {
+ query.setParameter("cardno", cardno);
}
int cnt = 0;
List list = query.getResultList();
@@ -649,42 +479,205 @@
return 0;
}
-
@Transactional
@Override
- public List<TDoorcardlstInfo> getSystemCardListMap(String factoryId, String allocatStartDate, String allocatEndDate, String doorName, String custName, String stuempNo, String syncStatus, String operFlag, String buildingid,String regionid) {
+ public Pagination getBuildingOperCardListFrSearch(String allocatStartDate, String allocatEndDate, String devname, String custname, String cardno, String syncflag, String operflag, String buildingid, String operid, int pageNo, int pageSize) {
+
try {
- String queryString = "select a.listid, a.factoryId,d.doorName,a.custName,g.operName,a.stuempNo," +
- "a.syncStatus,a.operFlag operFlagIndex,a.updatetime allocatTime,a.syncTime,a.closedate," +
- "b.updatetime feedbackTime,b.retmsg,a.reason ,a.buildingName,f.regionName" +
- " from t_doorcardlst a left join t_rtnresult b on a.listid=b.listid " +
- " left join tb_region f on a.regionid=f.regionid " +
- " left join t_doordev d on a.deviceid=d.doorid" +
- " left join tb_operator g on a.operid=g.operid" +
- " where 1>0 ";
+
+ String queryString = "select a.listid,b.devname,a.custname,a.cardno,a.bankcardno,d.opername," +
+ "a.syncflag,a.operflag,a.rectime,a.synctime,a.closedate," +
+ "a.reason ,b.buildingname,c.regionname" +
+ " from t_nc_cardlist a " +
+ " left join tb_operator d on a.operid=d.operid," +
+ " t_nc_device b " +
+ " left join tb_region c on b.regionid=c.regionid " +
+ " left join t_operbuilding e on e.buildingid=b.buildingid "+
+ " where 1>0 and a.deviceid = b.deviceid and e.operid=:operid " ;
if (!"".equals(allocatStartDate)) {
- queryString += " and a.updatetime>=:allocatStartDate ";
+ queryString += " and a.rectime>=:allocatStartDate ";
}
if (!"".equals(allocatEndDate)) {
- queryString += " and a.updatetime<=:allocatEndDate ";
+ queryString += " and a.rectime<=:allocatEndDate ";
}
- if (!("all").equals(syncStatus)) {
- queryString += " and a.syncstatus =:syncStatus";
+ if (!("all").equals(syncflag)) {
+ queryString += " and a.syncflag =:syncflag";
}
- if (!("all").equals(factoryId)) {
- queryString += " and a.factoryid =:factoryId";
+ if (!("").equals(devname)) {
+ queryString += " and b.devname like :devname";
}
- if (!("").equals(doorName)) {
- queryString += " and d.doorname like :doorName";
- }
- if (!("all").equals(operFlag)) {
- queryString += " and a.operFlag =:operFlag";
+ if (!("all").equals(operflag)) {
+ queryString += " and a.operflag =:operflag";
}
if (!("").equals(buildingid)) {
- queryString += " and a.buildingid = :buildingid";
+ queryString += " and b.buildingid = :buildingid ";
+ }
+
+ if (!("").equals(custname)) {
+ queryString += " and a.custname like :custname";
+ }
+ if (!("").equals(cardno)) {
+ queryString += " and a.cardno like :cardno";
+ }
+ queryString += " ORDER by a.listid DESC";
+
+ Query query = entityManager.createNativeQuery(queryString, TDoorcardlstInfo.class);
+ query.setParameter("operid", operid);
+
+ if (!"".equals(allocatStartDate)) {
+ query.setParameter("allocatStartDate", allocatStartDate + "000000");
+ }
+ if (!"".equals(allocatEndDate)) {
+ query.setParameter("allocatEndDate", allocatEndDate + "235959");
+ }
+
+
+ if (!("all").equals(syncflag)) {
+ query.setParameter("syncflag", syncflag);
+ }
+ if (!("").equals(devname)) {
+ query.setParameter("devname", "%" + devname + "%");
+ }
+ if (!("all").equals(operflag)) {
+ query.setParameter("operflag", operflag);
+ }
+ if (!("").equals(buildingid)) {
+ query.setParameter("buildingid", buildingid);
+ }
+ if (!("").equals(custname)) {
+ query.setParameter("custname", "%" + custname + "%");
+ }
+ if (!("").equals(cardno)) {
+ query.setParameter("cardno", cardno);
+ }
+
+ pageNo = pageNo <= 0 ? 1 : pageNo;
+ query.setFirstResult((pageNo - 1) * pageSize);
+ query.setMaxResults(pageSize);
+ Pagination page = new Pagination();
+ page.setPageNo(pageNo);
+ page.setPageSize(pageSize);
+
+ int totalCount = getBuildingOperCardListCount(allocatStartDate, allocatEndDate, devname, custname, cardno, syncflag, operflag, buildingid, operid);
+ page.setTotalCount(totalCount);
+
+ List<TDoorcardlstInfo> tDoorcardlstInfos = query.getResultList();
+ SimpleDateFormat _ymdhms = new SimpleDateFormat("yyyyMMddHHmmss");
+ SimpleDateFormat ymdhms = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+
+ page.setList(tDoorcardlstInfos);
+ return page;
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ private int getBuildingOperCardListCount(String allocatStartDate, String allocatEndDate, String devname, String custname, String cardno, String syncflag, String operflag, String buildingid,String operid){
+ try {
+ String queryString = "select count(*) from t_nc_cardlist a," +
+ " t_nc_device b "+
+ " left join t_operbuilding e on e.buildingid=b.buildingid "+
+ " where 1>0 and a.deviceid = b.deviceid and e.operid=:operid " ;
+
+ if (!"".equals(allocatStartDate)) {
+ queryString += " and a.rectime>=:allocatStartDate ";
+ }
+ if (!"".equals(allocatEndDate)) {
+ queryString += " and a.rectime<=:allocatEndDate ";
+ }
+ if (!("all").equals(syncflag)) {
+ queryString += " and a.syncflag =:syncflag";
+ }
+ if (!("all").equals(operflag)) {
+ queryString += " and a.operflag =:operflag";
+ }
+ if (!("").equals(buildingid)) {
+ queryString += " and b.buildingid = :buildingid ";
+ }
+ if (!("").equals(devname)) {
+ queryString += " and b.devname like :devname";
+ }
+ if (!("").equals(custname)) {
+ queryString += " and a.custname like :custname";
+ }
+ if (!("").equals(cardno)) {
+ queryString += " and a.cardno like :cardno";
+ }
+ Query query = entityManager.createNativeQuery(queryString);
+ query.setParameter("operid", operid);
+ if (!"".equals(allocatStartDate)) {
+ query.setParameter("allocatStartDate", allocatStartDate + "000000");
+ }
+ if (!"".equals(allocatEndDate)) {
+ query.setParameter("allocatEndDate", allocatEndDate + "235959");
+ }
+
+ if (!("all").equals(syncflag)) {
+ query.setParameter("syncflag", syncflag);
+ }
+
+ if (!("all").equals(operflag)) {
+ query.setParameter("operflag", operflag);
+ }
+ if (!("").equals(buildingid)) {
+ query.setParameter("buildingid", buildingid);
+ }
+ if (!("").equals(devname)) {
+ query.setParameter("devname", "%" + devname + "%");
+ }
+ if (!("").equals(custname)) {
+ query.setParameter("custname", "%" + custname + "%");
+ }
+ if (!("").equals(cardno)) {
+ query.setParameter("cardno", cardno);
+ }
+ int cnt = 0;
+ List list = query.getResultList();
+ if (list!=null && list.size()>0){
+ Object o = list.get(0);
+ cnt = Integer.parseInt(o.toString());
+ }
+ return cnt;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return 0;
+ }
+
+ @Transactional(readOnly = true)
+ @Override
+ public List<TDoorcardlstInfo> getSystemCardListMap( String allocatStartDate, String allocatEndDate, String devname, String custname, String cardno, String syncflag, String operflag, String buildingid,String regionid) {
+ try {
+ String queryString = "select a.listid,b.devname,a.custname,a.cardno,a.bankcardno,d.opername," +
+ "a.syncflag,a.operflag,a.rectime,a.synctime,a.closedate," +
+ "a.reason ,b.buildingname,c.regionname" +
+ " from t_nc_cardlist a " +
+ " left join tb_operator d on a.operid=d.operid," +
+ " t_nc_device b " +
+ " left join tb_region c on b.regionid=c.regionid " +
+ " where 1>0 and a.deviceid = b.deviceid " ;
+ if (!"".equals(allocatStartDate)) {
+ queryString += " and a.rectime>=:allocatStartDate ";
+ }
+ if (!"".equals(allocatEndDate)) {
+ queryString += " and a.rectime<=:allocatEndDate ";
+ }
+ if (!("all").equals(syncflag)) {
+ queryString += " and a.syncflag =:syncflag";
+ }
+ if (!("").equals(devname)) {
+ queryString += " and b.devname like :devname";
+ }
+ if (!("all").equals(operflag)) {
+ queryString += " and a.operflag =:operflag";
+ }
+ if (!("").equals(buildingid)) {
+ queryString += " and b.buildingid = :buildingid";
}
if (!regionid.equals("")){
- queryString += "and a.regionid in "
+ queryString += "and b.regionid in "
+"("
+ "with recursive tmp as "
+ "("
@@ -693,11 +686,11 @@
+ "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
+ ") select regionid from tmp )";
}
- if (!("").equals(custName)) {
- queryString += " and a.custname like :custName";
+ if (!("").equals(custname)) {
+ queryString += " and a.custname like :custname";
}
- if (!("").equals(stuempNo)) {
- queryString += " and a.stuempno like :stuempNo";
+ if (!("").equals(cardno)) {
+ queryString += " and a.cardno like :cardno";
}
queryString += " order by a.listid DESC";
@@ -710,17 +703,14 @@
}
- if (!("all").equals(syncStatus)) {
- query.setParameter("syncStatus", syncStatus);
+ if (!("all").equals(syncflag)) {
+ query.setParameter("syncflag", syncflag);
}
- if (!("all").equals(factoryId)) {
- query.setParameter("factoryId", factoryId);
+ if (!("").equals(devname)) {
+ query.setParameter("devname", "%" + devname + "%");
}
- if (!("").equals(doorName)) {
- query.setParameter("doorName", "%" + doorName + "%");
- }
- if (!("all").equals(operFlag)) {
- query.setParameter("operFlag", operFlag);
+ if (!("all").equals(operflag)) {
+ query.setParameter("operflag", operflag);
}
if (!("").equals(buildingid)) {
query.setParameter("buildingid", buildingid);
@@ -728,119 +718,74 @@
if (!("").equals(regionid)){
query.setParameter("regionid",regionid);
}
- if (!("").equals(custName)) {
- query.setParameter("custName", "%" + custName + "%");
+ if (!("").equals(custname)) {
+ query.setParameter("custname", "%" + custname + "%");
}
- if (!("").equals(stuempNo)) {
- query.setParameter("stuempNo", "%" + stuempNo + "%");
+ if (!("").equals(cardno)) {
+ query.setParameter("cardno", "%" + cardno + "%");
}
List<TDoorcardlstInfo> tDoorcardlstInfos = query.getResultList();
SimpleDateFormat _ymdhms = new SimpleDateFormat("yyyyMMddHHmmss");
SimpleDateFormat ymdhms = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (TDoorcardlstInfo grp : tDoorcardlstInfos) {
- List<String> factory = RedisUtil.lrange("dict_4", 0, -1);
- List<String> operflag = RedisUtil.lrange("dict_2", 0, -1);
- List<String> sync = RedisUtil.lrange("dict_3", 0, -1);
- if(operflag!= null && operflag.size()>0){
- String operFlagIndex = grp.getOperFlagIndex();
- for (String s : operflag) {
+ List<String> operFlag = dictionaryDao.findDictionaryStringByType(2);
+ List<String> sync = dictionaryDao.findDictionaryStringByType(3);
+ if(operflag!= null && operFlag.size()>0){
+ String operFlagIndex = grp.getOperflag();
+ for (String s : operFlag) {
String[] split = s.split("_");
if (operFlagIndex.equals(split[0])){
- grp.setOperFlag(split[1]);
+ grp.setOperflag(split[1]);
break;
}
}
}
if(sync!= null && sync.size()>0){
- String syncStatus1 = grp.getSyncStatus();
+ String syncStatus1 = grp.getSyncflag();
for (String s : sync) {
String[] split = s.split("_");
if (syncStatus1.equals(split[0])){
- grp.setSyncStatus(split[1]);
+ grp.setSyncflag(split[1]);
break;
}else {
- grp.setSyncStatus("");
+ grp.setSyncflag("");
}
}
}
- if(factory != null && factory.size()>0){
- String factoryId1 = grp.getFactoryId();
- for (String s : factory) {
- String[] split = s.split("_");
- if (factoryId1.equals(split[0])){
- grp.setFactoryName(split[1]);
- break;
- }else {
- grp.setFactoryName("");
- }
- }
- }else {
- queryString = "select a.id.dictcaption from TDictionary a where a.id.dicttype=:dicttype and a.id.dictval=:dictval";
- query = entityManager.createQuery(queryString);
- query.setParameter("dicttype", 4);
- query.setParameter("dictval", grp.getFactoryId());
- if(null != query.getSingleResult()){
- grp.setFactoryName(query.getSingleResult().toString());
- }else {
- grp.setFactoryName("");
- }
- query.setParameter("dicttype", 3);
- query.setParameter("dictval", grp.getSyncStatus());
- if(null != query.getSingleResult()) {
- grp.setSyncStatus(query.getSingleResult().toString());
- }else {
- grp.setSyncStatus("");
- }
- query.setParameter("dicttype", 2);
- if (grp.getOperFlagIndex() != null) {
- query.setParameter("dictval", grp.getOperFlagIndex());
- grp.setOperFlag(query.getSingleResult().toString());
- }
- }
- String time = grp.getAllocatTime();
+ String time = grp.getRectime();
Date date;
String hms = "000000";
if (time != null) {
if (time.length() == 14) {
date = _ymdhms.parse(time);
- grp.setAllocatTime(ymdhms.format(date));
+ grp.setRectime(ymdhms.format(date));
} else {
time += hms.substring(0, 14 - time.length());
date = _ymdhms.parse(time + "");
- grp.setAllocatTime(ymdhms.format(date));
+ grp.setRectime(ymdhms.format(date));
}
}
- time = grp.getSyncTime();
+ time = grp.getSynctime();
if (time != null) {
if (time.length() == 14) {
date = _ymdhms.parse(time);
- grp.setSyncTime(ymdhms.format(date));
+ grp.setSynctime(ymdhms.format(date));
} else {
time += hms.substring(0, 14 - time.length());
date = _ymdhms.parse(time);
- grp.setSyncTime(ymdhms.format(date));
+ grp.setSynctime(ymdhms.format(date));
}
}
- time = grp.getFeedbackTime();
- if (time != null) {
- if (time.length() == 14) {
- date = _ymdhms.parse(time);
- grp.setFeedbackTime(ymdhms.format(date));
- } else {
- time += hms.substring(0, 14 - time.length());
- date = _ymdhms.parse(time);
- grp.setFeedbackTime(ymdhms.format(date));
- }
- }
}
+
return tDoorcardlstInfos;
}catch (Exception e){
e.printStackTrace();
@@ -850,39 +795,36 @@
@Transactional
@Override
- public List<TDoorcardlstInfo> getOperatorCardListMap(String factoryId, String allocatStartDate, String allocatEndDate, String doorName, String custName, String stuempNo, String syncStatus, String operFlag, String buildingid, String regionid, String operRegionid) {
+ public List<TDoorcardlstInfo> getOperatorCardListMap( String allocatStartDate, String allocatEndDate, String devname, String custname, String cardno, String syncflag, String operflag, String buildingid, String regionid, String operRegionid) {
try {
- String queryString = "select a.listid, a.factoryId,d.doorName,a.custName,g.operName,a.stuempNo," +
- "a.syncStatus,a.operFlag operFlagIndex,a.updatetime allocatTime,a.syncTime,a.closedate," +
- "b.updatetime feedbackTime,b.retmsg,a.reason ,a.buildingName,f.regionName" +
- " from t_doorcardlst a left join t_rtnresult b on a.listid=b.listid " +
- " left join tb_region f on a.regionid=f.regionid " +
- " left join t_doordev d on a.deviceid=d.doorid" +
- " left join tb_operator g on a.operid=g.operid" +
- " where 1>0 " ;
+ String queryString = "select a.listid,b.devname,a.custname,a.cardno,a.bankcardno,d.opername," +
+ "a.syncflag,a.operflag,a.rectime,a.synctime,a.closedate," +
+ "a.reason ,b.buildingname,c.regionname" +
+ " from t_nc_cardlist a " +
+ " left join tb_operator d on a.operid=d.operid," +
+ " t_nc_device b " +
+ " left join tb_region c on b.regionid=c.regionid " +
+ " where 1>0 and a.deviceid=b.deviceid " ;
if (!"".equals(allocatStartDate)) {
- queryString += " and a.updatetime>=:allocatStartDate ";
+ queryString += " and a.rectime>=:allocatStartDate ";
}
if (!"".equals(allocatEndDate)) {
- queryString += " and a.updatetime<=:allocatEndDate ";
+ queryString += " and a.rectime<=:allocatEndDate ";
}
- if (!("all").equals(syncStatus)) {
- queryString += " and a.syncstatus =:syncStatus";
+ if (!("all").equals(syncflag)) {
+ queryString += " and a.syncflag =:syncflag";
}
- if (!("all").equals(factoryId)) {
- queryString += " and a.factoryid =:factoryId";
+ if (!("").equals(devname)) {
+ queryString += " and b.devname like :devname";
}
- if (!("").equals(doorName)) {
- queryString += " and d.doorname like :doorName";
- }
- if (!("all").equals(operFlag)) {
- queryString += " and a.operFlag =:operFlag";
+ if (!("all").equals(operflag)) {
+ queryString += " and a.operflag =:operflag";
}
if (!("").equals(buildingid)) {
- queryString += " and a.buildingid = :buildingid";
+ queryString += " and b.buildingid = :buildingid";
}
if (!regionid.equals("")){
- queryString += "and a.regionid in "
+ queryString += "and b.regionid in "
+"("
+ "with recursive tmp as "
+ "("
@@ -891,7 +833,7 @@
+ "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
+ ") select regionid from tmp where tmp.regionid=:regionid)";
}else {
- queryString += "and a.regionid in "
+ queryString += "and b.regionid in "
+"("
+ "with recursive tmp as "
+ "("
@@ -901,15 +843,17 @@
+ ") select regionid from tmp )";
}
- if (!("").equals(custName)) {
- queryString += " and a.custname like :custName";
+ if (!("").equals(custname)) {
+ queryString += " and a.custname like :custname";
}
- if (!("").equals(stuempNo)) {
- queryString += " and a.stuempno like :stuempNo";
+ if (!("").equals(cardno)) {
+ queryString += " and a.cardno like :cardno";
}
queryString += " order by a.listid DESC";
Query query = entityManager.createNativeQuery(queryString, TDoorcardlstInfo.class);
+
+ query.setParameter("operRegionid", operRegionid);
if (!"".equals(allocatStartDate)) {
query.setParameter("allocatStartDate", allocatStartDate + "000000");
}
@@ -918,137 +862,230 @@
}
- if (!("all").equals(syncStatus)) {
- query.setParameter("syncStatus", syncStatus);
+ if (!("all").equals(syncflag)) {
+ query.setParameter("syncflag", syncflag);
}
- if (!("all").equals(factoryId)) {
- query.setParameter("factoryId", factoryId);
+ if (!("").equals(devname)) {
+ query.setParameter("devname", "%" + devname + "%");
}
- if (!("").equals(doorName)) {
- query.setParameter("doorName", "%" + doorName + "%");
- }
- if (!("all").equals(operFlag)) {
- query.setParameter("operFlag", operFlag);
+ if (!("all").equals(operflag)) {
+ query.setParameter("operflag", operflag);
}
if (!("").equals(buildingid)) {
query.setParameter("buildingid", buildingid);
}
if (!("").equals(regionid)){
- query.setParameter("regionid",regionid);
+ query.setParameter("regionid", regionid);
}
- if (!("").equals(custName)) {
- query.setParameter("custName", "%" + custName + "%");
+ if (!("").equals(custname)) {
+ query.setParameter("custname", "%" + custname + "%");
}
- if (!("").equals(stuempNo)) {
- query.setParameter("stuempNo", "%" + stuempNo + "%");
+ if (!("").equals(cardno)) {
+ query.setParameter("cardno", cardno);
}
List<TDoorcardlstInfo> tDoorcardlstInfos = query.getResultList();
SimpleDateFormat _ymdhms = new SimpleDateFormat("yyyyMMddHHmmss");
SimpleDateFormat ymdhms = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (TDoorcardlstInfo grp : tDoorcardlstInfos) {
- List<String> factory = RedisUtil.lrange("dict_4", 0, -1);
- List<String> operflag = RedisUtil.lrange("dict_2", 0, -1);
- List<String> sync = RedisUtil.lrange("dict_3", 0, -1);
- if(operflag!= null && operflag.size()>0){
- String operFlagIndex = grp.getOperFlagIndex();
- for (String s : operflag) {
+ List<String> operFlag = dictionaryDao.findDictionaryStringByType(2);
+ List<String> sync = dictionaryDao.findDictionaryStringByType(3);
+ if(operflag!= null && operFlag.size()>0){
+ String operFlagIndex = grp.getOperflag();
+ for (String s : operFlag) {
String[] split = s.split("_");
if (operFlagIndex.equals(split[0])){
- grp.setOperFlag(split[1]);
+ grp.setOperflag(split[1]);
break;
}
}
}
if(sync!= null && sync.size()>0){
- String syncStatus1 = grp.getSyncStatus();
+ String syncStatus1 = grp.getSyncflag();
for (String s : sync) {
String[] split = s.split("_");
if (syncStatus1.equals(split[0])){
- grp.setSyncStatus(split[1]);
+ grp.setSyncflag(split[1]);
break;
}else {
- grp.setSyncStatus("");
+ grp.setSyncflag("");
}
}
}
- if(factory != null && factory.size()>0){
- String factoryId1 = grp.getFactoryId();
- for (String s : factory) {
- String[] split = s.split("_");
- if (factoryId1.equals(split[0])){
- grp.setFactoryName(split[1]);
- break;
- }else {
- grp.setFactoryName("");
- }
- }
- }else {
- queryString = "select a.id.dictcaption from TDictionary a where a.id.dicttype=:dicttype and a.id.dictval=:dictval";
- query = entityManager.createQuery(queryString);
- query.setParameter("dicttype", 4);
- query.setParameter("dictval", grp.getFactoryId());
- if(null != query.getSingleResult()){
- grp.setFactoryName(query.getSingleResult().toString());
- }else {
- grp.setFactoryName("");
- }
- query.setParameter("dicttype", 3);
- query.setParameter("dictval", grp.getSyncStatus());
- if(null != query.getSingleResult()) {
- grp.setSyncStatus(query.getSingleResult().toString());
- }else {
- grp.setSyncStatus("");
- }
- query.setParameter("dicttype", 2);
- if (grp.getOperFlagIndex() != null) {
- query.setParameter("dictval", grp.getOperFlagIndex());
- grp.setOperFlag(query.getSingleResult().toString());
- }
- }
- String time = grp.getAllocatTime();
+ String time = grp.getRectime();
Date date;
String hms = "000000";
if (time != null) {
if (time.length() == 14) {
date = _ymdhms.parse(time);
- grp.setAllocatTime(ymdhms.format(date));
+ grp.setRectime(ymdhms.format(date));
} else {
time += hms.substring(0, 14 - time.length());
date = _ymdhms.parse(time + "");
- grp.setAllocatTime(ymdhms.format(date));
+ grp.setRectime(ymdhms.format(date));
}
}
- time = grp.getSyncTime();
+ time = grp.getSynctime();
if (time != null) {
if (time.length() == 14) {
date = _ymdhms.parse(time);
- grp.setSyncTime(ymdhms.format(date));
+ grp.setSynctime(ymdhms.format(date));
} else {
time += hms.substring(0, 14 - time.length());
date = _ymdhms.parse(time);
- grp.setSyncTime(ymdhms.format(date));
+ grp.setSynctime(ymdhms.format(date));
}
}
- time = grp.getFeedbackTime();
- if (time != null) {
- if (time.length() == 14) {
- date = _ymdhms.parse(time);
- grp.setFeedbackTime(ymdhms.format(date));
- } else {
- time += hms.substring(0, 14 - time.length());
- date = _ymdhms.parse(time);
- grp.setFeedbackTime(ymdhms.format(date));
- }
- }
}
+
+ return tDoorcardlstInfos;
+
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ @Transactional
+ @Override
+ public List<TDoorcardlstInfo> getBuildingOperCardListMap(String allocatStartDate, String allocatEndDate, String devname, String custname, String cardno, String syncflag, String operflag, String buildingid, String operid) {
+ try {
+
+ String queryString = "select a.listid,b.devname,a.custname,a.cardno,a.bankcardno,d.opername," +
+ "a.syncflag,a.operflag,a.rectime,a.synctime,a.closedate," +
+ "a.reason ,b.buildingname,c.regionname" +
+ " from t_nc_cardlist a " +
+ " left join tb_operator d on a.operid=d.operid," +
+ " t_nc_device b " +
+ " left join tb_region c on b.regionid=c.regionid " +
+ " left join t_operbuilding e on e.buildingid=b.buildingid "+
+ " where 1>0 and a.deviceid=b.deviceid and e.operid=:operid " ;
+ if (!"".equals(allocatStartDate)) {
+ queryString += " and a.rectime>=:allocatStartDate ";
+ }
+ if (!"".equals(allocatEndDate)) {
+ queryString += " and a.rectime<=:allocatEndDate ";
+ }
+ if (!("all").equals(syncflag)) {
+ queryString += " and a.syncflag =:syncflag";
+ }
+ if (!("").equals(devname)) {
+ queryString += " and b.devname like :devname";
+ }
+ if (!("all").equals(operflag)) {
+ queryString += " and a.operflag =:operflag";
+ }
+ if (!("").equals(buildingid)) {
+ queryString += " and b.buildingid = :buildingid ";
+ }
+
+ if (!("").equals(custname)) {
+ queryString += " and a.custname like :custname";
+ }
+ if (!("").equals(cardno)) {
+ queryString += " and a.cardno like :cardno";
+ }
+ queryString += " ORDER by a.listid DESC";
+
+ Query query = entityManager.createNativeQuery(queryString, TDoorcardlstInfo.class);
+ query.setParameter("operid", operid);
+
+ if (!"".equals(allocatStartDate)) {
+ query.setParameter("allocatStartDate", allocatStartDate + "000000");
+ }
+ if (!"".equals(allocatEndDate)) {
+ query.setParameter("allocatEndDate", allocatEndDate + "235959");
+ }
+
+
+ if (!("all").equals(syncflag)) {
+ query.setParameter("syncflag", syncflag);
+ }
+ if (!("").equals(devname)) {
+ query.setParameter("devname", "%" + devname + "%");
+ }
+ if (!("all").equals(operflag)) {
+ query.setParameter("operflag", operflag);
+ }
+ if (!("").equals(buildingid)) {
+ query.setParameter("buildingid", buildingid);
+ }
+ if (!("").equals(custname)) {
+ query.setParameter("custname", "%" + custname + "%");
+ }
+ if (!("").equals(cardno)) {
+ query.setParameter("cardno", cardno);
+ }
+
+
+ List<TDoorcardlstInfo> tDoorcardlstInfos = query.getResultList();
+ SimpleDateFormat _ymdhms = new SimpleDateFormat("yyyyMMddHHmmss");
+ SimpleDateFormat ymdhms = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ for (TDoorcardlstInfo grp : tDoorcardlstInfos) {
+ List<String> operFlag = dictionaryDao.findDictionaryStringByType(2);
+ List<String> sync = dictionaryDao.findDictionaryStringByType(3);
+ if(operflag!= null && operFlag.size()>0){
+ String operFlagIndex = grp.getOperflag();
+ for (String s : operFlag) {
+ String[] split = s.split("_");
+ if (operFlagIndex.equals(split[0])){
+ grp.setOperflag(split[1]);
+ break;
+ }
+ }
+ }
+ if(sync!= null && sync.size()>0){
+ String syncStatus1 = grp.getSyncflag();
+ for (String s : sync) {
+ String[] split = s.split("_");
+ if (syncStatus1.equals(split[0])){
+ grp.setSyncflag(split[1]);
+ break;
+ }else {
+ grp.setSyncflag("");
+ }
+ }
+ }
+
+
+ String time = grp.getRectime();
+ Date date;
+ String hms = "000000";
+ if (time != null) {
+ if (time.length() == 14) {
+ date = _ymdhms.parse(time);
+ grp.setRectime(ymdhms.format(date));
+ } else {
+
+ time += hms.substring(0, 14 - time.length());
+ date = _ymdhms.parse(time + "");
+ grp.setRectime(ymdhms.format(date));
+ }
+
+ }
+
+ time = grp.getSynctime();
+ if (time != null) {
+ if (time.length() == 14) {
+ date = _ymdhms.parse(time);
+ grp.setSynctime(ymdhms.format(date));
+ } else {
+ time += hms.substring(0, 14 - time.length());
+ date = _ymdhms.parse(time);
+ grp.setSynctime(ymdhms.format(date));
+ }
+
+ }
+
+ }
+
return tDoorcardlstInfos;
}catch (Exception e){
e.printStackTrace();
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/CustomerDaoImpl.java b/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/CustomerDaoImpl.java
new file mode 100644
index 0000000..ce6dd47
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/CustomerDaoImpl.java
@@ -0,0 +1,78 @@
+package com.supwisdom.dlpay.mainservice.dao.impl;
+
+import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
+import com.supwisdom.dlpay.framework.util.StringUtil;
+import com.supwisdom.dlpay.mainservice.dao.CustomerDao;
+import com.supwisdom.dlpay.mainservice.domain.TCustomer;
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.Query;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+@Repository
+public class CustomerDaoImpl implements CustomerDao {
+
+ @PersistenceContext
+ EntityManager entityManager;
+
+ @Transactional
+ @Override
+ public TCustomer findCustomerByNo(String cardno, String bankcardno) {
+ String sql = "select bean from TCustomer bean left join TCard a on a.custid= bean.custid " +
+ " where a.cardno=:cardno and a.bankcardno = :bankcarno ";
+ TypedQuery<TCustomer> query = entityManager.createQuery(sql, TCustomer.class);
+ query.setParameter("cardno", cardno);
+ query.setParameter("bankcarno", bankcardno);
+ List<TCustomer> list = query.getResultList();
+ if (list!=null && list.size()>0){
+ return list.get(0);
+ }
+ return null;
+ }
+
+ @Transactional
+ @Override
+ public boolean saveCustomer(TCustomer bean) {
+ boolean flag=false;
+ try {
+ entityManager.persist(bean);
+ flag=true;
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ return flag;
+ }
+
+ @Transactional
+ @Override
+ public List<TCustomerInfo> getAllTCustomerList(String perName, String cardno, String bankcardno) {
+ String sql = "select a.custid,a.custname,b.cardno,b.bankcardno,b.expiredate from T_Customer a left join t_card b on a.custid = b.custid " +
+ " where a.status='1' and b.status='1' and b.lossflag='1' and b.frozeflag='1' ";
+ if (!StringUtil.isEmpty(perName)){
+ sql += " and a.custname like :perName ";
+ }
+ if (!StringUtil.isEmpty(cardno)){
+ sql +=" and b.cardno like :cardno ";
+ }
+ if (!StringUtil.isEmpty(bankcardno)){
+ sql +=" and b.bankcardno like bankcardno ";
+ }
+ sql +=" order by b.cardno desc ";
+ Query query = entityManager.createNativeQuery(sql, TCustomerInfo.class);
+ if (!StringUtil.isEmpty(perName)){
+ query.setParameter("perName", "%"+perName+"%");
+ }
+ if (!StringUtil.isEmpty(cardno)){
+ query.setParameter("cardno", cardno);
+ }
+ if (!StringUtil.isEmpty(bankcardno)){
+ query.setParameter("bankcardno", bankcardno);
+ }
+ List<TCustomerInfo> list = query.getResultList();
+ return list;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/DoordtlDaoImpl.java b/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/DoordtlDaoImpl.java
index 5e14310..43b18ff 100644
--- a/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/DoordtlDaoImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/DoordtlDaoImpl.java
@@ -18,80 +18,68 @@
@Transactional
@Override
- public List<TDoordtlInfo> findSystemExportExcelDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String stuempno, String custname, String buildingid, String regionid, String doorName, String factoryId, String streamstatus) {
+ public List<TDoordtlInfo> findSystemExportExcelDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno, String custname, String buildingid, String regionid, String devname, String streamstatus) {
try {
- String queryString = "select a.doorseqno,a.dtldesc ,a.doorid, a.cardphyid,c.factoryname,d.doorname,b.stuempno,b.custname,tb.buildingname,tr.regionname," +
- " to_char(to_date(a.transdate||a.transtime ,'yyyymmddhh24miss'),'yyyy-mm-dd hh24:mi:ss') as transdate, "
- + "case when a.status='0' then '失败' else '成功' end status,to_char(to_date( a.coldate||a.coltime,'yyyymmddhh24miss'),'yyyy-mm-dd hh24:mi:ss') as coldate " + "from "
- + "t_doordtl a "
- + "left join t_customer b on a.custid=b.custid " + "left join "
- + "t_building tb on b.buildingid=tb.buildingid " + "left join "
- + "tb_region tr on a.regionid = tr.regionid "+ "left join "
- + "t_doordev d on a.doorid = d.doorid, " + "t_keys c " + "where a.factoryid=c.factoryid ";
- if (!startTranDate.equals("")) {
- queryString += " and a.transdate>=:startTranDate and a.transdate<=:endTranDate ";
+ String queryString = "select a.doorseqno,b.deviceid,b.devname,a.custname,c.cardno,c.cardphyid,c.bankcardno,to_char(to_date(a.transdate ,'yyyymmdd'),'yyyy-mm-dd')||' '||to_char(to_timestamp(a.transtime,'hh24miss'),'hh24:mi:ss') transdate, " +
+ " to_char(to_date(a.coldate ,'yyyymmdd'),'yyyy-mm-dd')||' '||to_char(to_timestamp(a.coltime,'hh24miss'),'hh24:mi:ss') coldate,"
+ + " case when a.status='' then '失败' else '成功' end status,a.dtldesc "
+ + " from t_doordtl a "
+ + " left join t_card c on a.custid=c.custid,t_nc_device b "
+ + " left join tb_region d on b.regionid=d.regionid "
+ + " left join t_building e on b.buildingid=e.buildingid "
+ + " where 1>0 and cast(substr(a.doorid,5) as integer) = b.deviceid ";
+ if (!startTranDate.equals("") && !endTranDate.equals("")) {
+ queryString += " and a.transdate between :startTranDate and :endTranDate ";
}
- if (!startTranTime.equals("")) {
- queryString += " and a.transtime>=:startTranTime and a.transtime<=:endTranTime ";
- }
- if (!stuempno.equals("")) {
- queryString += " and b.stuempno like :stuempno ";
+ if (!cardno.equals("")) {
+ queryString += " and a.cardno like :cardno ";
}
if (!custname.equals("")) {
- queryString += " and b.custname like :custname ";
+ queryString += " and a.custname like :custname ";
}
- if (!buildingid.equals("")) {
- queryString += " and tb.buildingid = :buildingid ";
- }
- if (!regionid.equals("")){
- queryString += "and tr.regionid in "
- +"("
- + "with recursive tmp as "
- + "("
- + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr where regionid =:regionid "
- + "union all "
- + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
- + ") select regionid from tmp )";
- }
- if (!doorName.equals("")) {
- queryString += " and d.doorName like :doorName ";
- }
- if (!factoryId.equals("all")) {
- queryString += " and c.factoryId =:factoryId ";
+ if (!devname.equals("")) {
+ queryString += " and b.devname like :devname ";
}
if (!streamstatus.equals("all")) {
queryString += " and a.status =:streamstatus ";
}
+ if(!buildingid.equals("")){
+ queryString += " and e.buildingid = :buildingid";
+ }
+ if (!regionid.equals("")){
+ queryString += "and d.regionid in "
+ +"("
+ + "with recursive tmp as "
+ + "("
+ + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr where regionid = :regionid "
+ + "union all "
+ + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
+ + ") select regionid from tmp )";
+ }
+ queryString += " order by a.transdate DESC";
Query query = entityManager.createNativeQuery(queryString, TDoordtlInfo.class);
if (!startTranDate.equals("")) {
query.setParameter("startTranDate", startTranDate);
query.setParameter("endTranDate", endTranDate);
}
- if (!startTranTime.equals("")) {
- query.setParameter("startTranTime", startTranTime);
- query.setParameter("endTranTime", endTranTime);
- }
- if (!stuempno.equals("")) {
- query.setParameter("stuempno", "%" + stuempno + "%");
+ if (!cardno.equals("")) {
+ query.setParameter("cardno", cardno);
}
if (!custname.equals("")) {
query.setParameter("custname", "%" + custname + "%");
}
- if (!buildingid.equals("")) {
- query.setParameter("buildingid", buildingid);
- }
- if (!regionid.equals("")){
- query.setParameter("regionid", regionid);
- }
- if (!doorName.equals("")) {
- query.setParameter("doorName", "%" + doorName + "%");
- }
- if (!factoryId.equals("all")) {
- query.setParameter("factoryId", factoryId);
+ if (!devname.equals("")) {
+ query.setParameter("devname", "%" + devname + "%");
}
if (!streamstatus.equals("all")) {
query.setParameter("streamstatus", streamstatus);
}
+ if(!buildingid.equals("")){
+ query.setParameter("buildingid",buildingid);
+ }
+ if (!regionid.equals("")){
+ query.setParameter("regionid", regionid);
+ }
List<TDoordtlInfo> list = query.getResultList();
return list;
}catch (Exception e){
@@ -102,89 +90,78 @@
@Transactional
@Override
- public List<TDoordtlInfo> findOperatorExportExcelDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String stuempno, String custname, String buildingid, String regionid, String doorName, String factoryId, String streamstatus, String operRegionid) {
+ public List<TDoordtlInfo> findOperatorExportExcelDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno, String custname, String buildingid, String regionid, String devname, String streamstatus, String operRegionid) {
try {
- String queryString = "select a.dtldesc ,a.doorseqno, c.factoryname,d.doorname,b.stuempno,b.custname,tb.buildingname,tr.regionname," +
- " to_char(to_date(a.transdate||a.transtime ,'yyyymmddhh24miss'),'yyyy-mm-dd hh24:mi:ss') as transdate, "
- + "case when a.status='0' then '失败' else '成功' end status,to_char(to_date( a.coldate||a.coltime,'yyyymmddhh24miss'),'yyyy-mm-dd hh24:mi:ss') as coldate " + "from "
- + "t_doordtl a "
- + "left join t_customer b on a.custid=b.custid " + "left join "
- + "t_building tb on b.buildingid=tb.buildingid " + "left join "
- + "tb_region tr on a.regionid = tr.regionid "+ "left join "
- + "t_doordev d on a.doorid = d.doorid, " + "t_keys c " + "where a.factoryid=c.factoryid ";
+ String queryString = "select a.doorseqno,b.deviceid,b.devname,a.custname,c.cardno,c.cardphyid,c.bankcardno,to_char(to_date(a.transdate ,'yyyymmdd'),'yyyy-mm-dd')||' '||to_char(to_timestamp(a.transtime,'hh24miss'),'hh24:mi:ss') transdate, " +
+ " to_char(to_date(a.coldate ,'yyyymmdd'),'yyyy-mm-dd')||' '||to_char(to_timestamp(a.coltime,'hh24miss'),'hh24:mi:ss') coldate,"
+ + " case when a.status='' then '失败' else '成功' end status,a.dtldesc "
+ + " from t_doordtl a "
+ + " left join t_card c on a.custid=c.custid,t_nc_devcie b "
+ + " left join tb_region d on b.regionid=d.regionid "
+ + " left join t_building e on b.buildingid=e.buildingid "
+ + " where 1>0 and cast(substr(a.doorid,5) as integer) = b.deviceid ";
if (!startTranDate.equals("")) {
- queryString += " and a.transdate>=:startTranDate and a.transdate<=:endTranDate ";
+ queryString += " and a.transdate between :startTranDate and :endTranDate ";
}
- if (!startTranTime.equals("")) {
- queryString += " and a.transtime>=:startTranTime and a.transtime<=:endTranTime ";
- }
- if (!stuempno.equals("")) {
- queryString += " and b.stuempno like :stuempno ";
+ if (!cardno.equals("")) {
+ queryString += " and a.cardno like :cardno ";
}
if (!custname.equals("")) {
- queryString += " and b.custname like :custname ";
+ queryString += " and a.custname like :custname ";
}
- if (!buildingid.equals("")) {
- queryString += " and tb.buildingid = :buildingid ";
- }
- if (!regionid.equals("")){
- queryString += "and tr.regionid in "
- +"("
- + "with recursive tmp as "
- + "("
- + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr where regionid =:operRegionid "
- + "union all "
- + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
- + ") select regionid from tmp where tmp.regionid=:regionid)";
- }else {
- queryString += "and tr.regionid in "
- +"("
- + "with recursive tmp as "
- + "("
- + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr where regionid =:operRegionid "
- + "union all "
- + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
- + ") select regionid from tmp )";
- }
- if (!doorName.equals("")) {
- queryString += " and d.doorName like :doorName ";
- }
- if (!factoryId.equals("all")) {
- queryString += " and c.factoryId =:factoryId ";
+ if (!devname.equals("")) {
+ queryString += " and d.devname like :devname ";
}
if (!streamstatus.equals("all")) {
queryString += " and a.status =:streamstatus ";
}
+ if(!buildingid.equals("")){
+ queryString += " and e.buildingid = :buildingid";
+ }
+ if (!regionid.equals("")){
+ queryString += "and d.regionid in "
+ +"("
+ + "with recursive tmp as "
+ + "("
+ + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr where regionid = :operRegionid "
+ + "union all "
+ + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
+ + ") select regionid from tmp where tmp.regionid = :regionid )";
+ }else {
+ queryString += "and d.regionid in "
+ +"("
+ + "with recursive tmp as "
+ + "("
+ + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr where regionid = :operRegionid "
+ + "union all "
+ + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
+ + ") select regionid from tmp )";
+ }
+ queryString += " order by transdate DESC";
Query query = entityManager.createNativeQuery(queryString, TDoordtlInfo.class);
+
if (!startTranDate.equals("")) {
query.setParameter("startTranDate", startTranDate);
query.setParameter("endTranDate", endTranDate);
}
- if (!startTranTime.equals("")) {
- query.setParameter("startTranTime", startTranTime);
- query.setParameter("endTranTime", endTranTime);
- }
- if (!stuempno.equals("")) {
- query.setParameter("stuempno", "%" + stuempno + "%");
+ if (!cardno.equals("")) {
+ query.setParameter("cardno", cardno);
}
if (!custname.equals("")) {
query.setParameter("custname", "%" + custname + "%");
}
+ if (!devname.equals("")) {
+ query.setParameter("devname", "%" + devname + "%");
+ }
+ if (!streamstatus.equals("all")) {
+ query.setParameter("streamstatus", streamstatus);
+ }
if (!buildingid.equals("")) {
query.setParameter("buildingid", buildingid);
}
query.setParameter("operRegionid", operRegionid);
- if (!regionid.equals("")){
- query.setParameter("regionid", regionid);
- }
- if (!doorName.equals("")) {
- query.setParameter("doorName", "%" + doorName + "%");
- }
- if (!factoryId.equals("all")) {
- query.setParameter("factoryId", factoryId);
- }
- if (!streamstatus.equals("all")) {
- query.setParameter("streamstatus", streamstatus);
+ if(regionid.equals("")){
+ query.setParameter("regionid",regionid);
}
List<TDoordtlInfo> list = query.getResultList();
return list;
@@ -196,33 +173,96 @@
@Transactional
@Override
- public Pagination findSystemTDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String stuempno, String custname, String buildingid, String doorName, String factoryId, String streamstatus, int pageNo, int pageSize, String regionid) {
- String queryString = "select a.doorid,a.doorseqno, c.factoryname, d.doorname,a.stuempno,a.custname,a.transdate||a.transtime transdate,tb.buildingname,tr.regionname, "
- + "case when a.status='0' then '失败' else '成功' end status,a.coldate||a.coltime coldate,a.dtldesc,a.cardphyid "
- + "from t_doordtl a left join t_doordev d on a.doorid = d.doorid "
- + "left join t_building tb on a.buildingid=tb.buildingid "
- + "left join tb_region tr on a.regionid=tr.regionid, "
- +" t_keys c " + "where a.factoryid=c.factoryid ";
- if (!startTranDate.equals("")) {
+ public List<TDoordtlInfo> findBuildingOperExportExcelDoorDtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno, String custname, String buildingid, String devname, String streamstatus, String operid) {
+ try{
+ String queryString = "select a.doorseqno,b.deviceid,b.devname,a.custname,c.cardno,c.cardphyid,c.bankcardno,to_char(to_date(a.transdate ,'yyyymmdd'),'yyyy-mm-dd')||' '||to_char(to_timestamp(a.transtime,'hh24miss'),'hh24:mi:ss') transdate, " +
+ " to_char(to_date(a.coldate ,'yyyymmdd'),'yyyy-mm-dd')||' '||to_char(to_timestamp(a.coltime,'hh24miss'),'hh24:mi:ss') coldate,"
+ + " case when a.status='' then '失败' else '成功' end status,a.dtldesc "
+ + " from t_doordtl a "
+ + " left join t_card c left join on a.custid=c.custid,t_nc_device b "
+ + " left join tb_region d on b.regionid=d.regionid "
+ + " left join t_building e on b.buildingid=e.buildingid "
+ + " left join t_operBuilding f on e.buildingid = f.buildingid "
+ + " where 1>0 and cast(substr(a.doorid,5) as integer) = b.deviceid and f.operid = :operid ";
+ if (!startTranDate.equals("")) {
+ queryString += " and a.transdate between :startTranDate and :endTranDate ";
+ }
+ if (!cardno.equals("")) {
+ queryString += " and a.cardno like :cardno ";
+ }
+ if (!custname.equals("")) {
+ queryString += " and a.custname like :custname ";
+ }
+ if (!devname.equals("")) {
+ queryString += " and d.devname like :devname ";
+ }
+ if (!streamstatus.equals("all")) {
+ queryString += " and a.status =:streamstatus ";
+ }
+ if(!buildingid.equals("")){
+ queryString += " and e.buildingid = :buildingid";
+ }
+ queryString += " order by transdate DESC";
+ Query query = entityManager.createNativeQuery(queryString, TDoordtlInfo.class);
+
+ if (!startTranDate.equals("")) {
+ query.setParameter("startTranDate", startTranDate);
+ query.setParameter("endTranDate", endTranDate);
+ }
+ if (!cardno.equals("")) {
+ query.setParameter("cardno", cardno);
+ }
+ if (!custname.equals("")) {
+ query.setParameter("custname", "%" + custname + "%");
+ }
+ if (!devname.equals("")) {
+ query.setParameter("devname", "%" + devname + "%");
+ }
+ if (!streamstatus.equals("all")) {
+ query.setParameter("streamstatus", streamstatus);
+ }
+ if (!buildingid.equals("")) {
+ query.setParameter("buildingid", buildingid);
+ }
+ query.setParameter("operid", operid);
+
+ List<TDoordtlInfo> list = query.getResultList();
+ return list;
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ @Transactional
+ @Override
+ public Pagination findSystemTDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno, String custname, String buildingid, String devname, String streamstatus, int pageNo, int pageSize, String regionid) {
+ String queryString = "select a.doorseqno,b.deviceid,b.devname,a.custname,c.cardno,c.cardphyid,c.bankcardno,a.transdate||a.transtime transdate, a.coldate||a.coltime coldate,"
+ + " case when a.status='' then '失败' else '成功' end status,a.dtldesc "
+ + " from t_doordtl a left join t_card c on a.custid=c.custid, t_nc_device b "
+ + " left join tb_region d on b.regionid=d.regionid "
+ + " left join t_building e on b.buildingid=e.buildingid "
+ + " where 1>0 and cast(substr(a.doorid,5) as integer) = b.deviceid ";
+ if (!startTranDate.equals("") && !endTranDate.equals("")) {
queryString += " and transdate between :startTranDate and :endTranDate ";
}
- if (!stuempno.equals("")) {
- queryString += " and a.stuempno like :stuempno ";
+ if (!cardno.equals("")) {
+ queryString += " and a.cardno like :cardno ";
}
if (!custname.equals("")) {
queryString += " and a.custname like :custname ";
}
- if (!doorName.equals("")) {
- queryString += " and d.doorName like :doorName ";
+ if (!devname.equals("")) {
+ queryString += " and b.devname like :devname ";
}
if (!streamstatus.equals("all")) {
queryString += " and a.status =:streamstatus ";
}
if(!buildingid.equals("")){
- queryString += " and tb.buildingid = :buildingid";
+ queryString += " and e.buildingid = :buildingid";
}
if (!regionid.equals("")){
- queryString += "and tr.regionid in "
+ queryString += "and d.regionid in "
+"("
+ "with recursive tmp as "
+ "("
@@ -237,14 +277,14 @@
query.setParameter("startTranDate", startTranDate);
query.setParameter("endTranDate", endTranDate);
}
- if (!stuempno.equals("")) {
- query.setParameter("stuempno", stuempno);
+ if (!cardno.equals("")) {
+ query.setParameter("cardno", cardno);
}
if (!custname.equals("")) {
query.setParameter("custname", "%" + custname + "%");
}
- if (!doorName.equals("")) {
- query.setParameter("doorName", "%" + doorName + "%");
+ if (!devname.equals("")) {
+ query.setParameter("devname", "%" + devname + "%");
}
if (!streamstatus.equals("all")) {
query.setParameter("streamstatus", streamstatus);
@@ -263,8 +303,8 @@
page.setPageSize(pageSize);
List<TDoordtlInfo> list = query.getResultList();
page.setList(list);
- int totalCount = getSystemCount(startTranDate, endTranDate, startTranTime, endTranTime, stuempno, custname,
- buildingid, doorName, factoryId, streamstatus,regionid);
+ int totalCount = getSystemCount(startTranDate, endTranDate, cardno, custname,
+ buildingid, devname, streamstatus,regionid);
page.setTotalCount(totalCount);
return page;
}
@@ -272,37 +312,36 @@
- private int getSystemCount(String startTranDate, String endTranDate, String startTranTime, String endTranTime,
- String stuempno, String custname, String buildingid, String doorName,
- String factoryId, String streamstatus,String regionid) {
+ private int getSystemCount(String startTranDate, String endTranDate,
+ String cardno, String custname, String buildingid, String devname, String streamstatus,String regionid) {
try {
String queryString = "select count(*) as cnt "
+ " from t_doordtl a "
- + " left join t_doordev d on a.doorid = d.doorid "
- + "left join t_building tb on a.buildingid=tb.buildingid "
- + "left join tb_region tr on a.regionid=tr.regionid "
- + " where 1>0";
+ + " left join t_card c on a.custid=c.custid, t_nc_device b "
+ + " left join tb_region d on b.regionid=d.regionid "
+ + " left join t_building e on b.buildingid=e.buildingid "
+ + " where 1>0 and cast(substr(a.doorid,5) as integer) = b.deviceid ";
if (!startTranDate.equals("")) {
- queryString += " and transdate between :startTranDate and :endTranDate ";
+ queryString += " and a.transdate between :startTranDate and :endTranDate ";
}
- if (!stuempno.equals("")) {
- queryString += " and a.stuempno = :stuempno ";
+ if (!cardno.equals("")) {
+ queryString += " and a.cardno like :cardno ";
}
if (!custname.equals("")) {
queryString += " and a.custname like :custname ";
}
- if (!doorName.equals("")) {
- queryString += " and d.doorName like :doorName ";
+ if (!devname.equals("")) {
+ queryString += " and b.devname like :devname ";
}
if (!streamstatus.equals("all")) {
queryString += " and a.status =:streamstatus ";
}
if(!buildingid.equals("")){
- queryString += " and tb.buildingid = :buildingid";
+ queryString += " and e.buildingid = :buildingid";
}
if (!regionid.equals("")){
- queryString += "and tr.regionid in "
+ queryString += "and d.regionid in "
+"("
+ "with recursive tmp as "
+ "("
@@ -317,8 +356,8 @@
query.setParameter("startTranDate", startTranDate);
query.setParameter("endTranDate", endTranDate);
}
- if (!stuempno.equals("")) {
- query.setParameter("stuempno", stuempno);
+ if (!cardno.equals("")) {
+ query.setParameter("cardno", cardno);
}
if (!custname.equals("")) {
query.setParameter("custname", "%" + custname + "%");
@@ -326,8 +365,8 @@
if (!buildingid.equals("")) {
query.setParameter("buildingid", buildingid);
}
- if (!doorName.equals("")) {
- query.setParameter("doorName", "%" + doorName + "%");
+ if (!devname.equals("")) {
+ query.setParameter("devname", "%" + devname + "%");
}
if (!streamstatus.equals("all")) {
query.setParameter("streamstatus", streamstatus);
@@ -350,35 +389,35 @@
@Transactional
@Override
- public Pagination findOperatorTDoordtl(String operid, String startTranDate, String endTranDate, String startTranTime, String endTranTime, String stuempno, String custname, String buildingid, String doorName, String factoryId, String streamstatus, int pageNo, int pageSize, String regionid,String operRegionid) {
+ public Pagination findOperatorTDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno, String custname, String buildingid, String devname, String streamstatus, int pageNo, int pageSize, String regionid,String operRegionid) {
try{
- String queryString = "select a.doorid,a.doorseqno,c.factoryname,d.doorname,a.stuempno,a.custname,a.transdate||a.transtime transdate,"
- + " case when a.status='0' then '失败' else '成功' end status,a.coldate||a.coltime coldate,a.dtldesc,a.cardphyid,tb.buildingname,tr.regionname "
- + " from t_doordtl a left join t_doordev d on a.doorid = d.doorid"
- + " left join t_operdevice od on a.doorid = od.deviceid"
- + "left join t_building tb on a.buildingid=tb.buildingid "
- + "left join tb_region tr on a.regionid=tr.regionid, "
- + " t_keys c " + "where a.factoryid=c.factoryid ";
+ String queryString = "select a.doorseqno,b.deviceid,b.devname,a.custname,c.cardno,c.cardphyid,c.bankcardno,a.transdate||a.transtime transdate, a.coldate||a.coltime coldate,"
+ + " case when a.status='' then '失败' else '成功' end status,a.dtldesc "
+ + " from t_doordtl a "
+ + " left join t_card c on a.custid=c.custid,t_nc_device b "
+ + " left join tb_region d on b.regionid=d.regionid "
+ + " left join t_building e on b.buildingid=e.buildingid "
+ + " where 1>0 and cast(substr(a.doorid,5) as integer) = b.deviceid ";
if (!startTranDate.equals("")) {
queryString += " and transdate between :startTranDate and :endTranDate ";
}
- if (!stuempno.equals("")) {
- queryString += " and a.stuempno like :stuempno ";
+ if (!cardno.equals("")) {
+ queryString += " and a.cardno like :cardno ";
}
if (!custname.equals("")) {
queryString += " and a.custname like :custname ";
}
- if (!doorName.equals("")) {
- queryString += " and d.doorName like :doorName ";
+ if (!devname.equals("")) {
+ queryString += " and d.devname like :devname ";
}
if (!streamstatus.equals("all")) {
queryString += " and a.status =:streamstatus ";
}
if(!buildingid.equals("")){
- queryString += " and tb.buildingid = :buildingid";
+ queryString += " and e.buildingid = :buildingid";
}
if (!regionid.equals("")){
- queryString += "and tr.regionid in "
+ queryString += "and d.regionid in "
+"("
+ "with recursive tmp as "
+ "("
@@ -387,7 +426,7 @@
+ "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
+ ") select regionid from tmp where tmp.regionid = :regionid )";
}else {
- queryString += "and tr.regionid in "
+ queryString += "and d.regionid in "
+"("
+ "with recursive tmp as "
+ "("
@@ -403,14 +442,14 @@
query.setParameter("startTranDate", startTranDate);
query.setParameter("endTranDate", endTranDate);
}
- if (!stuempno.equals("")) {
- query.setParameter("stuempno", stuempno);
+ if (!cardno.equals("")) {
+ query.setParameter("cardno", cardno);
}
if (!custname.equals("")) {
query.setParameter("custname", "%" + custname + "%");
}
- if (!doorName.equals("")) {
- query.setParameter("doorName", "%" + doorName + "%");
+ if (!devname.equals("")) {
+ query.setParameter("devname", "%" + devname + "%");
}
if (!streamstatus.equals("all")) {
query.setParameter("streamstatus", streamstatus);
@@ -430,8 +469,8 @@
page.setPageSize(pageSize);
List<TDoordtlInfo> list = query.getResultList();
page.setList(list);
- int totalCount = getOperatorCount(startTranDate, endTranDate, startTranTime, endTranTime, stuempno, custname,
- buildingid, doorName, factoryId, streamstatus,regionid,operRegionid);
+ int totalCount = getOperatorCount(startTranDate, endTranDate, cardno, custname,
+ buildingid, devname, streamstatus,regionid,operRegionid);
page.setTotalCount(totalCount);
return page;
}catch (Exception e){
@@ -440,38 +479,39 @@
return null;
}
- private int getOperatorCount(String startTranDate, String endTranDate, String startTranTime, String endTranTime,
- String stuempno, String custname, String buildingid, String doorName,
- String factoryId, String streamstatus,String regionid,String operRegionid) {
+
+
+ private int getOperatorCount(String startTranDate, String endTranDate,
+ String cardno, String custname, String buildingid, String devname,
+ String streamstatus,String regionid,String operRegionid) {
try {
String queryString = "select count(*) as cnt "
+ " from t_doordtl a "
- + " left join t_doordev d on a.doorid = d.doorid "
- + " left join t_operdevice od on a.doorid = od.deviceid"
- + " left join t_building tb on a.buildingid=tb.buildingid "
- + " left join tb_region tr on a.regionid=tr.regionid "
- + " where 1>0 ";
+ + " left join t_card c on a.custid=c.custid, t_nc_device "
+ + " left join tb_region d on b.regionid=d.regionid "
+ + " left join t_building e on b.buildingid=e.buildingid "
+ + " where 1>0 and cast(substr(a.doorid,5) as integer) = b.deviceid ";
if (!startTranDate.equals("")) {
- queryString += " and transdate between :startTranDate and :endTranDate ";
+ queryString += " and a.transdate between :startTranDate and :endTranDate ";
}
- if (!stuempno.equals("")) {
- queryString += " and a.stuempno = :stuempno ";
+ if (!cardno.equals("")) {
+ queryString += " and a.cardno like :cardno ";
}
if (!custname.equals("")) {
queryString += " and a.custname like :custname ";
}
- if (!doorName.equals("")) {
- queryString += " and d.doorName like :doorName ";
+ if (!devname.equals("")) {
+ queryString += " and b.devname like :devname ";
}
if (!streamstatus.equals("all")) {
queryString += " and a.status =:streamstatus ";
}
if(!buildingid.equals("")){
- queryString += " and tb.buildingname like :buildingname";
+ queryString += " and e.buildingname like :buildingname";
}
if (!regionid.equals("")){
- queryString += "and tr.regionid in "
+ queryString += "and d.regionid in "
+"("
+ "with recursive tmp as "
+ "("
@@ -495,14 +535,14 @@
query.setParameter("startTranDate", startTranDate);
query.setParameter("endTranDate", endTranDate);
}
- if (!stuempno.equals("")) {
- query.setParameter("stuempno", stuempno);
+ if (!cardno.equals("")) {
+ query.setParameter("cardno", cardno);
}
if (!custname.equals("")) {
query.setParameter("custname", "%" + custname + "%");
}
- if (!doorName.equals("")) {
- query.setParameter("doorName", "%" + doorName + "%");
+ if (!devname.equals("")) {
+ query.setParameter("devname", "%" + devname + "%");
}
if (!streamstatus.equals("all")) {
query.setParameter("streamstatus", streamstatus);
@@ -525,4 +565,139 @@
}
return 0;
}
+
+ @Transactional
+ @Override
+ public Pagination findBuildingOperTDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno, String custname, String buildingid, String devname, String streamstatus, int pageNo, int pageSize, String operid) {
+ try{
+ String queryString = "select a.doorseqno,b.deviceid,b.devname,a.custname,c.cardno,c.cardphyid,c.bankcardno,a.transdate||a.transtime transdate, a.coldate||a.coltime coldate,"
+ + " case when a.status='' then '失败' else '成功' end status,a.dtldesc "
+ + " from t_doordtl a "
+ + " left join t_card c left join on a.custid=c.custid,t_nc_devcie b "
+ + " left join tb_region d on b.regionid=d.regionid "
+ + " left join t_building e on b.buildingid=e.buildingid "
+ + " left join t_operBuilding f on e.buildingid = f.buildingid "
+ + " where 1>0 and cast(substr(a.doorid,5) as integer) = b.deviceid and f.operid = :operid ";
+ if (!startTranDate.equals("")) {
+ queryString += " and transdate between :startTranDate and :endTranDate ";
+ }
+ if (!cardno.equals("")) {
+ queryString += " and a.cardno like :cardno ";
+ }
+ if (!custname.equals("")) {
+ queryString += " and a.custname like :custname ";
+ }
+ if (!devname.equals("")) {
+ queryString += " and d.devname like :devname ";
+ }
+ if (!streamstatus.equals("all")) {
+ queryString += " and a.status =:streamstatus ";
+ }
+ if(!buildingid.equals("")){
+ queryString += " and e.buildingid = :buildingid";
+ }
+ queryString += " order by transdate DESC";
+ Query query = entityManager.createNativeQuery(queryString, TDoordtlInfo.class);
+
+ if (!startTranDate.equals("")) {
+ query.setParameter("startTranDate", startTranDate);
+ query.setParameter("endTranDate", endTranDate);
+ }
+ if (!cardno.equals("")) {
+ query.setParameter("cardno", cardno);
+ }
+ if (!custname.equals("")) {
+ query.setParameter("custname", "%" + custname + "%");
+ }
+ if (!devname.equals("")) {
+ query.setParameter("devname", "%" + devname + "%");
+ }
+ if (!streamstatus.equals("all")) {
+ query.setParameter("streamstatus", streamstatus);
+ }
+ if (!buildingid.equals("")) {
+ query.setParameter("buildingid", buildingid);
+ }
+ query.setParameter("operid", operid);
+ pageNo = pageNo <= 0 ? 1 : pageNo;
+ query.setFirstResult((pageNo - 1) * pageSize);
+ query.setMaxResults(pageSize);
+ Pagination page = new Pagination();
+ page.setPageNo(pageNo);
+ page.setPageSize(pageSize);
+ List<TDoordtlInfo> list = query.getResultList();
+ page.setList(list);
+ int totalCount = getBuildingOperCount(startTranDate, endTranDate, cardno, custname,
+ buildingid, devname, streamstatus,operid);
+ page.setTotalCount(totalCount);
+ return page;
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ private int getBuildingOperCount(String startTranDate, String endTranDate,
+ String cardno, String custname, String buildingid, String devname,
+ String streamstatus,String operid){
+ try {
+ String queryString = "select count(*) as cnt "
+ + " from t_doordtl a "
+ + " left join t_card c on a.custid=c.custid,t_nc_device b "
+ + " left join tb_region d on b.regionid=d.regionid "
+ + " left join t_building e on b.buildingid=e.buildingid "
+ + " left join t_operBuilding f on e.buildingid = f.buildingid "
+ + " where 1>0 and cast(substr(a.doorid,5) as integer) = b.deviceid and f.operid = :operid ";
+
+ if (!startTranDate.equals("")) {
+ queryString += " and a.transdate between :startTranDate and :endTranDate ";
+ }
+ if (!cardno.equals("")) {
+ queryString += " and a.cardno like :cardno ";
+ }
+ if (!custname.equals("")) {
+ queryString += " and a.custname like :custname ";
+ }
+ if (!devname.equals("")) {
+ queryString += " and b.devname like :devname ";
+ }
+ if (!streamstatus.equals("all")) {
+ queryString += " and a.status =:streamstatus ";
+ }
+ if(!buildingid.equals("")){
+ queryString += " and e.buildingname like :buildingname";
+ }
+ Query query = entityManager.createNativeQuery(queryString);
+ query.setMaxResults(5);
+ if (!startTranDate.equals("")) {
+ query.setParameter("startTranDate", startTranDate);
+ query.setParameter("endTranDate", endTranDate);
+ }
+ if (!cardno.equals("")) {
+ query.setParameter("cardno", cardno);
+ }
+ if (!custname.equals("")) {
+ query.setParameter("custname", "%" + custname + "%");
+ }
+ if (!devname.equals("")) {
+ query.setParameter("devname", "%" + devname + "%");
+ }
+ if (!streamstatus.equals("all")) {
+ query.setParameter("streamstatus", streamstatus);
+ }
+ if (!buildingid.equals("")) {
+ query.setParameter("buildingid", buildingid);
+ }
+ query.setParameter("operid", operid);
+ List list = query.getResultList();
+ int cnt = 0;
+ if (list!=null && list.size()>0){
+ cnt = Integer.parseInt(list.get(0).toString());
+ }
+ return cnt;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return 0;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/domain/TCard.java b/src/main/java/com/supwisdom/dlpay/mainservice/domain/TCard.java
new file mode 100644
index 0000000..a8b4e34
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/domain/TCard.java
@@ -0,0 +1,230 @@
+package com.supwisdom.dlpay.mainservice.domain;
+
+import org.hibernate.annotations.GenericGenerator;
+
+import javax.persistence.*;
+
+/**
+ * TCard entity. @author MyEclipse Persistence Tools
+ */
+@Entity
+@Table(name = "T_CARD")
+public class TCard implements java.io.Serializable {
+
+ // Fields
+
+ private String cardno;
+ private String oldcardno;
+ private String custid;
+ private String cardphyid;
+ private String expiredate;
+ private String status;
+ private String lossflag;
+ private String lossdate;
+ private String renewflag;
+ private String renewdate;
+ private String renewcardno;
+ private String lossefttime;
+ private String frozeflag;
+ private String frozedate;
+ private String cardverno;
+ private String lastsavedtime;
+ private String bankcardno;
+ @GenericGenerator(name = "idGenerator", strategy = "uuid")
+ @GeneratedValue(generator = "idGenerator")
+ private String cardid;
+
+ // Constructors
+
+ /** default constructor */
+ public TCard() {
+ }
+
+ /** minimal constructor */
+
+ /** full constructor */
+ public TCard(String cardno, String oldcardno, String custid, String cardphyid, String expiredate, String status, String lossflag, String lossdate, String renewflag, String renewdate, String renewcardno, String lossefttime, String frozeflag, String frozedate, String cardverno, String lastsavedtime, String bankcardno, String cardid) {
+ this.cardno = cardno;
+ this.oldcardno = oldcardno;
+ this.custid = custid;
+ this.cardphyid = cardphyid;
+ this.expiredate = expiredate;
+ this.status = status;
+ this.lossflag = lossflag;
+ this.lossdate = lossdate;
+ this.renewflag = renewflag;
+ this.renewdate = renewdate;
+ this.renewcardno = renewcardno;
+ this.lossefttime = lossefttime;
+ this.frozeflag = frozeflag;
+ this.frozedate = frozedate;
+ this.cardverno = cardverno;
+ this.lastsavedtime = lastsavedtime;
+ this.bankcardno = bankcardno;
+ this.cardid = cardid;
+ }
+
+ @Id
+ @Column(name = "CARDID",unique = true, nullable = false,length = 32)
+ public String getCardid() {
+ return cardid;
+ }
+
+ public void setCardid(String cardid) {
+ this.cardid = cardid;
+ }
+
+ @Column(name = "CARDNO", nullable = false, length = 32)
+ public String getCardno() {
+ return this.cardno;
+ }
+
+ public void setCardno(String cardno) {
+ this.cardno = cardno;
+ }
+
+ @Column(name = "OLDCARDNO", length = 32)
+ public String getOldcardno() {
+ return this.oldcardno;
+ }
+
+ public void setOldcardno(String oldcardno) {
+ this.oldcardno = oldcardno;
+ }
+
+ @Column(name = "CUSTID", length = 32, nullable = false)
+ public String getCustid() {
+ return this.custid;
+ }
+
+ public void setCustid(String custid) {
+ this.custid = custid;
+ }
+
+ @Column(name = "CARDPHYID", length = 16)
+ public String getCardphyid() {
+ return this.cardphyid;
+ }
+
+ public void setCardphyid(String cardphyid) {
+ this.cardphyid = cardphyid;
+ }
+
+ @Column(name = "EXPIREDATE", length = 8)
+ public String getExpiredate() {
+ return this.expiredate;
+ }
+
+ public void setExpiredate(String expiredate) {
+ this.expiredate = expiredate;
+ }
+
+ @Column(name = "STATUS", nullable = false, length = 1)
+ public String getStatus() {
+ return this.status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ @Column(name = "LOSSFLAG", nullable = false, length = 1)
+ public String getLossflag() {
+ return this.lossflag;
+ }
+
+ public void setLossflag(String lossflag) {
+ this.lossflag = lossflag;
+ }
+
+ @Column(name = "LOSSDATE", length = 8)
+ public String getLossdate() {
+ return this.lossdate;
+ }
+
+ public void setLossdate(String lossdate) {
+ this.lossdate = lossdate;
+ }
+
+ @Column(name = "RENEWFLAG", length = 1)
+ public String getRenewflag() {
+ return this.renewflag;
+ }
+
+ public void setRenewflag(String renewflag) {
+ this.renewflag = renewflag;
+ }
+
+ @Column(name = "RENEWDATE", length = 8)
+ public String getRenewdate() {
+ return this.renewdate;
+ }
+
+ public void setRenewdate(String renewdate) {
+ this.renewdate = renewdate;
+ }
+
+ @Column(name = "RENEWCARDNO", length = 32)
+ public String getRenewcardno() {
+ return this.renewcardno;
+ }
+
+ public void setRenewcardno(String renewcardno) {
+ this.renewcardno = renewcardno;
+ }
+
+ @Column(name = "LOSSEFTTIME", length = 14)
+ public String getLossefttime() {
+ return this.lossefttime;
+ }
+
+ public void setLossefttime(String lossefttime) {
+ this.lossefttime = lossefttime;
+ }
+
+ @Column(name = "FROZEFLAG", nullable = false, length = 1)
+ public String getFrozeflag() {
+ return this.frozeflag;
+ }
+
+ public void setFrozeflag(String frozeflag) {
+ this.frozeflag = frozeflag;
+ }
+
+ @Column(name = "FROZEDATE", length = 8)
+ public String getFrozedate() {
+ return this.frozedate;
+ }
+
+ public void setFrozedate(String frozedate) {
+ this.frozedate = frozedate;
+ }
+
+
+ @Column(name = "CARDVERNO", length = 12)
+ public String getCardverno() {
+ return this.cardverno;
+ }
+
+ public void setCardverno(String cardverno) {
+ this.cardverno = cardverno;
+ }
+
+ @Column(name = "LASTSAVEDTIME",length = 14)
+ public String getLastsavedtime() {
+ return lastsavedtime;
+ }
+
+ public void setLastsavedtime(String lastsavedtime) {
+ this.lastsavedtime = lastsavedtime;
+ }
+
+ @Column(name = "BANKCARDNO",length = 32,nullable = false)
+ public String getBankcardno() {
+ return bankcardno;
+ }
+
+ public void setBankcardno(String bankcardno) {
+ this.bankcardno = bankcardno;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/domain/TCustomer.java b/src/main/java/com/supwisdom/dlpay/mainservice/domain/TCustomer.java
new file mode 100644
index 0000000..b3fbcf5
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/domain/TCustomer.java
@@ -0,0 +1,189 @@
+package com.supwisdom.dlpay.mainservice.domain;
+
+import org.hibernate.annotations.GenericGenerator;
+
+import javax.persistence.*;
+
+/**
+ * TCustomer entity. @author MyEclipse Persistence Tools
+ */
+@Entity
+@Table(name = "T_CUSTOMER")
+public class TCustomer implements java.io.Serializable {
+
+ // Fields
+ @GenericGenerator(name = "idGenerator", strategy = "uuid")
+ @GeneratedValue(generator = "idGenerator")
+ private String custid;
+ private String status;
+ private String custname;
+ private String sex;
+ private String email;
+ private String mobile;
+ private String addr;
+ private String indate;
+ private String outdate;
+ private String opendate;
+ private String closedate;
+ private String lastsavedtime;
+ private String addoperid;
+ private String remark;
+
+ // Constructors
+
+ /** default constructor */
+ public TCustomer() {
+ }
+
+ /** full constructor */
+ public TCustomer(String custid, String status, String custname, String sex, String email, String mobile, String addr, String indate, String outdate, String opendate, String closedate, String lastsavedtime, String addoperid, String remark) {
+ this.custid = custid;
+ this.status = status;
+ this.custname = custname;
+ this.sex = sex;
+ this.email = email;
+ this.mobile = mobile;
+ this.addr = addr;
+ this.indate = indate;
+ this.outdate = outdate;
+ this.opendate = opendate;
+ this.closedate = closedate;
+ this.lastsavedtime = lastsavedtime;
+ this.addoperid = addoperid;
+ this.remark = remark;
+ }
+
+
+
+
+ // Property accessors
+ @Id
+ @Column(name = "CUSTID", unique = true, nullable = false, length = 32)
+ public String getCustid() {
+ return this.custid;
+ }
+
+ public void setCustid(String custid) {
+ this.custid = custid;
+ }
+
+
+ @Column(name = "STATUS", nullable = false, length = 1)
+ public String getStatus() {
+ return this.status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ @Column(name = "CUSTNAME", length = 100)
+ public String getCustname() {
+ return this.custname;
+ }
+
+ public void setCustname(String custname) {
+ this.custname = custname;
+ }
+
+ @Column(name = "SEX", length = 1)
+ public String getSex() {
+ return this.sex;
+ }
+
+ public void setSex(String sex) {
+ this.sex = sex;
+ }
+
+
+ @Column(name = "EMAIL", length = 60)
+ public String getEmail() {
+ return this.email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+
+ @Column(name = "MOBILE", length = 20)
+ public String getMobile() {
+ return this.mobile;
+ }
+
+ public void setMobile(String mobile) {
+ this.mobile = mobile;
+ }
+
+ @Column(name = "ADDR", length = 240)
+ public String getAddr() {
+ return this.addr;
+ }
+
+ public void setAddr(String addr) {
+ this.addr = addr;
+ }
+
+ @Column(name = "INDATE", length = 8)
+ public String getIndate() {
+ return this.indate;
+ }
+
+ public void setIndate(String indate) {
+ this.indate = indate;
+ }
+
+ @Column(name = "OUTDATE", length = 8)
+ public String getOutdate() {
+ return this.outdate;
+ }
+
+ public void setOutdate(String outdate) {
+ this.outdate = outdate;
+ }
+
+ @Column(name = "OPENDATE", length = 8)
+ public String getOpendate() {
+ return this.opendate;
+ }
+
+ public void setOpendate(String opendate) {
+ this.opendate = opendate;
+ }
+
+ @Column(name = "CLOSEDATE", length = 8)
+ public String getClosedate() {
+ return this.closedate;
+ }
+
+ public void setClosedate(String closedate) {
+ this.closedate = closedate;
+ }
+
+ @Column(name = "LASTSAVEDTIME",length = 14)
+ public String getLastsavedtime() {
+ return lastsavedtime;
+ }
+
+ public void setLastsavedtime(String lastsavedtime) {
+ this.lastsavedtime = lastsavedtime;
+ }
+
+ @Column(name = "ADDOPERID",length = 32)
+ public String getAddoperid() {
+ return addoperid;
+ }
+
+ public void setAddoperid(String addoperid) {
+ this.addoperid = addoperid;
+ }
+
+ @Column(name = "remark",length = 255)
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/domain/TDoorcardlst.java b/src/main/java/com/supwisdom/dlpay/mainservice/domain/TDoorcardlst.java
deleted file mode 100644
index a0ef5fd..0000000
--- a/src/main/java/com/supwisdom/dlpay/mainservice/domain/TDoorcardlst.java
+++ /dev/null
@@ -1,249 +0,0 @@
-package com.supwisdom.dlpay.mainservice.domain;
-
-import javax.persistence.*;
-
-/**
- * TDoorcardlst entity. @author MyEclipse Persistence Tools
- */
-@Entity
-@Table(name = "T_DOORCARDLST")
-public class TDoorcardlst implements java.io.Serializable {
-
- // Fields
-
- private TDoorcardlstId id;
- private Integer custid;
- private Integer cardno;
- private String stuempno;
- private String custname;
- private String buildingid;
- private String buildingname;
- private String closedate;
- private String cardphyid;
- private String operflag;
- private String operid;
- private String syncstatus;
- private String synctime;
- private String updatetime;
- private String reason;
- private Integer conferenceid;
- private String usetype;
- private Integer version;
- private String regionid;
-
- // Constructors
-
- /** default constructor */
- public TDoorcardlst() {
- }
-
- public String getReason() {
- return reason;
- }
-
- public void setReason(String reason) {
- this.reason = reason;
- }
-
- /** minimal constructor */
- public TDoorcardlst(TDoorcardlstId id) {
- this.id = id;
- }
-
- public TDoorcardlst(TDoorcardlstId id, Integer custid, Integer cardno, String stuempno, String custname, String buildingid, String buildingname, String closedate, String cardphyid, String operflag, String operid, String syncstatus, String synctime, String updatetime, String reason, Integer conferenceid, String usetype, Integer version, String regionid) {
- this.id = id;
- this.custid = custid;
- this.cardno = cardno;
- this.stuempno = stuempno;
- this.custname = custname;
- this.buildingid = buildingid;
- this.buildingname = buildingname;
- this.closedate = closedate;
- this.cardphyid = cardphyid;
- this.operflag = operflag;
- this.operid = operid;
- this.syncstatus = syncstatus;
- this.synctime = synctime;
- this.updatetime = updatetime;
- this.reason = reason;
- this.conferenceid = conferenceid;
- this.usetype = usetype;
- this.version = version;
- this.regionid = regionid;
- }
-
- /** full constructor */
-
-
- // Property accessors
- @EmbeddedId
- @AttributeOverrides({
- @AttributeOverride(name = "listid", column = @Column(name = "LISTID", nullable = false, precision = 12, scale = 0)),
- @AttributeOverride(name = "factoryid", column = @Column(name = "FACTORYID", nullable = false, length = 9)),
- @AttributeOverride(name = "deviceid", column = @Column(name = "DEVICEID", nullable = false, length = 32)) })
- public TDoorcardlstId getId() {
- return this.id;
- }
-
- public void setId(TDoorcardlstId id) {
- this.id = id;
- }
-
- @Column(name = "CUSTID", precision = 9, scale = 0)
- public Integer getCustid() {
- return this.custid;
- }
-
- public void setCustid(Integer custid) {
- this.custid = custid;
- }
-
- @Column(name = "CARDNO", precision = 9, scale = 0)
- public Integer getCardno() {
- return this.cardno;
- }
-
- public void setCardno(Integer cardno) {
- this.cardno = cardno;
- }
-
- @Column(name = "STUEMPNO", length = 24)
- public String getStuempno() {
- return this.stuempno;
- }
-
- public void setStuempno(String stuempno) {
- this.stuempno = stuempno;
- }
-
- @Column(name = "CUSTNAME", length = 120)
- public String getCustname() {
- return this.custname;
- }
-
- public void setCustname(String custname) {
- this.custname = custname;
- }
-
-
-
- @Column(name = "CLOSEDATE", length = 8)
- public String getClosedate() {
- return this.closedate;
- }
-
- public void setClosedate(String closedate) {
- this.closedate = closedate;
- }
-
- @Column(name = "CARDPHYID", length = 16)
- public String getCardphyid() {
- return this.cardphyid;
- }
-
- public void setCardphyid(String cardphyid) {
- this.cardphyid = cardphyid;
- }
-
- @Column(name = "OPERFLAG", length = 1)
- public String getOperflag() {
- return this.operflag;
- }
-
- public void setOperflag(String operflag) {
- this.operflag = operflag;
- }
-
- @Column(name = "OPERID", length = 32)
- public String getOperid() {
- return this.operid;
- }
-
- public void setOperid(String operid) {
- this.operid = operid;
- }
-
- @Column(name = "SYNCSTATUS", length = 1)
- public String getSyncstatus() {
- return this.syncstatus;
- }
-
- public void setSyncstatus(String syncstatus) {
- this.syncstatus = syncstatus;
- }
-
- @Column(name = "SYNCTIME", length = 30)
- public String getSynctime() {
- return this.synctime;
- }
-
- public void setSynctime(String synctime) {
- this.synctime = synctime;
- }
-
- @Column(name = "UPDATETIME", length = 30)
- public String getUpdatetime() {
- return this.updatetime;
- }
-
- public void setUpdatetime(String updatetime) {
- this.updatetime = updatetime;
- }
-
-
-
- @Column(name = "conferenceid", length = 8)
- public Integer getConferenceid() {
- return conferenceid;
- }
-
- public void setConferenceid(Integer conferenceid) {
- this.conferenceid = conferenceid;
- }
-
- @Column(name = "usetype", length = 8)
- public String getUsetype() {
- return usetype;
- }
-
- public void setUsetype(String usetype) {
- this.usetype = usetype;
- }
-
- @Column(name = "version", precision = 9, scale = 0)
- public Integer getVersion() {
- return version;
- }
-
- public void setVersion(Integer version) {
- this.version = version;
- }
-
-
- @Column(name = "BUILDINGID",length = 32)
- public String getBuildingid() {
- return buildingid;
- }
-
- public void setBuildingid(String buildingid) {
- this.buildingid = buildingid;
- }
-
- @Column(name = "BUILDINGNAME")
- public String getBuildingname() {
- return buildingname;
- }
-
- public void setBuildingname(String buildingname) {
- this.buildingname = buildingname;
- }
-
- @Column(name = "REGIONID",length = 32)
- public String getRegionid() {
- return regionid;
- }
-
- public void setRegionid(String regionid) {
- this.regionid = regionid;
- }
-}
\ No newline at end of file
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/domain/TDoorcardlstId.java b/src/main/java/com/supwisdom/dlpay/mainservice/domain/TDoorcardlstId.java
deleted file mode 100644
index 27f35a6..0000000
--- a/src/main/java/com/supwisdom/dlpay/mainservice/domain/TDoorcardlstId.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package com.supwisdom.dlpay.mainservice.domain;
-
-
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-
-@Embeddable
-public class TDoorcardlstId implements java.io.Serializable {
-
- // Fields
-
- private Long listid;
- private String factoryid;
- private String deviceid;
-
- // Constructors
-
- /** default constructor */
- public TDoorcardlstId() {
- }
-
- /** full constructor */
- public TDoorcardlstId(Long listid, String factoryid, String deviceid) {
- this.listid = listid;
- this.factoryid = factoryid;
- this.deviceid = deviceid;
- }
-
- // Property accessors
-
- @Column(name = "LISTID", nullable = false, precision = 12, scale = 0)
- public Long getListid() {
- return this.listid;
- }
-
- public void setListid(Long listid) {
- this.listid = listid;
- }
-
- @Column(name = "FACTORYID", nullable = false, length = 9)
- public String getFactoryid() {
- return this.factoryid;
- }
-
- public void setFactoryid(String factoryid) {
- this.factoryid = factoryid;
- }
-
- @Column(name = "DEVICEID", nullable = false, length = 32)
- public String getDeviceid() {
- return this.deviceid;
- }
-
- public void setDeviceid(String deviceid) {
- this.deviceid = deviceid;
- }
-
- public boolean equals(Object other) {
- if ((this == other))
- return true;
- if ((other == null))
- return false;
- if (!(other instanceof TDoorcardlstId))
- return false;
- TDoorcardlstId castOther = (TDoorcardlstId) other;
-
- return ((this.getListid() == castOther.getListid()) || (this
- .getListid() != null && castOther.getListid() != null && this
- .getListid().equals(castOther.getListid())))
- && ((this.getFactoryid() == castOther.getFactoryid()) || (this
- .getFactoryid() != null
- && castOther.getFactoryid() != null && this
- .getFactoryid().equals(castOther.getFactoryid())))
- && ((this.getDeviceid() == castOther.getDeviceid()) || (this
- .getDeviceid() != null
- && castOther.getDeviceid() != null && this
- .getDeviceid().equals(castOther.getDeviceid())));
- }
-
- public int hashCode() {
- int result = 17;
-
- result = 37 * result
- + (getListid() == null ? 0 : this.getListid().hashCode());
- result = 37 * result
- + (getFactoryid() == null ? 0 : this.getFactoryid().hashCode());
- result = 37 * result
- + (getDeviceid() == null ? 0 : this.getDeviceid().hashCode());
- return result;
- }
-
-}
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/domain/TDoordev.java b/src/main/java/com/supwisdom/dlpay/mainservice/domain/TDoordev.java
deleted file mode 100644
index 1e880c1..0000000
--- a/src/main/java/com/supwisdom/dlpay/mainservice/domain/TDoordev.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package com.supwisdom.dlpay.mainservice.domain;
-
-import javax.persistence.*;
-
-/**
- * TDoordev entity. @author MyEclipse Persistence Tools
- */
-@Entity
-@Table(name = "T_DOORDEV")
-public class TDoordev implements java.io.Serializable {
-
- // Fields
-
- private TDoordevId id;
- private String doorname;
- private String lastupdtime;
- private String devdesc;
- private String updatetime;
- private String status;
- private String usetype;
-
- // Constructors
-
- /**
- * default constructor
- */
- public TDoordev() {
- }
-
- /**
- * minimal constructor
- */
- public TDoordev(TDoordevId id) {
- this.id = id;
- }
-
- /**
- * full constructor
- */
- public TDoordev(TDoordevId id, String doorname, String lastupdtime,
- String devdesc, String updatetime, String status, String usetype) {
- this.id = id;
- this.doorname = doorname;
- this.lastupdtime = lastupdtime;
- this.devdesc = devdesc;
- this.updatetime = updatetime;
- this.status = status;
- this.usetype = usetype;
- }
-
- // Property accessors
- @EmbeddedId
- @AttributeOverrides({
- @AttributeOverride(name = "factoryid", column = @Column(name = "FACTORYID", nullable = false, length = 9)),
- @AttributeOverride(name = "doorid", column = @Column(name = "DOORID", nullable = false, length = 32))})
- public TDoordevId getId() {
- return this.id;
- }
-
- public void setId(TDoordevId id) {
- this.id = id;
- }
-
- @Column(name = "DOORNAME", length = 300)
- public String getDoorname() {
- return this.doorname;
- }
-
- public void setDoorname(String doorname) {
- this.doorname = doorname;
- }
-
- @Column(name = "LASTUPDTIME", length = 14)
- public String getLastupdtime() {
- return this.lastupdtime;
- }
-
- public void setLastupdtime(String lastupdtime) {
- this.lastupdtime = lastupdtime;
- }
-
- @Column(name = "DEVDESC", length = 300)
- public String getDevdesc() {
- return this.devdesc;
- }
-
- public void setDevdesc(String devdesc) {
- this.devdesc = devdesc;
- }
-
- @Column(name = "UPDATETIME", length = 30)
- public String getUpdatetime() {
- return this.updatetime;
- }
-
- public void setUpdatetime(String updatetime) {
- this.updatetime = updatetime;
- }
-
- @Column(name = "STATUS", length = 1)
- public String getStatus() {
- return this.status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- @Column(name = "USETYPE", length = 6)
- public String getUsetype() {
- return this.usetype;
- }
-
- public void setUsetype(String usetype) {
- this.usetype = usetype;
- }
-}
\ No newline at end of file
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/domain/TDoordevId.java b/src/main/java/com/supwisdom/dlpay/mainservice/domain/TDoordevId.java
deleted file mode 100644
index 8f68785..0000000
--- a/src/main/java/com/supwisdom/dlpay/mainservice/domain/TDoordevId.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package com.supwisdom.dlpay.mainservice.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-
-/**
- * TDoordevId entity. @author MyEclipse Persistence Tools
- */
-@Embeddable
-public class TDoordevId implements java.io.Serializable {
-
- // Fields
-
- private String factoryid;
- private String doorid;
-
- // Constructors
-
- /** default constructor */
- public TDoordevId() {
- }
-
- /** full constructor */
- public TDoordevId(String factoryid, String doorid) {
- this.factoryid = factoryid;
- this.doorid = doorid;
- }
-
- // Property accessors
-
- @Column(name = "FACTORYID", nullable = false, length = 9)
- public String getFactoryid() {
- return this.factoryid;
- }
-
- public void setFactoryid(String factoryid) {
- this.factoryid = factoryid;
- }
-
- @Column(name = "DOORID", nullable = false, length = 32)
- public String getDoorid() {
- return this.doorid;
- }
-
- public void setDoorid(String doorid) {
- this.doorid = doorid;
- }
-
- public boolean equals(Object other) {
- if ((this == other))
- return true;
- if ((other == null))
- return false;
- if (!(other instanceof TDoordevId))
- return false;
- TDoordevId castOther = (TDoordevId) other;
-
- return ((this.getFactoryid() == castOther.getFactoryid()) || (this
- .getFactoryid() != null && castOther.getFactoryid() != null && this
- .getFactoryid().equals(castOther.getFactoryid())))
- && ((this.getDoorid() == castOther.getDoorid()) || (this
- .getDoorid() != null && castOther.getDoorid() != null && this
- .getDoorid().equals(castOther.getDoorid())));
- }
-
- public int hashCode() {
- int result = 17;
-
- result = 37 * result
- + (getFactoryid() == null ? 0 : this.getFactoryid().hashCode());
- result = 37 * result
- + (getDoorid() == null ? 0 : this.getDoorid().hashCode());
- return result;
- }
-
-}
\ No newline at end of file
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/domain/TDoordtl.java b/src/main/java/com/supwisdom/dlpay/mainservice/domain/TDoordtl.java
index 38269ec..f63ac1d 100644
--- a/src/main/java/com/supwisdom/dlpay/mainservice/domain/TDoordtl.java
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/domain/TDoordtl.java
@@ -15,20 +15,17 @@
private String transtime;
private String coldate;
private String coltime;
- private Integer cardno;
+ private String cardno;
private String cardphyid;
- private String stuempno;
- private Integer custid;
+ private String bankcardno;
+ private String custid;
private String custname;
private String status;
private String dtldesc;
private String updatetime;
private String devtype;
- private String regionid;
- private String buildingid;
private String direction;
private String directiondesc;
- private String posid;
// Constructors
@@ -41,26 +38,7 @@
this.id = id;
}
- public TDoordtl(TDoordtlId id, String transtime, String coldate, String coltime, Integer cardno, String cardphyid, String stuempno, Integer custid, String custname, String status, String dtldesc, String updatetime, String devtype, String regionid, String buildingid, String direction, String directiondesc, String posid) {
- this.id = id;
- this.transtime = transtime;
- this.coldate = coldate;
- this.coltime = coltime;
- this.cardno = cardno;
- this.cardphyid = cardphyid;
- this.stuempno = stuempno;
- this.custid = custid;
- this.custname = custname;
- this.status = status;
- this.dtldesc = dtldesc;
- this.updatetime = updatetime;
- this.devtype = devtype;
- this.regionid = regionid;
- this.buildingid = buildingid;
- this.direction = direction;
- this.directiondesc = directiondesc;
- this.posid = posid;
- }
+
/** full constructor */
@@ -107,12 +85,12 @@
this.coltime = coltime;
}
- @Column(name = "CARDNO", precision = 9, scale = 0)
- public Integer getCardno() {
+ @Column(name = "CARDNO", length = 32)
+ public String getCardno() {
return this.cardno;
}
- public void setCardno(Integer cardno) {
+ public void setCardno(String cardno) {
this.cardno = cardno;
}
@@ -125,21 +103,21 @@
this.cardphyid = cardphyid;
}
- @Column(name = "STUEMPNO", length = 24)
- public String getStuempno() {
- return this.stuempno;
+ @Column(name = "BANKCARDNO", length = 32)
+ public String getBankcardno() {
+ return this.bankcardno;
}
- public void setStuempno(String stuempno) {
- this.stuempno = stuempno;
+ public void setBankcardno(String bankcardno) {
+ this.bankcardno = bankcardno;
}
- @Column(name = "CUSTID", precision = 9, scale = 0)
- public Integer getCustid() {
+ @Column(name = "CUSTID", length = 32)
+ public String getCustid() {
return this.custid;
}
- public void setCustid(Integer custid) {
+ public void setCustid(String custid) {
this.custid = custid;
}
@@ -188,23 +166,6 @@
this.devtype = devtype;
}
- @Column(name="REGIONID",length = 32)
- public String getRegionid() {
- return regionid;
- }
-
- public void setRegionid(String regionid) {
- this.regionid = regionid;
- }
-
- @Column(name = "BUILDINGID",length = 32)
- public String getBuildingid() {
- return buildingid;
- }
-
- public void setBuildingid(String buildingid) {
- this.buildingid = buildingid;
- }
@Column(name = "DIRECTION",length = 8)
public String getDirection() {
@@ -224,14 +185,5 @@
this.directiondesc = directiondesc;
}
- @Column(name = "POSID", length = 100)
-
- public String getPosid() {
- return this.posid;
- }
-
- public void setPosid(String posid) {
- this.posid = posid;
- }
}
\ No newline at end of file
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/service/WebInterfaceService.java b/src/main/java/com/supwisdom/dlpay/mainservice/service/WebInterfaceService.java
index 896ad43..4840416 100644
--- a/src/main/java/com/supwisdom/dlpay/mainservice/service/WebInterfaceService.java
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/service/WebInterfaceService.java
@@ -1,7 +1,10 @@
package com.supwisdom.dlpay.mainservice.service;
+import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
import com.supwisdom.dlpay.mainservice.bean.TDoorcardlstInfo;
import com.supwisdom.dlpay.mainservice.bean.TDoordtlInfo;
+import com.supwisdom.dlpay.mainservice.domain.TCard;
+import com.supwisdom.dlpay.mainservice.domain.TCustomer;
import com.supwisdom.dlpay.mainservice.domain.TKey;
import com.supwisdom.dlpay.system.page.Pagination;
@@ -12,38 +15,84 @@
//获取所有厂商
public List<TKey> getAllKeys() throws Exception;
- //根据查询条件分页获取所有流水
- public Pagination getSystemCardListFrSearch(String factoryId, String allocatStartDate, String allocatEndDate,
- String doorName, String custName, String stuempNo, String syncStatus,String operFlag, String buildingid,String regionid, int pageNo, int pageSize);
- //根据查询条件分页获取管理员权限的流水
- public Pagination getOperatorCardListFrSearch(String factoryId, String allocatStartDate, String allocatEndDate,
- String doorName, String custName, String stuempNo, String syncStatus,String operFlag, String buildingid,String regionid, int pageNo, int pageSize,String operRegionid);
+ /*cardlist*********************/
- //根据查询条件获取所有导出表单信息
- public List<TDoorcardlstInfo> getSystemCardListMap(String factoryId, String allocatStartDate, String allocatEndDate,
- String doorName, String custName, String stuempNo, String syncStatus, String operFlag, String buildingid,String regionid);
+ //根据查询条件分页获取所有设备内名单信息
+ public Pagination getSystemCardListFrSearch(String allocatStartDate, String allocatEndDate,
+ String devname, String custname, String cardno, String syncflag,String operflag, String buildingid,String regionid, int pageNo, int pageSize);
- public List<TDoorcardlstInfo> getOperatorCardListMap(String factoryId, String allocatStartDate, String allocatEndDate,
- String doorName, String custName, String stuempNo, String syncStatus, String operFlag, String buildingid,String regionid,String operRegionid);
+ //根据查询条件分页获取管理员权限的设备内名单信息
+ public Pagination getOperatorCardListFrSearch(String allocatStartDate, String allocatEndDate,
+ String devname, String custname, String cardno, String syncflag,String operflag, String buildingid,String regionid, int pageNo, int pageSize,String operRegionid);
+
+ //根据查询条件分页获取楼栋管理员权限下的设备内名单信息
+ public Pagination getBuildingOperCardListFrSearch(String allocatStartDate, String allocatEndDate,
+ String devname, String custname, String cardno, String syncflag,String operflag, String buildingid,String operid, int pageNo, int pageSize);
+
+
+ //根据查询条件获取系统管理员所有导出表单信息
+ public List<TDoorcardlstInfo> getSystemCardListMap( String allocatStartDate, String allocatEndDate,
+ String devname, String custname, String cardno, String syncflag, String operflag, String buildingid,String regionid);
+
+ //根据查询条件获取区域管理员所有导出表单信息
+ public List<TDoorcardlstInfo> getOperatorCardListMap( String allocatStartDate, String allocatEndDate,
+ String devname, String custname, String cardno, String syncflag, String operflag, String buildingid,String regionid,String operRegionid);
+
+ //根据查询条件获取楼栋管理员所有导出表单信息
+ public List<TDoorcardlstInfo> getBuildingOperCardListMap( String allocatStartDate, String allocatEndDate,
+ String devname, String custname, String cardno, String syncflag, String operflag, String buildingid,String operid);
//根据名单编号将已同步的名单修改为未同步使其重新同步
public void updateDoorcardlstToNoWithIds (List<Long> listIds);
+
+ /*doordtl******************/
+
//根据查询条件获取所有导出Excel数据
- public List<TDoordtlInfo> findSystemExportExcelDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String stuempno,
- String custname, String buildingid, String regionid, String doorName, String factoryId, String streamstatus);
+ public List<TDoordtlInfo> findSystemExportExcelDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno,
+ String custname, String buildingid, String regionid, String devname, String streamstatus);
//根据查询条件获取管理员权限的Excel数据
- public List<TDoordtlInfo> findOperatorExportExcelDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String stuempno,
- String custname, String buildingid, String regionid, String doorName, String factoryId, String streamstatus,String operRegionid);
+ public List<TDoordtlInfo> findOperatorExportExcelDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno,
+ String custname, String buildingid, String regionid, String devname, String streamstatus,String operRegionid);
+
+ //根据查询条件获取楼栋管理员权限的Excel数据
+ public List<TDoordtlInfo> findBuildingOperExportExcelDoorDtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno,
+ String custname, String buildingid,String devname, String streamstatus,String operid);
//根据查询条件获取系统管理员流水数据
- public Pagination findSystemTDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String stuempno,
- String custname, String buildingid, String doorName, String factoryId, String streamstatus, int pageNo, int pageSize,String regionid);
+ public Pagination findSystemTDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno,
+ String custname, String buildingid, String devname, String streamstatus, int pageNo, int pageSize,String regionid);
- //根据查询条件获取管理员权限相应流水数据
+ //根据查询条件获取区域管理员权限相应流水数据
public Pagination findOperatorTDoordtl(
- String operid,String startTranDate, String endTranDate, String startTranTime, String endTranTime, String stuempno,
- String custname, String buildingid, String doorName, String factoryId, String streamstatus, int pageNo, int pageSize,String regionid,String operRegionid);
+ String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno,
+ String custname, String buildingid, String devname, String streamstatus, int pageNo, int pageSize,String regionid,String operRegionid);
+
+ //根据查询条件获取楼栋管理员权限相应流水数据
+ public Pagination findBuildingOperTDoordtl(
+ String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno,
+ String custname, String buildingid, String devname, String streamstatus, int pageNo, int pageSize,String operid);
+
+
+ /*customer*********************/
+
+ //根据卡号和银行卡号查询是否存在customer
+ public TCustomer findCustomerByNo(String cardno,String bankcardno);
+
+ //保存客户
+ public boolean saveCustomer(TCustomer bean);
+
+ //根据查询条件获取所有要下发的客户
+ public List<TCustomerInfo> getAllTCustomerList(String perName, String cardno, String bankcardno);
+
+
+ /*card************************/
+
+ //根据客户id获取其卡信息
+ public TCard findCardByCustid(String custid);
+
+ //保存卡信息
+ public boolean saveCard(TCard bean);
}
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/service/impl/WebInterfaceServiceImpl.java b/src/main/java/com/supwisdom/dlpay/mainservice/service/impl/WebInterfaceServiceImpl.java
index 8d8a543..cadb1d9 100644
--- a/src/main/java/com/supwisdom/dlpay/mainservice/service/impl/WebInterfaceServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/service/impl/WebInterfaceServiceImpl.java
@@ -1,10 +1,11 @@
package com.supwisdom.dlpay.mainservice.service.impl;
+import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
import com.supwisdom.dlpay.mainservice.bean.TDoorcardlstInfo;
import com.supwisdom.dlpay.mainservice.bean.TDoordtlInfo;
-import com.supwisdom.dlpay.mainservice.dao.CardListDao;
-import com.supwisdom.dlpay.mainservice.dao.DoordtlDao;
-import com.supwisdom.dlpay.mainservice.dao.KeyDao;
+import com.supwisdom.dlpay.mainservice.dao.*;
+import com.supwisdom.dlpay.mainservice.domain.TCard;
+import com.supwisdom.dlpay.mainservice.domain.TCustomer;
import com.supwisdom.dlpay.mainservice.domain.TKey;
import com.supwisdom.dlpay.mainservice.service.WebInterfaceService;
import com.supwisdom.dlpay.system.page.Pagination;
@@ -21,6 +22,10 @@
CardListDao cardListDao;
@Autowired
DoordtlDao doordtlDao;
+ @Autowired
+ CustomerDao customerDao;
+ @Autowired
+ CardDao cardDao;
@Override
public List<TKey> getAllKeys() throws Exception {
@@ -28,47 +33,94 @@
}
@Override
- public Pagination getSystemCardListFrSearch(String factoryId, String allocatStartDate, String allocatEndDate, String doorName, String custName, String stuempNo, String syncStatus, String operFlag, String buildingid,String regionid, int pageNo, int pageSize) {
- return cardListDao.getSystemCardListFrSearch(factoryId, allocatStartDate, allocatEndDate, doorName, custName, stuempNo, syncStatus, operFlag, buildingid,regionid, pageNo, pageSize);
+ public Pagination getSystemCardListFrSearch(String allocatStartDate, String allocatEndDate, String devname, String custname, String cardno, String syncflag, String operflag, String buildingid, String regionid, int pageNo, int pageSize) {
+ return cardListDao.getSystemCardListFrSearch(allocatStartDate, allocatEndDate, devname, custname, cardno, syncflag, operflag, buildingid, regionid, pageNo, pageSize);
}
@Override
- public Pagination getOperatorCardListFrSearch(String factoryId, String allocatStartDate, String allocatEndDate, String doorName, String custName, String stuempNo, String syncStatus, String operFlag, String buildingid, String regionid, int pageNo, int pageSize, String operRegionid) {
- return cardListDao.getOperatorCardListFrSearch(factoryId, allocatStartDate, allocatEndDate, doorName, custName, stuempNo, syncStatus, operFlag, buildingid, regionid, pageNo, pageSize, operRegionid);
+ public Pagination getOperatorCardListFrSearch(String allocatStartDate, String allocatEndDate, String devname, String custname, String cardno, String syncflag, String operflag, String buildingid, String regionid, int pageNo, int pageSize, String operRegionid) {
+ return cardListDao.getOperatorCardListFrSearch(allocatStartDate, allocatEndDate, devname, custname, cardno, syncflag, operflag, buildingid, regionid, pageNo, pageSize, operRegionid);
}
@Override
- public List<TDoorcardlstInfo> getSystemCardListMap(String factoryId, String allocatStartDate, String allocatEndDate, String doorName, String custName, String stuempNo, String syncStatus, String operFlag, String buildingid,String regionid) {
- return cardListDao.getSystemCardListMap(factoryId, allocatStartDate, allocatEndDate, doorName, custName, stuempNo, syncStatus, operFlag, buildingid,regionid);
+ public Pagination getBuildingOperCardListFrSearch(String allocatStartDate, String allocatEndDate, String devname, String custname, String cardno, String syncflag, String operflag, String buildingid, String operid, int pageNo, int pageSize) {
+ return cardListDao.getBuildingOperCardListFrSearch(allocatStartDate, allocatEndDate, devname, custname, cardno, syncflag, operflag, buildingid, operid, pageNo, pageSize);
}
@Override
- public List<TDoorcardlstInfo> getOperatorCardListMap(String factoryId, String allocatStartDate, String allocatEndDate, String doorName, String custName, String stuempNo, String syncStatus, String operFlag, String buildingid, String regionid, String operRegionid) {
- return cardListDao.getOperatorCardListMap(factoryId, allocatStartDate, allocatEndDate, doorName, custName, stuempNo, syncStatus, operFlag, buildingid, regionid, operRegionid);
+ public List<TDoorcardlstInfo> getSystemCardListMap(String allocatStartDate, String allocatEndDate, String devname, String custname, String cardno, String syncflag, String operflag, String buildingid, String regionid) {
+ return cardListDao.getSystemCardListMap(allocatStartDate, allocatEndDate, devname, custname, cardno, syncflag, operflag, buildingid, regionid);
}
@Override
+ public List<TDoorcardlstInfo> getOperatorCardListMap(String allocatStartDate, String allocatEndDate, String devname, String custname, String cardno, String syncflag, String operflag, String buildingid, String regionid, String operRegionid) {
+ return cardListDao.getOperatorCardListMap(allocatStartDate, allocatEndDate, devname, custname, cardno, syncflag, operflag, buildingid, regionid, operRegionid);
+ }
+
+ @Override
+ public List<TDoorcardlstInfo> getBuildingOperCardListMap(String allocatStartDate, String allocatEndDate, String devname, String custname, String cardno, String syncflag, String operflag, String buildingid, String operid) {
+ return cardListDao.getBuildingOperCardListMap(allocatStartDate, allocatEndDate, devname, custname, cardno, syncflag, operflag, buildingid, operid);
+ }
+
+
+ @Override
public void updateDoorcardlstToNoWithIds(List<Long> listIds) {
cardListDao.updateDoorcardlstToNoWithIds(listIds);
}
@Override
- public List<TDoordtlInfo> findSystemExportExcelDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String stuempno, String custname, String buildingid, String regionid, String doorName, String factoryId, String streamstatus) {
- return doordtlDao.findSystemExportExcelDoordtl(startTranDate, endTranDate, startTranTime, endTranTime, stuempno, custname, buildingid, regionid, doorName, factoryId, streamstatus);
+ public List<TDoordtlInfo> findSystemExportExcelDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno, String custname, String buildingid, String regionid, String devname, String streamstatus) {
+ return doordtlDao.findSystemExportExcelDoordtl(startTranDate, endTranDate, startTranTime, endTranTime, cardno, custname, buildingid, regionid, devname, streamstatus);
}
@Override
- public List<TDoordtlInfo> findOperatorExportExcelDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String stuempno, String custname, String buildingid, String regionid, String doorName, String factoryId, String streamstatus, String operRegionid) {
- return doordtlDao.findOperatorExportExcelDoordtl(startTranDate, endTranDate, startTranTime, endTranTime, stuempno, custname, buildingid, regionid, doorName, factoryId, streamstatus, operRegionid);
+ public List<TDoordtlInfo> findOperatorExportExcelDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno, String custname, String buildingid, String regionid, String devname, String streamstatus, String operRegionid) {
+ return doordtlDao.findOperatorExportExcelDoordtl(startTranDate, endTranDate, startTranTime, endTranTime, cardno, custname, buildingid, regionid, devname, streamstatus, operRegionid);
}
@Override
- public Pagination findSystemTDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String stuempno, String custname, String buildingid, String doorName, String factoryId, String streamstatus, int pageNo, int pageSize, String regionid) {
- return doordtlDao.findSystemTDoordtl(startTranDate, endTranDate, startTranTime, endTranTime, stuempno, custname, buildingid, doorName, factoryId, streamstatus, pageNo, pageSize, regionid);
+ public List<TDoordtlInfo> findBuildingOperExportExcelDoorDtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno, String custname, String buildingid, String devname, String streamstatus, String operid) {
+ return doordtlDao.findBuildingOperExportExcelDoorDtl(startTranDate, endTranDate, startTranTime, endTranTime, cardno, custname, buildingid, devname, streamstatus, operid);
}
@Override
- public Pagination findOperatorTDoordtl(String operid, String startTranDate, String endTranDate, String startTranTime, String endTranTime, String stuempno, String custname, String buildingid, String doorName, String factoryId, String streamstatus, int pageNo, int pageSize, String regionid,String operRegionid) {
- return doordtlDao.findOperatorTDoordtl(operid, startTranDate, endTranDate, startTranTime, endTranTime, stuempno, custname, buildingid, doorName, factoryId, streamstatus, pageNo, pageSize, regionid,operRegionid);
+ public Pagination findSystemTDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno, String custname, String buildingid, String devname, String streamstatus, int pageNo, int pageSize, String regionid) {
+ return doordtlDao.findSystemTDoordtl(startTranDate, endTranDate, startTranTime, endTranTime, cardno, custname, buildingid, devname, streamstatus, pageNo, pageSize, regionid);
+ }
+
+ @Override
+ public Pagination findOperatorTDoordtl( String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno, String custname, String buildingid, String devname, String streamstatus, int pageNo, int pageSize, String regionid, String operRegionid) {
+ return doordtlDao.findOperatorTDoordtl(startTranDate, endTranDate, startTranTime, endTranTime, cardno, custname, buildingid, devname, streamstatus, pageNo, pageSize, regionid, operRegionid);
+ }
+
+ @Override
+ public Pagination findBuildingOperTDoordtl(String startTranDate, String endTranDate, String startTranTime, String endTranTime, String cardno, String custname, String buildingid, String devname, String streamstatus, int pageNo, int pageSize, String operid) {
+ return doordtlDao.findBuildingOperTDoordtl(startTranDate, endTranDate, startTranTime, endTranTime, cardno, custname, buildingid, devname, streamstatus, pageNo, pageSize, operid);
+ }
+
+
+ @Override
+ public TCustomer findCustomerByNo(String cardno, String bankcardno) {
+ return customerDao.findCustomerByNo(cardno, bankcardno);
+ }
+
+ @Override
+ public boolean saveCustomer(TCustomer bean) {
+ return customerDao.saveCustomer(bean);
+ }
+
+ @Override
+ public List<TCustomerInfo> getAllTCustomerList(String perName, String cardno, String bankcardno) {
+ return customerDao.getAllTCustomerList(perName, cardno, bankcardno);
+ }
+
+ @Override
+ public TCard findCardByCustid(String custid) {
+ return cardDao.findCardByCustid(custid);
+ }
+
+ @Override
+ public boolean saveCard(TCard bean) {
+ return cardDao.saveCard(bean);
}
}
diff --git a/src/main/java/com/supwisdom/dlpay/ncmgr/controller/NcMgrController.java b/src/main/java/com/supwisdom/dlpay/ncmgr/controller/NcMgrController.java
index a2efe03..5e51d27 100644
--- a/src/main/java/com/supwisdom/dlpay/ncmgr/controller/NcMgrController.java
+++ b/src/main/java/com/supwisdom/dlpay/ncmgr/controller/NcMgrController.java
@@ -109,6 +109,7 @@
buildings = systemService.getBuildingByRegionId(operUser.getRegionid());
map.put("buildings", buildings);
}else if (opertype.equals("L")){
+ map.put("regions", regions);
page = ncService.getBuildingOperNcDeviceWithPage(devname, pageNo, pageSize, buildingid, devtype, operUser.getOperid());
map.put("PageResult", page);
buildings = systemService.getBuildingOperBuildings(operUser.getOperid());
@@ -374,15 +375,12 @@
TNcCardlist tNcCardlist = new TNcCardlist();
long listid = RedisUtil.incr("seq_door");
tNcCardlist.setListid(listid + "");
- tNcCardlist.setCustid(0);
- tNcCardlist.setStuempno("");
+ tNcCardlist.setCustid("");
tNcCardlist.setCustname(devid + "设备清除名单");
- tNcCardlist.setCardno(0);
+ tNcCardlist.setCardno("");
tNcCardlist.setCardphyid("FFFFFFFF");
- tNcCardlist.setDeptcode("");
- tNcCardlist.setDeptname("");
tNcCardlist.setClosedate("20991231");
- tNcCardlist.setDeviceid(devid + "");
+ tNcCardlist.setDeviceid(devid);
//清除名单专用标志
tNcCardlist.setOperflag("C");
tNcCardlist.setRectime(DateUtil.getNow());
diff --git a/src/main/java/com/supwisdom/dlpay/ncmgr/dao/NcAllottimeDao.java b/src/main/java/com/supwisdom/dlpay/ncmgr/dao/NcAllottimeDao.java
new file mode 100644
index 0000000..856d367
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/ncmgr/dao/NcAllottimeDao.java
@@ -0,0 +1,7 @@
+package com.supwisdom.dlpay.ncmgr.dao;
+
+import com.supwisdom.dlpay.ncmgr.domain.TNcAllottime;
+
+public interface NcAllottimeDao {
+ public boolean saveAllottime(TNcAllottime bean);
+}
diff --git a/src/main/java/com/supwisdom/dlpay/ncmgr/dao/NcCardListDao.java b/src/main/java/com/supwisdom/dlpay/ncmgr/dao/NcCardListDao.java
index b739b5d..947ed47 100644
--- a/src/main/java/com/supwisdom/dlpay/ncmgr/dao/NcCardListDao.java
+++ b/src/main/java/com/supwisdom/dlpay/ncmgr/dao/NcCardListDao.java
@@ -1,6 +1,7 @@
package com.supwisdom.dlpay.ncmgr.dao;
import com.supwisdom.dlpay.ncmgr.domain.TNcCardlist;
+import com.supwisdom.dlpay.system.page.Pagination;
public interface NcCardListDao {
@@ -9,4 +10,19 @@
public boolean saveCardlist(TNcCardlist bean);
public void updateForListReload(String devid);
+
+ public TNcCardlist getNcCardlist(int deviceid,String cardphyid,String timeid);
+
+ public Pagination getSystemCardList(String devname, String custname, String cardno, String syncstatus, String regionid, String allocatStartDate, String allocatEndDate,
+ String operflag, int pageNo, int pageSize);
+
+ public Pagination getOperatorCardList(String devname, String custname, String cardno, String syncstatus, String regionid, String allocatStartDate,String allocatEndDate,
+ String operflag, int pageNo, int pageSize,String operRegionid);
+
+ public Pagination getBuildingOperCardList(String devname, String custname, String cardno, String syncstatus, String allocatStartDate,String allocatEndDate,
+ String operflag, int pageNo, int pageSize,String operid);
+
+ public TNcCardlist getNcCardlistById(String id);
+
+ public boolean updateNcCardlist(TNcCardlist bean);
}
diff --git a/src/main/java/com/supwisdom/dlpay/ncmgr/dao/NcDeviceDao.java b/src/main/java/com/supwisdom/dlpay/ncmgr/dao/NcDeviceDao.java
index 9284dfe..f93e3a8 100644
--- a/src/main/java/com/supwisdom/dlpay/ncmgr/dao/NcDeviceDao.java
+++ b/src/main/java/com/supwisdom/dlpay/ncmgr/dao/NcDeviceDao.java
@@ -1,5 +1,6 @@
package com.supwisdom.dlpay.ncmgr.dao;
+import com.supwisdom.dlpay.doorlist.bean.TDoordevInfo;
import com.supwisdom.dlpay.ncmgr.domain.TBuilding;
import com.supwisdom.dlpay.ncmgr.domain.TNcDevice;
import com.supwisdom.dlpay.system.domain.TRegion;
@@ -47,4 +48,11 @@
public TNcDevice getDevByBuildingid(String buildingid);
public List<TNcDevice> findOperatorDevices(String operRegionid);
+
+
+ public List<TDoordevInfo> getSystemDevList();
+
+ public List<TDoordevInfo> getOperatorDevList(String regionid);
+
+ public List<TDoordevInfo> getBuildingOperDevList(String operid);
}
diff --git a/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcAllottimeDaoImpl.java b/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcAllottimeDaoImpl.java
new file mode 100644
index 0000000..e062d8d
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcAllottimeDaoImpl.java
@@ -0,0 +1,29 @@
+package com.supwisdom.dlpay.ncmgr.dao.impl;
+
+import com.supwisdom.dlpay.ncmgr.dao.NcAllottimeDao;
+import com.supwisdom.dlpay.ncmgr.domain.TNcAllottime;
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+@Repository
+public class NcAllottimeDaoImpl implements NcAllottimeDao {
+
+ @PersistenceContext
+ EntityManager entityManager;
+
+ @Transactional
+ @Override
+ public boolean saveAllottime(TNcAllottime bean) {
+ boolean flag=false;
+ try {
+ entityManager.persist(bean);
+ flag=true;
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ return flag;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcCardListDaoImpl.java b/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcCardListDaoImpl.java
index b53b532..0725ccb 100644
--- a/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcCardListDaoImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcCardListDaoImpl.java
@@ -1,7 +1,10 @@
package com.supwisdom.dlpay.ncmgr.dao.impl;
+import com.supwisdom.dlpay.doorlist.bean.TNcCardlistDeleteInfo;
+import com.supwisdom.dlpay.framework.util.StringUtil;
import com.supwisdom.dlpay.ncmgr.dao.NcCardListDao;
import com.supwisdom.dlpay.ncmgr.domain.TNcCardlist;
+import com.supwisdom.dlpay.system.page.Pagination;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
@@ -52,4 +55,409 @@
query.setParameter(1, devid);
query.executeUpdate();
}
+
+ @Transactional
+ @Override
+ public TNcCardlist getNcCardlist(int deviceid, String cardphyid, String timeid) {
+ String sql = "select lst from TNcCardlist as lst,TNcAllottime as t where lst.listid=t.id.listid and" +
+ " lst.deviceid=:deviceid and lst.cardphyid=:cardphyid and t.id.timeid=:timeid order by lst.listid desc";
+ TypedQuery<TNcCardlist> query = entityManager.createQuery(sql, TNcCardlist.class);
+ query.setParameter("deviceid", deviceid);
+ query.setParameter("cardphyid", cardphyid);
+ query.setParameter("timeid", timeid);
+ List<TNcCardlist> list = query.getResultList();
+ if (list!=null && list.size()>0){
+ return list.get(0);
+ }
+ return null;
+ }
+
+ @Transactional
+ @Override
+ public Pagination getSystemCardList(String devname, String custname, String cardno, String syncstatus, String regionid, String allocatStartDate, String allocatEndDate, String operflag, int pageNo, int pageSize) {
+ String sql = "select a.listid,a.devname,a.custname,a.cardno,a.bankcardno,b.opername,a.syncstatus,a.operflag,a.rectime,a.synctime " +
+ " from t_nc_cardlist a left join tn_operator b on a.operid=b.operid left join t_nc_device c on a.deviceid = c.deviceid " +
+ " where a.rectime>=:allocatStartDate and a.rectime<=:allocatEndDate and c.operflag='A' ";
+ if (!StringUtil.isEmpty(devname)){
+ sql += " and a.devname like :devname ";
+ }
+ if (!StringUtil.isEmpty(custname)){
+ sql += " and a.custname like :custname ";
+ }
+ if (!StringUtil.isEmpty(cardno)){
+ sql += " and a.cardno like :cardno ";
+ }
+ if (!StringUtil.isEmpty(syncstatus)){
+ sql += " and a.syncstatus = :syncstatus ";
+ }
+ if (!StringUtil.isEmpty(operflag)){
+ sql += " and a.operflag = :operflag ";
+ }
+ if (!StringUtil.isEmpty(regionid)){
+ sql += "and c.regionid in " +
+ "(with recursive tmp as (select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr " +
+ " where regionid= :regionid union all select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid " +
+ " ) select regionid from tmp )";
+ }
+ sql +=" order by a.listid desc " ;
+ Query query = entityManager.createNativeQuery(sql, TNcCardlistDeleteInfo.class);
+ if (!StringUtil.isEmpty(devname)){
+ query.setParameter("devname", "%"+devname+"%");
+ }
+ if (!StringUtil.isEmpty(custname)){
+ query.setParameter("custname", "%"+custname+"%");
+ }
+ if (!StringUtil.isEmpty(devname)){
+ query.setParameter("cardno", cardno);
+ }
+ if (!StringUtil.isEmpty(syncstatus)){
+ query.setParameter("syncstatus", syncstatus);
+ }
+ if (!StringUtil.isEmpty(operflag)){
+ query.setParameter("operflag", operflag);
+ }
+ if (!StringUtil.isEmpty(regionid)){
+ query.setParameter("regionid", regionid);
+ }
+ query.setParameter("allocatStartDate", allocatStartDate);
+ query.setParameter("allocatEndDate", allocatEndDate);
+ pageNo = pageNo <= 0 ? 1 : pageNo;
+ query.setFirstResult((pageNo - 1) * pageSize);
+ query.setMaxResults(pageSize);
+ Pagination page = new Pagination();
+ page.setPageNo(pageNo);
+ page.setPageSize(pageSize);
+ List<TNcCardlistDeleteInfo> list = query.getResultList();
+ page.setList(list);
+ int totalCount = getSystemCardListCount(devname,custname,cardno,syncstatus,operflag,regionid,allocatStartDate, allocatEndDate);
+ page.setTotalCount(totalCount);
+ return page;
+ }
+
+ private int getSystemCardListCount(String devname, String custname, String cardno, String syncstatus,String operflag, String regionid, String allocatStartDate, String allocatEndDate){
+ String sql = " select count(*) from t_nc_cardlist a "+
+ " left join t_nc_device c on a.deviceid = c.deviceid " +
+ " where a.rectime>=:allocatStartDate and a.rectime<=:allocatEndDate and c.operflag='A' ";
+ if (!StringUtil.isEmpty(devname)){
+ sql += " and a.devname like :devname ";
+ }
+ if (!StringUtil.isEmpty(custname)){
+ sql += " and a.custname like :custname ";
+ }
+ if (!StringUtil.isEmpty(cardno)){
+ sql += " and a.cardno like :cardno ";
+ }
+ if (!StringUtil.isEmpty(syncstatus)){
+ sql += " and a.syncstatus = :syncstatus ";
+ }
+ if (!StringUtil.isEmpty(operflag)){
+ sql += " and a.operflag = :operflag ";
+ }
+ if (!StringUtil.isEmpty(regionid)){
+ sql += "and c.regionid in " +
+ "(with recursive tmp as (select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr " +
+ " where regionid= :regionid union all select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid " +
+ " ) select regionid from tmp )";
+ }
+ Query query = entityManager.createNativeQuery(sql);
+ if (!StringUtil.isEmpty(devname)){
+ query.setParameter("devname", "%"+devname+"%");
+ }
+ if (!StringUtil.isEmpty(custname)){
+ query.setParameter("custname", "%"+custname+"%");
+ }
+ if (!StringUtil.isEmpty(devname)){
+ query.setParameter("cardno", cardno);
+ }
+ if (!StringUtil.isEmpty(syncstatus)){
+ query.setParameter("syncstatus", syncstatus);
+ }
+ if (!StringUtil.isEmpty(operflag)){
+ query.setParameter("operflag", operflag);
+ }
+ if (!StringUtil.isEmpty(regionid)){
+ query.setParameter("regionid", regionid);
+ }
+ query.setParameter("allocatStartDate", allocatStartDate);
+ query.setParameter("allocatEndDate", allocatEndDate);
+ int cnt=0;
+ List list = query.getResultList();
+ if (list!=null && list.size()>0){
+ cnt = Integer.parseInt(list.get(0).toString());
+ }
+ return cnt;
+ }
+
+ @Transactional
+ @Override
+ public Pagination getOperatorCardList(String devname, String custname, String cardno, String syncstatus, String regionid, String allocatStartDate, String allocatEndDate, String operflag, int pageNo, int pageSize, String operRegionid) {
+ String sql = "select a.listid,a.devname,a.custname,a.cardno,a.bankcardno,b.opername,a.syncstatus,a.operflag,a.rectime,a.synctime " +
+ " from t_nc_cardlist a left join tn_operator b on a.operid=b.operid left join t_nc_device c on a.deviceid = c.deviceid " +
+ " where a.rectime>=:allocatStartDate and a.rectime<=:allocatEndDate and c.operflag='A' ";
+ if (!StringUtil.isEmpty(devname)){
+ sql += " and a.devname like :devname ";
+ }
+ if (!StringUtil.isEmpty(custname)){
+ sql += " and a.custname like :custname ";
+ }
+ if (!StringUtil.isEmpty(cardno)){
+ sql += " and a.cardno like :cardno ";
+ }
+ if (!StringUtil.isEmpty(syncstatus)){
+ sql += " and a.syncstatus = :syncstatus ";
+ }
+ if (!StringUtil.isEmpty(operflag)){
+ sql += " and a.operflag = :operflag ";
+ }
+ if (!StringUtil.isEmpty(regionid)){
+ sql += "and c.regionid in "
+ +"("
+ + "with recursive tmp as "
+ + "("
+ + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr where regionid =:operRegionid "
+ + "union all "
+ + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
+ + ") select regionid from tmp where tmp.regionid=:regionid)";
+ }else {
+ sql += "and c.regionid in "
+ +"("
+ + "with recursive tmp as "
+ + "("
+ + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr where regionid =:operRegionid "
+ + "union all "
+ + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
+ + ") select regionid from tmp )";
+ }
+ sql +=" order by a.listid desc " ;
+ Query query = entityManager.createNativeQuery(sql, TNcCardlistDeleteInfo.class);
+ if (!StringUtil.isEmpty(devname)){
+ query.setParameter("devname", "%"+devname+"%");
+ }
+ if (!StringUtil.isEmpty(custname)){
+ query.setParameter("custname", "%"+custname+"%");
+ }
+ if (!StringUtil.isEmpty(devname)){
+ query.setParameter("cardno", cardno);
+ }
+ if (!StringUtil.isEmpty(syncstatus)){
+ query.setParameter("syncstatus", syncstatus);
+ }
+ if (!StringUtil.isEmpty(operflag)){
+ query.setParameter("operflag", operflag);
+ }
+ query.setParameter("operRegionid", operRegionid);
+ if (!StringUtil.isEmpty(regionid)){
+ query.setParameter("regionid", regionid);
+ }
+ query.setParameter("allocatStartDate", allocatStartDate);
+ query.setParameter("allocatEndDate", allocatEndDate);
+ pageNo = pageNo <= 0 ? 1 : pageNo;
+ query.setFirstResult((pageNo - 1) * pageSize);
+ query.setMaxResults(pageSize);
+ Pagination page = new Pagination();
+ page.setPageNo(pageNo);
+ page.setPageSize(pageSize);
+ List<TNcCardlistDeleteInfo> list = query.getResultList();
+ page.setList(list);
+ int totalCount = getOperatorCardListCount(devname,custname,cardno,syncstatus,operflag,regionid,allocatStartDate, allocatEndDate,operRegionid);
+ page.setTotalCount(totalCount);
+ return page;
+ }
+
+ private int getOperatorCardListCount(String devname, String custname, String cardno, String syncstatus,String operflag, String regionid, String allocatStartDate, String allocatEndDate,String operRegionid){
+ String sql = "select count(*) from t_nc_cardlist a " +
+ " left join t_nc_device c on a.deviceid = c.deviceid " +
+ " where a.rectime>=:allocatStartDate and a.rectime<=:allocatEndDate and c.operflag='A' ";
+ if (!StringUtil.isEmpty(devname)){
+ sql += " and a.devname like :devname ";
+ }
+ if (!StringUtil.isEmpty(custname)){
+ sql += " and a.custname like :custname ";
+ }
+ if (!StringUtil.isEmpty(cardno)){
+ sql += " and a.cardno like :cardno ";
+ }
+ if (!StringUtil.isEmpty(syncstatus)){
+ sql += " and a.syncstatus = :syncstatus ";
+ }
+ if (!StringUtil.isEmpty(operflag)){
+ sql += " and a.operflag = :operflag ";
+ }
+ if (!StringUtil.isEmpty(regionid)){
+ sql += "and c.regionid in "
+ +"("
+ + "with recursive tmp as "
+ + "("
+ + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr where regionid =:operRegionid "
+ + "union all "
+ + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
+ + ") select regionid from tmp where tmp.regionid=:regionid)";
+ }else {
+ sql += "and c.regionid in "
+ +"("
+ + "with recursive tmp as "
+ + "("
+ + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr where regionid =:operRegionid "
+ + "union all "
+ + "select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid "
+ + ") select regionid from tmp )";
+ }
+ Query query = entityManager.createNativeQuery(sql);
+ if (!StringUtil.isEmpty(devname)){
+ query.setParameter("devname", "%"+devname+"%");
+ }
+ if (!StringUtil.isEmpty(custname)){
+ query.setParameter("custname", "%"+custname+"%");
+ }
+ if (!StringUtil.isEmpty(devname)){
+ query.setParameter("cardno", cardno);
+ }
+ if (!StringUtil.isEmpty(syncstatus)){
+ query.setParameter("syncstatus", syncstatus);
+ }
+ if (!StringUtil.isEmpty(operflag)){
+ query.setParameter("operflag", operflag);
+ }
+ query.setParameter("operRegionid", operRegionid);
+ if (!StringUtil.isEmpty(regionid)){
+ query.setParameter("regionid", regionid);
+ }
+ query.setParameter("allocatStartDate", allocatStartDate);
+ query.setParameter("allocatEndDate", allocatEndDate);
+
+ int cnt=0;
+ List list = query.getResultList();
+ if (list!=null && list.size()>0){
+ cnt = Integer.parseInt(list.get(0).toString());
+ }
+ return cnt;
+ }
+
+ @Transactional
+ @Override
+ public Pagination getBuildingOperCardList(String devname, String custname, String cardno, String syncstatus, String allocatStartDate, String allocatEndDate, String operflag, int pageNo, int pageSize, String operid) {
+ String sql = "select a.listid,a.devname,a.custname,a.cardno,a.bankcardno,b.opername,a.syncstatus,a.operflag,a.rectime,a.synctime " +
+ " from t_nc_cardlist a left join tn_operator b on a.operid=b.operid left join t_nc_device c on a.deviceid = c.deviceid " +
+ " left join t_operbuilding d on d.buildingid = c.buildingid "+
+ " where a.rectime>=:allocatStartDate and a.rectime<=:allocatEndDate and c.operflag='A' and d.operid = :operid ";
+ if (!StringUtil.isEmpty(devname)){
+ sql += " and a.devname like :devname ";
+ }
+ if (!StringUtil.isEmpty(custname)){
+ sql += " and a.custname like :custname ";
+ }
+ if (!StringUtil.isEmpty(cardno)){
+ sql += " and a.cardno like :cardno ";
+ }
+ if (!StringUtil.isEmpty(syncstatus)){
+ sql += " and a.syncstatus = :syncstatus ";
+ }
+ if (!StringUtil.isEmpty(operflag)){
+ sql += " and a.operflag = :operflag ";
+ }
+ sql +=" order by a.listid desc " ;
+ Query query = entityManager.createNativeQuery(sql, TNcCardlistDeleteInfo.class);
+ if (!StringUtil.isEmpty(devname)){
+ query.setParameter("devname", "%"+devname+"%");
+ }
+ if (!StringUtil.isEmpty(custname)){
+ query.setParameter("custname", "%"+custname+"%");
+ }
+ if (!StringUtil.isEmpty(devname)){
+ query.setParameter("cardno", cardno);
+ }
+ if (!StringUtil.isEmpty(syncstatus)){
+ query.setParameter("syncstatus", syncstatus);
+ }
+ if (!StringUtil.isEmpty(operflag)){
+ query.setParameter("operflag", operflag);
+ }
+ query.setParameter("operid", operid);
+ query.setParameter("allocatStartDate", allocatStartDate);
+ query.setParameter("allocatEndDate", allocatEndDate);
+ pageNo = pageNo <= 0 ? 1 : pageNo;
+ query.setFirstResult((pageNo - 1) * pageSize);
+ query.setMaxResults(pageSize);
+ Pagination page = new Pagination();
+ page.setPageNo(pageNo);
+ page.setPageSize(pageSize);
+ List<TNcCardlistDeleteInfo> list = query.getResultList();
+ page.setList(list);
+ int totalCount = getBuildingOperCardListCount(devname,custname,cardno,syncstatus,operflag,operid,allocatStartDate, allocatEndDate);
+ page.setTotalCount(totalCount);
+ return page;
+ }
+
+ private int getBuildingOperCardListCount(String devname, String custname, String cardno, String syncstatus,String operflag, String operid, String allocatStartDate, String allocatEndDate){
+ String sql = "select count(*) from t_nc_cardlist a " +
+ " left join t_nc_device c on a.deviceid = c.deviceid " +
+ " left join t_operbuilding d on d.buildingid = c.buildingid "+
+ " where a.rectime>=:allocatStartDate and a.rectime<=:allocatEndDate and c.operflag='A' and d.operid = :operid ";
+ if (!StringUtil.isEmpty(devname)){
+ sql += " and a.devname like :devname ";
+ }
+ if (!StringUtil.isEmpty(custname)){
+ sql += " and a.custname like :custname ";
+ }
+ if (!StringUtil.isEmpty(cardno)){
+ sql += " and a.cardno like :cardno ";
+ }
+ if (!StringUtil.isEmpty(syncstatus)){
+ sql += " and a.syncstatus = :syncstatus ";
+ }
+ if (!StringUtil.isEmpty(operflag)){
+ sql += " and a.operflag = :operflag ";
+ }
+ Query query = entityManager.createNativeQuery(sql, TNcCardlistDeleteInfo.class);
+ if (!StringUtil.isEmpty(devname)){
+ query.setParameter("devname", "%"+devname+"%");
+ }
+ if (!StringUtil.isEmpty(custname)){
+ query.setParameter("custname", "%"+custname+"%");
+ }
+ if (!StringUtil.isEmpty(devname)){
+ query.setParameter("cardno", cardno);
+ }
+ if (!StringUtil.isEmpty(syncstatus)){
+ query.setParameter("syncstatus", syncstatus);
+ }
+ if (!StringUtil.isEmpty(operflag)){
+ query.setParameter("operflag", operflag);
+ }
+ query.setParameter("operid", operid);
+ query.setParameter("allocatStartDate", allocatStartDate);
+ query.setParameter("allocatEndDate", allocatEndDate);
+ int cnt=0;
+ List list = query.getResultList();
+ if (list!=null && list.size()>0){
+ cnt = Integer.parseInt(list.get(0).toString());
+ }
+ return cnt;
+ }
+
+ @Transactional
+ @Override
+ public TNcCardlist getNcCardlistById(String id) {
+ String sql = " select bean from TNcCardlist bean where bean.operflag='A' and bean.listid = :listid ";
+ TypedQuery<TNcCardlist> query = entityManager.createQuery(sql, TNcCardlist.class);
+ query.setParameter("listid", id);
+ List<TNcCardlist> list = query.getResultList();
+ if (list!=null && list.size()>0){
+ return list.get(0);
+ }
+ return null;
+ }
+
+ @Transactional
+ @Override
+ public boolean updateNcCardlist(TNcCardlist bean) {
+ boolean flag = false;
+ try {
+ entityManager.merge(bean);
+ flag = true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return flag;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcDeviceDaoImpl.java b/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcDeviceDaoImpl.java
index 46a9e9b..47b21ea 100644
--- a/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcDeviceDaoImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/ncmgr/dao/impl/NcDeviceDaoImpl.java
@@ -1,5 +1,6 @@
package com.supwisdom.dlpay.ncmgr.dao.impl;
+import com.supwisdom.dlpay.doorlist.bean.TDoordevInfo;
import com.supwisdom.dlpay.ncmgr.dao.NcDeviceDao;
import com.supwisdom.dlpay.ncmgr.domain.TBuilding;
import com.supwisdom.dlpay.ncmgr.domain.TNcDevice;
@@ -457,4 +458,39 @@
List<TNcDevice> list = query.getResultList();
return list;
}
+
+ @Transactional
+ @Override
+ public List<TDoordevInfo> getSystemDevList() {
+ String sql = "select a.deviceid,a.devname,b.regionname,a.buildingname from T_NC_device a left join tb_region b on a.regionid = b.regionid " +
+ " where a.operflag = 'A' and a.devtype='R'";
+ Query query = entityManager.createNativeQuery(sql, TDoordevInfo.class);
+ List<TDoordevInfo> list = query.getResultList();
+ return list;
+ }
+
+ @Transactional
+ @Override
+ public List<TDoordevInfo> getOperatorDevList(String regionid) {
+ String sql = "select a.deviceid,a.devname,b.regionname,a.buildingname from T_NC_device a left join tb_region b on a.regionid = b.regionid " +
+ " where a.operflag = 'A' and a.devtype='R' and a.regionid in(with recursive tmp as (select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr " +
+ " where regionid= :operRegionid union all select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid " +
+ " ) select regionid from tmp )";
+ Query query = entityManager.createNativeQuery(sql, TDoordevInfo.class);
+ query.setParameter("operRegionid", regionid);
+ List<TDoordevInfo> list = query.getResultList();
+ return list;
+ }
+
+ @Transactional
+ @Override
+ public List<TDoordevInfo> getBuildingOperDevList(String operid) {
+ String sql = "select a.deviceid,a.devname,b.regionname,a.buildingname from T_NC_device a left join tb_region b on a.regionid = b.regionid " +
+ "left join t_operbuilding c on a.buildingid=c.buildingid " +
+ "where a.operflag = 'A' and a.devtype='R' and c.operid=?1";
+ Query query = entityManager.createNativeQuery(sql, TDoordevInfo.class);
+ query.setParameter(1, operid);
+ List<TDoordevInfo> list = query.getResultList();
+ return list;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/ncmgr/domain/TNcAllottime.java b/src/main/java/com/supwisdom/dlpay/ncmgr/domain/TNcAllottime.java
new file mode 100644
index 0000000..af71384
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/ncmgr/domain/TNcAllottime.java
@@ -0,0 +1,56 @@
+package com.supwisdom.dlpay.ncmgr.domain;
+
+import javax.persistence.*;
+
+/**
+ * TNcAllottime entity. @author MyEclipse Persistence Tools
+ */
+@Entity
+@Table(name = "T_NC_ALLOTTIME")
+public class TNcAllottime implements java.io.Serializable {
+
+ // Fields
+
+ private TNcAllottimeId id;
+ private Integer deviceid;
+
+ // Constructors
+
+ /** default constructor */
+ public TNcAllottime() {
+ }
+
+ /** minimal constructor */
+ public TNcAllottime(TNcAllottimeId id) {
+ this.id = id;
+ }
+
+ /** full constructor */
+ public TNcAllottime(TNcAllottimeId id, Integer deviceid) {
+ this.id = id;
+ this.deviceid = deviceid;
+ }
+
+ // Property accessors
+ @EmbeddedId
+ @AttributeOverrides({
+ @AttributeOverride(name = "listid", column = @Column(name = "LISTID", nullable = false, length = 32)),
+ @AttributeOverride(name = "timeid", column = @Column(name = "TIMEID", nullable = false, length = 32)) })
+ public TNcAllottimeId getId() {
+ return this.id;
+ }
+
+ public void setId(TNcAllottimeId id) {
+ this.id = id;
+ }
+
+ @Column(name = "DEVICEID", nullable = false, precision = 9, scale = 0)
+ public Integer getDeviceid() {
+ return this.deviceid;
+ }
+
+ public void setDeviceid(Integer deviceid) {
+ this.deviceid = deviceid;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/supwisdom/dlpay/ncmgr/domain/TNcAllottimeId.java b/src/main/java/com/supwisdom/dlpay/ncmgr/domain/TNcAllottimeId.java
new file mode 100644
index 0000000..6b3bfca
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/ncmgr/domain/TNcAllottimeId.java
@@ -0,0 +1,76 @@
+package com.supwisdom.dlpay.ncmgr.domain;
+
+import javax.persistence.Column;
+import javax.persistence.Embeddable;
+
+/**
+ * TNcAllottimeId entity. @author MyEclipse Persistence Tools
+ */
+@Embeddable
+public class TNcAllottimeId implements java.io.Serializable {
+
+ // Fields
+
+ private String listid;
+ private String timeid;
+
+ // Constructors
+
+ /** default constructor */
+ public TNcAllottimeId() {
+ }
+
+ /** full constructor */
+ public TNcAllottimeId(String listid, String timeid) {
+ this.listid = listid;
+ this.timeid = timeid;
+ }
+
+ // Property accessors
+
+ @Column(name = "LISTID", nullable = false, length = 32)
+ public String getListid() {
+ return this.listid;
+ }
+
+ public void setListid(String listid) {
+ this.listid = listid;
+ }
+
+ @Column(name = "TIMEID", nullable = false, length = 32)
+ public String getTimeid() {
+ return this.timeid;
+ }
+
+ public void setTimeid(String timeid) {
+ this.timeid = timeid;
+ }
+
+ public boolean equals(Object other) {
+ if ((this == other))
+ return true;
+ if ((other == null))
+ return false;
+ if (!(other instanceof TNcAllottimeId))
+ return false;
+ TNcAllottimeId castOther = (TNcAllottimeId) other;
+
+ return ((this.getListid() == castOther.getListid()) || (this
+ .getListid() != null && castOther.getListid() != null && this
+ .getListid().equals(castOther.getListid())))
+ && ((this.getTimeid() == castOther.getTimeid()) || (this
+ .getTimeid() != null && castOther.getTimeid() != null && this
+ .getTimeid().equals(castOther.getTimeid())));
+ }
+
+ public int hashCode() {
+ int result = 17;
+
+ result = 37 * result
+ + (getListid() == null ? 0 : this.getListid().hashCode());
+ result = 37 * result
+ + (getTimeid() == null ? 0 : this.getTimeid().hashCode());
+ return result;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/supwisdom/dlpay/ncmgr/domain/TNcCardlist.java b/src/main/java/com/supwisdom/dlpay/ncmgr/domain/TNcCardlist.java
index db901ee..65d421f 100644
--- a/src/main/java/com/supwisdom/dlpay/ncmgr/domain/TNcCardlist.java
+++ b/src/main/java/com/supwisdom/dlpay/ncmgr/domain/TNcCardlist.java
@@ -1,9 +1,8 @@
package com.supwisdom.dlpay.ncmgr.domain;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
+import org.hibernate.annotations.GenericGenerator;
+
+import javax.persistence.*;
/**
* TNcCardlist entity. @author MyEclipse Persistence Tools
@@ -14,31 +13,23 @@
// Fields
private String listid;
- private Integer custid;
- private String stuempno;
+ private String custid;
private String custname;
- private Integer cardno;
+ private String cardno;
+ private String bankcardno;
private String cardphyid;
- private String deptcode;
- private String deptname;
private String closedate;
- private String deviceid;
+ private Integer deviceid;
private String operflag;
private String rectime;
private String synctime;
private String syncflag;
private String rtnflag;
private String rtntime;
- private Integer conferenceid;
+ private Integer version;
+ private String operid;
+ private String reason;
- @Column(name = "conferenceid", length=8)
- public Integer getConferenceid() {
- return conferenceid;
- }
-
- public void setConferenceid(Integer conferenceid) {
- this.conferenceid = conferenceid;
- }
// Constructors
/** default constructor */
@@ -50,20 +41,13 @@
this.listid = listid;
}
- /** full constructor */
- public TNcCardlist(String listid, Integer custid, String stuempno,
- String custname, Integer cardno, String cardphyid, String deptcode,
- String deptname, String closedate, String deviceid,
- String operflag, String rectime, String synctime, String syncflag,
- String rtnflag, String rtntime) {
+ public TNcCardlist(String listid, String custid, String custname, String cardno, String bankcardno, String cardphyid, String closedate, Integer deviceid, String operflag, String rectime, String synctime, String syncflag, String rtnflag, String rtntime, Integer version, String operid, String reason) {
this.listid = listid;
this.custid = custid;
- this.stuempno = stuempno;
this.custname = custname;
this.cardno = cardno;
+ this.bankcardno = bankcardno;
this.cardphyid = cardphyid;
- this.deptcode = deptcode;
- this.deptname = deptname;
this.closedate = closedate;
this.deviceid = deviceid;
this.operflag = operflag;
@@ -72,8 +56,14 @@
this.syncflag = syncflag;
this.rtnflag = rtnflag;
this.rtntime = rtntime;
+ this.version = version;
+ this.operid = operid;
+ this.reason = reason;
}
+ /** full constructor */
+
+
// Property accessors
@Id
@Column(name = "LISTID", unique = true, nullable = false, length = 32)
@@ -85,23 +75,15 @@
this.listid = listid;
}
- @Column(name = "CUSTID", precision = 9, scale = 0)
- public Integer getCustid() {
+ @Column(name = "CUSTID", length = 32)
+ public String getCustid() {
return this.custid;
}
- public void setCustid(Integer custid) {
+ public void setCustid(String custid) {
this.custid = custid;
}
- @Column(name = "STUEMPNO", length = 20)
- public String getStuempno() {
- return this.stuempno;
- }
-
- public void setStuempno(String stuempno) {
- this.stuempno = stuempno;
- }
@Column(name = "CUSTNAME", length = 60)
public String getCustname() {
@@ -112,15 +94,24 @@
this.custname = custname;
}
- @Column(name = "CARDNO", precision = 9, scale = 0)
- public Integer getCardno() {
+ @Column(name = "CARDNO", length = 32)
+ public String getCardno() {
return this.cardno;
}
- public void setCardno(Integer cardno) {
+ public void setCardno(String cardno) {
this.cardno = cardno;
}
+ @Column(name = "BANKCARDNO",length = 32)
+ public String getBankcardno() {
+ return bankcardno;
+ }
+
+ public void setBankcardno(String bankcardno) {
+ this.bankcardno = bankcardno;
+ }
+
@Column(name = "CARDPHYID", length = 20)
public String getCardphyid() {
return this.cardphyid;
@@ -130,24 +121,6 @@
this.cardphyid = cardphyid;
}
- @Column(name = "DEPTCODE", length = 20)
- public String getDeptcode() {
- return this.deptcode;
- }
-
- public void setDeptcode(String deptcode) {
- this.deptcode = deptcode;
- }
-
- @Column(name = "DEPTNAME", length = 60)
- public String getDeptname() {
- return this.deptname;
- }
-
- public void setDeptname(String deptname) {
- this.deptname = deptname;
- }
-
@Column(name = "CLOSEDATE", length = 14)
public String getClosedate() {
return this.closedate;
@@ -157,16 +130,16 @@
this.closedate = closedate;
}
- @Column(name = "DEVICEID", length = 32)
- public String getDeviceid() {
+ @Column(name = "DEVICEID", precision = 9, scale = 0)
+ public Integer getDeviceid() {
return this.deviceid;
}
- public void setDeviceid(String deviceid) {
+ public void setDeviceid(Integer deviceid) {
this.deviceid = deviceid;
}
- @Column(name = "OPERFLAG", length = 3)
+ @Column(name = "OPERFLAG", length = 1)
public String getOperflag() {
return this.operflag;
}
@@ -193,7 +166,7 @@
this.synctime = synctime;
}
- @Column(name = "SYNCFLAG", length = 3)
+ @Column(name = "SYNCFLAG", length = 1)
public String getSyncflag() {
return this.syncflag;
}
@@ -202,7 +175,7 @@
this.syncflag = syncflag;
}
- @Column(name = "RTNFLAG", length = 3)
+ @Column(name = "RTNFLAG", length = 1)
public String getRtnflag() {
return this.rtnflag;
}
@@ -220,4 +193,30 @@
this.rtntime = rtntime;
}
+ @Column(name="VERSION",length = 32)
+ public Integer getVersion() {
+ return version;
+ }
+
+ public void setVersion(Integer version) {
+ this.version = version;
+ }
+
+ @Column(name = "OPERID",length = 32)
+ public String getOperid() {
+ return operid;
+ }
+
+ public void setOperid(String operid) {
+ this.operid = operid;
+ }
+
+ @Column(name = "REASON",length = 255)
+ public String getReason() {
+ return reason;
+ }
+
+ public void setReason(String reason) {
+ this.reason = reason;
+ }
}
\ No newline at end of file
diff --git a/src/main/java/com/supwisdom/dlpay/ncmgr/service/NcService.java b/src/main/java/com/supwisdom/dlpay/ncmgr/service/NcService.java
index 923d2ad..cfb9db3 100644
--- a/src/main/java/com/supwisdom/dlpay/ncmgr/service/NcService.java
+++ b/src/main/java/com/supwisdom/dlpay/ncmgr/service/NcService.java
@@ -1,5 +1,6 @@
package com.supwisdom.dlpay.ncmgr.service;
+import com.supwisdom.dlpay.doorlist.bean.TDoordevInfo;
import com.supwisdom.dlpay.ncmgr.domain.*;
import com.supwisdom.dlpay.system.domain.TRegion;
import com.supwisdom.dlpay.system.page.Pagination;
@@ -74,6 +75,15 @@
//根据楼栋id获取设备
public TNcDevice getDevByBuildingid(String buildingid);
+ //获取系统管理员权限下所有可以分配的设备
+ public List<TDoordevInfo> getSystemDevList();
+
+ //获取区域管理员权限下所有可以分配的设备
+ public List<TDoordevInfo> getOperatorDevList(String regionid);
+
+ //获取楼栋管理员权限下所有可以分配的设备
+ public List<TDoordevInfo> getBuildingOperDevList(String operid);
+
//根据查询条件分页获取所有时间段信息
public Pagination getNcTimeWithPage(String time,int pageNo, int pageSize,Map map);
diff --git a/src/main/java/com/supwisdom/dlpay/ncmgr/service/impl/NcServiceImpl.java b/src/main/java/com/supwisdom/dlpay/ncmgr/service/impl/NcServiceImpl.java
index 495474c..d841614 100644
--- a/src/main/java/com/supwisdom/dlpay/ncmgr/service/impl/NcServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/ncmgr/service/impl/NcServiceImpl.java
@@ -1,5 +1,6 @@
package com.supwisdom.dlpay.ncmgr.service.impl;
+import com.supwisdom.dlpay.doorlist.bean.TDoordevInfo;
import com.supwisdom.dlpay.ncmgr.dao.*;
import com.supwisdom.dlpay.ncmgr.domain.*;
import com.supwisdom.dlpay.ncmgr.service.NcService;
@@ -140,6 +141,21 @@
}
@Override
+ public List<TDoordevInfo> getSystemDevList() {
+ return null;
+ }
+
+ @Override
+ public List<TDoordevInfo> getOperatorDevList(String regionid) {
+ return null;
+ }
+
+ @Override
+ public List<TDoordevInfo> getBuildingOperDevList(String operid) {
+ return null;
+ }
+
+ @Override
public Pagination getNcTimeWithPage(String time, int pageNo, int pageSize,Map map) {
Pagination page = ncTimeDao.getNcTimeWithPage(time, pageNo, pageSize);
map.put("timePage", page);
diff --git a/src/main/java/com/supwisdom/dlpay/query/controller/QueryController.java b/src/main/java/com/supwisdom/dlpay/query/controller/QueryController.java
index 924ea2e..0d217ff 100644
--- a/src/main/java/com/supwisdom/dlpay/query/controller/QueryController.java
+++ b/src/main/java/com/supwisdom/dlpay/query/controller/QueryController.java
@@ -55,13 +55,11 @@
* @throws Exception
*/
@ResponseBody
- @RequestMapping(value = "/getSearchFactoryIdList")
- public Map getSearchFactoryIdList(@AuthenticationPrincipal TOperator operUser) throws Exception {
+ @RequestMapping(value = "/getSearchIdList")
+ public Map getSearchIdList(@AuthenticationPrincipal TOperator operUser) throws Exception {
Map map = new HashMap<>();
try {
- //所有厂商
- List<TKey> allFactoryId = webInterfaceService.getAllKeys();
- map.put("allFactoryId", allFactoryId);
+
//流水状态
List<TDictionaryId> dtlStatus = systemService.findTDictionaryByType(20);
map.put("dtlStatus", dtlStatus);
@@ -74,11 +72,15 @@
buildings = ncService.getAllBuilding();
map.put("regions", regions);
map.put("buildings", buildings);
- }else if (!StringUtil.isEmpty(operUser.getRegionid())){
+ }else if (!StringUtil.isEmpty(operUser.getRegionid()) && opertype.equals("H")){
regions = systemService.getRegionListById(operUser.getRegionid());
map.put("regions", regions);
buildings = systemService.getBuildingByRegionId(operUser.getRegionid());
map.put("buildings", buildings);
+ }else if(opertype.equals("L")){
+ map.put("regions", regions);
+ buildings = systemService.getBuildingOperBuildings(operUser.getOperid());
+ map.put("buildings", buildings);
}
}catch (Exception e){
@@ -111,12 +113,11 @@
@RequestParam(value = "endTranDate", required = false, defaultValue = "") String endTranDate,
@RequestParam(value = "startTranTime", required = false, defaultValue = "000000") String startTranTime,
@RequestParam(value = "endTranTime", required = false, defaultValue = "235959") String endTranTime,
- @RequestParam(value = "stuempno", required = false, defaultValue = "") String stuempno,
+ @RequestParam(value = "cardno", required = false, defaultValue = "") String cardno,
@RequestParam(value = "custname", required = false, defaultValue = "") String custname,
@RequestParam(value = "buildingid", required = false, defaultValue = "") String buildingid,
@RequestParam(value = "regionid",required = false,defaultValue = "") String regionid,
- @RequestParam(value = "doorName", required = false, defaultValue = "") String doorName,
- @RequestParam(value = "factoryId", required = false, defaultValue = "all") String factoryId,
+ @RequestParam(value = "devname", required = false, defaultValue = "") String devname,
@RequestParam(value = "streamstatus", required = false, defaultValue = "all") String streamstatus,
@AuthenticationPrincipal TOperator operUser) {
Map map = new HashMap();
@@ -136,10 +137,12 @@
List<TDoordtlInfo> tDoordtlInfos = null;
if (!StringUtil.isEmpty(opertype) &&(opertype.equals("S")||opertype.equals("P"))) {
tDoordtlInfos = webInterfaceService.findSystemExportExcelDoordtl(startTranDate, endTranDate, startTranTime,
- endTranTime, stuempno, custname, buildingid, regionid, doorName, factoryId, streamstatus);
- }else if (!StringUtil.isEmpty(operUser.getRegionid())){
+ endTranTime, cardno, custname, buildingid, regionid, devname, streamstatus);
+ }else if (!StringUtil.isEmpty(operUser.getRegionid()) && opertype.equals("H")){
tDoordtlInfos = webInterfaceService.findOperatorExportExcelDoordtl(startTranDate, endTranDate, startTranTime,
- endTranTime, stuempno, custname, buildingid, regionid, doorName, factoryId, streamstatus,operUser.getRegionid());
+ endTranTime, cardno, custname, buildingid, regionid, devname, streamstatus,operUser.getRegionid());
+ }else if (opertype.equals("L")){
+
}
/**
* 2.设置表格属性: title:标题 sheetName:工作簿名 type:表格类型
@@ -165,11 +168,8 @@
* @param endTranDate
* @param startTranTime
* @param endTranTime
- * @param stuempno
* @param custname
* @param buildingid
- * @param doorName
- * @param factoryId
* @param streamstatus
* @param pageNo
* @param pageSize
@@ -185,11 +185,10 @@
@RequestParam(value = "endTranDate", required = false, defaultValue = "") String endTranDate,
@RequestParam(value = "startTranTime", required = false, defaultValue = "000000") String startTranTime,
@RequestParam(value = "endTranTime", required = false, defaultValue = "235959") String endTranTime,
- @RequestParam(value = "stuempno", required = false, defaultValue = "") String stuempno,
+ @RequestParam(value = "cardno", required = false, defaultValue = "") String cardno,
@RequestParam(value = "custname", required = false, defaultValue = "") String custname,
@RequestParam(value = "buildingid", required = false, defaultValue = "") String buildingid,
- @RequestParam(value = "doorName", required = false, defaultValue = "") String doorName,
- @RequestParam(value = "factoryId", required = false, defaultValue = "all") String factoryId,
+ @RequestParam(value = "devname", required = false, defaultValue = "") String devname,
@RequestParam(value = "streamstatus", required = false, defaultValue = "all") String streamstatus,
@RequestParam(value = "pageNo", required = false, defaultValue = "1") int pageNo,
@RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize,
@@ -199,9 +198,6 @@
Map map = new HashMap();
SimpleDateFormat ymd = new SimpleDateFormat("yyyyMMdd");
boolean index = true;
- if (factoryId.equals("") || factoryId == null) {
- factoryId = "all";
- }
try {
if (startTranDate.equals("Invalid date")) {
startTranDate = "";
@@ -213,10 +209,12 @@
Pagination tDoordtlInfo = new Pagination();
if (!StringUtil.isEmpty(opertype) &&(opertype.equals("S")||opertype.equals("P"))) {
tDoordtlInfo = webInterfaceService.findSystemTDoordtl(startTranDate, endTranDate, startTranTime,
- endTranTime, stuempno, custname, buildingid, doorName, factoryId, streamstatus, pageNo, pageSize,regionid);
- }else if (!StringUtil.isEmpty(operUser.getRegionid())){
- tDoordtlInfo = webInterfaceService.findOperatorTDoordtl(operUser.getOperid(), startTranDate, endTranDate, startTranTime,
- endTranTime, stuempno, custname, buildingid, doorName, factoryId, streamstatus, pageNo, pageSize, regionid,operUser.getRegionid());
+ endTranTime, cardno, custname, buildingid, devname, streamstatus, pageNo, pageSize,regionid);
+ }else if (!StringUtil.isEmpty(operUser.getRegionid()) && opertype.equals("H")){
+ tDoordtlInfo = webInterfaceService.findOperatorTDoordtl( startTranDate, endTranDate, startTranTime,
+ endTranTime, cardno, custname, buildingid, devname, streamstatus, pageNo, pageSize, regionid,operUser.getRegionid());
+ }else if (opertype.equals("L")){
+ tDoordtlInfo = webInterfaceService.findBuildingOperTDoordtl(startTranDate, endTranDate, startTranTime, endTranTime, cardno, custname, buildingid, devname, streamstatus, pageNo, pageSize, operUser.getOperid());
}
map.put("tDoordtlInfo", tDoordtlInfo);
map.put("index", index);
diff --git a/src/main/java/com/supwisdom/dlpay/system/bean/PropertiesBean.java b/src/main/java/com/supwisdom/dlpay/system/bean/PropertiesBean.java
index e991b7f..90d26f0 100644
--- a/src/main/java/com/supwisdom/dlpay/system/bean/PropertiesBean.java
+++ b/src/main/java/com/supwisdom/dlpay/system/bean/PropertiesBean.java
@@ -7,11 +7,11 @@
@Configuration
public class PropertiesBean {
- @Value("${redis.server}")
+ @Value("${spring.redis.host}")
public String host;
- @Value("${redis.port}")
+ @Value("${spring.redis.port}")
public int port;
- @Value("${redis.password}")
+ @Value("${spring.redis.password}")
public String password;
public String getHost() {
diff --git a/src/main/java/com/supwisdom/dlpay/system/dao/BuildingDao.java b/src/main/java/com/supwisdom/dlpay/system/dao/BuildingDao.java
index e351e45..5e8c865 100644
--- a/src/main/java/com/supwisdom/dlpay/system/dao/BuildingDao.java
+++ b/src/main/java/com/supwisdom/dlpay/system/dao/BuildingDao.java
@@ -36,5 +36,11 @@
public boolean saveOperBuilding(TOperbuilding bean);
+ public List<TBuilding> getAllBuildings();
+
+ public List<TBuilding> getOperatorBuildings(String regionid);
+
public List<TBuilding> getBuildingOperBuildings(String operid);
+
+
}
diff --git a/src/main/java/com/supwisdom/dlpay/system/dao/DictionaryDao.java b/src/main/java/com/supwisdom/dlpay/system/dao/DictionaryDao.java
index e2cc53e..3f1723c 100644
--- a/src/main/java/com/supwisdom/dlpay/system/dao/DictionaryDao.java
+++ b/src/main/java/com/supwisdom/dlpay/system/dao/DictionaryDao.java
@@ -24,4 +24,6 @@
public List<TDictionaryId> findByType(int type, String dicVal);
public TDictionary updateDictionary(String dicttype, String dicttypename, String dictval, String dictcaption, String oriengaltype, String oriengalval);
+
+ public List<String> findDictionaryStringByType(int type);
}
diff --git a/src/main/java/com/supwisdom/dlpay/system/dao/impl/BuildingDaoImpl.java b/src/main/java/com/supwisdom/dlpay/system/dao/impl/BuildingDaoImpl.java
index 307f3c4..726c582 100644
--- a/src/main/java/com/supwisdom/dlpay/system/dao/impl/BuildingDaoImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/system/dao/impl/BuildingDaoImpl.java
@@ -300,6 +300,29 @@
@Transactional
@Override
+ public List<TBuilding> getAllBuildings() {
+ String sql = "select bean from TBuilding bean where bean.flag = 'A' ";
+ TypedQuery<TBuilding> query = entityManager.createQuery(sql, TBuilding.class);
+ List<TBuilding> list = query.getResultList();
+ return list;
+ }
+
+ @Transactional
+ @Override
+ public List<TBuilding> getOperatorBuildings(String regionid) {
+ String sql = "select a.buildingid,a.buildingname,a.synctime,a.updtime,a.flag,a.buildingdesc,a.regionid from t_building a " +
+ " left join tb_region b on a.regionid=b.regionid " +
+ " where a.flag = 'A' and b.regionid in(with recursive tmp as (select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr " +
+ " where regionid= :operRegionid union all select tbr.regionid,tbr.parentid,tbr.regionname from tb_region tbr inner join tmp t on t.regionid=tbr.parentid " +
+ " ) select regionid from tmp )";
+ Query query = entityManager.createNativeQuery(sql, TBuilding.class);
+ query.setParameter("operRegionid", regionid);
+ List<TBuilding> list = query.getResultList();
+ return list;
+ }
+
+ @Transactional
+ @Override
public List<TBuilding> getBuildingOperBuildings(String operid) {
String sql = "select bean.buildingid,bean.buildingname,bean.synctime,bean.updtime,bean.flag,bean.buildingdesc,bean.regionid " +
" from T_Building bean " +
diff --git a/src/main/java/com/supwisdom/dlpay/system/dao/impl/DictionaryDaoImpl.java b/src/main/java/com/supwisdom/dlpay/system/dao/impl/DictionaryDaoImpl.java
index 0b64720..9e8e002 100644
--- a/src/main/java/com/supwisdom/dlpay/system/dao/impl/DictionaryDaoImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/system/dao/impl/DictionaryDaoImpl.java
@@ -6,6 +6,7 @@
import com.supwisdom.dlpay.system.domain.TDictionaryId;
import com.supwisdom.dlpay.system.page.Pagination;
import org.hibernate.transform.Transformers;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
@@ -119,6 +120,7 @@
@Transactional
@Override
+ //@Cacheable(cacheNames = "dicationary_cache", key = "#p0")
public List<TDictionaryId> findTDictionaryByType(int type) {
String sql = "select bean.id from TDictionary bean where bean.id.dicttype=?1";
Query query = entityManager.createQuery(sql,TDictionaryId.class);
@@ -138,7 +140,7 @@
}else if (opertype.equals("H")){
sql +=" and bean.id.dictval<>'P' and bean.id.dictval<>'S' and bean.id.dictval<>'H'";
}else {
- return null;
+ sql +=" and bean.id.dictval == 'L'";
}
TypedQuery<TDictionaryId> query = entityManager.createQuery(sql, TDictionaryId.class);
List<TDictionaryId> list = query.getResultList();
@@ -171,4 +173,15 @@
queryObject.executeUpdate();
return null;
}
+
+ @Transactional
+ @Override
+ @Cacheable(cacheNames = "dicationaryString_cache", key = "#p0")
+ public List<String> findDictionaryStringByType(int type) {
+ String sql = "select a.dictval || '_' || a.dictcaption as str from t_dictionary a where a.dicttype=?1";
+ Query query = entityManager.createNativeQuery(sql);
+ query.setParameter(1, type);
+ List list = query.getResultList();
+ return list;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/system/service/SystemService.java b/src/main/java/com/supwisdom/dlpay/system/service/SystemService.java
index 1cf4ced..ca2ba46 100644
--- a/src/main/java/com/supwisdom/dlpay/system/service/SystemService.java
+++ b/src/main/java/com/supwisdom/dlpay/system/service/SystemService.java
@@ -110,6 +110,12 @@
//保存操作员分配的楼栋
public boolean saveOperBuilding(TOperbuilding bean);
+ //获取所有楼栋信息
+ public List<TBuilding> getAllBuildings();
+
+ //获取区域管理员权限下的所有楼栋信息
+ public List<TBuilding> getOperatorBuildings(String regionid);
+
//获取楼栋管理员权限下的楼栋
public List<TBuilding> getBuildingOperBuildings(String operid);
}
diff --git a/src/main/java/com/supwisdom/dlpay/system/service/impl/SystemServiceImpl.java b/src/main/java/com/supwisdom/dlpay/system/service/impl/SystemServiceImpl.java
index 44c31e5..d969dd6 100644
--- a/src/main/java/com/supwisdom/dlpay/system/service/impl/SystemServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/system/service/impl/SystemServiceImpl.java
@@ -200,6 +200,16 @@
}
@Override
+ public List<TBuilding> getAllBuildings() {
+ return buildingDao.getAllBuildings();
+ }
+
+ @Override
+ public List<TBuilding> getOperatorBuildings(String regionid) {
+ return buildingDao.getOperatorBuildings(regionid);
+ }
+
+ @Override
public List<TBuilding> getBuildingOperBuildings(String operid) {
return buildingDao.getBuildingOperBuildings(operid);
}
diff --git a/src/main/kotlin/com/supwisdom/dlpay/DoorApplication.kt b/src/main/kotlin/com/supwisdom/dlpay/DoorApplication.kt
index 0a65a26..11956f3 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/DoorApplication.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/DoorApplication.kt
@@ -4,6 +4,7 @@
import org.springframework.beans.factory.annotation.Value
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
+import org.springframework.boot.web.servlet.ServletComponentScan
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.data.redis.connection.RedisConnectionFactory
@@ -22,16 +23,16 @@
@EnableRedisRepositories
class AppConfig {
- @Value("\${redis.server}")
+ @Value("\${spring.redis.host}")
lateinit var server: String
- @Value("\${redis.port}")
+ @Value("\${spring.redis.port}")
var port: Int = 0
- @Value("\${redis.database}")
+ @Value("\${spring.redis.database}")
var database: Int = 0
- @Value("\${redis.password}")
+ @Value("\${spring.redis.password}")
lateinit var password: String
@Bean
@@ -67,6 +68,7 @@
@SpringBootApplication
@EnableScheduling
+@ServletComponentScan
class DoorApplication
fun main(args: Array<String>) {
diff --git a/src/main/kotlin/com/supwisdom/dlpay/framework/controller/security_controller.kt b/src/main/kotlin/com/supwisdom/dlpay/framework/controller/security_controller.kt
index 9880233..2aa6ac2 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/framework/controller/security_controller.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/framework/controller/security_controller.kt
@@ -1,5 +1,6 @@
package com.supwisdom.dlpay.framework.controller
+import com.google.code.kaptcha.Producer
import com.supwisdom.dlpay.framework.ResponseBodyBuilder
import com.supwisdom.dlpay.framework.core.JwtConfig
import com.supwisdom.dlpay.framework.core.JwtTokenUtil
@@ -33,6 +34,7 @@
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import org.springframework.web.context.request.ServletWebRequest
+import java.lang.Exception
import java.util.*
import javax.imageio.ImageIO
import javax.servlet.http.HttpServletRequest
@@ -165,11 +167,30 @@
@RestController
class ValidateCodeController {
+ @Autowired
+ private lateinit var captchaProducer: Producer
+
@GetMapping("/code/image")
fun createCode(request: HttpServletRequest, response: HttpServletResponse) {
val imageCode = VerifyCode(60)
HttpSessionSessionStrategy().setAttribute(ServletWebRequest(request), ImageCodeUtil.LOGIN_IMAGECODE_SESSIONKEY, imageCode)
- ImageIO.write(imageCode.image, "JPEG", response.outputStream)
+ val session = request.session
+ response.setDateHeader("Expires", 0)
+ response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate")
+ response.addHeader("Cache-Control", "post-check=0, pre-check=0")
+ response.setHeader("Pragma", "no-cache")
+ response.contentType = "image/jpeg"
+ //生成验证码
+ val capText = captchaProducer.createText()
+ session.setAttribute(com.google.code.kaptcha.Constants.KAPTCHA_SESSION_KEY, capText)
+ //向客户端写出
+ val bi = captchaProducer.createImage(capText);
+ ImageIO.write(bi, "JPEG", response.outputStream)
+ try {
+ response.outputStream.flush()
+ } catch (ex: Exception) {
+ response.outputStream.close()
+ }
}
}
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 9924c65..b17f28c 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -24,6 +24,11 @@
spring.thymeleaf.mode=HTML5
spring.thymeleaf.cache=false
spring.thymeleaf.enabled=true
+################## 全局字符编码设置 ######################
+spring.http.encoding.force=true
+spring.http.encoding.charset=UTF-8
+spring.http.encoding.enabled=true
+server.tomcat.uri-encoding=UTF-8
################################################
# user password
diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql
index 1f115ef..a10fe24 100644
--- a/src/main/resources/data.sql
+++ b/src/main/resources/data.sql
@@ -10,8 +10,8 @@
INSERT INTO t_dictionary(dicttype,dicttypename,dictval,dictcaption) VALUES (2, '操作标志', 'L', '挂失');
INSERT INTO t_dictionary(dicttype,dicttypename,dictval,dictcaption) VALUES (2, '操作标志', 'C', '注销');
INSERT INTO t_dictionary(dicttype,dicttypename,dictval,dictcaption) VALUES (1, 'operator', 'S', '系统管理员');
-INSERT INTO t_dictionary(dicttype,dicttypename,dictval,dictcaption) VALUES (3, '同步状态', '0', '未同步');
-INSERT INTO t_dictionary(dicttype,dicttypename,dictval,dictcaption) VALUES (3, '同步状态', '1', '同步');
+INSERT INTO t_dictionary(dicttype,dicttypename,dictval,dictcaption) VALUES (3, '同步状态', 'N', '未同步');
+INSERT INTO t_dictionary(dicttype,dicttypename,dictval,dictcaption) VALUES (3, '同步状态', 'Y', '同步');
INSERT INTO t_dictionary(dicttype,dicttypename,dictval,dictcaption) VALUES (8, '设备类型', 'C', '控制器');
INSERT INTO t_dictionary(dicttype,dicttypename,dictval,dictcaption) VALUES (8, '设备类型', 'R', '读头');
INSERT INTO t_dictionary(dicttype,dicttypename,dictval,dictcaption) VALUES (9, '平台IP,发送请求用', 'http://localhost:8080/door', '平台IP地址');
diff --git a/src/main/resources/templates/doorlist/addDoorlist.html b/src/main/resources/templates/doorlist/addDoorlist.html
index f34e5ed..e1c3efc 100644
--- a/src/main/resources/templates/doorlist/addDoorlist.html
+++ b/src/main/resources/templates/doorlist/addDoorlist.html
@@ -7,20 +7,18 @@
</span>
</div>
<div class="layui-card-body">
- <div id="indexapp">
+ <div id="addDoorlistapp">
<template>
<el-steps :active="step" style="margin-top: 20px;margin-left: 12%">
<el-step title="选择人员" ></el-step>
- <el-step title="选择设备组" ></el-step>
<el-step title="选择门禁设备" ></el-step>
<el-step title="选择时间段" ></el-step>
- <el-step title="选择节假日" ></el-step>
<el-step title="下发成功" ></el-step>
</el-steps>
</template>
<!--人员选择-->
- <div id="personSelect">
+ <div id="addDoorlist_personSelect">
<div class="x_panel" style="margin-left: 1%;width: 98%;float: left;">
<div style="height: 60px;border-left: 1px solid #dfe6ec;border-right: 1px solid #dfe6ec;">
<el-col :span="22" :offset="1" >
@@ -30,31 +28,14 @@
<el-col :span="20"><el-input placeholder="请输入内容" size="mini" v-model="person_person.custname"></el-input></el-col>
</el-col>
<el-col :span="12">
- <el-col :span="3"><lable>学/工号:</lable></el-col>
- <el-col :span="21"><el-input placeholder="输入%进行模糊查询" size="mini" v-model="person_person.stuempno"></el-input></el-col>
+ <el-col :span="3"><lable>卡号:</lable></el-col>
+ <el-col :span="21"><el-input placeholder="输入%进行模糊查询" size="mini" v-model="person_person.cardno"></el-input></el-col>
</el-col>
</el-row>
<el-row :span="24">
<el-col :span="12">
- <el-col :span="3"><lable>部门:</lable></el-col>
- <el-col :span="20"><el-input placeholder="请输入内容" size="mini" v-model="person_person.deptname"></el-input></el-col>
- </el-col>
- <el-col :span="12">
- <el-col :span="3"><lable>班级:</lable></el-col>
- <el-col :span="21"><el-input placeholder="请输入内容" size="mini" v-model="person_person.classname" ></el-input></el-col>
- </el-col>
- </el-row>
- <el-row :span="24">
- <el-col :span="12">
- <el-col :span="3"><lable>类别:</lable></el-col>
- <el-select v-model="person_person.feetype" size="mini" clearable placeholder="请选择">
- <el-option
- v-for="type in feetypes"
- :key="type.value"
- :label="type.label"
- :value="type.value">
- </el-option>
- </el-select>
+ <el-col :span="4"><lable>银行卡号:</lable></el-col>
+ <el-col :span="19"><el-input placeholder="输入%进行模糊查询" size="mini" v-model="person_person.bankcardno"></el-input></el-col>
</el-col>
<el-col :span="12">
<el-col :span="3" :offset="3">
@@ -65,12 +46,12 @@
</el-col>
</div>
</div>
- <div id="personSel">
+ <div id="addDoorlist_personSel">
<div class="x_panel" style="margin-left: 1%;width: 45%;float: left">
<div class="x_title" style="margin-bottom: 10px">
- 未分配人员({{person_lefttable.length}}人)
+ <!--未分配人员({{person_lefttable.length}}人)-->
</div>
- <div id="pensonS-tb">
+ <div id="addDoorlist_pensonS-tb">
<template>
<el-table
@@ -88,25 +69,20 @@
width="55">
</el-table-column>
<el-table-column
- prop="stuempno"
- label="学/工号"
- width="140">
+ prop="cardno"
+ label="卡号"
+ width="160">
</el-table-column>
<el-table-column
sortable
prop="custname"
label="姓名"
- width="140">
- </el-table-column>
- <el-table-column
- prop="deptname"
- label="部门"
width="120">
</el-table-column>
<el-table-column
- prop="classname"
- label="班级"
- width="140">
+ prop="bankcardno"
+ label="银行卡号"
+ width="160">
</el-table-column>
</el-table>
</template>
@@ -124,7 +100,7 @@
<div class="x_panel" style="margin-right: 1%;width: 47%;float: right">
<div class="x_title" style="margin-bottom: 10px">
- 已分配人员({{person_righttable.length}}人)
+ <!--已分配人员({{person_righttable.length}}人)-->
</div>
<template>
<el-table
@@ -142,35 +118,30 @@
width="55">
</el-table-column>
<el-table-column
- prop="stuempno"
- label="学/工号"
- width="140">
+ prop="cardno"
+ label="卡号"
+ width="160">
</el-table-column>
<el-table-column
sortable
prop="custname"
label="姓名"
- width="140">
- </el-table-column>
- <el-table-column
- prop="deptname"
- label="部门"
width="120">
</el-table-column>
<el-table-column
- prop="classname"
- label="班级"
- width="140">
+ prop="bankcardno"
+ label="银行卡号"
+ width="160">
</el-table-column>
</el-table>
</template>
</div>
</div>
- <div id="excelTable" style="display:none;padding: 10px 0 0 0;width: 100%;float: left;">
+ <div id="addDoorlist_excelTable" style="display:none;padding: 10px 0 0 0;width: 100%;float: left;">
<div style="width:100%;padding:0 10px;font-size: 16px">
- <p>已查询到<span style="color:#ff9900" id="queryNumId"></span>条数据<el-tag type="info">文件路径:<span id="fileNameId"></span></el-tag></p>
- <span>未查询到<span style="color:#ff9900" id="queryNoNumId"></span>条数据,具体如下:</span>
+ <p>已查询到<span style="color:#ff9900" id="addDoorlist_queryNumId"></span>条数据<el-tag type="info">文件路径:<span id="addDoorlist_fileNameId"></span></el-tag></p>
+ <span>未查询到<span style="color:#ff9900" id="addDoorlist_queryNoNumId"></span>条数据,具体如下:</span>
</div>
<template>
<el-table
@@ -182,26 +153,14 @@
stripe
border>
<el-table-column
- prop="stuempno"
- label="学/工号">
+ prop="cardno"
+ label="卡号">
</el-table-column>
<el-table-column
sortable
prop="custname"
label="姓名">
</el-table-column>
- <el-table-column
- prop="deptfullname"
- label="部门">
- </el-table-column>
- <el-table-column
- prop="specialtycode"
- label="专业">
- </el-table-column>
- <el-table-column
- prop="classname"
- label="班级">
- </el-table-column>
</el-table>
</template>
</div>
@@ -209,24 +168,24 @@
<div style="width:80%;float: left;margin-top: auto;margin-right: 50%;">
备注 :<el-input size="small" v-model="person_reason" style="width: 40%" placeholder="输入下发设备名单的原因等备注信息"></el-input>
</div>
- <div style="float:left;border-top:solid 1px #e0e0e0; width:100%; height:30px; margin-top:10px;padding-top:10px; font-size: 14px!important;">
- <form action="${pageContext.request.contextPath}/doorlistMgr/addexcel" method="post" style="width: 60%;float:left;" id="uploadExcelId" name="formUpload" enctype="multipart/form-data" target="_top">
+ <!--<div style="float:left;border-top:solid 1px #e0e0e0; width:100%; height:30px; margin-top:10px;padding-top:10px; font-size: 14px!important;">
+ <form action="${pageContext.request.contextPath}/doorlistMgr/addexcel" method="post" style="width: 60%;float:left;" id="addDoorlist_uploadExcelId" name="formUpload" enctype="multipart/form-data" target="_top">
表单:<el-input size="small" v-model="per_sheetname" name="sheetname" style="width: 30%;"></el-input>
- <el-button size="small" type="primary" @click="person_openExcel">打开Excel<i class="el-icon-upload el-icon--right"></i></el-button>
+ <el-button size="small" type="primary" @click="person_openExcel">打开Excel<i class="el-icon-upload el-icon--right"></i></el-button>
文件路径:<el-input size="small" v-model="textfield" name="textfield" style="width: 30%;"></el-input>
- <input type="file" name="file" style="display: none" id="filePath" onchange="vue.textfield=this.value" />
+ <input type="file" name="file" style="display: none" id="filePath" onchange="addDoorlist_vue.textfield=this.value" />
</form>
<el-button size="small" type="primary" @click="person_inExcel">导入查询</el-button>
- <el-button size="small" type="primary" id="perImportBack" style="display: none" @click="perImporReturn">返回</el-button>
+ <el-button size="small" type="primary" id="addDoorlist_perImportBack" style="display: none" @click="perImporReturn">返回</el-button>
<el-button size="small" type="primary" @click="downloadExcel">导入模板下载</el-button>
- </div>
+ </div>-->
<div style="float:left;margin:10px 0 0 40%;"><el-button style="margin-top: 12px;" @click="per_nextStep">下一步</el-button></div>
</div>
<!--选择设备组-->
- <div style="display:none;margin-top:15px ;width:100%; font-size: 14px!important; " id="devGrpSelect">
+ <!--<div style="display:none;margin-top:15px ;width:100%; font-size: 14px!important; " id="devGrpSelect">
<div style="padding:12px 13px;font-size: 14px!important;" id="selectDevGrp-tb" >
<div style="width:100%;margin-top:15px" >
@@ -286,26 +245,37 @@
<el-button style="margin-top: 12px;" @click="devGrpUpstep">上一步</el-button>
<el-button style="margin-top: 12px;" @click="devGrpNextstep">下一步</el-button>
</div>
- </div>
+ </div>-->
<!--选择设备-->
- <div id="deviceSelect" style="display: none">
+ <div id="addDoorlist_deviceSelect" style="display: none">
<div class="x_panel" style="margin-left: 1%;width: 98%;float: left;">
<div style="height: 20px;border-left: 1px solid #dfe6ec;border-right: 1px solid #dfe6ec;">
<el-col>
<el-row :span="24">
- <el-col :span="9" :offset="2">
- 厂商:
- <el-select v-model="device.factoryId" size="mini" clearable placeholder="请选择">
+ <el-col :span="6" >
+ 区域:
+ <el-select v-model="device.regionid" size="mini" clearable placeholder="请选择">
<el-option
- v-for="id in factoryIds"
- :key="id.value"
- :label="id.label"
- :value="id.value">
+ v-for="regionid in regions"
+ :key="regionidid.value"
+ :label="regionid.label"
+ :value="regionid.value">
</el-option>
</el-select>
</el-col>
- <el-col :span="9">
+ <el-col :span="6" >
+ 楼栋:
+ <el-select v-model="device.buildingid" size="mini" clearable placeholder="请选择">
+ <el-option
+ v-for="buildingid in buildings"
+ :key="buildingid.value"
+ :label="buildingid.label"
+ :value="buildingid.value">
+ </el-option>
+ </el-select>
+ </el-col>
+ <el-col :span="6">
<el-col :span="5"><lable>设备名称:</lable></el-col>
<el-col :span="14"><el-input placeholder="请输入内容" size="mini" v-model="device.deviceName" ></el-input></el-col>
</el-col>
@@ -318,7 +288,7 @@
</div>
<div class="x_panel" style="margin-left: 1%;width: 45%;float: left">
<div class="x_title">
- 未分配设备({{device_lefttable.length}}台)
+ <!--未分配设备({{device_lefttable.length}}台)-->
</div>
<template>
<el-table
@@ -336,20 +306,25 @@
width="55">
</el-table-column>
<el-table-column
- prop="factoryname"
- label="厂商"
- width="100">
- </el-table-column>
- <el-table-column
sortable
- prop="doorname"
+ prop="devname"
label="设备名称"
width="150">
</el-table-column>
<el-table-column
- prop="doorid"
+ prop="deviceid"
label="设备编号">
</el-table-column>
+ <el-table-column
+ prop="regionname"
+ label="区域"
+ width="150">
+ </el-table-column>
+ <el-table-column
+ prop="buildingname"
+ label="楼栋"
+ width="150">
+ </el-table-column>
</el-table>
</template>
</div>
@@ -365,7 +340,7 @@
<div class="x_panel" style="margin-right: 1%;width: 47%;float: right">
<div class="x_title">
- 已分配设备({{device_righttable.length}}台)
+ <!--已分配设备({{device_righttable.length}}台)-->
</div>
<template>
<el-table
@@ -383,32 +358,37 @@
width="55">
</el-table-column>
<el-table-column
- prop="factoryname"
- label="厂商"
- width="100">
- </el-table-column>
- <el-table-column
sortable
- prop="doorname"
+ prop="devname"
label="设备名称"
width="150">
</el-table-column>
<el-table-column
- prop="doorid"
+ prop="deviceid"
label="设备编号">
</el-table-column>
+ <el-table-column
+ prop="regionname"
+ label="区域"
+ width="150">
+ </el-table-column>
+ <el-table-column
+ prop="buildingname"
+ label="楼栋"
+ width="150">
+ </el-table-column>
</el-table>
</template>
</div>
<div style="float:left;margin:10px 0 0 40%;">
- <el-button style="margin-top: 12px;" @click="devToDevGrp">上一步</el-button>
+ <el-button style="margin-top: 12px;" @click="devToUpStep">上一步</el-button>
<el-button style="margin-top: 12px;" @click="devNextStep">下一步</el-button>
</div>
</div>
<!--时间段选择-->
- <dev id="timeSelect" style="margin-top:15px ;width:100%; font-size: 14px!important;display:none; ">
- <div style="padding:12px 13px;font-size: 14px!important;" id="selectTime-tb" >
+ <dev id="addDoorlist_timeSelect" style="margin-top:15px ;width:100%; font-size: 14px!important;display:none; ">
+ <div style="padding:12px 13px;font-size: 14px!important;" id="addDoorlist_selectTime-tb" >
<div style="width:100%">
<el-row>
时间段名称:<el-input size="small" v-model="timeName" style="width: 30%;"></el-input>
@@ -427,8 +407,8 @@
{{tag}}
</el-tag>
</div>
- <div style="width:100%;color:#ff9900; margin-top:10px" id="timeSelect_remark">
- 注:时间段为必选项,不选择不能下发设备名单。若所选厂商为披克,则只能选择一个时间段!
+ <div style="width:100%;color:#ff9900; margin-top:10px" id="addDoorlist_timeSelect_remark">
+ 注:时间段为必选项,不选择不能下发设备名单。
</div>
</div>
<template>
@@ -441,25 +421,17 @@
@row-click="timeRowClick"
style="width: 100%;"
max-height="2000">
-
<el-table-column
- prop="factoryname"
- label="厂商"
- width="200">
+ prop="weekid"
+ label="时间段id"
+ width="150">
</el-table-column>
<el-table-column
- prop="timename"
+ prop="weekname"
label="时间段名称"
width="300">
</el-table-column>
- <el-table-column
- prop="lastupdtime"
- label="同步时间"
- width="260">
- </el-table-column>
- <el-table-column
- prop="timedesc"
- label="说明">
+
</el-table-column>
</el-table>
@@ -477,13 +449,13 @@
<div style="float:left;margin:10px 0 0 40%;">
<el-button style="margin-top: 12px;" @click="timeToDev">上一步</el-button>
- <el-button style="margin-top: 12px;" @click="timeNextStep">下一步</el-button>
+ <el-button style="margin-top: 12px;" @click="timeNextStep">下发设备名单</el-button>
</div>
</dev>
<!--节假日选择-->
- <div style="display:none;margin-top:15px;width:96%; font-size: 14px!important;" id="holidaySelect">
+ <!--<div style="display:none;margin-top:15px;width:96%; font-size: 14px!important;" id="holidaySelect">
<div style="padding:12px 13px;font-size: 14px!important;" id="selectHoliday-tb" >
<div style="width:100%;margin-top:15px">
已选节假日:<el-tag
@@ -549,34 +521,28 @@
<el-button style="margin-top: 12px;" @click="holNextStep">下发设备名单</el-button>
</div>
+ </div>-->
- </div>
-
- <div style="margin-top:15px;width:96%; font-size: 14px!important;display:none;" id="postSucess">
+ <div style="margin-top:15px;width:96%; font-size: 14px!important;display:none;" id="addDoorlist_postSucess">
<div style="border-top:solid 1px #909090; min-height:1px; margin-top:10px;padding-top:10px; font-size: 14px!important;">
<div style="margin-left:200px;height: 31px;">
<div style="color:#f60;width:167px;height:28px; font-size:20px;float: left;">您已成功下发名单!</div>
<el-button size="small" style="line-height:10px;overflow:hidden;height: 23px;margin-top: 3px;" type="primary" @click="rePush">继续下发设备名单</el-button>
</div>
-
+ <!--<div style="margin:10px 0 0 200px; ">
+ 该设备名单的部分明细内容:人员 <span style="color:#f60" id="postSuc_perNum">{{addDoorlist_vue.person_righttable.length + parseInt(addDoorlist_vue.personSel_excelNum)}}</span>个,
+ 设备<span style="color:#f60" id="postSuc_devNum">{{addDoorlist_vue.devSel_allocated.length}}</span>个,
+ 时间段<span style="color:#f60" id="postSuc_timeNum">{{addDoorlist_vue.timeTags.length}}</span>个。
+ </div>-->
<el-card class="box-card">
<el-collapse v-model="postCollapse">
- <el-collapse-item :title="devgrpTitle" name="1">
- <el-tag
- :key="tag"
- v-for="tag in devGrpTags"
- type="primary"
- size="medium">
- {{tag}}
- </el-tag>
- </el-collapse-item>
<el-collapse-item :title="devTitle" name="2">
<el-tag
:key="tag"
v-for="tag in devSel_allocated"
type="primary"
size="medium">
- {{tag.doorname}}
+ <!--{{tag.doorname}}-->
</el-tag>
</el-collapse-item>
<el-collapse-item :title="timeTitle" name="3">
@@ -585,16 +551,7 @@
v-for="tag in timeTags"
type="primary"
size="medium">
- {{tag}}
- </el-tag>
- </el-collapse-item>
- <el-collapse-item :title="holiTitle" name="4">
- <el-tag
- :key="tag"
- v-for="tag in holidayTags"
- type="primary"
- size="medium">
- {{tag}}
+ <!--{{tag}}-->
</el-tag>
</el-collapse-item>
</el-collapse>
@@ -606,12 +563,11 @@
</div>
<script>
- var vue = new Vue({
- el:"#indexapp",
+ var addDoorlist_vue = new Vue({
+ el:"#addDoorlistapp",
data:{
step:1,
//人员选择部分
- feetypes:[],
person_reason:'',
person_lefttable:[],
person_righttable:[],
@@ -624,17 +580,15 @@
textfield:'',
person_person:{
custname:'',
- stuempno:'',
- classname:'',
- deptname:'',
- feetype:''
+ cardno:'',
+ bankcardno:''
},
personSel_excelNum:0,
personSel_excelInfo:'',
reason:'',
perSel_allocated:[],
//设备组选择部分
- devGrpTags:[],
+ /* devGrpTags:[],
devgrpSel_selectedGrpId:[],
devGrpTable:[],
devgrppageSize:10,
@@ -644,19 +598,21 @@
groupName:'',
devgrpSel_index:true,
devSel_factoryId:'',
- usetype:'',
+ usetype:'',*/
//设备选择部分
device_lefttable:[],
device_righttable:[],
deviceLeftSelection:[],
deviceRightSelection:[],
device:{
- factoryId:'',
- deviceName:''
+ deviceName:'',
+ regionid:'',
+ buildingid:'',
},
dev_addBtn_dis:true,
dev_delBtn_dis:true,
- factoryIds:[],
+ regions:[],
+ buildings:[],
devSel_allocated:[],
//时间段选择部分
timeTable:[],
@@ -668,20 +624,20 @@
timeRow:null,
timeSel_selected:[],
//节假日选择部分
- holidayTable:[],
+ /*holidayTable:[],
holidayName:'',
holidayTags:[],
holtotSize:0,
holPage:1,
holpageSize:10,
holRow:null,
- holidaySel_selected:[],
+ holidaySel_selected:[],*/
//确认页面
- devgrpTitle:'',
+ //devgrpTitle:'',
devTitle:'',
timeTitle:'',
- holiTitle:'',
- postCollapse:['1','2','3','4'],
+ //holiTitle:'',
+ postCollapse:['1','2'],
},
methods:{
//人员选择部分
@@ -695,21 +651,19 @@
this.per_delBtn_dis=this.rightTableSelection<=0;
},
perImporReturn:function(){
- $('#excelTable').hide();
- $('#personSel').show();
- $('#perImportBack').hide();
+ $('#addDoorlist_excelTable').hide();
+ $('#addDoorlist_personSel').show();
+ $('#addDoorlist_perImportBack').hide();
this.per_sheetname='sheet1';
},
person_searchPerson:function(){
person_person=this.person_person;
var custname=person_person.custname;
- var stuempno=person_person.stuempno;
- var classname=person_person.classname;
- var deptname=person_person.deptname;
- var feetype=person_person.feetype;
- urlNotIn = "/doorlistMgr/getAllTCustomerList.json?"+"&perName="+custname+"&stuempNo="+stuempno
- +"&className="+classname+"&deptName="+deptname+"&feetype="+feetype;
- getAllTCustomerList(urlNotIn);
+ var cardno=person_person.cardno;
+ var bankcardno=person_person.bankcardno;
+ urlNotIn = "[[@{/doorlistMgr/getAllTCustomerList?}]]"+"perName="+custname+"&cardno="+cardno
+ +"&bankcardno="+bankcardno;
+ addDoorlist_getAllTCustomerList(urlNotIn);
},
person_addBtn:function(){
var _self=this;
@@ -737,35 +691,36 @@
this.per_delBtn_dis = true;
},
person_openExcel:function(){
- $("#filePath").click();
+ $("#addDoorlist_filePath").click();
//console.log($("#filePath").val());
- this.textfield=$("#filePath").val();
+ this.textfield=$("#addDoorlist_filePath").val();
},
person_inExcel:function(){
var path=JSON.parse(JSON.stringify(this.textfield));
var file=path.substring(path.lastIndexOf(".") + 1);
-
- inExcel(path,file);
+ addDoorlist_inExcel(path,file);
},
per_nextStep:function(){
if(this.personSel_excelNum==0&&this.person_righttable.length==0){
- layer.msg('请选择要分配的人员或者导入人员!',{icon:2,time:1000});
+ layer.msg('请选择要分配的人员!',{icon:2,time:1000});
return ;
}else{
- vue.perSel_allocated=this.person_righttable;
- $('#personSelect').hide();
- $('#devGrpSelect').show();
- commonQueryDevgrp(this,'',1,10);
+ addDoorlist_vue.perSel_allocated=this.person_righttable;
+ $('#addDoorlist_personSelect').hide();
+ //$('#addDoorlist_devGrpSelect').show();
+ //commonQueryDevgrp(this,'',1,10);
this.reason=this.person_reason;
- vue.step=2;
+ $("#addDoorlist_deviceSelect").show();
+ addDoorlist_fillDeviceDiv();
+ addDoorlist_vue.step=2;
}
},
downloadExcel:function(){
- var url ="/doorlistMgr/exportExcelTemplet.json";
+ var url ="[[@{/doorlistMgr/exportExcelTemplet}]]";
window.location.href=url;
},
//设备组选择部分
- devGrpTagClose:function(val){
+ /*devGrpTagClose:function(val){
this.devGrpTags.splice(this.devGrpTags.indexOf(val), 1);
},
devgrpSizeChange:function(val) {
@@ -805,7 +760,7 @@
$("#deviceSelect").show();
fillDeviceDiv();
vue.step=3;
- },
+ },*/
//设备选择部分
deviceLeftSelect:function(val){
this.deviceLeftSelection=val;
@@ -816,10 +771,11 @@
this.dev_delBtn_dis=this.deviceRightSelection<=0;
},
seachDevice:function(){
- var url = "/doorlistMgr/getAllTDevgroupdtlList.json?"+"&factoryId="+
- vue.device.factoryId +"&deviceName="+vue.device.deviceName+"&usetype=MJ";
- fillDevice_lefttable(url);
- vue.usetype='MJ';
+ var url = "[[@{/doorlistMgr/getAllTDevgroupdtlList?}]]"+
+ "deviceName="+addDoorlist_vue.device.deviceName+"®ionid="+addDoorlist_vue.device.regionid
+ +"&buildingid="+addDoorlist_vue.device.buildingid +"&usetype=MJ";
+ addDoorlist_fillDevice_lefttable(url);
+ addDoorlist_vue.usetype='MJ';
},
dev_addToright:function(){
var _self=this;
@@ -846,21 +802,21 @@
}
this.dev_delBtn_dis=true;
},
- devToDevGrp:function(){
- $("#deviceSelect").hide();
- $("#devGrpSelect").show();
- vue.step=2;
+ devToUpStep:function(){
+ $("#addDoorlist_deviceSelect").hide();
+ //$("#devGrpSelect").show();
+ $("#addDoorlist_personSelect").show();
+ addDoorlist_vue.step=1;
},
devNextStep:function(){
- this.step=4;
+ this.step=3;
this.devSel_allocated = this.device_righttable;
- this.devSel_factoryId=vue.device.factoryId;
- if((!this.devgrpSel_index) && (this.devSel_allocated=="")){
- layer.msg('设备组或设备分配完成后,方可进入下一步!',{icon:2,time:1000});
+ if(this.devSel_allocated==""){
+ layer.msg('设备分配完成后,方可进入下一步!',{icon:2,time:1000});
}else {
- $("#deviceSelect").hide();
- $("#timeSelect").show();
- commonQueryTime(this, '', 1, 10);
+ $("#addDoorlist_deviceSelect").hide();
+ $("#addDoorlist_timeSelect").show();
+ addDoorlist_commonQueryTime(this, '', 1, 10);
}
},
//时间段选择部分
@@ -870,45 +826,48 @@
},
timeSizeChange:function(val) {
this.timepageSize=val;
- commonQueryTime(this,this.timeName,this.timePage,val);
+ addDoorlist_commonQueryTime(this,this.timeName,this.timePage,val);
},
timePageChange:function(val) {
this.timePage=val;
- commonQueryTime(this,this.timeName,this.timePage,this.timepageSize);
+ addDoorlist_commonQueryTime(this,this.timeName,this.timePage,this.timepageSize);
},
timeRowChange:function(val) {
this.timeRow = val;
},
timeRowClick:function(val){
- var time=val.timename;
+ var time=val.weekname;
if($.inArray(time,this.timeTags)==-1) {
- this.timeSel_selected.push(val.timeid);
+ this.timeSel_selected.push(val.weekid);
this.timeTags.push(time);
}
},
searchTime:function(){
this.timePage=1;
this.timepageSize=10;
- commonQueryTime(this,this.timeName,this.timePage,this.timepageSize);
+ addDoorlist_commonQueryTime(this,this.timeName,this.timePage,this.timepageSize);
},
timeToDev:function(){
- vue.step=3;
- $("#deviceSelect").show();
- $("#timeSelect").hide();
+ addDoorlist_vue.step=2;
+ $("#addDoorlist_deviceSelect").show();
+ $("#addDoorlist_timeSelect").hide();
},
timeNextStep:function(){
- if(vue.timeSel_selected.length==0){
+ if(addDoorlist_vue.timeSel_selected.length==0){
layer.msg('请选择时间段,否则不能进行下一步!',{icon:2,time:1000});
}else{
- vue.step=5;
- $("#timeSelect").hide();
- $("#holidaySelect").show();
-
- commonQueryHoliday(this,this.holidayName,this.holPage,this.holpageSize);
+ layer.confirm('确定下发这些设备名单吗?', {icon: 3, title:'请确认',offset:'30%'},function(index) {
+ layer.closeAll('dialog');
+ addDoorlist_vue.step = 4;
+ $("#addDoorlist_timeSelect").hide();
+ addDoorlist_fillmsg(addDoorlist_vue);
+ $("#addDoorlist_postSucess").show();
+ addDoorlist_saveDoorCardlist();
+ })
}
},
//节假日选择部分
- holTagClose:function(val){
+ /*holTagClose:function(val){
this.holidayTags.splice(this.holidayTags.indexOf(val), 1);
},
holSizeChange:function(val) {
@@ -946,105 +905,95 @@
$("#postSucess").show();
saveDoorCardlist();
})
- },
+ },*/
rePush:function(){
- $("#postSucess").hide();
- initData();
- $("#personSelect").show();
+ $("#addDoorlist_postSucess").hide();
+ addDoorlist_initData();
+ $("#addDoorlist_personSelect").show();
}
},
created:function(){
- var url="/doorlistMgr/getFeeType.json";
- $.get(url).success(function (data, status) {
- var rows = [];
- rows.push({
- value:'',
- label:"全部"
- });
- var it = data.feeLst;
- for ( var i = 0; i < data.feeLst.length; i++) {
- rows.push({
- value:it[i].feetype,
- label:it[i].feename
- });
- }
- vue.feetypes=rows;
- vue.person_person.feetype='';
- });
+
}
});
- function fillmsg(_self){
- _self.devgrpTitle='设备组 '+ _self.devGrpTags.length + '个';
+ function addDoorlist_fillmsg(_self){
+ //_self.devgrpTitle='设备组 '+ _self.devGrpTags.length + '个';
_self.devTitle='设备 '+ _self.devSel_allocated.length + '个';
_self.timeTitle='时间段 '+ _self.timeTags.length + '个';
- _self.holiTitle='节假日 ' + _self.holidayTags.length + '个';
+ //_self.holiTitle='节假日 ' + _self.holidayTags.length + '个';
}
- function initData(){
+ function addDoorlist_initData(){
window.location.reload();
}
- function saveDoorCardlist(){
+ function addDoorlist_saveDoorCardlist(){
var timeIds='';
- for(var i=0;i<vue.timeSel_selected.length;i++){
+ for(var i=0;i<addDoorlist_vue.timeSel_selected.length;i++){
if(timeIds==''){
- timeIds=vue.timeSel_selected[i];
+ timeIds=addDoorlist_vue.timeSel_selected[i];
}else{
- timeIds+=','+vue.timeSel_selected[i];
+ timeIds+=','+addDoorlist_vue.timeSel_selected[i];
}
}
var holidayIds='';
- for(var i=0;i<vue.holidaySel_selected.length;i++){
+ /*for(var i=0;i<vue.holidaySel_selected.length;i++){
if(holidayIds == ''){
holidayIds = vue.holidaySel_selected[i];
}else{
holidayIds += ','+vue.holidaySel_selected[i];
}
- }
+ }*/
var devGrpIds='';
- for(var i=0;i<vue.devgrpSel_selectedGrpId.length;i++){
+ /*for(var i=0;i<addDoorlist_vue.devgrpSel_selectedGrpId.length;i++){
if(devGrpIds == ''){
- devGrpIds = vue.devgrpSel_selectedGrpId[i];
+ devGrpIds = addDoorlist_vue.devgrpSel_selectedGrpId[i];
}else{
- devGrpIds += ','+vue.devgrpSel_selectedGrpId[i];
+ devGrpIds += ','+addDoorlist_vue.devgrpSel_selectedGrpId[i];
}
- }
+ }*/
- var url = "/doorlistMgr/saveDoorCardlist.json?"+"&factoryId="+vue.devSel_factoryId+"&timeId="+timeIds
+ var url = "[[@{/doorlistMgr/saveDoorCardlist?}]]"+"timeId="+timeIds
+"&holidayId="+holidayIds+"&devGroupId="+devGrpIds+"&usetype=MJ";
var data = '{"tDevgroupdtlInfo":';
- if(vue.devSel_allocated == ""){
+ if(addDoorlist_vue.devSel_allocated == ""){
data += "[]";
}else{
- data += JSON.stringify(vue.devSel_allocated);
+ data += JSON.stringify(addDoorlist_vue.devSel_allocated);
}
data += ',"tCustomerInfo":';
- if(vue.perSel_allocated == ""){
+ if(addDoorlist_vue.perSel_allocated == ""){
data += "[]";
}else{
- data += JSON.stringify(vue.perSel_allocated);
+ data += JSON.stringify(addDoorlist_vue.perSel_allocated);
}
data += ',"tCustomerInfo_import":';
- if(vue.personSel_excelInfo == ""){
+ if(addDoorlist_vue.personSel_excelInfo == ""){
data += "[]";
}else{
- data += JSON.stringify(vue.personSel_excelInfo);
+ data += JSON.stringify(addDoorlist_vue.personSel_excelInfo);
}
data += ',"reason":';
- if(vue.reason == ""){
+ if(addDoorlist_vue.reason == ""){
data += '""';
}else{
- data += '"'+vue.reason+'"';
+ data += '"'+addDoorlist_vue.reason+'"';
}
data += '}';
+ var token=$("meta[name='_csrf_token']").attr("value");
$.ajax({
type: "POST",
url: url,
dataType: "json",
contentType: "application/json",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json',
+ 'X-CSRF-TOKEN':token,
+ },
data:data ,
success: function (data) {
if(data.okFlag == undefined){
@@ -1060,7 +1009,7 @@
}
- function inExcel(path,file) {
+ function addDoorlist_inExcel(path,file) {
if (path.length == 0) {
layer.msg('请选择要上传的文件!', {icon: 2, time: 1000});
return;
@@ -1071,22 +1020,27 @@
if ("xls" != file) {
layer.msg('请选择要上传的文件,格式只能为.xls的表格文件!!', {icon: 2, time: 1000});
} else {
- $("#fileNameId").text(path);
+ $("#addDoorlist_fileNameId").text(path);
importIndex = 0;
- var sheetName = JSON.parse(JSON.stringify(vue.per_sheetname));
+ var sheetName = JSON.parse(JSON.stringify(addDoorlist_vue.per_sheetname));
if (sheetName == "") {
layer.msg('请写出表单的名字!', {icon: 2, time: 1000});
sheetIndex = 0;
return;
} else {
- $('#excelTable').show();
- $('#personSel').hide();
- $('#perImportBack').show();
-
+ $('#addDoorlist_excelTable').show();
+ $('#addDoorlist_personSel').hide();
+ $('#addDoorlist_perImportBack').show();
+ var token=$("meta[name='_csrf_token']").attr("value");
var options = {
success: "",
type: 'post',
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json',
+ 'X-CSRF-TOKEN':token,
+ },
dataType: 'json',
success:function(data){
@@ -1095,22 +1049,22 @@
layer.msg('表单名字在此文件内不存在,请写正确的表单!',{icon:2,time:1000});
}else{
if(data.queryNoNum > 0){
- vue.person_exceltable=data.tCustomerNoExistInfos;
+ addDoorlist_vue.person_exceltable=data.tCustomerNoExistInfos;
}
- vue.personSel_excelNum = data.queryNum;
- vue.personSel_excelInfo = data.tCustomerInfos;
- $("#queryNumId").html(data.queryNum);
- $("#queryNoNumId").html(data.queryNoNum);
+ addDoorlist_vue.personSel_excelNum = data.queryNum;
+ addDoorlist_vue.personSel_excelInfo = data.tCustomerInfos;
+ $("#addDoorlist_queryNumId").html(data.queryNum);
+ $("#addDoorlist_queryNoNumId").html(data.queryNoNum);
}
}
};
- $('#uploadExcelId').ajaxSubmit(options);
+ $('#addDoorlist_uploadExcelId').ajaxSubmit(options);
}
}
}
}
- function commonQueryHoliday(_self,holidayName,pageNo,pageSize){
+ /*function commonQueryHoliday(_self,holidayName,pageNo,pageSize){
var url="/doorlistMgr/getAllDoorTHolidayList.json?factoryId="+_self.devSel_factoryId
+"&pageNo="+pageNo+"&pageSize="+pageSize+"&holidayName="+holidayName;
url = encodeURI(url);
@@ -1120,14 +1074,14 @@
window.location="login";
return;
}
- vue.holtotSize = data.pResult.totalCount;
- vue.holidayTable=data.pResult.list;
+ addDoorlist_vue.holtotSize = data.pResult.totalCount;
+ addDoorlist_vue.holidayTable=data.pResult.list;
})
- }
+ }*/
- function commonQueryTime(_self,timeName,pageNo,pageSize){
- var url = "/doorlistMgr/getAllTDoortimeList.json?&pageNo="+pageNo+"&pageSize="+pageSize+
- "&factoryId="+ _self.device.factoryId + "&timeName="+timeName;
+ function addDoorlist_commonQueryTime(_self,timeName,pageNo,pageSize){
+ var url = "[[@{/doorlistMgr/getAllTDoortimeList?pageNo=}]]"+pageNo+"&pageSize="+pageSize+
+ "&timeName="+timeName;
// url = encodeURI(url);
$.get(url).success(function(data,status){
if(data.pResult == undefined){
@@ -1135,48 +1089,42 @@
window.location="login";
return;
}else{
- vue.timetotSize = data.pResult.totalCount;
- vue.timeTable = data.pResult.list;
+ addDoorlist_vue.timetotSize = data.pResult.totalCount;
+ addDoorlist_vue.timeTable = data.pResult.list;
}
})
}
- function fillDeviceDiv(){
- $.get("/doorlistMgr/getSearchFactoryIdList.json").success(function (data, status) {
- var rows = [];
-
-
- for ( var i = 0; i < data.allFactoryId.length; i++) {
- it = data.allFactoryId[i];
- if(i == 0 && vue.devSel_factoryId == ""){
- vue.devSel_factoryId = it.factoryid;
- rows.push({
- value:it.factoryid,
- label:it.factoryname
+ function addDoorlist_fillDeviceDiv(){
+ $.get("[[@{/doorlistMgr/getRegionAndBuildingList}]]").success(function (data, status) {
+ var regionlist=[];
+ var regiondata = ret.regions;
+ if (regiondata!=null) {
+ for (var i = 0; i < regiondata.length; i++) {
+ regionlist.push({
+ label: regiondata[i].regionname,
+ value: regiondata[i].regionid
});
- }else{
- if(it.factoryid == vue.devSel_factoryId){
- rows.push({
- value:it.factoryid,
- label:it.factoryname
- });
- }else{
- rows.push({
- value:it.factoryid,
- label:it.factoryname
- });
- }
}
}
- vue.factoryIds=rows;
- vue.device.factoryId=vue.devSel_factoryId;
+
+ var buildinglist=[];
+ var buildingdata = ret.buildings;
+ for (var i = 0; i < buildingdata.length; i++) {
+ buildinglist.push({
+ label: buildingdata[i].buildingname,
+ value: buildingdata[i].buildingid
+ });
+ }
+ addDoorlist_vue.regions=regionlist;
+ addDoorlist_vue.buildings=buildinglist;
//var url = vue.cxt+"/doorlistMgr/getAllTDevgroupdtlList.json?factoryId="+vue.device.factoryId+"&usetype=MJ";
//fillDevice_lefttable(url);
})
}
- function fillDevice_lefttable(url){
+ function addDoorlist_fillDevice_lefttable(url){
url = encodeURI(url);
$.get(url).success(function(data,status){
if(data.pResult == undefined){
@@ -1184,11 +1132,11 @@
window.location="login";
return;
}
- vue.device_lefttable=data.pResult;
+ addDoorlist_vue.device_lefttable=data.pResult;
})
}
- function commonQueryDevgrp(_self,devGrpName,pageNo,pageSize){
+ /*function addDoorlist_commonQueryDevgrp(_self,devGrpName,pageNo,pageSize){
url = encodeURI("/doorlistMgr/getAllTdevgroupList.json?groupName="+devGrpName+"&pageNo="+pageNo+"&pageSize="+pageSize);
$.get(url).success(function(data,status){
if(data.pResult == undefined){
@@ -1199,14 +1147,20 @@
_self.devgrptotSize = data.pResult.totalCount;
_self.devGrpTable = data.pResult.list;
});
- }
+ }*/
- function getAllTCustomerList(url){
+ function addDoorlist_getAllTCustomerList(url){
url = encodeURI(url);
+ var token=$("meta[name='_csrf_token']").attr("value");
$.ajax({
type: "POST",
url: url,
dataType: "json",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json',
+ 'X-CSRF-TOKEN':token,
+ },
contentType: "application/json",
data: "",
success: function (data) {
@@ -1222,9 +1176,26 @@
if(data.countIndex){
layer.msg('人员数量过大,请输入查询条件!',{icon:2,time:3000});
}else{
- vue.person_lefttable=data.pNotInResult;
+ addDoorlist_vue.person_lefttable=data.pNotInResult;
}
}
});
}
-</script>
\ No newline at end of file
+</script>
+
+<style>
+ .tabcurrent{
+ border:1px solid #eee; padding:3px;
+ border-radius: 5;
+ margin:10px 0px 0px 200px;
+ width:53%;
+ min-height:80px;
+ }
+ .el-tag+.el-tag{
+ margin-left: 10px;
+ }
+ .x_title{
+ margin-bottom:0px;
+ }
+
+</style>
\ No newline at end of file
diff --git a/src/main/resources/templates/doorlist/deleteDoorlist.html b/src/main/resources/templates/doorlist/deleteDoorlist.html
index e76bb0c..6d59be6 100644
--- a/src/main/resources/templates/doorlist/deleteDoorlist.html
+++ b/src/main/resources/templates/doorlist/deleteDoorlist.html
@@ -1,39 +1,39 @@
<div class="layui-card">
<div class="layui-card-header">
- <h2 class="header-title">人员中心</h2>
+ <h2 class="header-title">删除门禁名单</h2>
<span class="layui-breadcrumb pull-right">
<a href="#">人员中心</a>
<a><cite>删除门禁名单</cite></a>
</span>
</div>
<div class="layui-card-body">
- <div id="searchDoorlist">
- <el-form :inline="true" ref="searchDoorForm" :model="searchDoorForm" label-width="110px"
+ <div id="deleteDoorlistApp">
+ <el-form :inline="true" ref="deleteDoorForm" :model="deleteDoorForm" label-width="110px"
data-parsley-validate class="form-horizontal form-label-left el-form-item el-form-item--mini">
<el-row>
<el-col :span="8">
<el-form-item label="分配开始时间">
- <el-date-picker type="date" v-model="searchDoorForm.allocatStartDate"
+ <el-date-picker type="date" v-model="deleteDoorForm.allocatStartDate"
:picker-options="pickerOptions0" :editable="false"
value-format="yyyyMMdd" style="width:100%;"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="分配结束时间">
- <el-date-picker type="date" v-model="searchDoorForm.allocatEndDate"
+ <el-date-picker type="date" v-model="deleteDoorForm.allocatEndDate"
:picker-options="pickerOptions0" :editable="false"
value-format="yyyyMMdd" style="width: 100%;"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
- <el-form-item label="厂商">
- <el-select v-model="searchDoorForm.factoryId" placeholder="请选择">
+ <el-form-item label="区域">
+ <el-select v-model="deleteDoorForm.regionid" placeholder="请选择">
<el-option
- v-for="fid in factoryIds"
- :key="fid.value"
- :label="fid.label"
- :value="fid.value">
+ v-for="regionid in regions"
+ :key="regionid.value"
+ :label="regionid.label"
+ :value="regionid.value">
</el-option>
</el-select>
</el-form-item>
@@ -43,22 +43,22 @@
<el-row>
<el-col :span="8">
<el-form-item label="姓名">
- <el-input v-model="searchDoorForm.custName" placeholder="姓名">
-
+ <el-input v-model="deleteDoorForm.custname" placeholder="姓名">
+ <i class="el-icon-edit el-input__icon" slot="icon" ></i>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
- <el-form-item label="学/工号">
- <el-input v-model="searchDoorForm.stuempNo" placeholder="输入%进行模糊查询">
-
+ <el-form-item label="卡号">
+ <el-input v-model="deleteDoorForm.cardno" placeholder="输入%进行模糊查询">
+ <i class="el-icon-edit el-input__icon" slot="icon" ></i>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备名称">
- <el-input v-model="searchDoorForm.doorName" placeholder="设备名称">
-
+ <el-input v-model="deleteDoorForm.devname" placeholder="设备名称">
+ <i class="el-icon-edit el-input__icon" slot="icon" ></i>
</el-input>
</el-form-item>
</el-col>
@@ -66,9 +66,9 @@
<el-row>
<el-col :span="8">
<el-form-item label="操作标记">
- <el-select v-model="searchDoorForm.operFlag" placeholder="请选择">
+ <el-select v-model="deleteDoorForm.operflag" placeholder="请选择">
<el-option
- v-for="flag in operFlag"
+ v-for="flag in operFlags"
:key="flag.value"
:label="flag.label"
:value="flag.value">
@@ -78,7 +78,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="名单状态">
- <el-select v-model="searchDoorForm.syncStatus" placeholder="请选择">
+ <el-select v-model="deleteDoorForm.syncstatu" placeholder="请选择">
<el-option
v-for="status in syncStatus"
:key="status.value"
@@ -89,8 +89,8 @@
</el-form-item>
</el-col>
<div style="margin-left: 110px;float: left">
- <button type="button" class="btn btn-info" @click="query" id="qrybtn">查 询</button>
- <button type="button" class="btn btn-info" @click="del" id="delbtn">批量删除</button>
+ <button type="button" class="btn btn-info" @click="query" id="deleteDoorlist_qrybtn">查 询</button>
+ <button type="button" class="btn btn-info" @click="del" id="deleteDoorlist_delbtn">批量删除</button>
</div>
</el-row>
@@ -113,61 +113,51 @@
width="55">
</el-table-column>
<el-table-column
- prop="factoryName"
- label="厂商"
- sortable
- width="100">
- </el-table-column>
- <el-table-column
- prop="doorName"
+ prop="devname"
label="设备名称"
width="170">
</el-table-column>
<el-table-column
- prop="stuempNo"
- label="学/工号"
- width="140">
- </el-table-column>
- <el-table-column
- prop="custName"
+ prop="custname"
label="姓名"
width="150">
</el-table-column>
<el-table-column
- prop="deptName"
- label="部门"
- width="160">
+ prop="cardno"
+ label="卡号"
+ width="140">
</el-table-column>
<el-table-column
- prop="loginName"
+ prop="bankcardno"
+ label="银行卡号"
+ width="180">
+ </el-table-column>
+ <el-table-column
+ prop="opername"
label="分配操作员"
width="140">
</el-table-column>
<el-table-column
- prop="syncStatus"
+ prop="syncstatus"
label="名单状态"
width="110">
</el-table-column>
<el-table-column
- prop="operFlag"
+ prop="operflag"
label="操作标记"
width="110">
</el-table-column>
<el-table-column
- prop="allocatTime"
- label="分配时间"
+ prop="rectime"
+ label="接收时间"
width="200">
</el-table-column>
<el-table-column
- prop="syncTime"
+ prop="synctime"
label="同步时间"
width="200">
</el-table-column>
- <el-table-column
- prop="feedbackTime"
- label="反馈时间"
- min-width="200">
- </el-table-column>
+
</el-table>
<div class="clearfix"></div>
<el-pagination
@@ -185,27 +175,27 @@
</div>
<script>
- var vue = new Vue({
- el: "#searchDoorlist",
+ var deleteDoorlist_vue = new Vue({
+ el: "#deleteDoorlistApp",
data: {
tableData: [],
currPage: 1,
pageSize: 10,
totSize: 0,
currentRow: null,
- searchDoorForm: {
+ deleteDoorForm: {
allocatStartDate: '',
- custName: '',
- factoryId: '',
- doorName: '',
+ custname: '',
+ regionid: '',
+ devname: '',
allocatEndDate: '',
- stuempNo: '',
- syncStatus: '',
- operFlag: '',
+ cardno: '',
+ syncstatu: '',
+ operflag: '',
},
- factoryIds: [],
+ regions: [],
syncStatus: [],
- operFlag: [],
+ operFlags: [],
dialogFormVisible: false,
dlgAllotDevVisible: false,
startTime: '',
@@ -218,18 +208,18 @@
},
pickerOptions1: {
disabledDate:function(time) {
- return time.getTime() <=vue.searchDoorForm.allocatStartDate.getTime();
+ return time.getTime() <=deleteDoorlist_vue.deleteDoorForm.allocatStartDate.getTime();
}
}
},
methods: {
handleSizeChange: function (val) {
this.pageSize = val;
- commonQuery(this, this.searchDoorForm, this.currPage, val);
+ deleteDoorlist_commonQuery(this, this.deleteDoorForm, this.currPage, val);
},
currPageChange: function (val) {
this.currPage = val;
- commonQuery(this, this.searchDoorForm, this.currPage, this.pageSize);
+ deleteDoorlist_commonQuery(this, this.deleteDoorForm, this.currPage, this.pageSize);
},
currRowChange: function (val) {
this.currentRow = val;
@@ -237,10 +227,10 @@
query: function () {
this.pagesize = 10;
this.currPage = 1;
- commonQuery(this, this.searchDoorForm, this.currPage, this.pageSize);
+ deleteDoorlist_commonQuery(this, this.deleteDoorForm, this.currPage, this.pageSize);
},
del: function () {
- deletedata();
+ deleteDoorlist_deletedata();
},
handleSelect: function (val) {
this.selectList = val;
@@ -248,13 +238,19 @@
},
created: function () {
- var url ="/doorlistMgr/getAllCardListFrDelete.json?pageNo=1&pageSize=10&usetype=MJ";
+ var url ="[[@{/doorlistMgr/getAllCardListFrDelete?}]]"+"pageNo=1&pageSize=10&usetype=MJ";
var _self = this;
- getAllFilled(_self);
+ deleteDoorlist_getAllFilled(_self);
+ var token=$("meta[name='_csrf_token']").attr("value");
$.ajax({
type: "POST",
dataType: "json",
contentType: "application/json",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json',
+ 'X-CSRF-TOKEN':token,
+ },
url: encodeURI(url),
success: function (ret) {
_self.totSize = ret.pResult.totalCount;
@@ -262,13 +258,13 @@
if (ret.index == false) {
var start = ret.startDate;
var end = ret.endDate;
- vue.searchDoorForm.allocatStartDate = new Date(start.substr(0, 4), start.substr(4, 2) - 1, start.substr(6, 2));
- vue.searchDoorForm.allocatEndDate = new Date(end.substr(0, 4), end.substr(4, 2) - 1, end.substr(6, 2));
+ deleteDoorlist_vue.deleteDoorForm.allocatStartDate = new Date(start.substr(0, 4), start.substr(4, 2) - 1, start.substr(6, 2));
+ deleteDoorlist_vue.deleteDoorForm.allocatEndDate = new Date(end.substr(0, 4), end.substr(4, 2) - 1, end.substr(6, 2));
}
}
})
- this.searchDoorForm.allocatStartDate ='';
- this.searchDoorForm.allocatEndDate ='';
+ this.deleteDoorForm.allocatStartDate ='';
+ this.deleteDoorForm.allocatEndDate ='';
}
});
@@ -294,26 +290,32 @@
return fmt;
}
- function commonQuery(_self, searchDoor, pageno, pagesize) {
- if (searchDoor.allocatStartDate != '') {
+ function deleteDoorlist_commonQuery(_self, deleteDoor, pageno, pagesize) {
+ if (deleteDoor.allocatStartDate != '') {
- var startStr = searchDoor.allocatStartDate.Format('yyyyMMdd');
+ var startStr = deleteDoor.allocatStartDate.Format('yyyyMMdd');
}
- if (searchDoor.allocatEndDate != '') {
+ if (deleteDoor.allocatEndDate != '') {
- var endStr = searchDoor.allocatEndDate.Format('yyyyMMdd');
+ var endStr = deleteDoor.allocatEndDate.Format('yyyyMMdd');
}
- var url = "/doorlistMgr/getAllCardListFrDelete.json?" + "&allocatStartDate=" + startStr + "&allocatEndDate=" + endStr +
- "&doorName=" + searchDoor.doorName + "&custName=" + searchDoor.custName
- + "&stuempNo=" + searchDoor.stuempNo + "&factoryId=" + searchDoor.factoryId
- + "&syncStatus=" + searchDoor.syncStatus + "&usetype=MJ" +
- "&pageNo=" + pageno + "&pageSize=" + pagesize + "&operFlag=" + searchDoor.operFlag;
+ var url = "[[@{/doorlistMgr/getAllCardListFrDelete}]]" + "allocatStartDate=" + startStr + "&allocatEndDate=" + endStr +
+ "&devname=" + deleteDoor.devname + "&custname=" + deleteDoor.custname
+ + "&cardno=" + deleteDoor.cardno + "®ionid=" + deleteDoor.regionid
+ + "&syncstatus=" + deleteDoor.syncstatus + "&usetype=MJ" +
+ "&pageNo=" + pageno + "&pageSize=" + pagesize + "&operflag=" + deleteDoor.operflag;
+ var token=$("meta[name='_csrf_token']").attr("value");
$.ajax({
type: "POST",
dataType: "json",
url: encodeURI(url),
contentType: "application/json",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json',
+ 'X-CSRF-TOKEN':token,
+ },
success: function (ret) {
_self.totSize = ret.pResult.totalCount;
_self.tableData = ret.pResult.list;
@@ -324,37 +326,43 @@
})
}
- function deletedata() {
- var delList = vue.selectList;
+ function deleteDoorlist_deletedata() {
+ var delList = deleteDoorlist_vue.selectList;
if (delList == '') {
layer.msg('请选择要删除的名单!', {icon: 2, time: 1000});
} else {
- var url = "/doorlistMgr/saveDoorDeleteCardlist?usetype=MJ";
+ var url = "[[@{/doorlistMgr/saveDoorDeleteCardlist}]]";
+ var token=$("meta[name='_csrf_token']").attr("value");
layer.confirm('确定要删除这些名单吗?', {icon: 3, title: '请确认', offset: '30%'}, function (index) {
$.ajax({
type: "POST",
url: url,
dataType: "json",
contentType: "application/json",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json',
+ 'X-CSRF-TOKEN':token,
+ },
data: JSON.stringify(delList),
success: function (data) {
layer.closeAll('dialog');
- refreshThisTable();
+ deleteDoorlist_refreshThisTable();
}
});
})
}
}
- function refreshThisTable() {
- $("#qrybtn").click();
+ function deleteDoorlist_refreshThisTable() {
+ $("#deleteDoorlist_qrybtn").click();
}
- function getAllFilled(_self) {
+ function deleteDoorlist_getAllFilled(_self) {
$.ajax({
type: "get",
dataType: "json",
- url: encodeURI("/doorlistMgr/getFillFormList"),
+ url: encodeURI("[[@{/doorlistMgr/getDelFillFormList}]]"),
contentType: "application/json",
success: function (data) {
var syncDicts = [];
@@ -369,18 +377,22 @@
label: syncDict[i]["dictcaption"]
})
}
- var factoryList = [];
- var factory = data.allFactoryId;
- factoryList.push({
- value: "all",
+
+ var regionList = [];
+ var regions = data.regions;
+ regionList.push({
+ value: "",
label: "全部"
})
- for (var i = 0; i < factory.length; i++) {
- factoryList.push({
- value: factory[i].factoryid,
- label: factory[i].factoryname
- })
+ if (regions!=null) {
+ for (var i = 0; i < regions.length; i++) {
+ regionList.push({
+ value: regions[i].regionid,
+ label: regions[i].regionname
+ })
+ }
}
+
var operDicts = [];
var operDict = data.operDicts;
operDicts.push({
@@ -393,13 +405,13 @@
label: operDict[i]["dictcaption"]
})
}
- vue.factoryIds = factoryList;
- vue.syncStatus = syncDicts;
- vue.operFlag = operDicts;
+ deleteDoorlist_vue.regions = regionList;
+ deleteDoorlist_vue.syncStatus = syncDicts;
+ deleteDoorlist_vue.operFlag = operDicts;
- vue.searchDoorForm.factoryId = 'all';
- vue.searchDoorForm.syncStatus = 'all';
- vue.searchDoorForm.operFlag = 'all';
+ deleteDoorlist_vue.deleteDoorForm.regionid = '';
+ deleteDoorlist_vue.deleteDoorForm.syncStatus = 'all';
+ deleteDoorlist_vue.deleteDoorForm.operFlag = 'all';
}
})
}
diff --git a/src/main/resources/templates/doorlist/impCustomerlist.html b/src/main/resources/templates/doorlist/impCustomerlist.html
new file mode 100644
index 0000000..8dddb89
--- /dev/null
+++ b/src/main/resources/templates/doorlist/impCustomerlist.html
@@ -0,0 +1,142 @@
+<div class="layui-card">
+ <div class="layui-card-header">
+ <h2 class="header-title">人员中心</h2>
+ <span class="layui-breadcrumb pull-right">
+ <a href="#">人员中心</a>
+ <a><cite>导入人员名单</cite></a>
+ </span>
+ </div>
+ <div class="layui-card-body">
+ <div id="impCustomerlist">
+ <el-alert
+ title="人员名单导入步骤:"
+ type="info"
+ :closable="false">
+ </el-alert>
+ <el-form :inline="true" ref="impDoorForm"
+ data-parsley-validate class="form-horizontal form-label-left el-form-item el-form-item--mini">
+ <el-row>
+ <el-col :span="12">
+ <el-form-item >
+ <form action="/door/doorlistMgr/impDoorCardList" method="post" style="float:left;" id="impCustomerlist_uploadExcelId" name="formUpload" enctype="multipart/form-data" target="_top">
+ <el-input v-model="textfield" type="hidden" name="textfield" ></el-input>
+ <el-button size="small" type="primary" @click="person_openExcel">选择导入文件<i class="el-icon-upload el-icon--right"></i></el-button>
+
+ <label >文件路径: {{ textfield }}</label>
+
+ <input type="file" name="impCustomerlist_file" style="display: none" id="impCustomerlist_filePath" onchange="impCustomerlist_vue.textfield=this.value" />
+ </form>
+ </el-form-item>
+ </el-col>
+
+ </el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item >
+ <el-button style="margin-top: 3px;" size="small" type="el-button el-button--success" @click="person_inExcel">导入名单</el-button>
+ </el-form-item>
+ </el-col>
+
+ </el-row>
+ </el-form>
+
+ <el-tag type="danger">导入说明:</el-tag><br>
+ <label >1、导入excel格式为xls,内容查看<el-button size="small" type="success" plain @click="downTemplate">导入模板</el-button></label><br>
+ <label >2、市民卡号、银行卡号、物理卡号为必填项,每次导入建议在1000条以内</label><br>
+ <label >3、为查询方便请尽量完善人员信息</label><br>
+ <label >4、注销日期到期则无法开门,请选填。例:20080808</label><br>
+ </div>
+ </div>
+</div>
+
+<script>
+ var impCustomerlist_vue = new Vue({
+ el:"#impCustomerlist",
+ data:{
+ exceltable:[],
+ textfield:'',
+
+ per_sheetname:'sheet1',
+ impDoorForm:{
+ }
+ },
+ methods:{
+ downTemplate:function(val) {
+ console.log("下载模板");
+ var url ="[[@{/doorlistMgr/downImpTemplate}]]";
+ window.location.href=url;
+ },
+ currRowChange:function(val) {
+ this.currentRow = val;
+ },
+ query:function(){
+ this.pagesize=10;
+ this.currPage=1;
+ },
+ person_openExcel:function(){
+ $("#impCustomerlist_filePath").click();
+ this.textfield=$("#impCustomerlist_filePath").val();
+ },
+ person_inExcel:function(){
+ alert(this.textfield)
+ var path=JSON.parse(JSON.stringify(this.textfield));
+ console.log(path);
+ var file=path.substring(path.lastIndexOf(".") + 1);
+ impCustomerlist_uploadExcel(path,file);
+ this.textfield='';
+
+ },
+ },
+ created:function(){
+
+ }
+ });
+
+ function impCustomerlist_uploadExcel(path,file) {
+ if (path.length == 0) {
+ layer.msg('请选择要上传的文件!', {icon: 2, time: 1000});
+ return;
+ }
+ if (path.length > 0) {
+ fileIndex = 0;
+ fileName = path;
+ if ("xls" != file) {
+ layer.msg('请选择要上传的文件,格式只能为.xls的表格文件!!', {icon: 2, time: 2000});
+ } else {
+ $("#impCustomerlist_fileNameId").text(path);
+ importIndex = 0;
+ var sheetName = JSON.parse(JSON.stringify(impCustomerlist_vue.per_sheetname));
+ if (sheetName == "") {
+ layer.msg('请写出表单的名字!', {icon: 2, time: 1000});
+ sheetIndex = 0;
+ return;
+ } else {
+
+ $('#excelTable').show();
+ var token=$("meta[name='_csrf_token']").attr("value");
+ var options = {
+ success: "",
+ type: 'post',
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json;multipart/form-data',
+ 'X-CSRF-TOKEN':token,
+ },
+ dataType: 'json',
+ success:function(data){
+ //console.log(data);
+ if (data.flag==1){
+ var tmpStr = "共:"+data.imp_totCnt+"条,成功:"+data.imp_succCnt+"条,失败:"+data.imp_errCnt+"条";
+ layer.alert('人员名单导入完成-->'+tmpStr, {icon: 6});
+ }else{
+ layer.alert("人员名单导入失败", {icon: 5});
+ }
+ }
+ };
+ $('#impCustomerlist_uploadExcelId').ajaxSubmit(options);
+
+ }
+ }
+ }
+ }
+</script>
\ No newline at end of file
diff --git a/src/main/resources/templates/doorlist/searchDoorlist.html b/src/main/resources/templates/doorlist/searchDoorlist.html
index 2c77b7b..66b2c82 100644
--- a/src/main/resources/templates/doorlist/searchDoorlist.html
+++ b/src/main/resources/templates/doorlist/searchDoorlist.html
@@ -26,9 +26,9 @@
<el-col :span="8">
<el-form-item label="名单状态">
- <el-select v-model="searchDoorForm.syncStatus" placeholder="请选择">
+ <el-select v-model="searchDoorForm.syncflag" placeholder="请选择">
<el-option
- v-for="status in syncStatus"
+ v-for="status in syncFlag"
:key="status.value"
:label="status.label"
:value="status.value">
@@ -41,21 +41,21 @@
<el-row>
<el-col :span="8">
<el-form-item label="姓名">
- <el-input v-model="searchDoorForm.custName" placeholder="姓名">
+ <el-input v-model="searchDoorForm.custname" placeholder="姓名">
<i class="el-icon-edit el-input__icon" slot="icon" ></i>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
- <el-form-item label="学/工号">
- <el-input v-model="searchDoorForm.stuempNo" placeholder="输入%进行模糊查询">
+ <el-form-item label="卡号">
+ <el-input v-model="searchDoorForm.cardno" placeholder="输入%进行模糊查询">
<i class="el-icon-edit el-input__icon" slot="icon" ></i>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备名称">
- <el-input v-model="searchDoorForm.doorName" placeholder="设备名称">
+ <el-input v-model="searchDoorForm.devname" placeholder="设备名称">
<i class="el-icon-edit el-input__icon" slot="icon" ></i>
</el-input>
</el-form-item>
@@ -64,7 +64,7 @@
<el-row>
<el-col :span="8">
<el-form-item label="操作标记">
- <el-select v-model="searchDoorForm.operFlag" placeholder="请选择">
+ <el-select v-model="searchDoorForm.operflag" placeholder="请选择">
<el-option
v-for="flag in operFlag"
:key="flag.value"
@@ -132,34 +132,34 @@
width="55">
</el-table-column>
<el-table-column
- prop="factoryName"
- label="厂商"
- sortable
- width="100">
- </el-table-column>
- <el-table-column
- prop="doorName"
+ prop="devname"
label="设备名称"
width="180">
</el-table-column>
<el-table-column
- prop="stuempNo"
- label="学/工号"
- width="140">
- </el-table-column>
- <el-table-column
- prop="custName"
- label="姓名"
- width="150">
+ prop="cardno"
+ label="卡号"
+ width="130">
</el-table-column>
+ <el-table-column
+ prop="custname"
+ label="姓名"
+ width="120">
+ </el-table-column>
<el-table-column
- prop="regionName"
+ prop="bankcardno"
+ label="银行卡号"
+ width="210">
+ </el-table-column>
+
+ <el-table-column
+ prop="regionname"
label="区域"
width="130">
</el-table-column>
<el-table-column
- prop="buildingName"
+ prop="buildingname"
label="楼栋"
width="180">
</el-table-column>
@@ -170,39 +170,33 @@
:formatter="formatDate">
</el-table-column>
<el-table-column
- prop="loginName"
+ prop="opername"
label="分配操作员"
width="130">
</el-table-column>
<el-table-column
- prop="syncStatus"
+ prop="syncflag"
label="名单状态"
- width="110">
+ width="110"
+ :formatter="syncform">
</el-table-column>
<el-table-column
- prop="operFlag"
+ prop="operflag"
label="操作标记"
- width="110">
+ width="110"
+ :formatter="operform">
</el-table-column>
<el-table-column
- prop="allocatTime"
+ prop="rectime"
label="分配时间"
- width="200">
+ width="200"
+ :formatter="rectimeform">
</el-table-column>
<el-table-column
- prop="syncTime"
+ prop="synctime"
label="同步时间"
- width="200">
- </el-table-column>
- <el-table-column
- prop="feedbackTime"
- label="反馈时间"
- width="200">
- </el-table-column>
- <el-table-column
- prop="retmsg"
- label="反馈信息"
- width="140">
+ width="200"
+ :formatter="synctimeform">
</el-table-column>
<el-table-column
prop="reason"
@@ -251,27 +245,24 @@
currentRow: null,
searchDoorForm: {
allocatStartDate: '',
- custName: '',
- factoryId: '',
- doorName: '',
+ custname: '',
+ devname: '',
allocatEndDate: '',
- stuempNo: '',
- syncStatus: '',
- operFlag: '',
+ cardno: '',
+ syncflag: '',
+ operflag: '',
buildingid: '',
regionid:''
},
regions:[],
buildings:[],
- factoryIds: [],
- syncStatus: [],
+ syncFlag: [],
operFlag: [],
selectList:[],
dialogFormVisible: false,
dlgAllotDevVisible: false,
startTime: '',
endTime: '',
- alloHolidayName: '',
alloTimeName: '',
pickerOptions0: {
disabledDate:function(time) {
@@ -280,9 +271,9 @@
},
pickerOptions1: {
disabledDate:function(time) {
- if(vue.searchDoorForm.allocatStartDate !=''){
+ if(searchDoorlist_vue.searchDoorForm.allocatStartDate !=''){
- return time.getTime() < vue.searchDoorForm.allocatStartDate.getTime();
+ return time.getTime() < searchDoorlist_vue.searchDoorForm.allocatStartDate.getTime();
}else {
return time.getTime() > Date.now();
}
@@ -329,6 +320,36 @@
this.searchDoorForm.buildingid='';
searchDoorlist_getRegionBuilding(this,value);
},
+ rectimeform:function(row,column,cellValue){
+ if(row.rectime != null) {
+ return searchDoorlist_timeformatter(row.rectime);
+ }
+ },
+ synctimeform:function(row,column,cellValue){
+ if(row.synctime != null) {
+ return searchDoorlist_timeformatter(row.synctime);
+ }
+ },
+ syncform:function (row) {
+ if (row.syncflag == 'N') {
+ return '未同步';
+ }
+ else if (row.syncflag == 'Y') {
+ return '已同步';
+ } else {
+ return row.syncflag;
+ }
+ },
+ operform:function (row) {
+ if (row.operflag == 'A') {
+ return '增加';
+ }
+ else if (row.operflag == 'D') {
+ return '删除';
+ } else {
+ return row.operflag;
+ }
+ }
},
created: function () {
var url = "[[@{/doorlistMgr/getFillFormList}]]";
@@ -351,18 +372,8 @@
label: syncDict[i]["dictcaption"]
})
}
- var factoryList = [];
- var factory = data.allFactoryId;
- factoryList.push({
- value: "all",
- label: "全部"
- })
- for (var i = 0; i < factory.length; i++) {
- factoryList.push({
- value: factory[i].factoryid,
- label: factory[i].factoryname
- })
- }
+
+
var operDicts = [];
var operDict = data.operDicts;
operDicts.push({
@@ -392,14 +403,12 @@
label: building[i]["buildingname"]
})
}
- searchDoorlist_vue.factoryIds = factoryList;
- searchDoorlist_vue.syncStatus = syncDicts;
+ searchDoorlist_vue.syncFlag = syncDicts;
searchDoorlist_vue.operFlag = operDicts;
searchDoorlist_vue.regions = regionlist;
- searchDoorlist_vue.buildings = buildinglist;
- searchDoorlist_vue.searchDoorForm.factoryId = 'all';
- searchDoorlist_vue.searchDoorForm.syncStatus = 'all';
- searchDoorlist_vue.searchDoorForm.operFlag = 'all';
+ searchDoorlist_vue.buildings = buildinglist
+ searchDoorlist_vue.searchDoorForm.syncflag = 'all';
+ searchDoorlist_vue.searchDoorForm.operflag = 'all';
}
})
this.searchDoorForm.allocatStartDate ='';
@@ -442,10 +451,10 @@
}
}
var url = "[[@{/doorlistMgr/getAllCardList?}]]" + "&allocatStartDate=" + startStr + "&allocatEndDate=" + endStr +
- "&doorName=" + searchDoor.doorName + "&custName=" + searchDoor.custName
- + "&stuempNo=" + searchDoor.stuempNo + "&factoryId=" + searchDoor.factoryId
- + "&syncStatus=" + searchDoor.syncStatus +
- "&pageNo=" + pageno + "&pageSize=" + pagesize + "&operFlag=" + searchDoor.operFlag
+ "&devname=" + searchDoor.devname + "&custname=" + searchDoor.custname
+ + "&cardno=" + searchDoor.cardno
+ + "&syncflag=" + searchDoor.syncflag +
+ "&pageNo=" + pageno + "&pageSize=" + pagesize + "&operflag=" + searchDoor.operflag
+ "&buildingid=" + searchDoor.buildingid+"®ionid=" +searchDoor.regionid;
var token=$("meta[name='_csrf_token']").attr("value");
$.ajax({
@@ -470,6 +479,15 @@
})
}
+ function searchDoorlist_timeformatter(time){
+
+ return time.substr(0,4)+'-'+time.substr(4,2)+'-'+time.substr(6,2)+' '
+ +time.substr(8,2)+':'+time.substr(10,2)+':'+time.substr(12,2);
+// console.log([year,month,date].join('-')+' '+[hour,moment,second].join(':'));
+// return [year,month,date].join('-')+' '+[hour,moment,second].join(':');
+
+ }
+
function searchDoorlist_exportExcel(_self, searchDoor) {
var startStr = '';
var endStr = '';
@@ -487,9 +505,9 @@
}
}
var url = "[[@{/doorlistMgr/exportExcel?}]]" + "allocatStartDate=" + startStr + "&allocatEndDate=" + endStr +
- "&doorName=" + searchDoor.doorName + "&custName=" + searchDoor.custName
- + "&stuempNo=" + searchDoor.stuempNo + "&factoryId=" + searchDoor.factoryId
- + "&syncStatus=" + searchDoor.syncStatus + "&operFlag=" + searchDoor.operFlag
+ "&devname=" + searchDoor.devname + "&custname=" + searchDoor.custname
+ + "&cardno=" + searchDoor.cardno
+ + "&syncflag=" + searchDoor.syncflag + "&operflag=" + searchDoor.operflag
+ "&buildingid=" + searchDoor.buildingid+"®ionid="+searchDoor.regionid;
// window.location.href
var uri = encodeURI(url);
diff --git a/src/main/resources/templates/login.html b/src/main/resources/templates/login.html
index 6e00652..fb62d74 100644
--- a/src/main/resources/templates/login.html
+++ b/src/main/resources/templates/login.html
@@ -45,7 +45,7 @@
<div class="layui-input-block">
<div class="layui-row inline-block">
<div class="layui-col-xs7">
- <input name="imageCode" type="text" placeholder="验证码"
+ <input name="verifyCodeActual" type="text" placeholder="验证码"
class="layui-input">
</div>
<div class="layui-col-xs5" style="padding-left: 10px;">
diff --git a/src/main/resources/templates/ncmgr/nc_dev.html b/src/main/resources/templates/ncmgr/nc_dev.html
index 4b093cf..8954ee0 100644
--- a/src/main/resources/templates/ncmgr/nc_dev.html
+++ b/src/main/resources/templates/ncmgr/nc_dev.html
@@ -401,9 +401,9 @@
devno: [
{validator: dev_validatePass, trigger: 'blur'}
],
- /*regionid: [
+ regionid: [
{required: true, message: '请选择设备所在区域', trigger: 'blur'}
- ],*/
+ ],
buildingid: [
{required: true, message: '请选择设备所在楼栋', trigger: 'blur'}
],
diff --git a/src/main/resources/templates/query/tdoorstream.html b/src/main/resources/templates/query/tdoorstream.html
index 3e9c138..7d1ea6c 100644
--- a/src/main/resources/templates/query/tdoorstream.html
+++ b/src/main/resources/templates/query/tdoorstream.html
@@ -29,9 +29,9 @@
</el-date-picker>
</el-col>
<el-col :span="8">
- <label class="control-label" style="margin-right:10px;font-size: 14px;width:80px">学/工号:
+ <label class="control-label" style="margin-right:10px;font-size: 14px;width:80px">卡号:
</label>
- <el-input v-model="tdoorstream.stuempno" placeholder="输入%进行模糊查询" style="width:193px"></el-input>
+ <el-input v-model="tdoorstream.cardno" placeholder="输入%进行模糊查询" style="width:193px"></el-input>
</el-col>
</el-row>
<el-row style="margin-top:10px">
@@ -90,7 +90,7 @@
<label class="control-label "
style="margin-right:10px;font-size: 14px;width:80px">设备名称:
</label>
- <el-input v-model="tdoorstream.doorname" style="width:193px"></el-input>
+ <el-input v-model="tdoorstream.devname" style="width:193px"></el-input>
</el-col>
<el-col :span="8" >
@@ -110,13 +110,16 @@
max-height="2000"
stripe border style="width: 100%">
<el-table-column
- prop="doorid" label="设备编号" width="130" sortable v-show="false">
+ prop="deviceid" label="设备编号" width="130" sortable v-show="false">
</el-table-column>
<el-table-column
- prop="doorname" label="设备名称" width="200">
+ prop="devname" label="设备名称" width="200">
</el-table-column>
<el-table-column
- prop="stuempno" label="学/工号" sortable width="140">
+ prop="cardno" label="卡号" sortable width="140">
+ </el-table-column>
+ <el-table-column
+ prop="bankcardno" label="银行卡号" width="200">
</el-table-column>
<el-table-column
prop="custname" label="姓名" width="125">
@@ -129,12 +132,6 @@
prop="transdate" label="刷卡时间" width="210" sortable :formatter="dateFormat">
</el-table-column>
<el-table-column
- prop="buildingname" label="楼栋" width="200">
- </el-table-column>
- <el-table-column
- prop="regionname" label="区域" width="125">
- </el-table-column>
- <el-table-column
prop="dtldesc" label="描述" width="125">
</el-table-column>
<el-table-column
@@ -183,10 +180,9 @@
dtlstatus:[],
currentRow : null,
tdoorstream : {
- stuempno:'',
+ cardno:'',
custname:'',
- factoryid:'',
- doorname:'',
+ devname:'',
buildingid:'',
dtlStatus:'all',
regionid:''
@@ -254,7 +250,7 @@
$.ajax({
type : "get",
dataType : "json",
- url : encodeURI("[[@{/query/getSearchFactoryIdList}]]"),
+ url : encodeURI("[[@{/query/getSearchIdList}]]"),
success : function(ret) {
var dtllist = [];
var dtlStatus = ret.dtlStatus;
@@ -304,11 +300,11 @@
}
var starttransdate = tdoorstream_Formatdate(Ustarttransdate);
var endtransdate = tdoorstream_Formatdate(Uendtransdate);
- var stuempno = _self.tdoorstream.stuempno;
+ var cardno = _self.tdoorstream.cardno;
var custname = _self.tdoorstream.custname;
var buildingid = _self.tdoorstream.buildingid;
var regionid = _self.tdoorstream.regionid;
- var doorname = _self.tdoorstream.doorname;
+ var devname = _self.tdoorstream.devname;
var dtlStatus = _self.tdoorstream.dtlStatus;
if(_self.totSize>2000){
layer.msg('数量过大请输入条件', {icon: 2, time: 1000});
@@ -316,20 +312,19 @@
}
//console.log(factoryid+stuempno);
var url =encodeURI( "[[@{/query/exportexcel?startTranDate=}]]"+starttransdate+"&endTranDate="
- +endtransdate+"&stuempno="+stuempno+"&custname="+custname+"&buildingid="+buildingid+"®ionid="+regionid+"&doorName="+doorname
- +"&streamstatus="+dtlStatus+"&factoryId="+factoryid)
+ +endtransdate+"&cardno="+cardno+"&custname="+custname+"&buildingid="+buildingid+"®ionid="+regionid+"&devname="+devname
+ +"&streamstatus="+dtlStatus)
window.open(url);
}
function tdoorstream_commonQuery(_self, Ustarttransdate,Uendtransdate,pageno, pagesize) {
- var factoryid = _self.tdoorstream.factoryid;
var starttransdate = tdoorstream_Formatdate(Ustarttransdate);
var endtransdate = tdoorstream_Formatdate(Uendtransdate);
- var stuempno = _self.tdoorstream.stuempno;
+ var cardno = _self.tdoorstream.cardno;
var custname = _self.tdoorstream.custname;
var buildingid = _self.tdoorstream.buildingid;
- var doorname = _self.tdoorstream.doorname;
+ var devname = _self.tdoorstream.devname;
var regionid = _self.tdoorstream.regionid;
var dtlStatus = _self.tdoorstream.dtlStatus;
//console.log(factoryid);
@@ -337,8 +332,8 @@
type : "get",
dataType : "json",
url : encodeURI("[[@{/query/getSearchDoorStreamList?&startTranDate=}]]"+starttransdate+"&endTranDate="+endtransdate+
- "&stuempno="+stuempno+"&custname="+custname+"&buildingid="+buildingid+"&doorName="+doorname+"&streamstatus="+dtlStatus+
- "&factoryId="+factoryid +"&pageNo="+pageno+"&pageSize="+pagesize+"®ionid="+regionid),
+ "&cardno="+cardno+"&custname="+custname+"&buildingid="+buildingid+"&devname="+devname+"&streamstatus="+dtlStatus+
+ "&pageNo="+pageno+"&pageSize="+pagesize+"®ionid="+regionid),
success : function(ret) {
// console.log(ret);
_self.totSize = ret.tDoordtlInfo.totalCount;
diff --git a/src/main/resources/templates/system/operator/setpwd.html b/src/main/resources/templates/system/operator/setpwd.html
index d549946..2e9085e 100644
--- a/src/main/resources/templates/system/operator/setpwd.html
+++ b/src/main/resources/templates/system/operator/setpwd.html
@@ -42,7 +42,7 @@
admin.closeThisTabs()
});
form.render('select');
- let url = '/operator/dosetpwd';
+ let url = '[[@{/operator/dosetpwd}]]';
// 表单提交事件
form.on('submit(setmypass)', function (data) {
layer.load(2);