会议报表
diff --git a/src/main/java/com/supwisdom/dlpay/conference/bean/ConfReportShowBean.java b/src/main/java/com/supwisdom/dlpay/conference/bean/ConfReportShowBean.java
index b93d495..ebb7e81 100644
--- a/src/main/java/com/supwisdom/dlpay/conference/bean/ConfReportShowBean.java
+++ b/src/main/java/com/supwisdom/dlpay/conference/bean/ConfReportShowBean.java
@@ -8,6 +8,8 @@
private String attendtime;
private String timeperoid;
private String attendrate;
+ private String actualcnt;
+ private String totcnt;
public Integer getConfid() {
return confid;
@@ -66,4 +68,20 @@
public void setAttendtime(String attendtime) {
this.attendtime = attendtime;
}
+
+ public String getActualcnt() {
+ return actualcnt;
+ }
+
+ public void setActualcnt(String actualcnt) {
+ this.actualcnt = actualcnt;
+ }
+
+ public String getTotcnt() {
+ return totcnt;
+ }
+
+ public void setTotcnt(String totcnt) {
+ this.totcnt = totcnt;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/controller/ConfReportController.java b/src/main/java/com/supwisdom/dlpay/conference/controller/ConfReportController.java
index 5dbeb2e..a77c228 100644
--- a/src/main/java/com/supwisdom/dlpay/conference/controller/ConfReportController.java
+++ b/src/main/java/com/supwisdom/dlpay/conference/controller/ConfReportController.java
@@ -12,16 +12,19 @@
import com.supwisdom.dlpay.customer.bean.CustomerSearchBean;
import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
import com.supwisdom.dlpay.framework.domain.TOperator;
+import com.supwisdom.dlpay.framework.service.SystemUtilService;
import com.supwisdom.dlpay.framework.util.DateUtil;
import com.supwisdom.dlpay.framework.util.PageResult;
import com.supwisdom.dlpay.framework.util.StringUtil;
import com.supwisdom.dlpay.framework.util.WebConstant;
import com.supwisdom.dlpay.mainservice.service.WebInterfaceService;
+import com.supwisdom.dlpay.system.service.ManagerService;
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;
@@ -35,14 +38,17 @@
@Autowired
private ConferenceService conferenceService;
@Autowired
- private WebInterfaceService webInterfaceService;
+ private SystemUtilService systemUtilService;
+ @Autowired
+ private ManagerService managerService;
@GetMapping("/confreport/index")
- public String ConferenceView(Model model) {
+ public String ConferenceView( @AuthenticationPrincipal UserDetails operUser,Model model) {
String today = DateUtil.getNow("yyyy-MM-dd");
-
- model.addAttribute("confDate", today);
+ model.addAttribute("startdate", today);
+ TOperator oper = (TOperator) operUser;
+ model.addAttribute("opercode", oper.getOpercode());
return "confreport/index";
}
@@ -52,7 +58,8 @@
@RequestParam("limit") Integer pageSize,
@RequestParam(value = "confname", required = false) String confname,
@RequestParam(value = "conftype", required = false) String conftype,
- @RequestParam(value = "confdate", required = false) String confdate,
+ @RequestParam(value = "startdate", required = false) String startdate,
+ @RequestParam(value = "enddate", required = false) String enddate,
@AuthenticationPrincipal UserDetails operUser,
Model model) {
try {
@@ -61,12 +68,16 @@
TOperator oper = (TOperator) operUser;
String deptcode = oper.getDeptcode();
String status = ConferenceConstant.CONFSTATUS_OVER;
- String date="";
- if(!StringUtil.isEmpty(confdate)){
- date=DateUtil.reformatDatetime(confdate,"yyyy-MM-dd","yyyyMMdd");
+ String stdate="";
+ String eddate="";
+ if(!StringUtil.isEmpty(startdate)){
+ stdate=DateUtil.reformatDatetime(startdate,"yyyy-MM-dd","yyyyMMdd");
+ }
+ if(!StringUtil.isEmpty(enddate)){
+ eddate=DateUtil.reformatDatetime(enddate,"yyyy-MM-dd","yyyyMMdd");
}
- return conferenceService.getConfReportPage(confname, conftype, deptcode, date, status, pageNo, pageSize);
+ return conferenceService.getConfReportPage(confname, conftype, deptcode, stdate,eddate, status, pageNo, pageSize);
} catch (Exception e) {
e.printStackTrace();
return new PageResult<>(99, "系统查询错误");
@@ -108,4 +119,36 @@
return new PageResult<>(99, "系统查询错误");
}
}
+
+ @GetMapping("/confreport/print")
+ public String printReport( @RequestParam(value = "confname", required = false) String confname,
+ @RequestParam(value = "conftype", required = false) String conftype,
+ @RequestParam(value = "startdate", required = false) String startdate,
+ @RequestParam(value = "enddate", required = false) String enddate,
+ @RequestParam(value = "opercode",required = false) String opercode,
+ ModelMap model) {
+ TOperator oper=managerService.getOperatorByOpercode(opercode);
+
+ String deptcode = oper.getDeptcode();
+ String status = ConferenceConstant.CONFSTATUS_OVER;
+ String stdate="";
+ String eddate="";
+ if(!StringUtil.isEmpty(startdate)){
+ stdate=DateUtil.reformatDatetime(startdate,"yyyy-MM-dd","yyyyMMdd");
+ }
+ if(!StringUtil.isEmpty(enddate)){
+ eddate=DateUtil.reformatDatetime(enddate,"yyyy-MM-dd","yyyyMMdd");
+ }
+ PageResult<ConfReportShowBean> page=conferenceService.getConfReportPage(confname, conftype, deptcode, stdate,eddate, status, 1, 100);
+
+ model.addAttribute("startdate", startdate);
+ model.addAttribute("enddate", enddate);
+ model.addAttribute("showlist",page.getData());
+ model.addAttribute("opername", oper == null ? "unknow" : oper.getOpername());
+ model.addAttribute("printdatetime",DateUtil.reformatDatetime(systemUtilService.getSysdatetime().getHostdatetime(),DateUtil.DATETIME_FMT,"yyyy-MM-dd HH:mm:ss"));
+
+
+ return "confreport/print/printindex";
+ }
+
}
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 8f1dd95..73cd92f 100644
--- a/src/main/java/com/supwisdom/dlpay/conference/service/ConferenceService.java
+++ b/src/main/java/com/supwisdom/dlpay/conference/service/ConferenceService.java
@@ -23,7 +23,7 @@
PageResult<ConferenceShowBean> getConferenceInfos(String confname, String conftype,String deptocde,String confdate, int pageNo, int pageSize);
@Transactional(rollbackFor = Exception.class, readOnly = true)
- PageResult<ConfReportShowBean> getConfReportPage(String confname, String conftype, String deptcode, String confdate,String status, int pageNo, int pageSize);
+ PageResult<ConfReportShowBean> getConfReportPage(String confname, String conftype, String deptcode, String startdate,String enddate,String status, int pageNo, int pageSize);
@Transactional(rollbackFor = Exception.class)
boolean deleteConference(int confid) throws Exception;
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 56b4af9..82df227 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
@@ -75,7 +75,7 @@
@Override
public PageResult<ConferenceShowBean> getConferenceInfos(String confname, String conftype,String deptcode,String confdate, int pageNo, int pageSize) {
- Page<TConference> page = getConferencePage(confname, conftype, deptcode, confdate,"", pageNo, pageSize);
+ Page<TConference> page = getConferencePage(confname, conftype, deptcode, "","","", pageNo, pageSize);
List<ConferenceShowBean> result = new ArrayList<>(0);
if (null != page && page.getTotalElements() > 0) {
for (TConference conf : page.getContent()) {
@@ -97,8 +97,8 @@
}
@Override
- public PageResult<ConfReportShowBean> getConfReportPage(String confname, String conftype, String deptcode, String confdate,String status, int pageNo, int pageSize) {
- Page<TConference> page = getConferencePage(confname, conftype, deptcode, confdate,status, pageNo, pageSize);
+ public PageResult<ConfReportShowBean> getConfReportPage(String confname, String conftype, String deptcode, String startdate,String enddate,String status, int pageNo, int pageSize) {
+ Page<TConference> page = getConferencePage(confname, conftype, deptcode, startdate,enddate,status, pageNo, pageSize);
List<ConfReportShowBean> result = new ArrayList<>(0);
DecimalFormat format=new DecimalFormat("0.00");
if (null != page && page.getTotalElements() > 0) {
@@ -113,12 +113,14 @@
bean.setTimeperoid(starttime+"~"+endtime);
bean.setAttendtime(conf.getAttendtime().substring(0, 2) + ":" + conf.getAttendtime().substring(2));
if(ConferenceConstant.CONFTYPE_NOLIST.equals(conf.getConftype())){
- Integer totcnt=checkNolistDeptCustomer(conf.getConfid());
+ Integer totcnt=getNoListConfPeopleTotalCount(conf.getConfid());
Integer actualcnt=nolistConfPeopleDao.countByConfid(conf.getConfid());
Float rate=0f;
if(0!=totcnt){
rate=actualcnt*100f/totcnt;
}
+ bean.setActualcnt(actualcnt+"");
+ bean.setTotcnt(totcnt+"");
bean.setAttendrate(format.format(rate)+"%");
}else if(ConferenceConstant.CONFTYPE_LIST.equals(conf.getConftype())){
@@ -127,9 +129,11 @@
Float rate=0f;
if(0!=totcnt){
rate=actualcnt*100f/totcnt;
+ bean.setAttendrate(format.format(rate)+"%");
}
+ bean.setActualcnt(actualcnt+"");
+ bean.setTotcnt(totcnt+"");
bean.setAttendrate(format.format(rate)+"%");
-
}
result.add(bean);
@@ -139,7 +143,7 @@
}
@NotNull
- private Page<TConference> getConferencePage(String confname, String conftype, String deptcode, String confdate,String status, int pageNo, int pageSize) {
+ private Page<TConference> getConferencePage(String confname, String conftype, String deptcode, String startdate,String enddate,String status, int pageNo, int pageSize) {
Sort.Order order1=new Sort.Order(Sort.Direction.DESC, "confdate");
Sort.Order order2=new Sort.Order(Sort.Direction.DESC, "confid");
List<Sort.Order> list = new ArrayList<>();
@@ -167,8 +171,11 @@
predicates.add(root.get("deptcode").in(childdplist));
}
- if (!StringUtil.isEmpty(confdate)) {
- predicates.add(criteriaBuilder.equal(root.get("confdate").as(String.class), confdate));
+ if (!StringUtil.isEmpty(startdate)) {
+ predicates.add(criteriaBuilder.greaterThanOrEqualTo(root.get("confdate").as(String.class), startdate));
+ }
+ if (!StringUtil.isEmpty(enddate)) {
+ predicates.add(criteriaBuilder.lessThanOrEqualTo(root.get("confdate").as(String.class), enddate));
}
if (!StringUtil.isEmpty(status)) {
predicates.add(criteriaBuilder.equal(root.get("status").as(String.class), status));
@@ -789,7 +796,7 @@
return null;
}
- private Integer checkNolistDeptCustomer(Integer confid) {
+ private Integer getNoListConfPeopleTotalCount(Integer confid) {
Query query = entityManager.createNativeQuery("select count(t.custid) from t_customer t " +
"where t.deptcode in (select distinct d.deptcode from tb_conf_people p left join t_customer t " +
"on p.custid=t.custid left join tb_dept d on d.deptcode=t.deptcode where confid=:confid)");
diff --git a/src/main/kotlin/com/supwisdom/dlpay/security.kt b/src/main/kotlin/com/supwisdom/dlpay/security.kt
index 9fc95e1..b823768 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/security.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/security.kt
@@ -203,6 +203,7 @@
.antMatchers("/login", "/login/form","/app/**").permitAll()
.antMatchers("/static/**").permitAll()
.antMatchers("/code/image").permitAll()
+ .antMatchers("/confreport/print").permitAll()
.antMatchers("/atte/print/**").permitAll()
.antMatchers("/**").hasAnyRole("USER", "ADMIN")
.anyRequest().authenticated()
diff --git a/src/main/resources/templates/confreport/index.html b/src/main/resources/templates/confreport/index.html
index 7717bdb..5da8028 100644
--- a/src/main/resources/templates/confreport/index.html
+++ b/src/main/resources/templates/confreport/index.html
@@ -27,11 +27,21 @@
placeholder="输入名称查询"/>
</div>
</div>
+ </div>
+ <div class="layui-form-item">
<div class="layui-inline">
- <label class="layui-form-label" style="width:120px">会议日期:</label>
+ <label class="layui-form-label" style="width:120px">起始日期</label>
<div class="layui-input-inline">
- <input type="text" name="confdate" class="layui-input" th:value="${confDate}"
- id="search-confreport-confdate" placeholder="yyyy-MM-dd">
+ <input type="text" name="startdate" class="layui-input" th:value="${startdate}"
+ id="search-confreport-startdate" placeholder="yyyy-MM-dd">
+ </div>
+ </div>
+
+ <div class="layui-inline">
+ <label class="layui-form-label" style="width:120px">结束日期</label>
+ <div class="layui-input-inline">
+ <input type="text" name="enddate" class="layui-input" th:value="${startdate}"
+ id="search-confreport-enddate" placeholder="yyyy-MM-dd">
</div>
</div>
@@ -39,16 +49,17 @@
<button id="btn-search-confreport" class="layui-btn icon-btn" data-type="search"><i
class="layui-icon"></i>搜索
</button>
+ <button id="btn-search-confreportprint" class="layui-btn icon-btn" data-type="search"><i
+ class="layui-icon"></i>打印
+ </button>
</div>
-
</div>
-
</div>
<table class="layui-table" id="confreportTable" lay-filter="confreportTable-filter"></table>
</div>
</div>
-
+<input hidden th:value="${opercode}" id="confreport-opercode">
<!-- 表格操作列 -->
<script type="text/html" id="confreport-table-bar">
@@ -63,20 +74,27 @@
var element = layui.element;
form.render("select");
- var confdate = $("#search-confreport-confdate").val();
+ var startdate = $("#search-confreport-startdate").val();
+ var enddate = $("#search-confreport-enddate").val();
var laydate = layui.laydate;
laydate.render({
- elem: '#search-confreport-confdate',
+ elem: '#search-confreport-startdate',
btns: ['now', 'confirm'],
trigger: 'click',
- max: confdate
+ max: startdate
});
-
+ laydate.render({
+ elem: '#search-confreport-enddate',
+ btns: ['now', 'confirm'],
+ trigger: 'click',
+ max: startdate
+ });
// 渲染表格
table.render({
elem: '#confreportTable',
url: '[[@{/confreport/reportlist}]]',
+ where: {startdate: startdate},
page: true,
cols: [
[
@@ -119,12 +137,35 @@
$('#btn-search-confreport').click(function () {
var conftype = $("#search-confreport-conftype").val();
var confname = $("#search-confreport-confname").val();
- var confdate = $("#search-confreport-confdate").val();
+ var startdate = $("#search-confreport-startdate").val();
+ var enddate = $("#search-confreport-enddate").val();
table.reload('confreportTable', {
- where: {conftype: conftype, confname: confname, confdate: confdate},
+ where: {conftype: conftype, confname: confname, startdate: startdate, enddate: enddate},
page: {curr: 1}
});
});
+ var LODOP;
+ $('#btn-search-confreportprint').click(function () {
+ var conftype = $("#search-confreport-conftype").val();
+ var opercode = $("#confreport-opercode").val();
+ var confname = $("#search-confreport-confname").val();
+ var startdate = $("#search-confreport-startdate").val();
+ var enddate = $("#search-confreport-enddate").val();
+ var url = '/confreport/print?startdate=' + startdate + '&enddate=' + enddate + '&conftype=' + conftype + '&confname=' + confname+ '&opercode=' + opercode;
+
+ LODOP = getLodop();
+ LODOP.PRINT_INIT("考勤报表");
+ LODOP.SET_PRINT_PAGESIZE(2, 0, 0,"A4");
+ LODOP.ADD_PRINT_URL(30, 20, "95%", "90%", encodeURI(url));
+ LODOP.ADD_PRINT_HTM("95%", "48%", 150, 50, "<font style='font-size:12px'><span tdata='pageNO'>##</span>/<span tdata='pageCount'> ##</span></font>");
+ LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
+ LODOP.SET_PRINT_STYLEA(0, "HOrient", 3);
+ LODOP.SET_PRINT_STYLEA(0, "VOrient", 3);
+ LODOP.SET_SHOW_MODE("NP_NO_RESULT", true);
+ LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW",true);
+ LODOP.PREVIEW();
+
+ });
//监听单元格
diff --git a/src/main/resources/templates/confreport/print/printindex.html b/src/main/resources/templates/confreport/print/printindex.html
new file mode 100644
index 0000000..1483b94
--- /dev/null
+++ b/src/main/resources/templates/confreport/print/printindex.html
@@ -0,0 +1,97 @@
+<!DOCTYPE html>
+<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
+<head>
+ <meta charset="UTF-8">
+ <title>会议签到报表</title>
+
+ <link rel="stylesheet" th:href="@{/static/libs/layui/css/layui.css}"/>
+ <link rel="stylesheet" th:href="@{/static/custom/css/custom.css}"/>
+</head>
+<body>
+<div class="layui-card">
+ <div class="layui-card-header" style="text-align: center;">
+ <h1>会议签到报表</h1>
+ </div>
+ <div class="layui-card-body">
+ <div class="layui-form toolbar">
+ <div style="float: left;padding-left: 10px;font-size:16px" th:text="${'时间:'+startdate +'至'+ enddate}"></div>
+ </div>
+ <table class="layui-table sw-table sw-print">
+ <thead>
+ <tr>
+ <th style="text-align: center;">会议名称</th>
+ <th style="text-align: center;">会议日期</th>
+ <th style="text-align: center;">名单人数</th>
+ <th style="text-align: center;">参会人数</th>
+ <th style="text-align: center;">参会率</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr th:if="${null==showlist || showlist.size()==0}">
+ <td colspan="13">无数据</td>
+ </tr>
+ <div th:remove="tag" th:if="${null!=showlist && showlist.size()>0}" th:each="data:${showlist}"
+ >
+ <tr >
+ <td th:text="${data.confname}"></td>
+ <td th:text="${data.confdate}"></td>
+ <td th:text="${data.totcnt}"></td>
+ <td th:text="${data.actualcnt}"></td>
+ <td th:text="${data.attendrate}"></td>
+ </tr>
+
+ </div>
+ <!--<div th:if="${null!=sum}">
+ <tr>
+ <td colspan="4" >合计:</td>
+ <td th:text="${sum.cnt1}"></td>
+ <td th:text="${sum.cnt2}"></td>
+ <td th:text="${sum.cnt3}"></td>
+ <td th:text="${sum.cnt4}"></td>
+ <td th:text="${sum.cnts}"></td>
+ </tr>
+ </div>-->
+ </tbody>
+ </table>
+ <!--<div class="layui-form toolbar">-->
+ <!--<div style="float: left;padding-left: 3px;" th:text="${'制表人:'+opername+' '+ printdatetime}"></div>-->
+ <!--</div>-->
+ </div>
+ <div class="layui-card-body" style="margin-top: 25px;">
+ <div class="col-sm-12">
+ <table width="100%">
+ <tr style="height: 25px;">
+ <td width="12%" style="text-align: right;padding-right: 5px;"></td>
+ <td width="18%"
+ style="text-align: left;" ></td>
+ <td width="5%"> </td>
+ <td width="12%" style="text-align: right;padding-right: 5px;">制表人:</td>
+ <td width="18%"
+ style="text-align: left;border-bottom: 1px solid #666;" th:text="${opername}"></td>
+ <td width="5%"> </td>
+ <td width="12%" style="text-align: right;padding-right: 5px;">制表日期:</td>
+ <td width="18%"
+ style="text-align: left;border-bottom: 1px solid #666;" th:text="${printdatetime}">
+ </td>
+ </tr>
+ <tr style="height: 25px;"></tr>
+ <tr style="height: 25px;">
+ <td width="12%" style="text-align: right;padding-right: 5px;"></td>
+ <td width="18%"
+ style="text-align: left;" ></td>
+ <td width="5%"> </td>
+ <td width="12%" style="text-align: right;padding-right: 5px;">审核人签字:</td>
+ <td width="18%"
+ style="text-align: left;border-bottom: 1px solid #666;"></td>
+ <td width="5%"> </td>
+ <td width="12%" style="text-align: right;padding-right: 5px;">盖章:</td>
+ <td width="18%"
+ style="text-align: left;border-bottom: 1px solid #666;">
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+</body>
+</html>
\ No newline at end of file