劳务费人次统计表
diff --git a/src/main/java/com/supwisdom/dlpay/framework/filter/CrosXssFilter.java b/src/main/java/com/supwisdom/dlpay/framework/filter/CrosXssFilter.java
index b8349ee..d984b9f 100644
--- a/src/main/java/com/supwisdom/dlpay/framework/filter/CrosXssFilter.java
+++ b/src/main/java/com/supwisdom/dlpay/framework/filter/CrosXssFilter.java
@@ -42,11 +42,11 @@
//sql,xss过滤
HttpServletRequest httpServletRequest = (HttpServletRequest) request;
- logger.error("CrosXssFilter.......orignal url:{},ParameterMap:{}",httpServletRequest.getRequestURI(), new Gson().toJson(httpServletRequest.getParameterMap()));
+ logger.error("..........RequestUrl:{},RequestParam:{}",httpServletRequest.getRequestURI(), new Gson().toJson(httpServletRequest.getParameterMap()));
XssHttpServletRequestWrapper xssHttpServletRequestWrapper = new XssHttpServletRequestWrapper(
httpServletRequest);
chain.doFilter(xssHttpServletRequestWrapper, response);
- logger.error("CrosXssFilter..........doFilter url:{},ParameterMap:{}",xssHttpServletRequestWrapper.getRequestURI(), new Gson().toJson(xssHttpServletRequestWrapper.getParameterMap()));
+// logger.error("CrosXssFilter..........doFilter url:{},ParameterMap:{}",xssHttpServletRequestWrapper.getRequestURI(), new Gson().toJson(xssHttpServletRequestWrapper.getParameterMap()));
}
@Override
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/bean/LaborCountSearchData.java b/src/main/java/com/supwisdom/dlpay/restaurant/bean/LaborCountSearchData.java
new file mode 100644
index 0000000..c6f6e16
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/bean/LaborCountSearchData.java
@@ -0,0 +1,106 @@
+package com.supwisdom.dlpay.restaurant.bean;
+
+public class LaborCountSearchData {
+ private Integer rownum; //行号
+
+ private Integer dwid; //单位id 设备组一级
+ private String dwname; //单位名称
+ private Integer groupid; //食堂ID 设备组二级
+ private String groupname; //单位名称
+
+ private Integer bfeecnt;
+ private Integer lfeecnt;
+ private Integer dfeecnt;
+
+ private Double bfeeamt;
+ private Double lfeeamt;
+ private Double dfeeamt;
+
+ public Integer getRownum() {
+ return rownum;
+ }
+
+ public void setRownum(Integer rownum) {
+ this.rownum = rownum;
+ }
+
+ public Integer getDwid() {
+ return dwid;
+ }
+
+ public void setDwid(Integer dwid) {
+ this.dwid = dwid;
+ }
+
+ public String getDwname() {
+ return dwname;
+ }
+
+ public void setDwname(String dwname) {
+ this.dwname = dwname;
+ }
+
+ public Integer getGroupid() {
+ return groupid;
+ }
+
+ public void setGroupid(Integer groupid) {
+ this.groupid = groupid;
+ }
+
+ public String getGroupname() {
+ return groupname;
+ }
+
+ public void setGroupname(String groupname) {
+ this.groupname = groupname;
+ }
+
+ public Integer getBfeecnt() {
+ return bfeecnt;
+ }
+
+ public void setBfeecnt(Integer bfeecnt) {
+ this.bfeecnt = bfeecnt;
+ }
+
+ public Integer getLfeecnt() {
+ return lfeecnt;
+ }
+
+ public void setLfeecnt(Integer lfeecnt) {
+ this.lfeecnt = lfeecnt;
+ }
+
+ public Integer getDfeecnt() {
+ return dfeecnt;
+ }
+
+ public void setDfeecnt(Integer dfeecnt) {
+ this.dfeecnt = dfeecnt;
+ }
+
+ public Double getBfeeamt() {
+ return bfeeamt;
+ }
+
+ public void setBfeeamt(Double bfeeamt) {
+ this.bfeeamt = bfeeamt;
+ }
+
+ public Double getLfeeamt() {
+ return lfeeamt;
+ }
+
+ public void setLfeeamt(Double lfeeamt) {
+ this.lfeeamt = lfeeamt;
+ }
+
+ public Double getDfeeamt() {
+ return dfeeamt;
+ }
+
+ public void setDfeeamt(Double dfeeamt) {
+ this.dfeeamt = dfeeamt;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/bean/LaborCountShowBean.java b/src/main/java/com/supwisdom/dlpay/restaurant/bean/LaborCountShowBean.java
new file mode 100644
index 0000000..0ce0a08
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/bean/LaborCountShowBean.java
@@ -0,0 +1,117 @@
+package com.supwisdom.dlpay.restaurant.bean;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class LaborCountShowBean {
+ private Integer dwid; //单位id 设备组一级
+ private String dwname; //单位名称
+
+ private Integer bfeecnt;
+ private Integer lfeecnt;
+ private Integer dfeecnt;
+
+ private Double bfeeamt;
+ private Double lfeeamt;
+ private Double dfeeamt;
+
+ private List<LaborCountSearchData> datalist = new ArrayList<LaborCountSearchData>(0);
+
+ public LaborCountShowBean() {
+ }
+
+ public LaborCountShowBean(Integer dwid, String dwname, Integer bfeecnt, Integer lfeecnt, Integer dfeecnt, Double bfeeamt, Double lfeeamt, Double dfeeamt) {
+ this.dwid = dwid;
+ this.dwname = dwname;
+ this.bfeecnt = bfeecnt;
+ this.lfeecnt = lfeecnt;
+ this.dfeecnt = dfeecnt;
+ this.bfeeamt = bfeeamt;
+ this.lfeeamt = lfeeamt;
+ this.dfeeamt = dfeeamt;
+ }
+
+ public LaborCountShowBean(Integer dwid, String dwname, Integer bfeecnt, Integer lfeecnt, Integer dfeecnt, Double bfeeamt, Double lfeeamt, Double dfeeamt, List<LaborCountSearchData> datalist) {
+ this.dwid = dwid;
+ this.dwname = dwname;
+ this.bfeecnt = bfeecnt;
+ this.lfeecnt = lfeecnt;
+ this.dfeecnt = dfeecnt;
+ this.bfeeamt = bfeeamt;
+ this.lfeeamt = lfeeamt;
+ this.dfeeamt = dfeeamt;
+ this.datalist = datalist;
+ }
+
+ public Integer getDwid() {
+ return dwid;
+ }
+
+ public void setDwid(Integer dwid) {
+ this.dwid = dwid;
+ }
+
+ public String getDwname() {
+ return dwname;
+ }
+
+ public void setDwname(String dwname) {
+ this.dwname = dwname;
+ }
+
+ public Integer getBfeecnt() {
+ return bfeecnt;
+ }
+
+ public void setBfeecnt(Integer bfeecnt) {
+ this.bfeecnt = bfeecnt;
+ }
+
+ public Integer getLfeecnt() {
+ return lfeecnt;
+ }
+
+ public void setLfeecnt(Integer lfeecnt) {
+ this.lfeecnt = lfeecnt;
+ }
+
+ public Integer getDfeecnt() {
+ return dfeecnt;
+ }
+
+ public void setDfeecnt(Integer dfeecnt) {
+ this.dfeecnt = dfeecnt;
+ }
+
+ public Double getBfeeamt() {
+ return bfeeamt;
+ }
+
+ public void setBfeeamt(Double bfeeamt) {
+ this.bfeeamt = bfeeamt;
+ }
+
+ public Double getLfeeamt() {
+ return lfeeamt;
+ }
+
+ public void setLfeeamt(Double lfeeamt) {
+ this.lfeeamt = lfeeamt;
+ }
+
+ public Double getDfeeamt() {
+ return dfeeamt;
+ }
+
+ public void setDfeeamt(Double dfeeamt) {
+ this.dfeeamt = dfeeamt;
+ }
+
+ public List<LaborCountSearchData> getDatalist() {
+ return datalist;
+ }
+
+ public void setDatalist(List<LaborCountSearchData> datalist) {
+ this.datalist = datalist;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/controller/StatementReportController.java b/src/main/java/com/supwisdom/dlpay/restaurant/controller/StatementReportController.java
index 1bbc804..edbb2a4 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/controller/StatementReportController.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/controller/StatementReportController.java
@@ -4,6 +4,7 @@
import com.supwisdom.dlpay.framework.service.SystemUtilService;
import com.supwisdom.dlpay.framework.util.DateUtil;
+import com.supwisdom.dlpay.restaurant.bean.LaborCountShowBean;
import com.supwisdom.dlpay.restaurant.bean.LaborfeeSearchBean;
import com.supwisdom.dlpay.restaurant.bean.LaborfeeShowBean;
import com.supwisdom.dlpay.restaurant.service.StatementReportService;
@@ -106,4 +107,79 @@
+ @GetMapping("/laborcount")
+ public String LaborCountIndex(@ModelAttribute("searchBean") LaborfeeSearchBean searchBean,
+ @AuthenticationPrincipal UserDetails operUser,
+ ModelMap map) {
+ try {
+ String statdate = statementReportService.getMaxStatementDate();
+ String maxdate = DateUtil.reformatDatetime(statdate, "yyyyMMdd", "yyyy-MM-dd");
+ String maxmonth = DateUtil.reformatDatetime(statdate.substring(0, 6), "yyyyMM", "yyyy-MM");
+ map.addAttribute("maxdate", maxdate);
+ map.addAttribute("maxmonth", maxmonth);
+
+ searchBean.setStartdate(statdate);
+ searchBean.setEnddate(statdate);
+ searchBean.setDatetype("days");
+ searchBean.setYearmonth(maxmonth);
+ map.addAttribute("showlist", statementReportService.getLaborCountSearchData(searchBean));
+
+ TOperator oper = (TOperator) operUser;
+ map.addAttribute("opercode", oper == null ? "unknow" : oper.getOpercode());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return "restaurant/report/laborcount";
+ }
+
+ @PostMapping("/searchlaborcount")
+ @PreAuthorize("hasPermission('/report/laborcount','')")
+ public String searchLaborCountData(@ModelAttribute("searchBean") LaborfeeSearchBean searchBean,
+ @AuthenticationPrincipal UserDetails operUser,
+ ModelMap map) {
+ try {
+ TOperator oper = (TOperator) operUser;
+ map.addAttribute("opercode", oper == null ? "unknow" : oper.getOpercode());
+
+ map.addAttribute("showlist", statementReportService.getLaborCountSearchData(searchBean));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return "restaurant/report/laborcount::laborCountTable";
+ }
+
+ @GetMapping("/excelexportlaborcnt")
+ @PreAuthorize("hasPermission('/report/excelexportlaborcnt','')")
+ public void excelExportLaborCount(@ModelAttribute("searchBean") LaborfeeSearchBean searchBean,
+ @AuthenticationPrincipal UserDetails operUser,
+ HttpServletRequest request, HttpServletResponse response, ModelMap map){
+ try {
+ List<LaborCountShowBean> datalist = statementReportService.getLaborCountSearchData(searchBean);
+ TOperator oper = (TOperator) operUser;
+ String filename="商户劳务费人次统计表";
+ statementReportService.doCreateLaborCountExcel(response, datalist, searchBean, filename, oper);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @GetMapping("/print/printlaborcnt")
+ public String printLaborCount(@ModelAttribute("searchBean") LaborfeeSearchBean searchBean,
+ @RequestParam(value = "opercode",required = false) String opercode, ModelMap map) {
+ try {
+ map.addAttribute("showlist", statementReportService.getLaborCountSearchData(searchBean));
+
+ TOperator oper = statementReportService.getOperatorByOpercode(opercode);
+ map.addAttribute("opername", oper == null ? "unknow" : oper.getOpername());
+ map.addAttribute("period", statementReportService.getLaborfeeSearchPeriod(searchBean));
+ map.addAttribute("printdatetime",DateUtil.reformatDatetime(systemUtilService.getSysdatetime().getHostdatetime(),DateUtil.DATETIME_FMT,"yyyy-MM-dd HH:mm:ss"));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return "restaurant/report/print/printlaborcount";
+ }
+
+
+
}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/StatementReportService.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/StatementReportService.java
index 2af4d7a..e758c65 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/service/StatementReportService.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/StatementReportService.java
@@ -1,6 +1,7 @@
package com.supwisdom.dlpay.restaurant.service;
import com.supwisdom.dlpay.framework.domain.TOperator;
+import com.supwisdom.dlpay.restaurant.bean.LaborCountShowBean;
import com.supwisdom.dlpay.restaurant.bean.LaborfeeSearchBean;
import com.supwisdom.dlpay.restaurant.bean.LaborfeeShowBean;
import org.springframework.transaction.annotation.Transactional;
@@ -25,4 +26,10 @@
void doCreateLaborfeeExcel(HttpServletResponse response, List<LaborfeeShowBean> datalist, LaborfeeSearchBean searchBean, String filename, TOperator oper);
+ @Transactional(rollbackFor = Exception.class,readOnly = true)
+ List<LaborCountShowBean> getLaborCountSearchData(LaborfeeSearchBean searchBean);
+
+ @Transactional(rollbackFor = Exception.class,readOnly = true)
+ void doCreateLaborCountExcel(HttpServletResponse response, List<LaborCountShowBean> datalist, LaborfeeSearchBean searchBean, String filename, TOperator oper);
+
}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/StatementReportServiceImpl.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/StatementReportServiceImpl.java
index 5bc7a76..3472a38 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/StatementReportServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/StatementReportServiceImpl.java
@@ -6,9 +6,7 @@
import com.supwisdom.dlpay.framework.util.DateUtil;
import com.supwisdom.dlpay.framework.util.MoneyUtil;
import com.supwisdom.dlpay.framework.util.StringUtil;
-import com.supwisdom.dlpay.restaurant.bean.LaborfeeSearchBean;
-import com.supwisdom.dlpay.restaurant.bean.LaborfeeSearchData;
-import com.supwisdom.dlpay.restaurant.bean.LaborfeeShowBean;
+import com.supwisdom.dlpay.restaurant.bean.*;
import com.supwisdom.dlpay.restaurant.dao.CheckCtlDao;
import com.supwisdom.dlpay.restaurant.domain.TCheckCtl;
import com.supwisdom.dlpay.restaurant.service.StatementReportService;
@@ -391,4 +389,280 @@
}
+ @Override
+ public List<LaborCountShowBean> getLaborCountSearchData(LaborfeeSearchBean searchBean) {
+ if (null != searchBean) {
+ String startdate = DateUtil.unParseToDateFormat(searchBean.getStartdate());
+ String enddate = DateUtil.unParseToDateFormat(searchBean.getEnddate());
+ if ("month".equals(searchBean.getDatetype())) {
+ //按月查询
+ startdate = DateUtil.unParseToDateFormat(searchBean.getYearmonth().trim() + "-01");
+ enddate = String.valueOf(DateUtil.getLastDayOfMonth(Integer.valueOf(searchBean.getYearmonth().substring(0, 4)), Integer.valueOf(searchBean.getYearmonth().substring(5, 7))));
+ }
+
+ StringBuffer sb = new StringBuffer("select cast(ROW_NUMBER() OVER() as int4) as rownum,case when a2.devgroupid is not null then a2.devgroupid when a1.devgroupid is not null then a1.devgroupid else t.devgroupid end as dwid," +
+ " case when a2.devgroupid is not null then a2.groupname when a1.devgroupid is not null then a1.groupname else '' end as dwname," +
+ " t.devgroupid as groupid, case when a1.devgroupid is not null then a1.groupname else '' end as groupname," +
+ " cast(sum(case when t.mealtype='breakfast' then t.feecnt else 0 end) as int4) as bfeecnt, " +
+ " cast(sum(case when t.mealtype='lunch' then t.feecnt else 0 end) as int4) as lfeecnt, " +
+ " cast(sum(case when t.mealtype='dinner' then t.feecnt else 0 end) as int4) as dfeecnt, " +
+ " sum(case when t.mealtype='breakfast' then t.feeamt else 0 end) as bfeeamt, " +
+ " sum(case when t.mealtype='lunch' then t.feeamt else 0 end) as lfeeamt, " +
+ " sum(case when t.mealtype='dinner' then t.feeamt else 0 end) as dfeeamt " +
+ "from tb_rpt_mealsdtl t left join tb_devicegroup a1 on t.devgroupid=a1.devgroupid left join tb_devicegroup a2 on a1.pid=a2.devgroupid " +
+ "where t.checkdate>=:startdate and t.checkdate<=:enddate " +
+ "group by t.devgroupid,a1.devgroupid,a2.devgroupid order by t.devgroupid ");
+ Query query = entityManager.createNativeQuery(sb.toString());
+ query.setParameter("startdate", startdate);
+ query.setParameter("enddate", enddate);
+ query.unwrap(NativeQueryImpl.class).setResultTransformer(Transformers.aliasToBean(LaborCountSearchData.class));
+ List<LaborCountSearchData> list = query.getResultList();
+ if (null != list) return transforLaborCountShowBean(list);
+ }
+ return new ArrayList<>(0);
+ }
+
+ private List<LaborCountShowBean> transforLaborCountShowBean(List<LaborCountSearchData> list) {
+ if (StringUtil.isEmpty(list)) return new ArrayList<>(0);
+
+ List<LaborCountShowBean> result = new ArrayList<>(0);
+ LaborCountShowBean sumBean = new LaborCountShowBean(-1, "总 计", 0, 0, 0, 0D, 0D, 0D);
+ for (LaborCountSearchData data : list) {
+ sumBean.setBfeecnt(sumBean.getBfeecnt() + data.getBfeecnt());
+ sumBean.setLfeecnt(sumBean.getLfeecnt() + data.getLfeecnt());
+ sumBean.setDfeecnt(sumBean.getDfeecnt() + data.getDfeecnt());
+ sumBean.setBfeeamt(sumBean.getBfeeamt() + data.getBfeeamt());
+ sumBean.setLfeeamt(sumBean.getLfeeamt() + data.getLfeeamt());
+ sumBean.setDfeeamt(sumBean.getDfeeamt() + data.getDfeeamt()); //总计求和
+
+ boolean exist = false;
+ for (LaborCountShowBean bean : result) {
+ if (bean.getDwid().intValue() == data.getDwid()) {
+ exist = true;
+ bean.getDatalist().add(data);
+
+ bean.setBfeecnt(bean.getBfeecnt() + data.getBfeecnt());
+ bean.setLfeecnt(bean.getLfeecnt() + data.getLfeecnt());
+ bean.setDfeecnt(bean.getDfeecnt() + data.getDfeecnt());
+
+ bean.setBfeeamt(bean.getBfeeamt() + data.getBfeeamt());
+ bean.setLfeeamt(bean.getLfeeamt() + data.getLfeeamt());
+ bean.setDfeeamt(bean.getDfeeamt() + data.getDfeeamt());
+ break;
+ }
+ }
+
+ if (!exist) {
+ LaborCountShowBean tmp = new LaborCountShowBean();
+ tmp.setDwid(data.getDwid());
+ tmp.setDwname(data.getDwname());
+
+ tmp.setBfeecnt(data.getBfeecnt());
+ tmp.setLfeecnt(data.getLfeecnt());
+ tmp.setDfeecnt(data.getDfeecnt());
+
+ tmp.setBfeeamt(data.getBfeeamt());
+ tmp.setLfeeamt(data.getLfeeamt());
+ tmp.setDfeeamt(data.getDfeeamt());
+ tmp.getDatalist().add(data);
+
+ result.add(tmp);
+ }
+
+ }
+
+ result.add(sumBean); //最后加上总计
+ return result;
+ }
+
+ @Override
+ public void doCreateLaborCountExcel(HttpServletResponse response, List<LaborCountShowBean> datalist, LaborfeeSearchBean searchBean, String filename, TOperator oper) {
+ // 创建工作簿实例
+ HSSFWorkbook workbook = new HSSFWorkbook();
+ HSSFSheet sheet = workbook.createSheet("商户劳务费清单(刷卡次数版)");
+
+ //TODO:设置列宽
+ //序号|单位|食堂|(正价:早餐|中餐|晚餐)|(折后:早餐|中餐|晚餐)|(劳务费:早餐|中餐|晚餐|小计)
+ int columns = 10; //
+ sheet.setColumnWidth(0, ExcelPoiUtil.columnWidth(6)); //序号
+ sheet.setColumnWidth(1, ExcelPoiUtil.columnWidth(25)); //单位
+ sheet.setColumnWidth(2, ExcelPoiUtil.columnWidth(20)); //食堂
+ for (int i = 3; i < columns; i++) {
+ sheet.setColumnWidth(i, ExcelPoiUtil.columnWidth(14));
+ }
+
+ //标题样式
+ HSSFCellStyle titleStyle = ExcelPoiUtil.creatStyle(workbook, "宋体", true, 20, HSSFCellStyle.ALIGN_CENTER, false); //设置单元格样式
+ //表头样式
+ HSSFCellStyle headStyle = ExcelPoiUtil.creatStyle(workbook, "宋体", true, 15, HSSFCellStyle.ALIGN_CENTER, true); //设置单元格样式
+ //正文样式 有边框-textStyle1 无边框-textStyle2
+ HSSFCellStyle textStyle1 = ExcelPoiUtil.creatStyle(workbook, "宋体", false, 10, HSSFCellStyle.ALIGN_CENTER, true); //设置单元格样式
+ HSSFCellStyle textStyle2 = ExcelPoiUtil.creatStyle(workbook, "宋体", false, 10, HSSFCellStyle.ALIGN_CENTER, false); //设置单元格样式
+
+
+ //TODO:创建标题
+ HSSFRow row0 = ExcelPoiUtil.createRow(sheet, 0, 800); //表格标题
+ ExcelPoiUtil.createCell(row0, 0, titleStyle, filename);
+ sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, columns - 1)); //合并单元格CellRangeAddress构造参数依次表示 起始行,截至行,起始列, 截至列
+
+ //TODO:创建表格页眉
+ HSSFRow row1 = ExcelPoiUtil.createRow(sheet, 1, 400);
+ ExcelPoiUtil.createCell(row1, 0, textStyle2, "区间");
+ ExcelPoiUtil.createCell(row1, 1, textStyle2, getLaborfeeSearchPeriod(searchBean));
+ ExcelPoiUtil.createCell(row1, columns - 1, ExcelPoiUtil.creatStyle(workbook, "宋体", false, 10, HSSFCellStyle.ALIGN_RIGHT, false), "单位:元");
+
+ //TODO:创建表头(poi做多行合并,一定需要先绘制单元格,然后写入数据,最后合并)
+ HSSFRow row2 = ExcelPoiUtil.createRow(sheet, 2, 600);
+ ExcelPoiUtil.createCell(row2, 0, headStyle, "序号");
+ ExcelPoiUtil.createCell(row2, 1, headStyle, "单位");
+ ExcelPoiUtil.createCell(row2, 2, headStyle, "食堂");
+
+ ExcelPoiUtil.createCell(row2, 3, headStyle, "刷卡次数(人)");
+ ExcelPoiUtil.createCell(row2, 4, headStyle, null);
+ ExcelPoiUtil.createCell(row2, 5, headStyle, null);
+ sheet.addMergedRegion(new CellRangeAddress(2, 2, 3, 5)); //合并单元格CellRangeAddress构造参数依次表示 起始行,截至行,起始列, 截至列
+
+ ExcelPoiUtil.createCell(row2, 6, headStyle, "应支付劳务费(元)");
+ ExcelPoiUtil.createCell(row2, 7, headStyle, null);
+ ExcelPoiUtil.createCell(row2, 8, headStyle, null);
+ ExcelPoiUtil.createCell(row2, 9, headStyle, null);
+ sheet.addMergedRegion(new CellRangeAddress(2, 2, 6, 9)); //合并单元格CellRangeAddress构造参数依次表示 起始行,截至行,起始列, 截至列
+
+
+ HSSFRow row3 = ExcelPoiUtil.createRow(sheet, 3, 800); //表头第二行
+ ExcelPoiUtil.createCell(row3, 0, headStyle, null);
+ sheet.addMergedRegion(new CellRangeAddress(2, 3, 0, 0)); //合并列
+
+ ExcelPoiUtil.createCell(row3, 1, headStyle, null);
+ sheet.addMergedRegion(new CellRangeAddress(2, 3, 1, 1)); //合并列
+
+ ExcelPoiUtil.createCell(row3, 2, headStyle, null);
+ sheet.addMergedRegion(new CellRangeAddress(2, 3, 2, 2)); //合并列
+
+ ExcelPoiUtil.createCell(row3, 3, headStyle, "早餐");
+ ExcelPoiUtil.createCell(row3, 4, headStyle, "午餐");
+ ExcelPoiUtil.createCell(row3, 5, headStyle, "晚餐");
+
+ ExcelPoiUtil.createCell(row3, 6, headStyle, "早餐\n应付劳务费");
+ ExcelPoiUtil.createCell(row3, 7, headStyle, "午餐\n应付劳务费");
+ ExcelPoiUtil.createCell(row3, 8, headStyle, "晚餐\n应付劳务费");
+ ExcelPoiUtil.createCell(row3, 9, headStyle, "应支付劳\n务费小计");
+
+ //TODO: 数据
+ int rowNum = 4;
+ if (StringUtil.isEmpty(datalist)) {
+ //无数据
+ HSSFRow row4 = ExcelPoiUtil.createRow(sheet, rowNum, 500);
+ ExcelPoiUtil.createCell(row4, 0, textStyle1, "无数据");
+ for(int n=1;n<columns;n++) ExcelPoiUtil.createCell(row4, n, textStyle1, null);
+ sheet.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 0, columns - 1)); //合并列
+ } else {
+ //有数据
+ for (int i = 0; i < datalist.size() - 1; i++) {
+ LaborCountShowBean rowData = datalist.get(i);
+ if (StringUtil.isEmpty(rowData.getDatalist())) continue;
+
+ int firstRowNo = rowNum;
+ HSSFRow row = ExcelPoiUtil.createRow(sheet, rowNum++, 500);
+ ExcelPoiUtil.createCell(row, 0, textStyle1, "" + rowData.getDatalist().get(0).getRownum()); //序号
+ ExcelPoiUtil.createCell(row, 1, textStyle1, rowData.getDwname()); //单位
+
+ for (int j = 0; j < rowData.getDatalist().size(); j++) {
+ LaborCountSearchData detail = rowData.getDatalist().get(j);
+ if (j > 0) {
+ //非首行
+ row = ExcelPoiUtil.createRow(sheet, rowNum++, 500);
+ ExcelPoiUtil.createCell(row, 0, textStyle1, "" + detail.getRownum()); //序号
+ ExcelPoiUtil.createCell(row, 1, textStyle1, null); //序号
+ }
+ ExcelPoiUtil.createCell(row, 2, textStyle1, detail.getGroupname()); //食堂
+ ExcelPoiUtil.createCell(row, 3, textStyle1,""+detail.getBfeecnt()); //早餐
+ ExcelPoiUtil.createCell(row, 4, textStyle1,""+detail.getLfeecnt()); //午餐
+ ExcelPoiUtil.createCell(row, 5, textStyle1,""+detail.getDfeecnt()); //晚餐
+
+ ExcelPoiUtil.createCell(row, 6, textStyle1, MoneyUtil.formatYuanToString(detail.getBfeeamt())); //早餐
+ ExcelPoiUtil.createCell(row, 7, textStyle1, MoneyUtil.formatYuanToString(detail.getLfeeamt())); //午餐
+ ExcelPoiUtil.createCell(row, 8, textStyle1, MoneyUtil.formatYuanToString(detail.getDfeeamt())); //晚餐
+ ExcelPoiUtil.createCell(row, 9, textStyle1, MoneyUtil.formatYuanToString(detail.getBfeeamt() + detail.getLfeeamt() + detail.getDfeeamt())); //小计
+ }
+ if (rowData.getDatalist().size() > 1) {
+ sheet.addMergedRegion(new CellRangeAddress(firstRowNo, rowNum - 1, 1, 1)); //合并列
+
+ //单位小计行
+ row = ExcelPoiUtil.createRow(sheet, rowNum++, 500);
+ ExcelPoiUtil.createCell(row, 0, textStyle1, rowData.getDwname() + "小计");
+ ExcelPoiUtil.createCell(row, 1, textStyle1, null);
+ ExcelPoiUtil.createCell(row, 2, textStyle1, null);
+ sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, 2)); //合并列
+
+ ExcelPoiUtil.createCell(row, 3, textStyle1,""+rowData.getBfeecnt()); //早餐
+ ExcelPoiUtil.createCell(row, 4, textStyle1,""+rowData.getLfeecnt()); //午餐
+ ExcelPoiUtil.createCell(row, 5, textStyle1,""+rowData.getDfeecnt()); //晚餐
+
+ ExcelPoiUtil.createCell(row, 6, textStyle1, MoneyUtil.formatYuanToString(rowData.getBfeeamt())); //早餐
+ ExcelPoiUtil.createCell(row, 7, textStyle1, MoneyUtil.formatYuanToString(rowData.getLfeeamt())); //午餐
+ ExcelPoiUtil.createCell(row, 8, textStyle1, MoneyUtil.formatYuanToString(rowData.getDfeeamt())); //晚餐
+ ExcelPoiUtil.createCell(row, 9, textStyle1, MoneyUtil.formatYuanToString(rowData.getBfeeamt() + rowData.getLfeeamt() + rowData.getDfeeamt())); //小计
+ }
+ }
+
+ //TODO: 总计
+ LaborCountShowBean sumBean = datalist.get(datalist.size() - 1);
+ HSSFRow sumRow = ExcelPoiUtil.createRow(sheet, rowNum, 500);
+ ExcelPoiUtil.createCell(sumRow, 0, textStyle1, sumBean.getDwname());
+ ExcelPoiUtil.createCell(sumRow, 1, textStyle1, null);
+ ExcelPoiUtil.createCell(sumRow, 2, textStyle1, null);
+ sheet.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 0, 2)); //合并列
+
+ ExcelPoiUtil.createCell(sumRow, 3, textStyle1, ""+sumBean.getBfeecnt()); //早餐
+ ExcelPoiUtil.createCell(sumRow, 4, textStyle1, ""+sumBean.getLfeecnt()); //午餐
+ ExcelPoiUtil.createCell(sumRow, 5, textStyle1, ""+sumBean.getDfeecnt()); //晚餐
+
+ ExcelPoiUtil.createCell(sumRow, 6, textStyle1, MoneyUtil.formatYuanToString(sumBean.getBfeeamt())); //早餐
+ ExcelPoiUtil.createCell(sumRow, 7, textStyle1, MoneyUtil.formatYuanToString(sumBean.getLfeeamt())); //午餐
+ ExcelPoiUtil.createCell(sumRow, 8, textStyle1, MoneyUtil.formatYuanToString(sumBean.getDfeeamt())); //晚餐
+ ExcelPoiUtil.createCell(sumRow, 9, textStyle1, MoneyUtil.formatYuanToString(sumBean.getBfeeamt() + sumBean.getLfeeamt() + sumBean.getDfeeamt())); //小计
+ }
+
+ //TODO: 表格页脚
+ HSSFCellStyle textStyle3 = ExcelPoiUtil.creatStyle(workbook, "宋体", false, 10, HSSFCellStyle.ALIGN_LEFT, false); //设置单元格样式
+ HSSFRow buttom = ExcelPoiUtil.createRow(sheet, ++rowNum, 400);
+ ExcelPoiUtil.createCell(buttom, 0, textStyle3, "制表人:" + (oper == null ? "unknow" : oper.getOpername()) + " " + DateUtil.reformatDatetime(systemUtilService.getSysdatetime().getHostdatetime(), DateUtil.DATETIME_FMT, "yyyy-MM-dd HH:mm:ss"));
+ sheet.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 0, 2)); //合并列
+
+ //TODO: 审核信息
+ HSSFRow signRow10 = ExcelPoiUtil.createRow(sheet, rowNum + 3, 400);
+ ExcelPoiUtil.createCell(signRow10, 0, textStyle3, "银行方审核盖章:");
+ ExcelPoiUtil.createCell(signRow10, 5, textStyle3, "苍山饭店审核盖章:");
+ sheet.addMergedRegion(new CellRangeAddress(rowNum + 3, rowNum + 3, 0, 4)); //合并列
+ sheet.addMergedRegion(new CellRangeAddress(rowNum + 3, rowNum + 3, 5, columns - 1)); //合并列
+ HSSFRow signRow11 = ExcelPoiUtil.createRow(sheet, rowNum + 4, 400);
+ ExcelPoiUtil.createCell(signRow11, 0, textStyle3, "审核人:");
+ ExcelPoiUtil.createCell(signRow11, 5, textStyle3, "审核人:");
+ sheet.addMergedRegion(new CellRangeAddress(rowNum + 4, rowNum + 4, 0, 4)); //合并列
+ sheet.addMergedRegion(new CellRangeAddress(rowNum + 4, rowNum + 4, 5, columns - 1)); //合并列
+
+ HSSFRow signRow20 = ExcelPoiUtil.createRow(sheet, rowNum + 8, 400);
+ ExcelPoiUtil.createCell(signRow20, 0, textStyle3, "市民卡公司审核盖章:");
+ ExcelPoiUtil.createCell(signRow20, 5, textStyle3, "建桥园审核盖章:");
+ sheet.addMergedRegion(new CellRangeAddress(rowNum + 8, rowNum + 8, 0, 4)); //合并列
+ sheet.addMergedRegion(new CellRangeAddress(rowNum + 8, rowNum + 8, 5, columns - 1)); //合并列
+ HSSFRow signRow21 = ExcelPoiUtil.createRow(sheet, rowNum + 9, 400);
+ ExcelPoiUtil.createCell(signRow21, 0, textStyle3, "审核人:");
+ ExcelPoiUtil.createCell(signRow21, 5, textStyle3, "审核人:");
+ sheet.addMergedRegion(new CellRangeAddress(rowNum + 9, rowNum + 9, 0, 4)); //合并列
+ sheet.addMergedRegion(new CellRangeAddress(rowNum + 9, rowNum + 9, 5, columns - 1)); //合并列
+
+ try {
+ response.setContentType("application/x-msdownload");
+ response.setHeader("Content-Disposition", "attachment;" + " filename="+ new String(filename.getBytes(), "ISO-8859-1") + ".xls");
+ OutputStream out = response.getOutputStream();
+ workbook.write(out);
+ out.flush();
+ out.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
}
diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql
index b49c77f..6d69446 100644
--- a/src/main/resources/data.sql
+++ b/src/main/resources/data.sql
@@ -126,6 +126,7 @@
INSERT INTO "tb_function"("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid") VALUES (34, NULL, 1, NULL, '', '/customerlist/index', '餐补人员名单管理', 1, 24);
INSERT INTO "tb_function"("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid") VALUES (35, NULL, 0, NULL, 'layui-icon-rmb', '#', '报表中心', 10, -1);
INSERT INTO "tb_function"("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid") VALUES (36, NULL, 1, NULL, '', '/report/laborfee', '商户劳务费报表', 1, 35);
+INSERT INTO "tb_function"("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid") VALUES (37, NULL, 1, NULL, '', '/report/laborcount', '商户劳务费人次统计表', 2, 35);
@@ -311,6 +312,8 @@
INSERT INTO "tb_permission"("id", "resid", "role_func_id", "roleid") VALUES ('ff8080816ea5a411016ea5bc08af007d', 95, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs');
INSERT INTO "tb_permission"("id", "resid", "role_func_id", "roleid") VALUES ('ff8080816eb6236e016eb62961f8007d', 96, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs');
+INSERT INTO "tb_permission"("id", "resid", "role_func_id", "roleid") VALUES ('ff8080816ec4640b016ec471f89d0080', 97, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs');
+INSERT INTO "tb_permission"("id", "resid", "role_func_id", "roleid") VALUES ('ff8080816ec4640b016ec471f89d007f', 98, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs');
INSERT INTO "tb_resource" (id,code,function_id,name,uri) VALUES (4, '1', 4, '添加功能', '/function/add');
@@ -413,6 +416,8 @@
INSERT INTO "tb_resource"("id", "code", "function_id", "name", "uri") VALUES (94, '', 34, '查询', '/customerlist/index');
INSERT INTO "tb_resource"("id", "code", "function_id", "name", "uri") VALUES (95, '', 36, '查询', '/report/laborfee');
INSERT INTO "tb_resource"("id", "code", "function_id", "name", "uri") VALUES (96, '', 36, '导出', '/report/excelexportlaborfee');
+INSERT INTO "tb_resource"("id", "code", "function_id", "name", "uri") VALUES (97, '', 37, '查询', '/report/laborcount');
+INSERT INTO "tb_resource"("id", "code", "function_id", "name", "uri") VALUES (98, '', 37, '导出', '/report/excelexportlaborcnt');
@@ -465,6 +470,7 @@
INSERT INTO "tb_role_function"("id", "functionid", "permissions", "roleid") VALUES ('ff8080816ea5a411016ea5bc08ae007b', 35, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs');
INSERT INTO "tb_role_function"("id", "functionid", "permissions", "roleid") VALUES ('ff8080816ea5a411016ea5bc08ae007c', 36, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs');
+INSERT INTO "tb_role_function"("id", "functionid", "permissions", "roleid") VALUES ('ff8080816ec4640b016ec471f89d007e', 37, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs');
INSERT INTO "tb_shopsettlement" (shopsettlementno,operno,shopid,shopname) VALUES ('1', '1234', '2000000012', '测试商户');
diff --git a/src/main/resources/static/libs/CLodop/LodopFuncs.js b/src/main/resources/static/libs/CLodop/LodopFuncs.js
index 59b481c..3a21b3f 100755
--- a/src/main/resources/static/libs/CLodop/LodopFuncs.js
+++ b/src/main/resources/static/libs/CLodop/LodopFuncs.js
@@ -13,12 +13,12 @@
//====页面引用CLodop云打印必须的JS文件,用双端口(8000和18000)避免其中某个被占用:====
if (needCLodop()) {
// https
- // var src1 = "https://localhost:8443/CLodopfuncs.js?priority=1";
- // var src2 = "https://localhost:8444/CLodopfuncs.js?priority=0";
+ var src1 = "https://localhost:8443/CLodopfuncs.js?priority=1";
+ var src2 = "https://localhost:8444/CLodopfuncs.js?priority=0";
//http
- var src1 = "http://localhost:8000/CLodopfuncs.js?priority=1";
- var src2 ="http://localhost:18000/CLodopfuncs.js?priority=0";
+ // var src1 = "http://localhost:8000/CLodopfuncs.js?priority=1";
+ // var src2 ="http://localhost:18000/CLodopfuncs.js?priority=0";
var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
var oscript = document.createElement("script");
diff --git a/src/main/resources/templates/restaurant/report/laborcount.html b/src/main/resources/templates/restaurant/report/laborcount.html
new file mode 100644
index 0000000..c5826be
--- /dev/null
+++ b/src/main/resources/templates/restaurant/report/laborcount.html
@@ -0,0 +1,261 @@
+<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" lay-filter="shopreport-labercount-search-form">
+ <input type="hidden" id="shopreport-labercount-hidden-maxdate" th:value="${maxdate}"/>
+ <input type="hidden" id="shopreport-labercount-hidden-maxmonth" th:value="${maxmonth}"/>
+ <div class="layui-form-item" style="margin-bottom: 0;">
+ <div class="layui-inline">
+ <label class="layui-form-label">汇总日期</label>
+ <div class="layui-input-inline">
+ <input type="text" name="startdate" id="shopreport-labercount-search-startdate" placeholder="起始日期"
+ th:value="${maxdate}"
+ autocomplete="off" class="layui-input"/>
+ </div>
+ <div class="layui-form-mid">-</div>
+ <div class="layui-input-inline">
+ <input type="text" name="enddate" id="shopreport-labercount-search-enddate" placeholder="截止日期"
+ th:value="${maxdate}"
+ autocomplete="off" class="layui-input"/>
+ </div>
+ </div>
+
+ <div class="layui-inline">
+ <label class="layui-form-label">汇总月份</label>
+ <div class="layui-input-block">
+ <input type="text" name="yearmonth" id="shopreport-labercount-search-yearmonth" placeholder="选择月份"
+ th:value="${maxmonth}" autocomplete="off" class="layui-input"/>
+ </div>
+ </div>
+
+ <div class="layui-inline">
+ <div class="layui-input-block" style="margin-left: 0;">
+ <input type="checkbox" name="datetype" id="shopreport-labercount-datetype" lay-skin="primary"
+ title="按月份查询"/>
+ </div>
+ </div>
+
+ <div class="layui-inline">
+ <button id="shopreport-labercount-search-btn" class="layui-btn icon-btn" data-type="search"><i
+ class="layui-icon"></i>搜索
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="layui-card-body">
+ <div class="layui-form toolbar">
+ <div class="layui-btn-group">
+ <button id="shopreport-labercount-export-excel" class="layui-btn layui-btn-sm layui-btn-primary sw-print"><i class="layui-icon layui-icon-export"></i>导出</button>
+ <button id="shopreport-labercount-print-table" class="layui-btn layui-btn-sm layui-btn-primary sw-print"><i class="layui-icon layui-icon-print"></i>打印</button>
+ </div>
+ </div>
+ <table class="layui-table sw-table" id="shopreport-labercount-table" th:fragment="laborCountTable">
+ <thead>
+ <tr>
+ <th rowspan="3" style="text-align: center;min-width: 35px;">序号</th>
+ <th rowspan="3" style="text-align: center;min-width: 100px;">单位</th>
+ <th rowspan="3" style="text-align: center;min-width: 100px;">食堂</th>
+ <th colspan="3" style="text-align: center;">刷卡次数(人)</th>
+ <th colspan="4" style="text-align: center;">应支付劳务费(元)</th>
+ </tr>
+ <tr>
+ <th rowspan="2" style="text-align: center;min-width: 60px;">早餐</th>
+ <th rowspan="2" style="text-align: center;min-width: 60px;">午餐</th>
+ <th rowspan="2" style="text-align: center;min-width: 60px;">晚餐</th>
+
+ <th rowspan="2" style="text-align: center;min-width: 60px;">早餐<br/>应付劳务费</th>
+ <th rowspan="2" style="text-align: center;min-width: 60px;">午餐<br/>应付劳务费</th>
+ <th rowspan="2" style="text-align: center;min-width: 60px;">晚餐<br/>应付劳务费</th>
+ <th rowspan="2" style="text-align: center;min-width: 60px;">应支付劳<br/>务费小计</th>
+ </tr>
+ </thead>
+ <tbody id="shopreport-labercount-tbody" th:data-startdate="${searchBean.startdate}" th:data-enddate="${searchBean.enddate}" th:data-datetype="${searchBean.datetype}" th:data-yearmonth="${searchBean.yearmonth}" th:data-opercode="${opercode}">
+ <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}" th:with="childCount=${data.datalist.size()}">
+ <tr th:if=${!dataStat.last}>
+ <td th:text="${childCount>0}?${data.datalist[0].rownum}:''"></td>
+ <td th:text="${data.dwname}" th:rowspan="${data.datalist.size()}"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].groupname}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].bfeecnt}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].lfeecnt}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].dfeecnt}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].bfeeamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].lfeeamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].dfeeamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].bfeeamt+data.datalist[0].lfeeamt+data.datalist[0].dfeeamt,1,2)}:''"></td>
+ </tr>
+ <tr th:each="article,stats:${data.datalist}" th:if="${!stats.first}">
+ <td th:text="${article.rownum}"></td>
+ <td th:text="${article.groupname}"></td>
+ <td th:text="${article.bfeecnt}"></td>
+ <td th:text="${article.lfeecnt}"></td>
+ <td th:text="${article.dfeecnt}"></td>
+ <td th:text="${#numbers.formatDecimal(article.bfeeamt,1,2)}"></td>
+ <td th:text="${#numbers.formatDecimal(article.lfeeamt,1,2)}"></td>
+ <td th:text="${#numbers.formatDecimal(article.dfeeamt,1,2)}"></td>
+ <td th:text="${#numbers.formatDecimal(article.bfeeamt+article.lfeeamt+article.dfeeamt,1,2)}"></td>
+ </tr>
+ <tr th:if="${childCount>1}">
+ <td colspan="3" th:text="${data.dwname+'小计'}"></td>
+ <td th:text="${data.bfeecnt}"></td>
+ <td th:text="${data.lfeecnt}"></td>
+ <td th:text="${data.dfeecnt}"></td>
+ <td th:text="${#numbers.formatDecimal(data.bfeeamt,1,2)}"></td>
+ <td th:text="${#numbers.formatDecimal(data.lfeeamt,1,2)}"></td>
+ <td th:text="${#numbers.formatDecimal(data.dfeeamt,1,2)}"></td>
+ <td th:text="${#numbers.formatDecimal(data.bfeeamt+data.lfeeamt+data.dfeeamt,1,2)}"></td>
+ </tr>
+ <tr th:if="${dataStat.last}">
+ <td style="font-weight: bold;" colspan="3" th:text="${data.dwname}"></td>
+ <td style="font-weight: bold;" th:text="${data.bfeecnt}"></td>
+ <td style="font-weight: bold;" th:text="${data.lfeecnt}"></td>
+ <td style="font-weight: bold;" th:text="${data.dfeecnt}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.bfeeamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.lfeeamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.dfeeamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.bfeeamt+data.lfeeamt+data.dfeeamt,1,2)}"></td>
+ </tr>
+ </div>
+ </tbody>
+ </table>
+ </div>
+</div>
+
+<script>
+ layui.use(['form', 'layer', 'laydate', 'admin'], function () {
+ var form = layui.form;
+ var laydate = layui.laydate;
+ var layer = layui.layer;
+ var $ = layui.jquery;
+
+ form.render("checkbox");
+ laydate.render({
+ elem: '#shopreport-labercount-search-yearmonth',
+ type: 'month',
+ max: $("#shopreport-labercount-hidden-maxdate").val(),
+ trigger: 'click',
+ change: function (value, date, endDate) {
+ $('#shopreport-labercount-search-yearmonth').val(value);
+ $('#layui-laydate1').remove();
+ }
+ });
+ laydate.render({
+ elem: '#shopreport-labercount-search-startdate',
+ max: $("#shopreport-labercount-hidden-maxdate").val(),
+ trigger: 'click'
+ });
+ laydate.render({
+ elem: '#shopreport-labercount-search-enddate',
+ max: $("#shopreport-labercount-hidden-maxdate").val(),
+ trigger: 'click'
+ });
+
+ $("#shopreport-labercount-search-btn").click(function(){
+ var startdate=$("#shopreport-labercount-search-startdate").val();
+ var enddate = $("#shopreport-labercount-search-enddate").val();
+ var yearmonth=$("#shopreport-labercount-search-yearmonth").val();
+ var dtype = $("#shopreport-labercount-datetype").is(":checked")?"month":"days";
+ if ("month" == dtype) {
+ if (isempty(yearmonth)) {
+ layer.msg('请选择月份', {icon: 2});
+ return;
+ }
+ } else {
+ if (isempty(startdate) || isempty(enddate)) {
+ layer.msg('请选择汇总时间段', {icon: 2});
+ return;
+ }
+ }
+
+ layer.load(2);
+ $.ajax({
+ url: '[[@{/report/searchlaborcount}]]',
+ type: "POST",
+ data: {
+ startdate: startdate,
+ enddate: enddate,
+ datetype: dtype,
+ yearmonth: yearmonth,
+ _csrf: $("meta[name='_csrf_token']").attr("value")
+ },
+ success: function (data) {
+ $("#shopreport-labercount-table").html(data);
+ layer.closeAll('loading');
+ },
+ error: function (status, err) {
+ layer.closeAll('loading');
+ layer.msg('查询失败了', {icon: 2});
+ }
+ });
+ });
+
+ //打印
+ var LODOP; //声明为全局变量
+ $("#shopreport-labercount-print-table").click(function(){
+ var startdate= $("#shopreport-labercount-tbody").attr("data-startdate");
+ var enddate= $("#shopreport-labercount-tbody").attr("data-enddate");
+ var datetype= $("#shopreport-labercount-tbody").attr("data-datetype");
+ var yearmonth= $("#shopreport-labercount-tbody").attr("data-yearmonth");
+ var opercode = $("#shopreport-labercount-tbody").attr("data-opercode");
+ var url = '/report/print/printlaborcnt?startdate=' + startdate + '&enddate=' + enddate + '&datetype=' + datetype + '&yearmonth=' + yearmonth + '&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();
+ });
+
+ //导出
+ $("#shopreport-labercount-export-excel").click(function(){
+ var startdate= $("#shopreport-labercount-tbody").attr("data-startdate");
+ var enddate= $("#shopreport-labercount-tbody").attr("data-enddate");
+ var datetype= $("#shopreport-labercount-tbody").attr("data-datetype");
+ var yearmonth= $("#shopreport-labercount-tbody").attr("data-yearmonth");
+
+ var dataUrl='[[@{/report/excelexportlaborcnt}]]?startdate='+startdate+'&enddate='+enddate+'&datetype='+datetype+'&yearmonth='+yearmonth;
+ var xhr = new XMLHttpRequest();
+ xhr.responseType = "blob"; //设置响应类型为blob类型
+ xhr.onload = function () {
+ debugger
+ if (this.status == "200") {
+ //获取响应文件流
+ var blob = this.response;
+ // 转换完成,创建一个a标签用于下载
+ var aElem = document.createElement('a');
+ aElem.href = window.URL.createObjectURL(blob);
+ aElem.download = "商户劳务费人次统计表.xls";
+ aElem.onload = function (e) {
+ window.URL.revokeObjectURL(aElem.href);
+ };
+ $("body").append(aElem); // 修复firefox中无法触发click
+ aElem.click();
+ $(aElem).remove();
+
+ }else if(this.status == "403"){
+ layer.msg('无导出资源权限', {icon: 2});
+ } else {
+ layer.msg('导出excel失败了', {icon: 2});
+ }
+ }
+ xhr.open("GET", dataUrl, true);
+ xhr.send();
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/main/resources/templates/restaurant/report/print/printlaborcount.html b/src/main/resources/templates/restaurant/report/print/printlaborcount.html
new file mode 100644
index 0000000..255777f
--- /dev/null
+++ b/src/main/resources/templates/restaurant/report/print/printlaborcount.html
@@ -0,0 +1,129 @@
+<!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: 3px;" th:text="${'区间:'+period}"></div>
+ <div style="float: right;" th:text="'单位:元'"></div>
+ </div>
+ <table class="layui-table sw-table sw-print">
+ <thead>
+ <tr>
+ <th rowspan="3" style="text-align: center;width: 28px;">序号</th>
+ <th rowspan="3" style="text-align: center;min-width: 100px;">单位</th>
+ <th rowspan="3" style="text-align: center;min-width: 100px;">食堂</th>
+ <th colspan="3" style="text-align: center;">刷卡次数(人)</th>
+ <th colspan="4" style="text-align: center;">应支付劳务费(元)</th>
+ </tr>
+ <tr>
+ <th rowspan="2" style="text-align: center;min-width: 50px;">早餐</th>
+ <th rowspan="2" style="text-align: center;min-width: 50px;">午餐</th>
+ <th rowspan="2" style="text-align: center;min-width: 50px;">晚餐</th>
+
+ <th rowspan="2" style="text-align: center;min-width: 70px;">早餐<br/>应付劳务费</th>
+ <th rowspan="2" style="text-align: center;min-width: 70px;">午餐<br/>应付劳务费</th>
+ <th rowspan="2" style="text-align: center;min-width: 70px;">晚餐<br/>应付劳务费</th>
+ <th rowspan="2" style="text-align: center;min-width: 70px;">应支付劳<br/>务费小计</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}"
+ th:with="childCount=${data.datalist.size()}">
+ <tr th:if=${!dataStat.last}>
+ <td th:text="${childCount>0}?${data.datalist[0].rownum}:''"></td>
+ <td th:text="${data.dwname}" th:rowspan="${data.datalist.size()}"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].groupname}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].bfeecnt}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].lfeecnt}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].dfeecnt}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].bfeeamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].lfeeamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].dfeeamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].bfeeamt+data.datalist[0].lfeeamt+data.datalist[0].dfeeamt,1,2)}:''"></td>
+ </tr>
+ <tr th:each="article,stats:${data.datalist}" th:if="${!stats.first}">
+ <td th:text="${article.rownum}"></td>
+ <td th:text="${article.groupname}"></td>
+ <td th:text="${article.bfeecnt}"></td>
+ <td th:text="${article.lfeecnt}"></td>
+ <td th:text="${article.dfeecnt}"></td>
+ <td th:text="${#numbers.formatDecimal(article.bfeeamt,1,2)}"></td>
+ <td th:text="${#numbers.formatDecimal(article.lfeeamt,1,2)}"></td>
+ <td th:text="${#numbers.formatDecimal(article.dfeeamt,1,2)}"></td>
+ <td th:text="${#numbers.formatDecimal(article.bfeeamt+article.lfeeamt+article.dfeeamt,1,2)}"></td>
+ </tr>
+ <tr th:if="${childCount>1}">
+ <td colspan="3" th:text="${data.dwname+'小计'}"></td>
+ <td th:text="${data.bfeecnt}"></td>
+ <td th:text="${data.lfeecnt}"></td>
+ <td th:text="${data.dfeecnt}"></td>
+ <td th:text="${#numbers.formatDecimal(data.bfeeamt,1,2)}"></td>
+ <td th:text="${#numbers.formatDecimal(data.lfeeamt,1,2)}"></td>
+ <td th:text="${#numbers.formatDecimal(data.dfeeamt,1,2)}"></td>
+ <td th:text="${#numbers.formatDecimal(data.bfeeamt+data.lfeeamt+data.dfeeamt,1,2)}"></td>
+ </tr>
+ <tr th:if="${dataStat.last}">
+ <td style="font-weight: bold;" colspan="3" th:text="${data.dwname}"></td>
+ <td style="font-weight: bold;" th:text="${data.bfeecnt}"></td>
+ <td style="font-weight: bold;" th:text="${data.lfeecnt}"></td>
+ <td style="font-weight: bold;" th:text="${data.dfeecnt}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.bfeeamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.lfeeamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.dfeeamt,1,2)}"></td>
+ <td style="font-weight: bold;"
+ th:text="${#numbers.formatDecimal(data.bfeeamt+data.lfeeamt+data.dfeeamt,1,2)}"></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;">
+ <table class="sw-print-sign">
+ <tr>
+ <td width="50%">银行方审核盖章:</td>
+ <td width="50%">苍山饭店审核盖章:</td>
+ </tr>
+ <tr>
+ <td>审核人:</td>
+ <td>审核人:</td>
+ </tr>
+ <tr>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td>市民卡公司审核盖章:</td>
+ <td>建桥园审核盖章:</td>
+ </tr>
+ <tr>
+ <td>审核人:</td>
+ <td>审核人:</td>
+ </tr>
+ </table>
+ </div>
+</div>
+</body>
+</html>
\ No newline at end of file