会议签到页面增加与查询功能
diff --git a/src/main/java/com/supwisdom/dlpay/conference/bean/ConfPeopleImportBean.java b/src/main/java/com/supwisdom/dlpay/conference/bean/ConfPeopleImportBean.java
new file mode 100644
index 0000000..b77c180
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/bean/ConfPeopleImportBean.java
@@ -0,0 +1,32 @@
+package com.supwisdom.dlpay.conference.bean;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+
+import java.io.Serializable;
+
+public class ConfPeopleImportBean implements Serializable {
+ @Excel(name = "姓名")
+ private String custname;
+ @Excel(name="市民卡号")
+ private String cardno;
+
+
+
+ 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;
+ }
+
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/bean/ConferenceShowBean.java b/src/main/java/com/supwisdom/dlpay/conference/bean/ConferenceShowBean.java
new file mode 100644
index 0000000..942b92c
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/bean/ConferenceShowBean.java
@@ -0,0 +1,86 @@
+package com.supwisdom.dlpay.conference.bean;
+
+public class ConferenceShowBean {
+ private String confname;
+ private String conftype;
+ private String confdate;
+ private String status;
+ private String remark;
+ private String starttime;
+ private String endtime;
+ private String attendtime;
+ private String timeperoid;
+
+ public String getConfname() {
+ return confname;
+ }
+
+ public void setConfname(String confname) {
+ this.confname = confname;
+ }
+
+
+ public String getStarttime() {
+ return starttime;
+ }
+
+ public void setStarttime(String starttime) {
+ this.starttime = starttime;
+ }
+
+ public String getEndtime() {
+ return endtime;
+ }
+
+ public void setEndtime(String endtime) {
+ this.endtime = endtime;
+ }
+
+ public String getConftype() {
+ return conftype;
+ }
+
+ public void setConftype(String conftype) {
+ this.conftype = conftype;
+ }
+
+ public String getConfdate() {
+ return confdate;
+ }
+
+ public void setConfdate(String confdate) {
+ this.confdate = confdate;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getTimeperoid() {
+ return timeperoid;
+ }
+
+ public void setTimeperoid(String timeperoid) {
+ this.timeperoid = timeperoid;
+ }
+
+ public String getAttendtime() {
+ return attendtime;
+ }
+
+ public void setAttendtime(String attendtime) {
+ this.attendtime = attendtime;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/controller/ConferenceController.java b/src/main/java/com/supwisdom/dlpay/conference/controller/ConferenceController.java
new file mode 100644
index 0000000..3455a5e
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/controller/ConferenceController.java
@@ -0,0 +1,197 @@
+package com.supwisdom.dlpay.conference.controller;
+
+import cn.afterturn.easypoi.entity.vo.MapExcelConstants;
+import cn.afterturn.easypoi.excel.entity.ExportParams;
+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.api.bean.JsonResult;
+import com.supwisdom.dlpay.conference.bean.ConferenceShowBean;
+import com.supwisdom.dlpay.conference.service.ConferenceService;
+import com.supwisdom.dlpay.conference.util.ConferenceConstant;
+import com.supwisdom.dlpay.framework.domain.TOperator;
+import com.supwisdom.dlpay.framework.util.*;
+import com.supwisdom.dlpay.util.WebCheckException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.annotation.AuthenticationPrincipal;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+@Controller
+public class ConferenceController {
+ @Autowired
+ private ConferenceService conferenceService;
+
+
+ @GetMapping("/conference/index")
+ public String ConferenceView() {
+ return "conference/conflist";
+ }
+
+ @GetMapping("/conference/conflist")
+ @ResponseBody
+ public PageResult<ConferenceShowBean> searchDiscountRules(@RequestParam("page") Integer pageNo,
+ @RequestParam("limit") Integer pageSize,
+ @RequestParam(value = "confname", required = false) String confname,
+ @RequestParam(value = "conftype", required = false) String conftype) {
+ try {
+ if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
+ if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
+ return conferenceService.getConferenceInfos(confname, conftype, pageNo, pageSize);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return new PageResult<>(99, "系统查询错误");
+ }
+ }
+
+ /* @PostMapping("/discountconf/deleteconf")
+ @PreAuthorize("hasPermission('/discountconf/deleteconf','')")
+ @ResponseBody
+ public JsonResult deleteDiscountRule(@RequestParam("confid") Integer confid) {
+ try {
+ if (null == confid) {
+ return JsonResult.error("参数传递错误");
+ }
+ if (deviceDiscountRuleService.deleteDiscountRule(confid)) {
+ 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);
+ }
+ }
+
+ @PostMapping("/discountconf/closeconf")
+ @PreAuthorize("hasPermission('/discountconf/closeconf','')")
+ @ResponseBody
+ public JsonResult closeDiscountRule(@RequestParam("confid") Integer confid) {
+ try {
+ if (null == confid) {
+ return JsonResult.error("参数传递错误");
+ }
+ if (deviceDiscountRuleService.closeDiscountRule(confid)) {
+ 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"));
+ return "conference/confform";
+ }
+
+
+
+ @PostMapping("/conference/addconf")
+ @ResponseBody
+ public JsonResult editDiscountRule(@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(value = "file", required = false) MultipartFile file,
+ @AuthenticationPrincipal UserDetails operUser,
+ HttpServletRequest request) {
+ try {
+ if (StringUtil.isEmpty(confname)
+ || (!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) {
+ return JsonResult.error("时间范围错误,起始时间必须比签到时间大");
+ }
+ TOperator oper = (TOperator) operUser;
+ if (null == oper || StringUtil.isEmpty(oper.getOperid())) {
+ return JsonResult.error("登录过期,请重新登录");
+ }
+ System.out.println("file::"+file);
+ 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.saveNewConference(confname.trim(),DateUtil.unParseToDateFormat(confdate), conftype, DateUtil.unParseToDateFormat(starttime), DateUtil.unParseToDateFormat(endtime),DateUtil.unParseToDateFormat(attendtime), oper,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);
+ }
+ }
+
+
+ @GetMapping("/conference/downloadexcel")
+ @ResponseBody
+ public void downloadDiscountRuleExcel(HttpServletRequest request, HttpServletResponse response, ModelMap map) {
+ try {
+ List<ExcelExportEntity> entity = new ArrayList<ExcelExportEntity>();
+ /**
+ * 1. 设置列信息:name:列标题 key: 列属性
+ */
+ entity.add(new ExcelExportEntity("市民卡号", "cardno"));
+ entity.add(new ExcelExportEntity("姓名", "custname"));
+ 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文件失败");
+ }
+ }
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/dao/ConfPeopleDao.java b/src/main/java/com/supwisdom/dlpay/conference/dao/ConfPeopleDao.java
new file mode 100644
index 0000000..1a7cf7a
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/dao/ConfPeopleDao.java
@@ -0,0 +1,13 @@
+package com.supwisdom.dlpay.conference.dao;
+
+
+import com.supwisdom.dlpay.conference.domain.TConfPeople;
+import com.supwisdom.dlpay.conference.domain.TConferenceDevbind;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface ConfPeopleDao extends JpaRepository<TConfPeople, String> {
+
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/dao/ConferenceDao.java b/src/main/java/com/supwisdom/dlpay/conference/dao/ConferenceDao.java
new file mode 100644
index 0000000..4ef8249
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/dao/ConferenceDao.java
@@ -0,0 +1,14 @@
+package com.supwisdom.dlpay.conference.dao;
+
+
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+import com.supwisdom.dlpay.conference.domain.TConference;
+
+@Repository
+public interface ConferenceDao extends JpaRepository<TConference, Integer> , JpaSpecificationExecutor<TConference> {
+
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/dao/ConferenceDevbindDao.java b/src/main/java/com/supwisdom/dlpay/conference/dao/ConferenceDevbindDao.java
new file mode 100644
index 0000000..ad6af9f
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/dao/ConferenceDevbindDao.java
@@ -0,0 +1,12 @@
+package com.supwisdom.dlpay.conference.dao;
+
+
+import com.supwisdom.dlpay.conference.domain.TConferenceDevbind;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface ConferenceDevbindDao extends JpaRepository<TConferenceDevbind, String> {
+
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/dao/NolistConfPeopleDao.java b/src/main/java/com/supwisdom/dlpay/conference/dao/NolistConfPeopleDao.java
new file mode 100644
index 0000000..ec104e4
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/dao/NolistConfPeopleDao.java
@@ -0,0 +1,12 @@
+package com.supwisdom.dlpay.conference.dao;
+
+
+import com.supwisdom.dlpay.conference.domain.TConfPeople;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface NolistConfPeopleDao extends JpaRepository<TConfPeople, String> {
+
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/domain/TConfPeople.java b/src/main/java/com/supwisdom/dlpay/conference/domain/TConfPeople.java
new file mode 100644
index 0000000..b52fc7b
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/domain/TConfPeople.java
@@ -0,0 +1,90 @@
+package com.supwisdom.dlpay.conference.domain;
+
+import org.hibernate.annotations.GenericGenerator;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "TB_ConfPeople",
+ indexes = {@Index(name = "ConfPeople_confid_idx", columnList = "confid")})
+public class TConfPeople {
+ @Id
+ @GenericGenerator(name = "idGenerator", strategy = "uuid")
+ @GeneratedValue(generator = "idGenerator")
+ @Column(name = "ID", nullable = false, length = 32)
+ private String id;
+
+ @Column(name="CARDNO", length = 8)
+ private String cardno;
+
+ @Column(name="CONFID", length = 9)
+ private Integer confid;
+
+ @Column(name="CUSTNAME", length = 60)
+ private String custname;
+
+ @Column(name="CUSTID", length = 32)
+ private String custid;
+
+ @Column(name="ATTSTATUS", nullable = false, length = 12)
+ private String attstatus;
+
+ @Column(name="LASTSAVED", length = 14)
+ private String lastsaved;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getCardno() {
+ return cardno;
+ }
+
+ public void setCardno(String cardno) {
+ this.cardno = cardno;
+ }
+
+ public Integer getConfid() {
+ return confid;
+ }
+
+ public void setConfid(Integer confid) {
+ this.confid = confid;
+ }
+
+ public String getCustname() {
+ return custname;
+ }
+
+ public void setCustname(String custname) {
+ this.custname = custname;
+ }
+
+ public String getCustid() {
+ return custid;
+ }
+
+ public void setCustid(String custid) {
+ this.custid = custid;
+ }
+
+ public String getAttstatus() {
+ return attstatus;
+ }
+
+ public void setAttstatus(String attstatus) {
+ this.attstatus = attstatus;
+ }
+
+ public String getLastsaved() {
+ return lastsaved;
+ }
+
+ public void setLastsaved(String lastsaved) {
+ this.lastsaved = lastsaved;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/domain/TConference.java b/src/main/java/com/supwisdom/dlpay/conference/domain/TConference.java
new file mode 100644
index 0000000..4ce3b5e
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/domain/TConference.java
@@ -0,0 +1,153 @@
+package com.supwisdom.dlpay.conference.domain;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "TB_CONFERENCE")
+public class TConference {
+ @Id
+ @SequenceGenerator(name = "discount_ruleid", sequenceName = "SEQ_DISCOUNTRULEID", allocationSize = 1)
+ @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "discount_ruleid")
+ @Column(name = "CONFID", nullable = false, precision = 9)
+ private Integer confid;
+
+ @Column(name = "CONFNAME", nullable = false, length = 200)
+ private String confname;
+
+ @Column(name = "CONFDATE", nullable = false, length = 8)
+ private String confdate;
+
+ @Column(name = "STARTTIME", nullable = false, length = 4)
+ private String starttime;
+
+ @Column(name = "ENDTIME", nullable = false, length = 4)
+ private String endtime;
+
+ @Column(name = "ATTENDTIME", nullable = false, length = 4)
+ private String attendtime;
+
+ @Column(name = "DEPARTCODE", length = 32)
+ private String departcode;
+
+ @Column(name = "STATUS", nullable = false, length = 10)
+ private String status;
+
+ @Column(name = "CONFTYPE", length = 10)
+ private String conftype;
+
+ @Column(name = "CREATE_OPERID", length = 32)
+ private String createOperid;
+
+ @Column(name = "CREATETIME", length = 14)
+ private String createtime;
+
+ @Column(name = "LASTSAVED", length = 14)
+ private String lastsaved;
+
+ @Column(name = "REMARK", length = 600)
+ private String remark;
+
+ public Integer getConfid() {
+ return confid;
+ }
+
+ public void setConfid(Integer confid) {
+ this.confid = confid;
+ }
+
+ public String getConfname() {
+ return confname;
+ }
+
+ public void setConfname(String confname) {
+ this.confname = confname;
+ }
+
+ public String getConfdate() {
+ return confdate;
+ }
+
+ public void setConfdate(String confdate) {
+ this.confdate = confdate;
+ }
+
+ public String getStarttime() {
+ return starttime;
+ }
+
+ public void setStarttime(String starttime) {
+ this.starttime = starttime;
+ }
+
+ public String getEndtime() {
+ return endtime;
+ }
+
+ public void setEndtime(String endtime) {
+ this.endtime = endtime;
+ }
+
+ public String getAttendtime() {
+ return attendtime;
+ }
+
+ public void setAttendtime(String attendtime) {
+ this.attendtime = attendtime;
+ }
+
+ public String getDepartcode() {
+ return departcode;
+ }
+
+ public void setDepartcode(String departcode) {
+ this.departcode = departcode;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getCreateOperid() {
+ return createOperid;
+ }
+
+ public void setCreateOperid(String createOperid) {
+ this.createOperid = createOperid;
+ }
+
+ public String getCreatetime() {
+ return createtime;
+ }
+
+ public void setCreatetime(String createtime) {
+ this.createtime = createtime;
+ }
+
+ public String getLastsaved() {
+ return lastsaved;
+ }
+
+ public void setLastsaved(String lastsaved) {
+ this.lastsaved = lastsaved;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getConftype() {
+ return conftype;
+ }
+
+ public void setConftype(String conftype) {
+ this.conftype = conftype;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/domain/TConferenceDevbind.java b/src/main/java/com/supwisdom/dlpay/conference/domain/TConferenceDevbind.java
new file mode 100644
index 0000000..e33217a
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/domain/TConferenceDevbind.java
@@ -0,0 +1,68 @@
+package com.supwisdom.dlpay.conference.domain;
+
+import org.hibernate.annotations.GenericGenerator;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "TB_CONFERENCE_DEVBIND",
+ indexes = {@Index(name = "conference_devbind_uk", unique = true, columnList = "deviceid,confid")})
+public class TConferenceDevbind {
+ @Id
+ @GenericGenerator(name = "idGenerator", strategy = "uuid")
+ @GeneratedValue(generator = "idGenerator")
+ @Column(name = "ID", nullable = false, length = 32)
+ private String id;
+
+ @Column(name = "DEVICEID", nullable = false, precision = 9)
+ private Integer deviceid;
+
+ @Column(name = "CONFID", nullable = false, precision = 9)
+ private Integer confid;
+
+ @Column(name = "CREATE_OPERID", length = 32)
+ private String createOperid;
+
+ @Column(name = "CREATETIME", length = 14)
+ private String createtime;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public Integer getDeviceid() {
+ return deviceid;
+ }
+
+ public void setDeviceid(Integer deviceid) {
+ this.deviceid = deviceid;
+ }
+
+ public Integer getConfid() {
+ return confid;
+ }
+
+ public void setConfid(Integer confid) {
+ this.confid = confid;
+ }
+
+ public String getCreateOperid() {
+ return createOperid;
+ }
+
+ public void setCreateOperid(String createOperid) {
+ this.createOperid = createOperid;
+ }
+
+ public String getCreatetime() {
+ return createtime;
+ }
+
+ public void setCreatetime(String createtime) {
+ this.createtime = createtime;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/domain/TNolistConfPeople.java b/src/main/java/com/supwisdom/dlpay/conference/domain/TNolistConfPeople.java
new file mode 100644
index 0000000..1bcad07
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/domain/TNolistConfPeople.java
@@ -0,0 +1,90 @@
+package com.supwisdom.dlpay.conference.domain;
+
+import org.hibernate.annotations.GenericGenerator;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "TB_Nolist_ConfPeople",
+ indexes = {@Index(name = "NolistPeople_confid_idx", columnList = "confid")})
+public class TNolistConfPeople {
+ @Id
+ @GenericGenerator(name = "idGenerator", strategy = "uuid")
+ @GeneratedValue(generator = "idGenerator")
+ @Column(name = "ID", nullable = false, length = 32)
+ private String id;
+
+ @Column(name="CARDNO", length = 8)
+ private Integer cardno;
+
+ @Column(name="CONFID", length = 9)
+ private Integer confid;
+
+ @Column(name="CUSTNAME", length = 60)
+ private String custname;
+
+ @Column(name="CUSTID", length = 32)
+ private String custid;
+
+ @Column(name="ATTSTATUS", nullable = false, length = 12)
+ private String attstatus;
+
+ @Column(name="LASTSAVED", length = 14)
+ private String lastsaved;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public Integer getCardno() {
+ return cardno;
+ }
+
+ public void setCardno(Integer cardno) {
+ this.cardno = cardno;
+ }
+
+ public Integer getConfid() {
+ return confid;
+ }
+
+ public void setConfid(Integer confid) {
+ this.confid = confid;
+ }
+
+ public String getCustname() {
+ return custname;
+ }
+
+ public void setCustname(String custname) {
+ this.custname = custname;
+ }
+
+ public String getCustid() {
+ return custid;
+ }
+
+ public void setCustid(String custid) {
+ this.custid = custid;
+ }
+
+ public String getAttstatus() {
+ return attstatus;
+ }
+
+ public void setAttstatus(String attstatus) {
+ this.attstatus = attstatus;
+ }
+
+ public String getLastsaved() {
+ return lastsaved;
+ }
+
+ public void setLastsaved(String lastsaved) {
+ this.lastsaved = lastsaved;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/service/ConferenceService.java b/src/main/java/com/supwisdom/dlpay/conference/service/ConferenceService.java
new file mode 100644
index 0000000..6ae6352
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/service/ConferenceService.java
@@ -0,0 +1,63 @@
+package com.supwisdom.dlpay.conference.service;
+
+import com.supwisdom.dlpay.conference.bean.ConferenceShowBean;
+import com.supwisdom.dlpay.framework.domain.TOperator;
+import com.supwisdom.dlpay.framework.util.PageResult;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+
+public interface ConferenceService {
+
+ @Transactional(rollbackFor = Exception.class, readOnly = true)
+ PageResult<ConferenceShowBean> getConferenceInfos(String confname, String conftype, int pageNo, int pageSize);
+
+ @Transactional(rollbackFor = Exception.class)
+ boolean deleteConference(int confid) ;
+
+ @Transactional(rollbackFor = Exception.class)
+ boolean closeConference(int confid) ;
+
+/*
+ @Transactional(rollbackFor = Exception.class, readOnly = true)
+ boolean checkConferencenameExist(String confname,Integer confid);*/
+
+ @Transactional(rollbackFor = Exception.class)
+ boolean saveNewConference(String confname,String confdate, String conftype, String starttime,
+ String endtime, String attendtime, TOperator oper, String filepath) throws Exception;
+
+/*
+ @Transactional(rollbackFor = Exception.class, readOnly = true)
+ PageResult<TDiscountDetail> getConferenceDetails(String searchkey, int confid, int pageNo, int pageSize);
+
+ @Transactional(rollbackFor = Exception.class, readOnly = true)
+ PageResult<ConferenceShowBean> getCheckConferenceInfos(String status, int pageNo, int pageSize);
+
+ @Transactional(rollbackFor = Exception.class)
+ boolean doCheckConference(int confid, boolean passflag, String reason, TOperator oper) throws Exception;
+
+ @Transactional(rollbackFor = Exception.class, readOnly = true)
+ List<ConferenceSelectBean> getNormalConferences();
+
+ @Transactional(rollbackFor = Exception.class, readOnly = true)
+ PageResult<ConferenceBindShowBean> getConferenceDevBindInfo(String searchkey, int pageNo, int pageSize);
+
+ @Transactional(rollbackFor = Exception.class, readOnly = true)
+ TDiscountDevbind getDiscountDevbindById(String id);
+
+ @Transactional(rollbackFor = Exception.class, readOnly = true)
+ DiscountBean getCustomerDiscount(Integer deviceid, String termtime,String custid);
+
+ @Transactional(rollbackFor = Exception.class)
+ boolean deleteDiscountDevbind(TDiscountDevbind bind);
+
+ @Transactional(rollbackFor = Exception.class, readOnly = true)
+ PageResult<DevparaBinddevShowBean> searchRuleBindDevices(Integer devgroupid, String searchkey, int confid);
+
+ @Transactional(rollbackFor = Exception.class)
+ boolean saveRuleBindDevices(int confid, List<Integer> deviceIds, TOperator oper) ;
+*/
+
+}
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
new file mode 100644
index 0000000..1186265
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/service/impl/ConferenceServiceImpl.java
@@ -0,0 +1,192 @@
+package com.supwisdom.dlpay.conference.service.impl;
+
+
+import cn.afterturn.easypoi.excel.ExcelImportUtil;
+import cn.afterturn.easypoi.excel.entity.ImportParams;
+import com.supwisdom.dlpay.conference.bean.ConfPeopleImportBean;
+import com.supwisdom.dlpay.conference.bean.ConferenceShowBean;
+import com.supwisdom.dlpay.conference.dao.ConfPeopleDao;
+import com.supwisdom.dlpay.conference.dao.ConferenceDao;
+import com.supwisdom.dlpay.conference.domain.TConfPeople;
+import com.supwisdom.dlpay.conference.domain.TConference;
+import com.supwisdom.dlpay.conference.service.ConferenceService;
+import com.supwisdom.dlpay.conference.util.ConferenceConstant;
+import com.supwisdom.dlpay.doorlist.bean.CustomerListBean;
+import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
+import com.supwisdom.dlpay.framework.domain.TOperator;
+import com.supwisdom.dlpay.framework.util.DateUtil;
+import com.supwisdom.dlpay.framework.util.PageResult;
+import com.supwisdom.dlpay.framework.util.StringUtil;
+import com.supwisdom.dlpay.mainservice.domain.TCard;
+import com.supwisdom.dlpay.mainservice.domain.TCustomer;
+import com.supwisdom.dlpay.mainservice.service.WebInterfaceService;
+import com.supwisdom.dlpay.util.WebCheckException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.domain.Sort;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+public class ConferenceServiceImpl implements ConferenceService {
+
+ @Autowired
+ private ConferenceDao conferenceDao;
+ @Autowired
+ private WebInterfaceService webInterfaceService;
+ @Autowired
+ private ConfPeopleDao confPeopleDao;
+
+ @Override
+ public PageResult<ConferenceShowBean> getConferenceInfos(String confname, String conftype, int pageNo, int pageSize) {
+ Pageable pageable = PageRequest.of(pageNo - 1, pageSize, Sort.by("confdate"));
+
+ Page<TConference> page = conferenceDao.findAll(new Specification<TConference>() {
+ @Override
+ public Predicate toPredicate(Root<TConference> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {
+ List<Predicate> predicates = new ArrayList<>();
+ if (!StringUtil.isEmpty(confname)) {
+ predicates.add(criteriaBuilder.like(root.get("confname").as(String.class), "%" + confname.trim() + "%"));
+ }
+ if (!StringUtil.isEmpty(conftype)) {
+ predicates.add(criteriaBuilder.equal(root.get("conftype").as(String.class), conftype));
+
+ }
+ /* if (!StringUtil.isEmpty(status)) {
+ predicates.add(criteriaBuilder.equal(root.get("status").as(String.class), status));
+ }*/
+ return criteriaBuilder.and(predicates.toArray(new Predicate[0]));
+ }
+ }, pageable);
+ List<ConferenceShowBean> result = new ArrayList<>(0);
+ if (null != page && page.getTotalElements() > 0) {
+ for (TConference conf : page.getContent()) {
+ ConferenceShowBean bean = new ConferenceShowBean();
+ bean.setConfname(conf.getConfname());
+ bean.setConfdate(conf.getConfdate());
+ bean.setConftype(conf.getConftype());
+ bean.setStatus(conf.getStatus());
+ bean.setRemark(conf.getRemark());
+ bean.setStarttime(conf.getStarttime().substring(0, 2) + ":" + conf.getStarttime().substring(2));
+ bean.setEndtime(conf.getEndtime().substring(0, 2) + ":" + conf.getEndtime().substring(2));
+ bean.setTimeperoid(bean.getStarttime()+"~"+bean.getEndtime());
+ bean.setAttendtime(conf.getAttendtime().substring(0, 2) + ":" + conf.getAttendtime().substring(2));
+ result.add(bean);
+ }
+ }
+ return new PageResult<>(page.getTotalElements(), result);
+ }
+
+ @Override
+ public boolean deleteConference(int confid) {
+ return false;
+ }
+
+ @Override
+ public boolean closeConference(int confid) {
+ return false;
+ }
+
+ @Override
+ public boolean saveNewConference(String confname,String confdate, String conftype, String starttime, String endtime,String attendtime, TOperator oper, String fpath) throws Exception {
+ TConference conf = new TConference();
+ conf.setConftype(conftype);
+ conf.setConfname(confname);
+ conf.setAttendtime(attendtime);
+ conf.setConfdate(confdate);
+ conf.setStatus(ConferenceConstant.CONFSTATUS_UNSTART);
+ conf.setCreateOperid(oper.getOperid());
+ conf.setStarttime(starttime);
+ conf.setEndtime(endtime);
+ conf.setDepartcode(oper.getDeptcode());
+ String systime = DateUtil.getNow();
+ conf.setCreatetime(systime);
+ conf.setLastsaved(systime);
+ conf = conferenceDao.save(conf);
+
+ if(ConferenceConstant.CONFTYPE_NOLIST.equals(conf.getConftype())){
+ return true;
+ }
+
+ List<String> successCardnos = new ArrayList<>(0);
+ List<String> errmsgList = new ArrayList<>(0);
+
+ ImportParams params = new ImportParams();
+ params.setTitleRows(0);
+ List<ConfPeopleImportBean> peoplelist = ExcelImportUtil.importExcel(new File(fpath), ConfPeopleImportBean.class, params);
+ if (peoplelist.size() <= 0) {
+ throw new WebCheckException("模板数据为空");
+ }
+
+ try {
+ for (int n = 0; n < peoplelist.size(); n++) {
+ String msg = "";
+ String cardno =peoplelist.get(n).getCardno().trim();
+ String name = peoplelist.get(n).getCustname().trim();
+ if (StringUtil.isEmpty(cardno)) {
+ msg += ",市民卡号为空";
+ }
+ if (StringUtil.isEmpty(name)) {
+ msg += ",姓名为空";
+ }
+ TCustomerInfo customer = webInterfaceService.getAllTCustomerList(name,cardno,null).get(0);
+ if (!StringUtil.isEmpty(cardno)) {
+ if (null == customer) {
+ msg += ",市民卡用户不存在";
+ } else if (!customer.getCustname().equals(name)) {
+ msg += ",市民卡号与姓名不匹配!";
+ }
+ }
+ if (!StringUtil.isEmpty(cardno) && successCardnos.contains(cardno)) {
+ msg += ",市民卡号重复!";
+ }
+
+
+ if (!StringUtil.isEmpty(msg)) {
+ errmsgList.add("第" + (n + 1) + "行数据错误" + msg);
+ } else {
+ TConfPeople people = new TConfPeople();
+ people.setAttstatus(ConferenceConstant.ATTENDSTATUS_UNCHECK);
+ people.setCardno(cardno);
+ people.setCustid(customer.getCustid());
+ people.setConfid(conf.getConfid());
+ people.setLastsaved(DateUtil.getNow());
+ people.setCustname(name);
+ confPeopleDao.save(people); //保存明细
+
+ successCardnos.add(cardno);
+ }
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new WebCheckException("模板格式有误,请确保卡号为文本格式");
+ }
+
+ if (!StringUtil.isEmpty(errmsgList)) {
+ StringBuffer errmsg = new StringBuffer("导入失败,名单存在错误!");
+ for (int j = 0; j < errmsgList.size(); j++) {
+ errmsg.append("<br/>" + errmsgList.get(j));
+ if (j > 10) {
+ errmsg.append("<br/>错误太多,请仔细核对名单后再上传!");
+ }
+ }
+ throw new WebCheckException(errmsg.toString());
+ }
+ return true;
+
+ }
+
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/util/ConferenceConstant.java b/src/main/java/com/supwisdom/dlpay/conference/util/ConferenceConstant.java
new file mode 100644
index 0000000..549358d
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/util/ConferenceConstant.java
@@ -0,0 +1,16 @@
+package com.supwisdom.dlpay.conference.util;
+
+public class ConferenceConstant {
+ public static final String CONFTYPE_LIST="list";
+ public static final String CONFTYPE_NOLIST="nolist";
+ public static final String CONFSTATUS_START="start";
+ public static final String CONFSTATUS_UNSTART="unstart";
+ public static final String CONFSTATUS_OVER="over";
+ public static final String CONFSTATUS_CLOSED="closed";
+ public static final String ATTENDSTATUS_UNCHECK="uncheck";
+ public static final String ATTENDSTATUS_CHECKED="checked";
+ public static final String ATTENDSTATUS_LATE="late";
+ public static final String ATTENDSTATUS_INSTEAD="instead";
+
+
+}
diff --git a/src/main/resources/templates/conference/confform.html b/src/main/resources/templates/conference/confform.html
new file mode 100644
index 0000000..cfc45f0
--- /dev/null
+++ b/src/main/resources/templates/conference/confform.html
@@ -0,0 +1,228 @@
+<div id="conference-form" lay-filter="conference-form-filter" class="layui-form model-form" style="padding: 10px 25px;">
+ <input type="hidden" id="conference-hidden-maxdate" th:value="${maxdate}"/>
+ <div class="layui-form-item">
+ <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/>
+ <input type="radio" name="conftype" id="form-conference-conftype-nolist"
+ lay-filter="conference-conftype-filter" value="nolist" title="无名单"/>
+
+ </div>
+ </div>
+
+ <div class="layui-form-item">
+ <label class="confinput-label layui-form-label"><span style="color: red">* </span>会议名称</label>
+ <div class="layui-input-block">
+ <input type="text" class="layui-input" name="confname" id="form-conference-confname" maxlength="20"
+ style="width: 90%;"
+ autocomplete="off" lay-verify="required|Confname"/>
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <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"/>
+ </div>
+ </div>
+
+
+ <div class="layui-form-item">
+ <label class="confinput-label layui-form-label"><span style="color: red">* </span>会议时间段</label>
+ <div class="layui-input-inline" style="width: 100px;">
+ <input type="text" name="starttime" placeholder="9:00" id="form-conference-starttime" autocomplete="off"
+ maxlength="5"
+ class="layui-input" lay-verify="required"/>
+ </div>
+ <div class="layui-form-mid">-</div>
+ <div class="layui-input-inline" style="width: 100px;">
+ <input type="text" name="endtime" placeholder="12:00" id="form-conference-endtime" autocomplete="off"
+ maxlength="5"
+ class="layui-input" lay-verify="required"/>
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="confinput-label layui-form-label"><span style="color: red">* </span>签到时间</label>
+ <div class="layui-input-inline" style="width: 100px;">
+ <input type="text" name="attendtime" placeholder="8:30" id="form-conference-attendtime" autocomplete="off"
+ maxlength="5"
+ class="layui-input" lay-verify="required"/>
+ </div>
+ </div>
+
+ <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-block">
+ <select lay-verify="required" name="listid" class="layui-select" id="conference-form-select-listid">
+ <option th:each="lst:${listbeans}" th:value="${lst.listid}"
+ th:text="${lst.listname}"></option>
+ </select> 
+ </div>-->
+ <div class="layui-input-inline" style="width: auto;">
+ <button type="button" class="layui-btn upoadfile-btn">
+ <i class="layui-icon"></i>上传名单
+ <input type="file" name="file" id="form-conference-records" style="width:auto;"/>
+ </button>
+ </div>
+ <div class="layui-input-inline" style="padding-top: 15px;">
+ <a th:href="@{/conference/downloadexcel}"
+ style="color: blue;text-decoration: none;cursor: pointer;">下载名单模板</a>
+ </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-submit" lay-submit id="submitbtn">保存</button>
+ </div>
+</div>
+
+<script>
+ layui.use(['layer', 'admin', 'form', 'laydate', 'upload'], function () {
+ var layer = layui.layer;
+ var admin = layui.admin;
+ var form = layui.form;
+ var laydate = layui.laydate;
+ var upload = layui.upload;
+
+ var confType = 'list';
+
+ form.render("select");
+ laydate.render({
+ elem: '#form-conference-starttime',
+ type: 'time',
+ format: 'HH:mm',
+ trigger: 'click'
+ });
+ laydate.render({
+ elem: '#form-conference-endtime',
+ type: 'time',
+ format: 'HH:mm',
+ trigger: 'click'
+ });
+ laydate.render({
+ elem: '#form-conference-attendtime',
+ type: 'time',
+ format: 'HH:mm',
+ trigger: 'click'
+ });
+ laydate.render({
+ elem: '#form-conference-confdate',
+ min: $("#conference-hidden-maxdate").val(),
+ trigger: 'click'
+ });
+
+ form.render("radio");
+
+ form.on('radio(conference-conftype-filter)', function (data) {
+ changeDiscountRuletype(data.value);
+ confType = data.value;
+ });
+
+ var changeDiscountRuletype = function (val) {
+ if ('nolist' == val) {
+ $("#conference-conflist").hide();
+ } else {
+ $("#conference-conflist").show();
+ }
+ }
+
+ form.on('submit(conference-form-submit)', function (data) {
+ debugger
+ var token = $("meta[name='_csrf_token']").attr("value");
+ var vdata = data.field;
+ if (null == vdata.starttime || null == vdata.endtime) {
+ layer.msg("请选择时间段", {icon: 2, time: 1500});
+ return;
+ } else if (vdata.endtime <= vdata.starttime) {
+ layer.msg("请正确选择时间段", {icon: 2, time: 1500});
+ return;
+ } else if (vdata.starttime <= vdata.attendtime) {
+ layer.msg("签到时间必须早于开始时间", {icon: 2, time: 1500});
+ return;
+ }
+
+
+ var formData = new FormData();
+ formData.append("conftype", vdata.conftype);
+ formData.append("confname", vdata.confname);
+ formData.append("starttime", vdata.starttime);
+ formData.append("endtime", vdata.endtime);
+ formData.append("attendtime", vdata.attendtime);
+ formData.append("confdate",vdata.confdate);
+ var flag=false;
+ var files = $('#form-conference-records').prop('files');
+ 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]);
+ flag = true;
+ }
+ if (!flag&&"list"==vdata.conftype) {
+ layer.msg("请选择名单", {icon: 2, time: 1500});
+ return;
+ }
+
+ layer.load(2);
+ $.ajax({
+ type: "POST",
+ url: '[[@{/conference/addconf}]]',
+ 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);
+ }
+ });
+ });
+ });
+</script>
+
+<style>
+ .confinput-label {
+ width: 24%;
+ }
+
+ .upoadfile-btn input {
+ position: absolute;
+ font-size: 100px;
+ right: 0;
+ top: 0;
+ opacity: 0;
+ width: 113px;
+ height: 34px;
+ }
+</style>
\ No newline at end of file
diff --git a/src/main/resources/templates/conference/conflist.html b/src/main/resources/templates/conference/conflist.html
new file mode 100644
index 0000000..e3e175d
--- /dev/null
+++ b/src/main/resources/templates/conference/conflist.html
@@ -0,0 +1,179 @@
+<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 class="layui-form toolbar">
+ 搜索:
+ <select id="search-conference-conftype">
+ <option value=""> 选择会议类型 </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="输入名称查询"/> 
+ <button id="btn-search-conference" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
+ </button>
+ <button id="btn-conference-add" class="layui-btn icon-btn" data-type="add"><i class="layui-icon"></i>新 增</button>
+ </div>
+ <table class="layui-table" id="conferenceTable" lay-filter="conferenceTable-filter"></table>
+ </div>
+</div>
+
+
+<!-- 表格操作列 -->
+<script type="text/html" id="conference-table-bar">
+ {{# if(d.conftype=='list' ){ }}
+ <a class="layui-btn layui-btn layui-btn-xs" lay-event="detail">查看名单</a>
+ {{# } }}
+ {{# if(d.status=='closed' || d.status=='over'){ }}
+ <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
+ {{# } else if(d.status=='unstart'){ }}
+ <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="closed">关闭</a>
+ {{# } }}
+</script>
+
+<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;
+
+ form.render("select");
+ // 渲染表格
+ table.render({
+ elem: '#conferenceTable',
+ url: '[[@{/conference/conflist}]]',
+ page: true,
+ cols: [
+ [
+ {field: 'confname', title: '会议名称', align: 'center', fixed: 'left' },
+ {field: 'confdate',width:150, title: '会议日期', align: 'center'},
+ {field: 'timeperoid',width:150, title: '会议时间', align: 'center'},
+ {field: 'attendtime',width:150, title: '签到时间', align: 'center'},
+
+ {
+ field: 'conftype', title: '会议类型', align: 'center', width: 120, sort: true, templet: function (d) {
+ if ('list' == d.conftype) {
+ return '有名单';
+ } else if ('nolist' == d.conftype) {
+ return '无名单';
+ } else {
+ return d.conftype;
+ }
+ }
+ },
+ {
+ field: 'status', title: '状态', align: 'center', width: 120, sort: true, templet: function (d) {
+ if ('unstart' == d.status) {
+ return '<span class="layui-badge layui-bg-orange">未开始</span>'
+ } else if ('start' == d.status) {
+ return '<span class="layui-badge layui-bg-green">进行中</span>';
+ } else if ('closed' == d.status) {
+ return '<span class="layui-badge layui-bg-gray">关闭</span>';
+ } else if ('over' == d.status) {
+ return '<span class="layui-badge">结束</span>';
+ } else {
+ return d.status;
+ }
+ }
+ },
+ /* {field: 'remark', title: '备注', align: 'center'},*/
+ {align: 'center', title: '操作', width: 250, toolbar: '#conference-table-bar', fixed: 'right'}
+ ]
+ ]
+ });
+
+ // 搜索按钮点击事件
+ $('#btn-search-conference').click(function () {
+ var conftype = $("#search-conference-conftype").val();
+ var confname = $("#search-conference-confname").val();
+ table.reload('conferenceTable', {where: {conftype: conftype, confname: confname}, page: {curr: 1}});
+ });
+
+ $('#btn-conference-add').click(function () {
+ admin.popupCenter({
+ title: "新增会议",
+ path: '[[@{/conference/load4addconf}]]',
+ area: '500px',
+ finish: function () {
+ table.reload('conferenceTable');
+ }
+ });
+ });
+
+ //监听单元格
+ table.on('tool(conferenceTable-filter)', function (obj) {
+ var data = obj.data;
+ if('del' == obj.event){
+ layer.confirm('确定直接删除会议【'+data.confname+'】吗?', {
+ btn: ['确定', '取消']
+ },function(){
+ layer.load(2);
+ admin.go('[[@{/conference/deleterule}]]', {
+ ruleid: data.ruleid,
+ _csrf: $("meta[name='_csrf_token']").attr("value")
+ }, 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('conferenceTable');
+ }, function (err) {
+ admin.errorBack(err)
+ });
+ });
+
+ }else if('closed' == obj.event){
+ layer.confirm('确定关闭会议【'+data.confname+'】吗?', {
+ btn: ['确定', '取消']
+ },function(){
+ layer.load(2);
+ admin.go('[[@{/conference/closerule}]]', {
+ ruleid: data.ruleid,
+ _csrf: $("meta[name='_csrf_token']").attr("value")
+ }, 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('conferenceTable');
+ }, function (err) {
+ admin.errorBack(err)
+ });
+ });
+
+ }else if('detail' == obj.event){
+ admin.popupCenter({
+ title: "查看名单",
+ path: '[[@{/conference/load4detail}]]?ruleid=' + data.ruleid,
+ area: '600px',
+ finish: function () {
+ table.reload('conferenceTable');
+ }
+ });
+ }
+ });
+
+ });
+</script>
\ No newline at end of file