会议签到展示提交
diff --git a/build.gradle b/build.gradle
index 3c7b3e1..71be02a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -81,7 +81,7 @@
implementation group: 'taglibs', name: 'standard', version: '1.1.2'
implementation group: 'commons-codec', name: 'commons-codec', version: '1.13'
implementation files('libs/ojdbc6.jar')
-
+ implementation group: 'com.google.zxing', name: 'core', version: '3.3.3'
implementation 'cn.afterturn:easypoi-web:3.0.3'
implementation 'cn.afterturn:easypoi-base:3.0.3'
@@ -93,7 +93,7 @@
compileOnly 'org.projectlombok:lombok:1.18.8'
compile 'com.supwisdom:payapi-sdk:1.0.10'
-
+
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/src/main/java/com/supwisdom/dlpay/conference/api/bean/ConferenceReq.java b/src/main/java/com/supwisdom/dlpay/conference/api/bean/ConferenceReq.java
new file mode 100644
index 0000000..3c32907
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/api/bean/ConferenceReq.java
@@ -0,0 +1,14 @@
+package com.supwisdom.dlpay.conference.api.bean;
+
+
+public class ConferenceReq {
+ private String confdate;
+
+ public String getConfdate() {
+ return confdate;
+ }
+
+ public void setConfdate(String confdate) {
+ this.confdate = confdate;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/api/bean/ConferenceResp.java b/src/main/java/com/supwisdom/dlpay/conference/api/bean/ConferenceResp.java
new file mode 100644
index 0000000..c6c5714
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/api/bean/ConferenceResp.java
@@ -0,0 +1,28 @@
+package com.supwisdom.dlpay.conference.api.bean;
+
+import com.supwisdom.dlpay.api.bean.ApiResponse;
+import com.supwisdom.dlpay.conference.domain.TConference;
+
+import java.util.List;
+
+public class ConferenceResp extends ApiResponse {
+ private Integer count;
+ private List<TConference> conflist;
+
+
+ public Integer getCount() {
+ return count;
+ }
+
+ public void setCount(Integer count) {
+ this.count = count;
+ }
+
+ public List<TConference> getConflist() {
+ return conflist;
+ }
+
+ public void setConflist(List<TConference> conflist) {
+ this.conflist = conflist;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/api/controller/ConerenceApiController.java b/src/main/java/com/supwisdom/dlpay/conference/api/controller/ConerenceApiController.java
new file mode 100644
index 0000000..6bf54fa
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/api/controller/ConerenceApiController.java
@@ -0,0 +1,45 @@
+package com.supwisdom.dlpay.conference.api.controller;
+
+import com.supwisdom.dlpay.conference.api.bean.ConferenceReq;
+import com.supwisdom.dlpay.conference.api.bean.ConferenceResp;
+import com.supwisdom.dlpay.conference.bean.ConferenceShowBean;
+import com.supwisdom.dlpay.conference.domain.TConference;
+import com.supwisdom.dlpay.conference.service.ConferenceService;
+import com.supwisdom.dlpay.framework.data.SystemDateTime;
+import com.supwisdom.dlpay.framework.service.SystemUtilService;
+import com.supwisdom.dlpay.framework.util.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.List;
+
+@Controller
+@RequestMapping("/api/conference")
+public class ConerenceApiController {
+ @Autowired
+ private SystemUtilService systemUtilService;
+ @Autowired
+ private ConferenceService conferenceService;
+
+ @RequestMapping(value = "/login", method = RequestMethod.POST)
+ @ResponseBody
+ public ConferenceResp getConferenceToday(@ModelAttribute ConferenceReq req) {
+ ConferenceResp resp = new ConferenceResp();
+ String confdate=req.getConfdate();
+ if(StringUtil.isEmpty(confdate)){
+ resp.setRetcode(99);
+ resp.setRetmsg("日期为空");
+ return resp;
+ }
+ List<TConference> conflist=conferenceService.getConferenceByDateAndStatus(confdate,"");
+ resp.setConflist(conflist);
+ resp.setCount(conflist.size());
+ resp.setRetmsg("OK");
+ resp.setRetcode(0);
+ return resp;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/controller/ConfPeopleController.java b/src/main/java/com/supwisdom/dlpay/conference/controller/ConfPeopleController.java
index 4d49878..6d3dd92 100644
--- a/src/main/java/com/supwisdom/dlpay/conference/controller/ConfPeopleController.java
+++ b/src/main/java/com/supwisdom/dlpay/conference/controller/ConfPeopleController.java
@@ -46,9 +46,9 @@
String deptcode=oper.getDeptcode();
List<TConference> conf=conferenceService.getAllConference(deptcode);
for(TConference c:conf){
- String conftype="有名单";
+ String conftype="名单会议";
if(ConferenceConstant.CONFTYPE_NOLIST.equals(c.getConftype())){
- conftype="无名单";
+ conftype="临时会议";
}
String date= DateUtil.reformatDatetime(c.getConfdate(),"yyyyMMdd","yyyy-MM-dd");
c.setConfname(c.getConfname()+" "+date+" "+conftype);
diff --git a/src/main/java/com/supwisdom/dlpay/conference/controller/ConferenceController.java b/src/main/java/com/supwisdom/dlpay/conference/controller/ConferenceController.java
index aa2e548..3d865ce 100644
--- a/src/main/java/com/supwisdom/dlpay/conference/controller/ConferenceController.java
+++ b/src/main/java/com/supwisdom/dlpay/conference/controller/ConferenceController.java
@@ -11,6 +11,7 @@
import com.supwisdom.dlpay.conference.domain.TConferenceDevbind;
import com.supwisdom.dlpay.conference.service.ConferenceService;
import com.supwisdom.dlpay.conference.util.ConferenceConstant;
+import com.supwisdom.dlpay.conference.util.QRCodeUtil;
import com.supwisdom.dlpay.framework.domain.TOperator;
import com.supwisdom.dlpay.framework.util.*;
import com.supwisdom.dlpay.ncmgr.domain.TNcDevice;
@@ -25,6 +26,7 @@
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
+import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
@@ -40,7 +42,6 @@
private NcService ncService;
-
@GetMapping("/conference/index")
public String ConferenceView() {
return "conference/conflist";
@@ -49,16 +50,16 @@
@GetMapping("/conference/conflist")
@ResponseBody
public PageResult<ConferenceShowBean> searchConflist(@RequestParam("page") Integer pageNo,
- @RequestParam("limit") Integer pageSize,
- @RequestParam(value = "confname", required = false) String confname,
- @RequestParam(value = "conftype", required = false) String conftype,
+ @RequestParam("limit") Integer pageSize,
+ @RequestParam(value = "confname", required = false) String confname,
+ @RequestParam(value = "conftype", required = false) String conftype,
@AuthenticationPrincipal UserDetails operUser) {
try {
if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
TOperator oper = (TOperator) operUser;
- String deptcode=oper.getDeptcode();
- return conferenceService.getConferenceInfos(confname, conftype,deptcode, pageNo, pageSize);
+ String deptcode = oper.getDeptcode();
+ return conferenceService.getConferenceInfos(confname, conftype, deptcode, pageNo, pageSize);
} catch (Exception e) {
e.printStackTrace();
return new PageResult<>(99, "系统查询错误");
@@ -85,66 +86,85 @@
}
}
+ @PostMapping("/conference/deleteconfpeople")
+ @ResponseBody
+ public JsonResult deleteConfPeople(@RequestParam String pid) {
+ try {
+ if (null == pid) {
+ return JsonResult.error("参数传递错误");
+ }
+ if (conferenceService.deleteConfPeople(pid)) {
+ return JsonResult.ok("删除成功!");
+ } else {
+ return JsonResult.error("删除失败!");
+ }
+ } catch (WebCheckException ex) {
+ return JsonResult.error(ex.getMessage());
+ } catch (Exception e) {
+ e.printStackTrace();
+ return JsonResult.error("系统处理异常").put("exception", e);
+ }
+ }
+
@GetMapping("/conference/load4addconf")
public String load4addConference(Model model) {
- String now=DateUtil.getNow("yyyyMMdd");
- model.addAttribute("maxdate",DateUtil.reformatDatetime(now,"yyyyMMdd","yyyy-MM-dd"));
- List<TNcDevice> devices=ncService.getSystemDevByType(ConferenceConstant.DEVICETYPE_CONFERENCE);
- model.addAttribute("confdevice",devices);
+ String now = DateUtil.getNow("yyyyMMdd");
+ model.addAttribute("maxdate", DateUtil.reformatDatetime(now, "yyyyMMdd", "yyyy-MM-dd"));
+ List<TNcDevice> devices = ncService.getSystemDevByType(ConferenceConstant.DEVICETYPE_CONFERENCE);
+ model.addAttribute("confdevice", devices);
return "conference/confform";
}
-
@PostMapping("/conference/addconf")
@ResponseBody
public JsonResult editConference(@RequestParam("confname") String confname,
- @RequestParam("conftype") String conftype,
- @RequestParam("confdate") String confdate,
- @RequestParam("starttime") String starttime,
- @RequestParam("endtime") String endtime,
- @RequestParam("attendtime") String attendtime,
- @RequestParam("deviceid") Integer deviceid,
- @RequestParam(value = "file", required = false) MultipartFile file,
- @AuthenticationPrincipal UserDetails operUser,
- HttpServletRequest request) {
+ @RequestParam("conftype") String conftype,
+ @RequestParam("confdate") String confdate,
+ @RequestParam("starttime") String starttime,
+ @RequestParam("endtime") String endtime,
+ @RequestParam("attendtime") String attendtime,
+ @RequestParam("deviceid") Integer deviceid,
+ // @RequestParam(value = "file", required = false) MultipartFile file,
+ @AuthenticationPrincipal UserDetails operUser,
+ HttpServletRequest request) {
try {
if (StringUtil.isEmpty(confname)
- ||null==deviceid
- || (!ConferenceConstant.CONFTYPE_LIST.equals(conftype) && !ConferenceConstant.CONFTYPE_NOLIST.equals(conftype) )
+ || null == deviceid
+ || (!ConferenceConstant.CONFTYPE_LIST.equals(conftype) && !ConferenceConstant.CONFTYPE_NOLIST.equals(conftype))
|| !DateUtil.checkDatetimeValid(starttime, "HH:mm")
|| !DateUtil.checkDatetimeValid(endtime, "HH:mm")
|| !DateUtil.checkDatetimeValid(attendtime, "HH:mm")) {
return JsonResult.error("参数传递错误");
} else if (DateUtil.compareDatetime(endtime, starttime, "HH:mm") <= 0) {
return JsonResult.error("时间范围错误,结束时间必须比起始时间大");
- }else if (DateUtil.compareDatetime(starttime, attendtime, "HH:mm") <= 0) {
+ } else if (DateUtil.compareDatetime(starttime, attendtime, "HH:mm") <= 0) {
return JsonResult.error("时间范围错误,起始时间必须比签到时间大");
}
TOperator oper = (TOperator) operUser;
if (null == oper || StringUtil.isEmpty(oper.getOperid())) {
return JsonResult.error("登录过期,请重新登录");
}
- String path = request.getSession().getServletContext().getRealPath("upload");
+ /* String path = request.getSession().getServletContext().getRealPath("upload");
- String fpath=null;
- if(null!=file){
+ String fpath = null;
+ if (null != file) {
String fileName = file.getOriginalFilename();
File targetFile = new File(path, fileName);
if (!targetFile.exists()) {
targetFile.mkdirs();
}
file.transferTo(targetFile);
- fpath=path + "/" + fileName;
- }
+ fpath = path + "/" + fileName;
+ }*/
- if (conferenceService.saveNewConference(confname.trim(),DateUtil.unParseToDateFormat(confdate), conftype, DateUtil.unParseToDateFormat(starttime), DateUtil.unParseToDateFormat(endtime),DateUtil.unParseToDateFormat(attendtime), oper,fpath,deviceid)) {
+ if (conferenceService.saveNewConference(confname.trim(), DateUtil.unParseToDateFormat(confdate), conftype, DateUtil.unParseToDateFormat(starttime), DateUtil.unParseToDateFormat(endtime), DateUtil.unParseToDateFormat(attendtime), oper, deviceid)) {
return JsonResult.ok("新增成功");
} else {
return JsonResult.error("新增失败");
}
- }catch (WebCheckException e) {
+ } catch (WebCheckException e) {
return JsonResult.ok(599, e.getMessage());
} catch (Exception e) {
e.printStackTrace();
@@ -185,21 +205,21 @@
@GetMapping("/conference/load4detail")
public String load4ConfDetails(@RequestParam("confid") Integer confid, Model model) {
model.addAttribute("detailConfid", confid);
- TNcDevice device=conferenceService.getBindedDevice(confid);
- String devname="未绑定";
- if(null!=device){
- devname=device.getDevname();
+ TNcDevice device = conferenceService.getBindedDevice(confid);
+ String devname = "未绑定";
+ if (null != device) {
+ devname = device.getDevname();
}
- model.addAttribute("deviceName",devname);
+ model.addAttribute("deviceName", devname);
return "conference/confdetail";
}
@GetMapping("/conference/load4detaillist")
@ResponseBody
public PageResult<TConfPeople> searchConfPeople(@RequestParam("page") Integer pageNo,
- @RequestParam("limit") Integer pageSize,
- @RequestParam("confid") Integer confid,
- @RequestParam(value = "searchkey", required = false) String searchkey) {
+ @RequestParam("limit") Integer pageSize,
+ @RequestParam("confid") Integer confid,
+ @RequestParam(value = "searchkey", required = false) String searchkey) {
try {
if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
@@ -211,4 +231,59 @@
}
}
-}
+ @RequestMapping("/conference/getQRCode")
+ @ResponseBody
+ public void getQRCode(@RequestParam("confid") String id, HttpServletResponse httpServletResponse) throws Exception {
+ // QRCodeUtil.createQrCode(new FileOutputStream(new File("d:\\qrcode\\qrcode.jpg")),"confid="+id,800,"JPEG");
+
+ httpServletResponse.setHeader("Cache-Control", "no-store");
+ httpServletResponse.setHeader("Pragma", "no-cache");
+ httpServletResponse.setDateHeader("Expires", 0);
+ httpServletResponse.setContentType("image/jpeg");
+ ServletOutputStream responseOutputStream = httpServletResponse.getOutputStream();
+ QRCodeUtil.createQrCode(responseOutputStream, "confid=" + id, 750, "JPEG");
+ responseOutputStream.flush();
+ responseOutputStream.close();
+
+ }
+
+ @GetMapping("/conference/loadimport")
+ public String loadimport(@RequestParam("confid") Integer confid, Model model) {
+ model.addAttribute("detailConfid", confid);
+ return "conference/import";
+ }
+
+ @PostMapping("/conference/doimport")
+ @ResponseBody
+ public JsonResult editConference(@RequestParam("confid") Integer confid,
+ @RequestParam(value = "file", required = false) MultipartFile file,
+ HttpServletRequest request) {
+ try {
+
+ String path = request.getSession().getServletContext().getRealPath("upload");
+
+ String fpath = null;
+ if (null != file) {
+ String fileName = file.getOriginalFilename();
+ File targetFile = new File(path, fileName);
+ if (!targetFile.exists()) {
+ targetFile.mkdirs();
+ }
+ file.transferTo(targetFile);
+ fpath = path + "/" + fileName;
+ }
+
+ if (conferenceService.saveConferencePeopleByExcel(confid,fpath)) {
+ return JsonResult.ok("新增成功");
+ } else {
+ return JsonResult.error("新增失败");
+ }
+ } catch (WebCheckException e) {
+ return JsonResult.ok(599, e.getMessage());
+ } catch (Exception e) {
+ e.printStackTrace();
+ return JsonResult.error("系统处理异常").put("exception", e);
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/supwisdom/dlpay/conference/dao/ConferenceDao.java b/src/main/java/com/supwisdom/dlpay/conference/dao/ConferenceDao.java
index d18f7e7..3ed44f1 100644
--- a/src/main/java/com/supwisdom/dlpay/conference/dao/ConferenceDao.java
+++ b/src/main/java/com/supwisdom/dlpay/conference/dao/ConferenceDao.java
@@ -16,6 +16,8 @@
List<TConference> findByConfdateAndStatus(String confdate, String status);
+ List<TConference> findByConfdate(String confdate);
+
@Query("from TConference where deptcode=?1 order by confid desc")
List<TConference> findAllByDeptcodeOrderByConfdate(String deptcode);
diff --git a/src/main/java/com/supwisdom/dlpay/conference/service/ConferenceService.java b/src/main/java/com/supwisdom/dlpay/conference/service/ConferenceService.java
index c04be47..16416da 100644
--- a/src/main/java/com/supwisdom/dlpay/conference/service/ConferenceService.java
+++ b/src/main/java/com/supwisdom/dlpay/conference/service/ConferenceService.java
@@ -21,6 +21,9 @@
@Transactional(rollbackFor = Exception.class)
boolean deleteConference(int confid) throws Exception;
+ @Transactional(rollbackFor = Exception.class)
+ boolean deleteConfPeople(String pid) throws Exception;
+
@Transactional(rollbackFor = Exception.class, readOnly = true)
TNcDevice getBindedDevice(int confid) ;
@@ -38,7 +41,11 @@
@Transactional(rollbackFor = Exception.class)
boolean saveNewConference(String confname,String confdate, String conftype, String starttime,
- String endtime, String attendtime, TOperator oper, String filepath,Integer deviceid) throws Exception;
+ String endtime, String attendtime, TOperator oper, Integer deviceid) throws Exception;
+
+ @Transactional(rollbackFor = Exception.class)
+ boolean saveConferencePeopleByExcel(Integer confid,String fpath) throws Exception;
+
@Transactional(rollbackFor = Exception.class, readOnly = true)
PageResult<TConfPeople> getConferenceDetails(String searchkey, int confid, int pageNo, int pageSize);
diff --git a/src/main/java/com/supwisdom/dlpay/conference/service/impl/ConferenceServiceImpl.java b/src/main/java/com/supwisdom/dlpay/conference/service/impl/ConferenceServiceImpl.java
index 627afba..a09dc10 100644
--- a/src/main/java/com/supwisdom/dlpay/conference/service/impl/ConferenceServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/conference/service/impl/ConferenceServiceImpl.java
@@ -133,6 +133,16 @@
}
@Override
+ public boolean deleteConfPeople(String pid) throws Exception {
+ TConfPeople people=confPeopleDao.getOne(pid);
+ if(null == people){
+ throw new WebCheckException("会议人员不存在");
+ }
+ confPeopleDao.delete(people);
+ return true;
+ }
+
+ @Override
public TNcDevice getBindedDevice(int confid) {
TConferenceDevbind bind=conferenceDevbindDao.findByConfid(confid);
if(null!=bind){
@@ -145,7 +155,13 @@
@Override
public List<TConference> getConferenceByDateAndStatus(String confdate,String status) {
- List<TConference> conflist=conferenceDao.findByConfdateAndStatus(confdate,status);
+ List<TConference> conflist;
+ if(!StringUtil.isEmpty(status)){
+ conflist=conferenceDao.findByConfdateAndStatus(confdate,status);
+ }else{
+ conflist=conferenceDao.findByConfdate(confdate);
+ }
+
if(StringUtil.isEmpty(conflist)){
return null;
}
@@ -177,7 +193,7 @@
}*/
@Override
- public boolean saveNewConference(String confname,String confdate, String conftype, String starttime, String endtime,String attendtime, TOperator oper, String fpath,Integer deviceid) throws Exception {
+ public boolean saveNewConference(String confname,String confdate, String conftype, String starttime, String endtime,String attendtime, TOperator oper, Integer deviceid) throws Exception {
String errdevname=checkTimeErrorDevice(attendtime,endtime,confdate,deviceid);
if(!StringUtil.isEmpty(errdevname)){
@@ -206,10 +222,18 @@
bind.setDeviceid(deviceid);
conferenceDevbindDao.save(bind);
- if(ConferenceConstant.CONFTYPE_NOLIST.equals(conf.getConftype())){
- return true;
- }
+
+ return true;
+
+ }
+
+ @Override
+ public boolean saveConferencePeopleByExcel(Integer confid, String fpath) throws Exception {
+ TConference conference=conferenceDao.findByConfid(confid);
+ if(null==conference){
+ throw new WebCheckException("会议不存在");
+ }
List<String> successCardnos = new ArrayList<>(0);
List<String> errmsgList = new ArrayList<>(0);
@@ -246,10 +270,9 @@
if (!StringUtil.isEmpty(cardno) && successCardnos.contains(cardno)) {
msg += ",市民卡号重复!";
}
- String errconfname=checkConfTimeError(attendtime,endtime,confdate,cardno);
+ String errconfname=checkConfTimeError(conference.getAttendtime(),conference.getEndtime(),conference.getConfdate(),cardno);
if(!StringUtil.isEmpty(errconfname)){
- // throw new WebCheckException("会议与《"+ StringUtils.join(errconfname.toArray(),",")+"》存在时间冲突,请重新设置会议时间");
- msg += ",市民卡号[" + cardno + "]与会议:"+errconfname+"存在规则时间段冲突!";
+ msg += ",市民卡号[" + cardno + "]在会议:"+errconfname+"中已存在!";
}
if (!StringUtil.isEmpty(msg)) {
@@ -259,7 +282,7 @@
people.setAttstatus(ConferenceConstant.ATTENDSTATUS_UNCHECK);
people.setCardno(cardno);
people.setCustid(customer.getCustid());
- people.setConfid(conf.getConfid());
+ people.setConfid(conference.getConfid());
people.setLastsaved(DateUtil.getNow());
people.setCustname(name);
confPeopleDao.save(people); //保存明细
@@ -283,8 +306,8 @@
}
throw new WebCheckException(errmsg.toString());
}
- return true;
+ return true;
}
@Override
@@ -292,8 +315,8 @@
StringBuffer querySql = new StringBuffer("from TConfPeople t where t.confid=:confid ");
StringBuffer countSql = new StringBuffer("select count(t.pid) as cnt from TConfPeople t where t.confid=:confid ");
if (!StringUtil.isEmpty(searchkey)) {
- querySql.append(" and (t.cardno like :str or t.username like :str) ");
- countSql.append(" and (t.cardno like :str or t.username like :str) ");
+ querySql.append(" and (t.cardno like :str or t.custname like :str) ");
+ countSql.append(" and (t.cardno like :str or t.custname like :str) ");
}
querySql.append(" order by t.cardno ");
Query query = entityManager.createQuery(querySql.toString());
diff --git a/src/main/java/com/supwisdom/dlpay/conference/util/ConferenceConstant.java b/src/main/java/com/supwisdom/dlpay/conference/util/ConferenceConstant.java
index ec63725..5c43481 100644
--- a/src/main/java/com/supwisdom/dlpay/conference/util/ConferenceConstant.java
+++ b/src/main/java/com/supwisdom/dlpay/conference/util/ConferenceConstant.java
@@ -18,13 +18,4 @@
public static final Integer CONFDTL_STATUS_UPDATED=1;
public static final Integer CONFDTL_STATUS_UNUPDATE=0;
-
- public static void main(String[] args) {
- String i="1100";
- String l="1200";
- System.out.println(DateUtil.compareDatetime(l,i,"HHmm"));
- }
-
-
-
}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/util/QRCodeUtil.java b/src/main/java/com/supwisdom/dlpay/conference/util/QRCodeUtil.java
new file mode 100644
index 0000000..950fff1
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/util/QRCodeUtil.java
@@ -0,0 +1,44 @@
+package com.supwisdom.dlpay.conference.util;
+
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.EncodeHintType;
+import com.google.zxing.WriterException;
+import com.google.zxing.common.BitMatrix;
+import com.google.zxing.qrcode.QRCodeWriter;
+import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
+
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Hashtable;
+
+public class QRCodeUtil {
+
+ public static boolean createQrCode(OutputStream outputStream,
+ String content, int qrCodeSize, String imageFormat)
+ throws WriterException, IOException {
+ Hashtable<EncodeHintType, ErrorCorrectionLevel> hintMap = new Hashtable<EncodeHintType, ErrorCorrectionLevel>();
+ hintMap.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); // L-7%,M-15%,Q-25%,H-30%
+ QRCodeWriter qrCodeWriter = new QRCodeWriter();
+ BitMatrix byteMatrix = qrCodeWriter.encode(content,
+ BarcodeFormat.QR_CODE, qrCodeSize, qrCodeSize, hintMap);
+ int matrixWidth = byteMatrix.getWidth();
+ BufferedImage image = new BufferedImage(matrixWidth - 200,
+ matrixWidth - 200, BufferedImage.TYPE_INT_RGB);
+ image.createGraphics();
+ Graphics2D graphics = (Graphics2D) image.getGraphics();
+ graphics.setColor(Color.WHITE);
+ graphics.fillRect(0, 0, matrixWidth, matrixWidth);
+ graphics.setColor(Color.BLACK);
+ for (int i = 0; i < matrixWidth; i++) {
+ for (int j = 0; j < matrixWidth; j++) {
+ if (byteMatrix.get(i, j)) {
+ graphics.fillRect(i - 100, j - 100, 1, 1);
+ }
+ }
+ }
+ return ImageIO.write(image, imageFormat, outputStream);
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/customer/bean/TCustomerExportBean.java b/src/main/java/com/supwisdom/dlpay/customer/bean/TCustomerExportBean.java
new file mode 100644
index 0000000..cad153b
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/customer/bean/TCustomerExportBean.java
@@ -0,0 +1,70 @@
+package com.supwisdom.dlpay.customer.bean;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class TCustomerExportBean 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 deptname;
+ @Excel(name = "客户类型")
+ private String custtypename;
+
+ 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 getDeptname() {
+ return deptname;
+ }
+
+ public void setDeptname(String deptname) {
+ this.deptname = deptname;
+ }
+
+ public String getCusttypename() {
+ return custtypename;
+ }
+
+ public void setCusttypename(String custtypename) {
+ this.custtypename = custtypename;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/customer/controller/CustomerController.java b/src/main/java/com/supwisdom/dlpay/customer/controller/CustomerController.java
index bd11ebf..6cd7f45 100644
--- a/src/main/java/com/supwisdom/dlpay/customer/controller/CustomerController.java
+++ b/src/main/java/com/supwisdom/dlpay/customer/controller/CustomerController.java
@@ -1,12 +1,17 @@
package com.supwisdom.dlpay.customer.controller;
+import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
+import cn.afterturn.easypoi.excel.entity.ExportParams;
+import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
+import cn.afterturn.easypoi.view.PoiBaseView;
import com.google.gson.Gson;
import com.supwisdom.dlpay.api.bean.JsonResult;
import com.supwisdom.dlpay.api.bean.QueryUserParam;
import com.supwisdom.dlpay.api.bean.UserInforResponse;
import com.supwisdom.dlpay.customer.bean.CustomerSaveBean;
import com.supwisdom.dlpay.customer.bean.CustomerSearchBean;
+import com.supwisdom.dlpay.customer.bean.TCustomerExportBean;
import com.supwisdom.dlpay.doorlist.bean.CustomerListBean;
import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
import com.supwisdom.dlpay.framework.domain.TOperator;
@@ -14,8 +19,10 @@
import com.supwisdom.dlpay.framework.util.PageResult;
import com.supwisdom.dlpay.framework.util.StringUtil;
import com.supwisdom.dlpay.framework.util.WebConstant;
+import com.supwisdom.dlpay.mainservice.bean.TDoordtlInfo;
import com.supwisdom.dlpay.mainservice.service.WebInterfaceService;
import com.supwisdom.dlpay.paysdk.proxy.UserProxy;
+import com.supwisdom.dlpay.system.bean.TreeSelectNode;
import com.supwisdom.dlpay.system.domain.TCustType;
import com.supwisdom.dlpay.system.domain.TDept;
import com.supwisdom.dlpay.system.service.SystemService;
@@ -25,7 +32,12 @@
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
@Controller
@RequestMapping("/customer")
@@ -42,7 +54,7 @@
@RequestMapping("/index")
public String indexView(ModelMap model) {
List<TCustType> lst = systemService.findAllCusttype();
- List<TDept> dept=systemService.findAllDept();
+ List<TDept> dept = systemService.findAllDept();
Gson gson = new Gson();
String deptString = gson.toJson(dept);
model.put("deptlist", deptString);
@@ -56,21 +68,23 @@
@ResponseBody
public PageResult<TCustomerInfo> getDataList(@RequestParam("page") Integer pageNo,
@RequestParam("limit") Integer pageSize,
- @RequestParam(value = "searchkey", required = false) String searchKey,
+ @RequestParam(value = "custname", required = false) String custname,
+ // @RequestParam(value = "deptcode", required = false) String deptcode,
@AuthenticationPrincipal TOperator operUser) {
try {
if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
CustomerSearchBean searchBean = new CustomerSearchBean();
searchBean.setPageNo(pageNo);
- searchBean.setCustname(searchKey);
+ searchBean.setCustname(custname);
searchBean.setPageSize(pageSize);
- String deptcode=operUser.getDeptcode();
- if(!StringUtil.isEmpty(deptcode)){
- searchBean.setDeptcode(deptcode);
+ String deptcode="";
+ if (StringUtil.isEmpty(deptcode)&&!"S".equals(operUser.getOpertype())) {
+ deptcode = operUser.getDeptcode();
}
+ searchBean.setDeptcode(deptcode);
- PageResult<TCustomerInfo> bean= webInterfaceService.getCustomerInfoPage(searchBean);
+ PageResult<TCustomerInfo> bean = webInterfaceService.getCustomerInfoPage(searchBean);
return bean;
} catch (Exception e) {
@@ -82,10 +96,10 @@
@GetMapping("/loadadd")
public String loadadd(Model model) {
- List<TCustType> list=systemService.findAllCusttype();
- model.addAttribute("typelist",list);
- List<TDept> deptlist=systemService.findAllDept();
- model.addAttribute("deptlist",deptlist);
+ List<TCustType> list = systemService.findAllCusttype();
+ model.addAttribute("typelist", list);
+ List<TDept> deptlist = systemService.findAllDept();
+ model.addAttribute("deptlist", deptlist);
return "doorlist/customer/form";
}
@@ -95,15 +109,15 @@
public JsonResult add(@RequestBody CustomerListBean customer,
@AuthenticationPrincipal TOperator operUser) {
if (customer != null) {
- String operid=operUser.getOperid();
+ String operid = operUser.getOperid();
String now = DateUtil.getNow();
QueryUserParam queryUserParam = new QueryUserParam();
queryUserParam.setCitizencardno(customer.getCardno());
UserInforResponse response = userProxy.querybycardno(queryUserParam);
if (response.getRetcode() != 0) {
- return JsonResult.error("核心平台验证人员失败:"+response.getRetmsg());
+ return JsonResult.error("核心平台验证人员失败:" + response.getRetmsg());
}
- webInterfaceService.doSaveCustomerAndCard(operid,now,customer,response);
+ webInterfaceService.doSaveCustomerAndCard(operid, now, customer, response);
return JsonResult.ok();
} else {
return JsonResult.error("添加失败");
@@ -112,14 +126,57 @@
@PostMapping("/delete")
@ResponseBody
- public JsonResult delete(@RequestParam String custid) {
- boolean flag=webInterfaceService.deleteCustomer(custid);
- if(flag){
+ public JsonResult delete(@RequestParam String custid) {
+ boolean flag = webInterfaceService.deleteCustomer(custid);
+ if (flag) {
return JsonResult.ok();
}
return JsonResult.error("删除失败");
}
+ @GetMapping("/depttree")
+ @ResponseBody
+ public List<TreeSelectNode> searchDeptTree() {
+ List<TreeSelectNode> tree = systemService.getDeptSelectTree();
+ return tree;
+ }
+ @ResponseBody
+ @RequestMapping(value = "/exportexcel")
+ public void exportexcel(HttpServletRequest request, HttpServletResponse response,
+ @RequestParam(value = "custname", required = false, defaultValue = "all") String custname,
+ @AuthenticationPrincipal TOperator operUser) {
+
+ Map map = new HashMap();
+ try {
+ /**
+ * 1. 查询数据
+ */
+ // final int max_field = 9;
+ // 保存表字段
+ List<TCustomerExportBean> bean = null;
+ String deptcode="";
+ if(!"S".equals(operUser.getOpertype())){
+ deptcode=operUser.getDeptcode();
+ }
+ bean=webInterfaceService.getCustomerExportBean(custname,deptcode);
+
+ /**
+ * 2.设置表格属性: title:标题 sheetName:工作簿名 type:表格类型
+ */
+ ExportParams params = new ExportParams("人员表", "人员", ExcelType.XSSF);
+// params.setFreezeCol(2);
+ map.put(NormalExcelConstants.DATA_LIST, bean);//设置值
+ map.put(NormalExcelConstants.PARAMS, params);//设置属性
+ map.put(NormalExcelConstants.CLASS, TCustomerExportBean.class);
+ map.put(NormalExcelConstants.FILE_NAME, "设备流水名单");
+ PoiBaseView.render(map, request, response, NormalExcelConstants.EASYPOI_EXCEL_VIEW);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ map.put("result", "导出excel文件失败");
+ }
+
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/dao/CustomerDao.java b/src/main/java/com/supwisdom/dlpay/mainservice/dao/CustomerDao.java
index 1fe805b..e6e5001 100644
--- a/src/main/java/com/supwisdom/dlpay/mainservice/dao/CustomerDao.java
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/dao/CustomerDao.java
@@ -1,6 +1,7 @@
package com.supwisdom.dlpay.mainservice.dao;
import com.supwisdom.dlpay.customer.bean.CustomerSearchBean;
+import com.supwisdom.dlpay.customer.bean.TCustomerExportBean;
import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
import com.supwisdom.dlpay.framework.util.PageResult;
import com.supwisdom.dlpay.mainservice.domain.TCustomer;
@@ -22,4 +23,6 @@
public PageResult<TCustomerInfo> getCustomerInfoPage(CustomerSearchBean param);
boolean deleteCustomer(String custid);
+
+ List<TCustomerExportBean> getCustomerExportList(String custname,String deptcode);
}
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
index aab4496..d9af3d7 100644
--- a/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/CustomerDaoImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/CustomerDaoImpl.java
@@ -1,6 +1,7 @@
package com.supwisdom.dlpay.mainservice.dao.impl;
import com.supwisdom.dlpay.customer.bean.CustomerSearchBean;
+import com.supwisdom.dlpay.customer.bean.TCustomerExportBean;
import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
import com.supwisdom.dlpay.framework.util.PageResult;
import com.supwisdom.dlpay.framework.util.StringUtil;
@@ -100,15 +101,7 @@
List<String> childdplist=null;
String deptcode=param.getDeptcode();
- if (!StringUtil.isEmpty(deptcode)&&!"0".equals(deptcode)) {
- Query chirdGroupQuery = entityManager.createNativeQuery("WITH RECURSIVE r AS(" +
- "SELECT * FROM tb_dept WHERE deptcode =:deptcode " +
- "union ALL " +
- "SELECT t.* FROM tb_dept t, r WHERE t.fdeptcode = r.deptcode) " +
- "select deptcode from r order by deptno");
- chirdGroupQuery.setParameter("deptcode", deptcode);
- childdplist = chirdGroupQuery.getResultList(); //递归查询所有的子节点
- }
+ childdplist = getChildDeptlist(childdplist, deptcode);
String perName=param.getCustname();
String sql = "select a.custid,a.custname,a.deptcode,a.custtypeid,b.cardno,b.bankcardno,b.cardphyid,b.expiredate from T_Customer a left join t_card b on a.custid = b.custid " +
@@ -144,6 +137,19 @@
return new PageResult<>(count.longValue(), list);
}
+ private List<String> getChildDeptlist(List<String> childdplist, String deptcode) {
+ if (!StringUtil.isEmpty(deptcode)&&!"0".equals(deptcode)) {
+ Query chirdGroupQuery = entityManager.createNativeQuery("WITH RECURSIVE r AS(" +
+ "SELECT * FROM tb_dept WHERE deptcode =:deptcode " +
+ "union ALL " +
+ "SELECT t.* FROM tb_dept t, r WHERE t.fdeptcode = r.deptcode) " +
+ "select deptcode from r order by deptno");
+ chirdGroupQuery.setParameter("deptcode", deptcode);
+ childdplist = chirdGroupQuery.getResultList(); //递归查询所有的子节点
+ }
+ return childdplist;
+ }
+
@Transactional
@Override
public TCustomerInfo getTCustomerByExcel(String cardno) {
@@ -173,4 +179,30 @@
}
return flag;
}
+
+ @Override
+ public List<TCustomerExportBean> getCustomerExportList(String custname,String deptcode) {
+ List<String> childdplist=null;
+ childdplist = getChildDeptlist(childdplist, deptcode);
+ String sql = "select a.custname,a.deptname,a.custtypename,b.cardno,b.bankcardno,b.cardphyid from T_Customer a left join t_card b on a.custid = b.custid " +
+ " where a.status='1' and b.status='normal' and b.transtatus='normal' ";
+
+ if (!StringUtil.isEmpty(custname)){
+ sql += " and a.custname like :perName ";
+ }
+ if (!StringUtil.isEmpty(childdplist)) {
+ sql+=" and a.deptcode in ('"+ StringUtils.join(childdplist.toArray(),"','")+"') ";
+
+ }
+ sql +=" order by b.cardno desc ";
+
+ Query query = entityManager.createNativeQuery(sql);
+ if (!StringUtil.isEmpty(custname)){
+ query.setParameter("perName", "%"+custname+"%");
+ }
+
+ query.unwrap(NativeQueryImpl.class).setResultTransformer(Transformers.aliasToBean(TCustomerExportBean.class));
+ List<TCustomerExportBean> list = query.getResultList();
+ return list;
+ }
}
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 1dc753c..ca2da77 100644
--- a/src/main/java/com/supwisdom/dlpay/mainservice/service/WebInterfaceService.java
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/service/WebInterfaceService.java
@@ -2,6 +2,7 @@
import com.supwisdom.dlpay.api.bean.UserInforResponse;
import com.supwisdom.dlpay.customer.bean.CustomerSearchBean;
+import com.supwisdom.dlpay.customer.bean.TCustomerExportBean;
import com.supwisdom.dlpay.doorlist.bean.CustomerListBean;
import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
import com.supwisdom.dlpay.framework.util.PageResult;
@@ -146,6 +147,8 @@
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
PageResult<TCustomerInfo> getCustomerInfoPage(CustomerSearchBean bean);
+ @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
+ List<TCustomerExportBean> getCustomerExportBean(String custname,String deptcode);
- }
+}
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 76e3775..469cd16 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
@@ -2,6 +2,7 @@
import com.supwisdom.dlpay.api.bean.UserInforResponse;
import com.supwisdom.dlpay.customer.bean.CustomerSearchBean;
+import com.supwisdom.dlpay.customer.bean.TCustomerExportBean;
import com.supwisdom.dlpay.doorlist.bean.CustomerListBean;
import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
import com.supwisdom.dlpay.framework.util.PageResult;
@@ -246,4 +247,9 @@
public PageResult<TCustomerInfo> getCustomerInfoPage(CustomerSearchBean bean){
return customerDao.getCustomerInfoPage(bean);
}
+
+ @Override
+ public List<TCustomerExportBean> getCustomerExportBean(String custname, String deptcode) {
+ return customerDao.getCustomerExportList(custname,deptcode);
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/system/dao/DeptDao.java b/src/main/java/com/supwisdom/dlpay/system/dao/DeptDao.java
index 9c99e27..a113305 100644
--- a/src/main/java/com/supwisdom/dlpay/system/dao/DeptDao.java
+++ b/src/main/java/com/supwisdom/dlpay/system/dao/DeptDao.java
@@ -16,10 +16,14 @@
@Query("from TDept t where t.status='normal' ")
List<TDept> findNormalDept();
- Page<TDept> findAllByDeptnameContainingOrDeptnoContaining(String name,String deptno, Pageable pageable);
+ @Query("from TDept t order by deptcode")
+ List<TDept> findAllOrderByDeptcode();
+
+ Page<TDept> findAllByDeptnameContainingOrDeptnoContainingOrderByDeptcode(String name,String deptno, Pageable pageable);
@Query("select count(t.deptno) from TDept t where t.deptno=?1 ")
long checkDeptnoExists(String deptno);
List<TDept> findByDeptno(String deptno);
+
}
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 4d0dfe1..12a2bba 100644
--- a/src/main/java/com/supwisdom/dlpay/system/service/SystemService.java
+++ b/src/main/java/com/supwisdom/dlpay/system/service/SystemService.java
@@ -4,10 +4,7 @@
import com.supwisdom.dlpay.api.bean.JsonResult;
import com.supwisdom.dlpay.framework.util.PageResult;
import com.supwisdom.dlpay.ncmgr.domain.TBuilding;
-import com.supwisdom.dlpay.system.bean.AllotBuildingBean;
-import com.supwisdom.dlpay.system.bean.CustTypeSearchBean;
-import com.supwisdom.dlpay.system.bean.DeptSearchBean;
-import com.supwisdom.dlpay.system.bean.RegionZTreeNodes;
+import com.supwisdom.dlpay.system.bean.*;
import com.supwisdom.dlpay.system.domain.*;
import com.supwisdom.dlpay.system.page.Pagination;
import org.springframework.transaction.annotation.Propagation;
@@ -243,4 +240,8 @@
@Transactional(rollbackFor = Exception.class, readOnly = true)
TDept getDeptByDeptno(String deptno);
+
+ @Transactional(rollbackFor = Exception.class, readOnly = true)
+ List<TreeSelectNode> getDeptSelectTree();
+
}
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 369a23f..166403e 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
@@ -5,10 +5,7 @@
import com.supwisdom.dlpay.framework.util.PageResult;
import com.supwisdom.dlpay.framework.util.StringUtil;
import com.supwisdom.dlpay.ncmgr.domain.TBuilding;
-import com.supwisdom.dlpay.system.bean.AllotBuildingBean;
-import com.supwisdom.dlpay.system.bean.CustTypeSearchBean;
-import com.supwisdom.dlpay.system.bean.DeptSearchBean;
-import com.supwisdom.dlpay.system.bean.RegionZTreeNodes;
+import com.supwisdom.dlpay.system.bean.*;
import com.supwisdom.dlpay.system.dao.*;
import com.supwisdom.dlpay.system.domain.*;
import com.supwisdom.dlpay.system.page.Pagination;
@@ -341,7 +338,7 @@
Pageable pageable = PageRequest.of(param.getPageNo() - 1, param.getPageSize()
, Sort.by("deptno"));
if (!StringUtil.isEmpty(param.getSearchkey())) {
- return new PageResult<>(deptDao.findAllByDeptnameContainingOrDeptnoContaining(param.getSearchkey(), param.getSearchkey(), pageable));
+ return new PageResult<>(deptDao.findAllByDeptnameContainingOrDeptnoContainingOrderByDeptcode(param.getSearchkey(), param.getSearchkey(), pageable));
}
return new PageResult<>(deptDao.findAll(pageable));
@@ -349,7 +346,7 @@
@Override
public List<TDept> findAllDept() {
- return deptDao.findAll();
+ return deptDao.findAllOrderByDeptcode();
}
@Override
@@ -383,4 +380,32 @@
List<TDept> dept=deptDao.findByDeptno(deptno);
return dept.size()>0?dept.get(0):null;
}
+
+ public List<TreeSelectNode> getDeptSelectTree() {
+ List<TDept> groupList = deptDao.findAll();
+ if (StringUtil.isEmpty(groupList)) return new ArrayList<>(0);
+ return getDeptTree(groupList, "-1");
+ }
+
+ private List<TreeSelectNode> getDeptTree(List<TDept> groupList, String pid) {
+ List<TreeSelectNode> result = new ArrayList<>(0);
+ for (TDept gp : groupList) {
+ if (("-1".equals(pid) && "-1".equals(gp.getFdeptcode())) || (null != pid && pid.equals(gp.getFdeptcode()))) {
+ TreeSelectNode node = new TreeSelectNode();
+ node.setId(gp.getDeptcode());
+ node.setName(gp.getDeptname());
+ node.setOpen(true);
+ // node.setGrouptype(gp.getGrouptype());
+ node.setChecked(false);
+ List<TreeSelectNode> children = getDeptTree(groupList, gp.getDeptcode());
+ if (!StringUtil.isEmpty(children)) {
+ node.setChildren(children);
+ } else {
+ node.setChildren(null);
+ }
+ result.add(node);
+ }
+ }
+ return result;
+ }
}
diff --git a/src/main/kotlin/com/supwisdom/dlpay/security.kt b/src/main/kotlin/com/supwisdom/dlpay/security.kt
index 0a1404a..cfd7f4c 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/security.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/security.kt
@@ -123,6 +123,7 @@
.antMatcher("/api/**")
.authorizeRequests()
.antMatchers("/api/auth/**").permitAll()
+ .antMatchers("/api/conference/**").permitAll()
.antMatchers("/api/notify/**").permitAll()
.antMatchers("/api/common/**").hasAnyRole("THIRD_COMMON", "THIRD_ADMIN")
.antMatchers("/api/consume/**").hasRole("THIRD_CONSUME")
diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql
index 7962596..4740cba 100644
--- a/src/main/resources/data.sql
+++ b/src/main/resources/data.sql
@@ -196,3 +196,15 @@
INSERT INTO tb_systemparam(param_key,param_value,param_desc,param_flag) VALUES ('IMPCUSTOME_FIRST_TIME','','第一次名单导入时间','1');
INSERT INTO tb_systemparam(param_key,param_value,param_desc,param_flag) VALUES ('PAYAPI_APPID','300003','登录核心平台appid','1');
INSERT INTO tb_systemparam(param_key,param_value,param_desc,param_flag) VALUES ('PAYAPI_SECRET','b32309b244904e1789b055eb1da51db1','登录核心平台secret','1');
+
+
+
+INSERT INTO "t_dictionary"("dicttype", "dicttypename", "dictval", "dictcaption") VALUES (8, '设备类型', 'H', '会议平板');
+INSERT INTO "t_dictionary"("dicttype", "dicttypename", "dictval", "dictcaption") VALUES (16, '设备使用类别', 'HY', '会议签到');
+
+INSERT INTO "tb_function"("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", "grade") VALUES (29, NULL, 0, NULL, 'layui-icon-app', '#', '会议签到', 8, -1, NULL);
+INSERT INTO "tb_function"("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", "grade") VALUES (31, NULL, 1, NULL, '', '/system/custtypeindex', '客户类别管理', 9, 3, NULL);
+INSERT INTO "tb_function"("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", "grade") VALUES (32, NULL, 1, NULL, '', '/system/deptindex', '部门管理', 10, 3, NULL);
+INSERT INTO "tb_function"("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", "grade") VALUES (33, NULL, 1, NULL, '', '/customer/index', '客户管理', 2, 21, NULL);
+INSERT INTO "tb_function"("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", "grade") VALUES (35, NULL, 1, NULL, '', '/conference/index', '会议管理', 1, 29, NULL);
+INSERT INTO "tb_function"("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", "grade") VALUES (39, NULL, 1, NULL, '', '/confpeople/index', '会议人员查询', 2, 29, NULL);
\ No newline at end of file
diff --git a/src/main/resources/templates/conference/confdetail.html b/src/main/resources/templates/conference/confdetail.html
index fc7afc2..8a606ff 100644
--- a/src/main/resources/templates/conference/confdetail.html
+++ b/src/main/resources/templates/conference/confdetail.html
@@ -6,12 +6,19 @@
</div>
<div class="layui-form toolbar">
搜索:
- <input type="hidden" id="search-conference-detail-confid" th:value="${detailConfid}" />
- <input id="search-conference-detail-searchkey" class="layui-input search-input" maxlength="20" type="text" style="width: 200px;"
+ <input type="hidden" id="search-conference-detail-confid" th:value="${detailConfid}"/>
+ <input id="search-conference-detail-searchkey" class="layui-input search-input" maxlength="20" type="text"
+ style="width: 200px;"
placeholder="输入市民卡号或姓名查询"/> 
<button id="btn-search-conference-detail" class="layui-btn icon-btn" data-type="search"><i
class="layui-icon"></i>搜索
</button>
+ <!--<div class="layui" style="width:100px;height:100px;display: inline-block;">
+ <a href="" download="qrcode" id="qrcodeDownload">
+ <img border="0" src="" id="qrcode" style="width:100%;height:auto;">
+ </a>
+ </div>-->
+
</div>
<table class="layui-table" id="conferenceDetailTable" lay-filter="conferenceDetailTable-filter"></table>
</div>
@@ -19,11 +26,24 @@
<script>
layui.use(['form', 'table', 'layer', 'admin', 'element'], function () {
- var form = layui.form;
var table = layui.table;
- var admin = layui.admin;
- var element = layui.element;
+ let admin = layui.admin;
+ var token = $("meta[name='_csrf_token']").attr("value");
+ var confid = $("#search-conference-detail-confid").val();
+ /* var url = '[[@{/conference/getQRCode}]]?confid=' + confid;
+ $.ajax({
+ url: url,
+ type: 'get',
+ headers: {
+ 'Accept': 'application/json',
+ 'X-CSRF-TOKEN': token,
+ },
+ success: function (result) {
+ }
+ })
+ $("#qrcode").attr("src", url);
+ $("#qrcodeDownload").attr("href", url);*/
// 渲染表格
var renderDetailTable = function (obj) {
@@ -36,12 +56,22 @@
cols: [
[
{field: 'cardno', title: '市民卡号', align: 'center'},
- {field: 'custname', title: '姓名', align: 'center'}
+ {field: 'custname', title: '姓名', align: 'center'},
+ {
+ field: 'custid',
+ align: 'center',
+ width: 160,
+ title: '操作',
+ fixed: 'right',
+ templet: function (item) {
+ return ' <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="cp-del"><i class="layui-icon layui-icon-delete"></i>删除</a>'
+ }
+ }
]
]
});
}
- renderDetailTable({confid: $("#search-conference-detail-confid").val()});
+ renderDetailTable({confid: confid});
// 搜索按钮点击事件
$('#btn-search-conference-detail').click(function () {
@@ -50,5 +80,42 @@
table.reload('conferenceDetailTable', {where: {confid: confid, searchkey: searchkey}, page: {curr: 1}});
});
+ table.on('tool(conferenceDetailTable-filter)', function (obj) {
+ let data = obj.data;
+ let layEvent = obj.event;
+ if (layEvent === 'cp-del') {
+ showDelete(data);
+ }
+ });
+ let showDelete = function (data) {
+ layer.confirm('确定要删除吗?', function (i) {
+ layer.close(i);
+ layer.load(2);
+ let token = $("meta[name='_csrf_token']").attr("value");
+ admin.go('[[@{/conference/deleteconfpeople}]]', {
+ pid: data.pid,
+ _csrf: token
+ }, function (data) {
+ console.log(data.code);
+ layer.closeAll('loading');
+ if (data.code == 200) {
+ layer.msg(data.msg, {icon: 1});
+ } else if (data.code == 401) {
+ layer.msg(data.msg, {icon: 2, time: 1500}, function () {
+ location.replace('/login');
+ }, 1000);
+ return;
+ } else {
+ layer.msg(data.msg, {icon: 2});
+ }
+ table.reload('conferenceDetailTable', {});
+ }, function (ret) {
+ console.log(ret);
+ layer.closeAll('loading');
+ layer.msg('请求失败了,请稍后再试', {icon: 2});
+ });
+ });
+ }
+
});
</script>
\ No newline at end of file
diff --git a/src/main/resources/templates/conference/confform.html b/src/main/resources/templates/conference/confform.html
index 2a9b697..4b404db 100644
--- a/src/main/resources/templates/conference/confform.html
+++ b/src/main/resources/templates/conference/confform.html
@@ -4,9 +4,9 @@
<label class="confinput-label layui-form-label confinput-label">会议类型</label>
<div class="layui-input-block">
<input type="radio" name="conftype" id="form-conference-conftype-list"
- lay-filter="conference-conftype-filter" value="list" title="有名单" checked/>
+ lay-filter="conference-conftype-filter" value="list" title="名单会议" checked/>
<input type="radio" name="conftype" id="form-conference-conftype-nolist"
- lay-filter="conference-conftype-filter" value="nolist" title="无名单"/>
+ lay-filter="conference-conftype-filter" value="nolist" title="临时会议"/>
</div>
</div>
@@ -20,7 +20,7 @@
</div>
</div>
<div class="layui-form-item">
- <label class="confinput-label layui-form-label"><span style="color: red">* </span>会议名称</label>
+ <label class="confinput-label layui-form-label"><span style="color: red">* </span>会议日期</label>
<div class="layui-input-inline">
<input type="text" name="confdate" id="form-conference-confdate" placeholder="会议日期" th:value="${maxdate}"
autocomplete="off" class="layui-input"/>
@@ -60,7 +60,7 @@
</div>
</div>
- <div class="layui-form-item" id="conference-conflist">
+<!-- <div class="layui-form-item" id="conference-conflist">
<label class="confinput-label layui-form-label"><span style="color: red">* </span>会议人员</label>
<div class="layui-input-inline" style="width: auto;">
@@ -73,7 +73,7 @@
<a th:href="@{/conference/downloadexcel}"
style="color: blue;text-decoration: none;cursor: pointer;">下载名单模板</a>
</div>
- </div>
+ </div>-->
<div class="layui-form-item model-form-footer">
<button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
@@ -119,18 +119,18 @@
form.render("radio");
- form.on('radio(conference-conftype-filter)', function (data) {
+ /* form.on('radio(conference-conftype-filter)', function (data) {
changeDiscountRuletype(data.value);
confType = data.value;
- });
+ });*/
- var changeDiscountRuletype = function (val) {
+ /* var changeDiscountRuletype = function (val) {
if ('nolist' == val) {
$("#conference-conflist").hide();
} else {
$("#conference-conflist").show();
}
- }
+ }*/
form.on('submit(conference-form-submit)', function (data) {
var token = $("meta[name='_csrf_token']").attr("value");
@@ -156,7 +156,7 @@
formData.append("attendtime", vdata.attendtime);
formData.append("confdate",vdata.confdate);
formData.append("deviceid",vdata.deviceid);
- var flag=false;
+ /* var flag=false;
var files = $('#form-conference-records').prop('files');
for (var i = 0; i < files.length; i++) {
var filename = files[i].name;
@@ -171,7 +171,7 @@
if (!flag&&"list"==vdata.conftype) {
layer.msg("请选择名单", {icon: 2, time: 1500});
return;
- }
+ }*/
layer.load(2);
$.ajax({
diff --git a/src/main/resources/templates/conference/conflist.html b/src/main/resources/templates/conference/conflist.html
index 71a4011..b0c951f 100644
--- a/src/main/resources/templates/conference/conflist.html
+++ b/src/main/resources/templates/conference/conflist.html
@@ -11,8 +11,8 @@
搜索:
<select id="search-conference-conftype">
<option value=""> 选择会议类型</option>
- <option value="list"> 有名单</option>
- <option value="nolist"> 无名单</option>
+ <option value="list"> 名单会议</option>
+ <option value="nolist"> 临时会议</option>
</select> 
<input id="search-conference-confname" class="layui-input search-input" maxlength="20" type="text"
placeholder="输入名称查询"/> 
@@ -32,12 +32,15 @@
{{# if(d.status=='unstart'&&d.conftype=='list'){ }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
+ <a class="layui-btn layui-btn layui-btn-xs" lay-event="people">分配人员</a>
<a class="layui-btn layui-btn layui-btn-xs" lay-event="detail">查看明细</a>
{{# } else if(d.status=='unstart'&&d.conftype=='nolist'){ }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
{{# } else if(d.status!='unstart'&&d.conftype=='list'){ }}
+ <a class="layui-btn layui-btn layui-btn-xs" lay-event="people">分配人员</a>
<a class="layui-btn layui-btn layui-btn-xs" lay-event="detail">查看明细</a>
{{# } }}
+
</script>
<script>
@@ -67,9 +70,9 @@
sort: true,
templet: function (d) {
if ('list' == d.conftype) {
- return '有名单';
+ return '名单会议';
} else if ('nolist' == d.conftype) {
- return '无名单';
+ return '临时会议';
} else {
return d.conftype;
}
@@ -117,7 +120,6 @@
//监听单元格
table.on('tool(conferenceTable-filter)', function (obj) {
var data = obj.data;
- console.log(data);
if ('del' == obj.event) {
layer.confirm('确定直接删除会议【' + data.confname + '】吗?', {
btn: ['确定', '取消']
@@ -128,7 +130,6 @@
_csrf:token,
id: data.confid
}, function (data) {
- console.log(data.code);
layer.closeAll('loading');
if (data.code == 200) {
layer.msg(data.msg, {icon: 1});
@@ -182,7 +183,16 @@
table.reload('conferenceTable');
}
});
+ }else if ('people' == obj.event) {
+ admin.popupCenter({
+ title: "分配人员",
+ path: '[[@{/conference/loadimport}]]?confid=' + data.confid,
+ finish: function () {
+ table.reload('conferenceTable');
+ }
+ });
}
+
});
});
diff --git a/src/main/resources/templates/conference/import.html b/src/main/resources/templates/conference/import.html
new file mode 100644
index 0000000..80d1da7
--- /dev/null
+++ b/src/main/resources/templates/conference/import.html
@@ -0,0 +1,94 @@
+<div style="color: #0c91e5" align="right">
+ <a th:href="@{/conference/downloadexcel}" class="layui-btn layui-btn-primary" style="margin: 5px">点击此处下载导入模板</a>
+</div>
+<form lay-filter="form" class="layui-form model-form" >
+ <!-- row -->
+ <input type="hidden" id="search-conference-detail-confid" th:value="${detailConfid}" />
+ <div class="layui-form-item">
+ <label class="control-label">请选择导入文件<span style="color: red"> * </span></label>
+ <input type="file" name="file" id="conference-file" placeholder="请选择xls格式文件">
+ </div>
+
+ <!-- /row -->
+ <!-- row -->
+ <div class="layui-form-item" align="center">
+ <div id="conference-importError" style="color:red">
+ </div>
+ <div id="conference-importInfo" >
+ </div>
+ </div>
+
+ <div class="layui-form-item model-form-footer">
+ <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">关闭</button>
+ <button class="layui-btn" lay-filter="conference-form-import" lay-submit id="importbtn">保存</button>
+ </div>
+</form>
+
+<script>
+
+ layui.use(['layer', 'admin', 'form', 'formSelects'], function () {
+ var layer = layui.layer;
+ var admin = layui.admin;
+ var form = layui.form;
+ console.log(123);
+
+ form.on('submit(conference-form-import)', function (data) {
+ $("#conference-importError").html("");
+ var files = $('#conference-file').prop('files');
+ var formData = new FormData();
+ for (var i = 0; i < files.length; i++) {
+ var filename = files[i].name;
+ var suffix = filename.substr(filename.lastIndexOf("."));
+ if ('.xls' != suffix && '.xlsx' != suffix) {
+ layer.msg("请选择excel文件", {icon: 2, time: 1500});
+ return;
+ }
+ formData.append('file', files[i]);
+ }
+ var confid=$('#search-conference-detail-confid').val();
+ formData.append("confid",confid);
+ layer.load(2);
+ let token = $("meta[name='_csrf_token']").attr("value");
+ $.ajax({
+ type: "POST",
+ url: '[[@{/conference/doimport}]]',
+ dataType: 'json',
+ processData: false,
+ contentType: false,
+ data: formData,
+ headers: {
+ 'Accept': 'application/json',
+ 'X-CSRF-TOKEN': token,
+ },
+ success: function (result) {
+ layer.closeAll('loading');
+ if (result.code == 200) {
+ layer.msg(result.msg, {icon: 1, time: 1500});
+ admin.finishPopupCenter();
+ } else if (result.code == 401) {
+ layer.msg(result.msg, {icon: 2, time: 1500}, function () {
+ location.replace('[[@{/login}]]');
+ }, 1000);
+ return;
+ } else if (result.code == 599) {
+ //自定义错误
+ layer.open({
+ type: 0,
+ title: "错误信息",
+ icon: 2,
+ area: ['600px', '400px'],
+ content: result.msg
+ });
+
+ } else {
+ layer.msg(result.msg, {icon: 2, time: 1500});
+ }
+ },
+ error: function (err) {
+ admin.errorBack(err);
+ }
+ });
+ return false;
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/main/resources/templates/doorlist/customer/index.html b/src/main/resources/templates/doorlist/customer/index.html
index e70b2d0..f197ea3 100644
--- a/src/main/resources/templates/doorlist/customer/index.html
+++ b/src/main/resources/templates/doorlist/customer/index.html
@@ -9,12 +9,15 @@
<div class="layui-card-body">
<div class="layui-form toolbar">
搜索:
- <input id="customer-search-value" class="layui-input search-input" type="text" placeholder="输入姓名"/> 
+ <input id="customer-search-value" class="layui-input search-input" type="text" placeholder="输入姓名"/>
+ <!-- <input id="search-customer-deptcode" type="text"
+ lay-filter="search-customer-deptcode-filter" autocomplete="off"
+ class="layui-input search-input"/>-->
<button id="customer-btn-search" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
</button>
<button id="customer-btn-add" class="layui-btn icon-btn" data-type="add"><i class="layui-icon"></i>添加人员</button>
<!-- <button id="customer-btn-import" class="layui-btn icon-btn" ><i class="layui-icon"></i>批量导入</button>-->
- <!-- <a id="customer-btn-export" href="javascript:void(0);" class="layui-btn layui-btn-primary" >导出</a>-->
+ <!--<a id="customer-btn-export" href="javascript:void(0);" class="layui-btn layui-btn-primary" >导出</a>-->
</div>
<table class="layui-table" id="customer-table" lay-filter="customer-table"></table>
</div>
@@ -27,13 +30,38 @@
var custtypelist=JSON.parse(ctlist);
var dplist=$("#deptlist").val();
var deptlist=JSON.parse(dplist);
- layui.use(['form', 'table', 'layer', 'admin', 'element'], function () {
+ layui.use(['form', 'table', 'layer', 'admin', 'element','treeSelect'], function () {
let form = layui.form;
let table = layui.table;
let admin = layui.admin;
+ // var treeSelect = layui.treeSelect;
+ var $ = layui.$;
- form.render('select');
-
+ form.render("select");
+ /* treeSelect.render({
+ elem: '#search-customer-deptcode',
+ data: '[[@{/customer/depttree}]]',
+ type: 'get',
+ placeholder: '选择部门',
+ search: false,
+ style: {
+ folder: {
+ enable: false
+ },
+ line: {
+ enable: true
+ }
+ },
+ // 点击回调
+ click: function (d) {
+ var treeNode = d.current;
+ console.log(treeNode);
+ return true;
+ },
+ success: function (d) {
+ console.log(d); // 加载完成后的回调函数
+ }
+ });*/
// 渲染表格
table.render({
elem: '#customer-table',
@@ -93,6 +121,17 @@
]
]
});
+
+ $('#customer-btn-export').click(function () {
+ let key = $('#customer-search-value').val().trim();
+
+ var url = '[[@{/customer/export?}]]'+ "custname=" + key;
+ /* $("#form").attr("action",url);
+ $("#form").submit();*/
+ $("#customer-btn-export").attr("href", url );
+ $("#customer-btn-export")[0].click();
+ });
+
$('#customer-btn-export').click(function () {
var url = '[[@{/customer/export}]]';
/* $("#form").attr("action",url);
@@ -105,7 +144,9 @@
// 搜索按钮点击事件
$('#customer-btn-search').click(function () {
let key = $('#customer-search-value').val().trim();
- table.reload('customer-table', {where: {searchkey: key}, page: {curr: 1}});
+ // let deptcode=$('#customer-deptcode').val();
+
+ table.reload('customer-table', {where: {custname: key}, page: {curr: 1}});
});
$('#customer-btn-add').click(function () {
showModel();
diff --git a/src/main/resources/templates/system/dept/form.html b/src/main/resources/templates/system/dept/form.html
index 2f89041..dba67f5 100644
--- a/src/main/resources/templates/system/dept/form.html
+++ b/src/main/resources/templates/system/dept/form.html
@@ -22,7 +22,7 @@
<label class="layui-form-label">父区域</label>
<div class="layui-input-block">
<select name="fdeptcode" id="fdeptcode" lay-verify="required">
- <option value="0">根部门</option>
+ <!-- <option value="0">根部门</option>-->
<option th:each="dept : ${deptlist}" th:value="${dept.deptcode}">[[${dept.deptname}]]</option>
</select>
</div>
diff --git a/src/main/resources/templates/system/dept/index.html b/src/main/resources/templates/system/dept/index.html
index a5bab59..152439e 100644
--- a/src/main/resources/templates/system/dept/index.html
+++ b/src/main/resources/templates/system/dept/index.html
@@ -98,6 +98,10 @@
}
});
let showDelete = function (data) {
+ if('0'==data.deptcode){
+ layer.msg('根目录无法删除!', {icon: 2, time: 1500});
+ return;
+ }
layer.confirm('确定要删除吗?', function (i) {
layer.close(i);
layer.load(2);