商户日结报表
Conflicts:
src/main/java/com/supwisdom/dlpay/framework/filter/CrosXssFilter.java
src/main/java/com/supwisdom/dlpay/restaurant/service/StatementReportService.java
diff --git a/src/main/java/com/supwisdom/dlpay/AppLoginRunner.java b/src/main/java/com/supwisdom/dlpay/AppLoginRunner.java
index e9b9f49..a9eaa0a 100644
--- a/src/main/java/com/supwisdom/dlpay/AppLoginRunner.java
+++ b/src/main/java/com/supwisdom/dlpay/AppLoginRunner.java
@@ -52,14 +52,14 @@
}
- @Scheduled(cron = "0 0/5 * * * ?")
+ @Scheduled(cron = "0 0/10 * * * ?")
private void doRefresh() {
try{
ApiLoginHelper helper = new ApiLoginHelper(apiLoginProxy);
helper.refresh();
logger.info("刷新成功");
}catch (Exception e){
- logger.error("刷新成功");
+ logger.error("刷新失败");
}
}
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 d984b9f..4366a3e 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("..........RequestUrl:{},RequestParam:{}",httpServletRequest.getRequestURI(), new Gson().toJson(httpServletRequest.getParameterMap()));
+ // logger.error("CrosXssFilter.......orignal url:{},ParameterMap:{}",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/MealsDtlSearchBean.java b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DailyReportSearchBean.java
similarity index 89%
rename from src/main/java/com/supwisdom/dlpay/restaurant/bean/MealsDtlSearchBean.java
rename to src/main/java/com/supwisdom/dlpay/restaurant/bean/DailyReportSearchBean.java
index 5db77bd..f991919 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/bean/MealsDtlSearchBean.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DailyReportSearchBean.java
@@ -2,7 +2,7 @@
import com.supwisdom.dlpay.system.bean.PageBean;
-public class MealsDtlSearchBean extends PageBean {
+public class DailyReportSearchBean extends PageBean {
private String startdate;
private String enddate;
private Integer groupid;
@@ -33,7 +33,7 @@
@Override
public String toString() {
- return "MealsDtlSearchBean{" +
+ return "DailyReportSearchBean{" +
"startdate='" + startdate + '\'' +
", enddate='" + enddate + '\'' +
", groupid=" + groupid +
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/bean/DailyReportSearchData.java b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DailyReportSearchData.java
new file mode 100644
index 0000000..0c6ce19
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DailyReportSearchData.java
@@ -0,0 +1,153 @@
+package com.supwisdom.dlpay.restaurant.bean;
+
+import java.math.BigInteger;
+
+public class DailyReportSearchData {
+ private String checkdate;
+
+ private Double btotalamt; //早餐总金额
+ private BigInteger btotalcnt;//早餐份数
+ private Double ltotalamt; //午餐总金额
+ private BigInteger ltotalcnt;//午餐份数
+ private Double dtotalamt; //晚餐总金额
+ private BigInteger dtotalcnt;//晚餐份数
+
+ private Double bpayamt; //早餐支付金额
+ private BigInteger bpaycnt;
+ private Double lpayamt; //午餐支付总金额
+ private BigInteger lpaycnt;
+ private Double dpayamt; //晚餐支付总金额
+ private BigInteger dpaycnt;
+
+ private Double bfeeamt; //早餐支付金额
+ private Double lfeeamt; //午餐支付总金额
+ private Double dfeeamt; //晚餐支付总金额
+
+ public String getCheckdate() {
+ return checkdate;
+ }
+
+ public void setCheckdate(String checkdate) {
+ this.checkdate = checkdate;
+ }
+
+ public BigInteger getBtotalcnt() {
+ return btotalcnt;
+ }
+
+ public void setBtotalcnt(BigInteger btotalcnt) {
+ this.btotalcnt = btotalcnt;
+ }
+
+ public BigInteger getLtotalcnt() {
+ return ltotalcnt;
+ }
+
+ public void setLtotalcnt(BigInteger ltotalcnt) {
+ this.ltotalcnt = ltotalcnt;
+ }
+
+ public BigInteger getDtotalcnt() {
+ return dtotalcnt;
+ }
+
+ public void setDtotalcnt(BigInteger dtotalcnt) {
+ this.dtotalcnt = dtotalcnt;
+ }
+
+ public BigInteger getBpaycnt() {
+ return bpaycnt;
+ }
+
+ public void setBpaycnt(BigInteger bpaycnt) {
+ this.bpaycnt = bpaycnt;
+ }
+
+ public BigInteger getLpaycnt() {
+ return lpaycnt;
+ }
+
+ public void setLpaycnt(BigInteger lpaycnt) {
+ this.lpaycnt = lpaycnt;
+ }
+
+ public BigInteger getDpaycnt() {
+ return dpaycnt;
+ }
+
+ public void setDpaycnt(BigInteger dpaycnt) {
+ this.dpaycnt = dpaycnt;
+ }
+
+ public Double getBtotalamt() {
+ return btotalamt;
+ }
+
+ public void setBtotalamt(Double btotalamt) {
+ this.btotalamt = btotalamt;
+ }
+
+ public Double getLtotalamt() {
+ return ltotalamt;
+ }
+
+ public void setLtotalamt(Double ltotalamt) {
+ this.ltotalamt = ltotalamt;
+ }
+
+ public Double getDtotalamt() {
+ return dtotalamt;
+ }
+
+ public void setDtotalamt(Double dtotalamt) {
+ this.dtotalamt = dtotalamt;
+ }
+
+ public Double getBpayamt() {
+ return bpayamt;
+ }
+
+ public void setBpayamt(Double bpayamt) {
+ this.bpayamt = bpayamt;
+ }
+
+ public Double getLpayamt() {
+ return lpayamt;
+ }
+
+ public void setLpayamt(Double lpayamt) {
+ this.lpayamt = lpayamt;
+ }
+
+ public Double getDpayamt() {
+ return dpayamt;
+ }
+
+ public void setDpayamt(Double dpayamt) {
+ this.dpayamt = dpayamt;
+ }
+
+ 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/DailyReportShowBean.java b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DailyReportShowBean.java
new file mode 100644
index 0000000..d30e3de
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DailyReportShowBean.java
@@ -0,0 +1,188 @@
+package com.supwisdom.dlpay.restaurant.bean;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+
+public class DailyReportShowBean {
+ private String checkdate;
+
+ private Double btotalamt; //早餐总金额
+ private BigInteger btotalcnt;//早餐份数
+ private Double ltotalamt; //午餐总金额
+ private BigInteger ltotalcnt;//午餐份数
+ private Double dtotalamt; //晚餐总金额
+ private BigInteger dtotalcnt;//晚餐份数
+
+ private Double bpayamt; //早餐支付金额
+ private BigInteger bpaycnt;
+ private Double lpayamt; //午餐支付总金额
+ private BigInteger lpaycnt;
+ private Double dpayamt; //晚餐支付总金额
+ private BigInteger dpaycnt;
+
+ private Double bfeeamt; //早餐支付金额
+ private Double lfeeamt; //午餐支付总金额
+ private Double dfeeamt; //晚餐支付总金额
+
+ private List<DailyReportSearchData> datalist = new ArrayList<DailyReportSearchData>(0);
+
+ public DailyReportShowBean(){
+
+ }
+
+ public DailyReportShowBean(String checkdate, Double btotalamt, BigInteger btotalcnt, Double ltotalamt, BigInteger ltotalcnt, Double dtotalamt, BigInteger dtotalcnt, Double bpayamt, BigInteger bpaycnt, Double lpayamt, BigInteger lpaycnt, Double dpayamt, BigInteger dpaycnt, Double bfeeamt, Double lfeeamt, Double dfeeamt) {
+ this.checkdate = checkdate;
+ this.btotalamt = btotalamt;
+ this.btotalcnt = btotalcnt;
+ this.ltotalamt = ltotalamt;
+ this.ltotalcnt = ltotalcnt;
+ this.dtotalamt = dtotalamt;
+ this.dtotalcnt = dtotalcnt;
+ this.bpayamt = bpayamt;
+ this.bpaycnt = bpaycnt;
+ this.lpayamt = lpayamt;
+ this.lpaycnt = lpaycnt;
+ this.dpayamt = dpayamt;
+ this.dpaycnt = dpaycnt;
+ this.bfeeamt = bfeeamt;
+ this.lfeeamt = lfeeamt;
+ this.dfeeamt = dfeeamt;
+ }
+
+ public List<DailyReportSearchData> getDatalist() {
+ return datalist;
+ }
+
+ public void setDatalist(List<DailyReportSearchData> datalist) {
+ this.datalist = datalist;
+ }
+
+ public String getCheckdate() {
+ return checkdate;
+ }
+
+ public void setCheckdate(String checkdate) {
+ this.checkdate = checkdate;
+ }
+
+ public BigInteger getBtotalcnt() {
+ return btotalcnt;
+ }
+
+ public void setBtotalcnt(BigInteger btotalcnt) {
+ this.btotalcnt = btotalcnt;
+ }
+
+ public BigInteger getLtotalcnt() {
+ return ltotalcnt;
+ }
+
+ public void setLtotalcnt(BigInteger ltotalcnt) {
+ this.ltotalcnt = ltotalcnt;
+ }
+
+ public BigInteger getDtotalcnt() {
+ return dtotalcnt;
+ }
+
+ public void setDtotalcnt(BigInteger dtotalcnt) {
+ this.dtotalcnt = dtotalcnt;
+ }
+
+ public BigInteger getBpaycnt() {
+ return bpaycnt;
+ }
+
+ public void setBpaycnt(BigInteger bpaycnt) {
+ this.bpaycnt = bpaycnt;
+ }
+
+ public BigInteger getLpaycnt() {
+ return lpaycnt;
+ }
+
+ public void setLpaycnt(BigInteger lpaycnt) {
+ this.lpaycnt = lpaycnt;
+ }
+
+ public BigInteger getDpaycnt() {
+ return dpaycnt;
+ }
+
+ public void setDpaycnt(BigInteger dpaycnt) {
+ this.dpaycnt = dpaycnt;
+ }
+
+ public Double getBtotalamt() {
+ return btotalamt;
+ }
+
+ public void setBtotalamt(Double btotalamt) {
+ this.btotalamt = btotalamt;
+ }
+
+ public Double getLtotalamt() {
+ return ltotalamt;
+ }
+
+ public void setLtotalamt(Double ltotalamt) {
+ this.ltotalamt = ltotalamt;
+ }
+
+ public Double getDtotalamt() {
+ return dtotalamt;
+ }
+
+ public void setDtotalamt(Double dtotalamt) {
+ this.dtotalamt = dtotalamt;
+ }
+
+ public Double getBpayamt() {
+ return bpayamt;
+ }
+
+ public void setBpayamt(Double bpayamt) {
+ this.bpayamt = bpayamt;
+ }
+
+ public Double getLpayamt() {
+ return lpayamt;
+ }
+
+ public void setLpayamt(Double lpayamt) {
+ this.lpayamt = lpayamt;
+ }
+
+ public Double getDpayamt() {
+ return dpayamt;
+ }
+
+ public void setDpayamt(Double dpayamt) {
+ this.dpayamt = dpayamt;
+ }
+
+ 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/controller/DailyReportController.java b/src/main/java/com/supwisdom/dlpay/restaurant/controller/DailyReportController.java
new file mode 100644
index 0000000..aa7f71c
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/controller/DailyReportController.java
@@ -0,0 +1,108 @@
+package com.supwisdom.dlpay.restaurant.controller;
+
+
+import com.supwisdom.dlpay.framework.domain.TOperator;
+import com.supwisdom.dlpay.framework.service.SystemUtilService;
+import com.supwisdom.dlpay.restaurant.bean.DailyReportSearchBean;
+import com.supwisdom.dlpay.restaurant.bean.DailyReportShowBean;
+import com.supwisdom.dlpay.restaurant.service.DailyReportService;
+import com.supwisdom.dlpay.restaurant.service.StatementReportService;
+import com.supwisdom.dlpay.framework.util.DateUtil;
+import com.supwisdom.dlpay.framework.util.PageResult;
+import com.supwisdom.dlpay.restaurant.bean.MealsDtlShowBean;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.security.core.annotation.AuthenticationPrincipal;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+@Controller
+@RequestMapping("/dailyreport")
+public class DailyReportController {
+
+ @Autowired
+ private SystemUtilService systemUtilService;
+ @Autowired
+ private DailyReportService dailyReportService;
+ @Autowired
+ private StatementReportService statementReportService;
+
+ @RequestMapping("/index")
+ public String indexView(
+ @ModelAttribute("searchBean") DailyReportSearchBean searchBean,
+ @AuthenticationPrincipal UserDetails operUser,
+ ModelMap model) {
+ String settledate = statementReportService.getMaxStatementDate();
+ String maxdate = DateUtil.reformatDatetime(settledate, "yyyyMMdd", "yyyy-MM-dd");
+ searchBean.setStartdate(settledate);
+ searchBean.setEnddate(settledate);
+ searchBean.setGroupid(0);
+ model.addAttribute("showlist", dailyReportService.getDailyReportSearchData(searchBean));
+
+ model.addAttribute("maxdate", maxdate);
+
+ TOperator oper = (TOperator) operUser;
+ model.addAttribute("opercode", oper == null ? "unknow" : oper.getOpercode());
+ return "restaurant/dailyreport/index";
+ }
+
+ @RequestMapping("/dailyreportlist")
+ @PreAuthorize("hasPermission('/dailyreport/dailyreportlist','')")
+ public String getDataList(
+ @ModelAttribute("searchBean") DailyReportSearchBean searchBean,
+ @AuthenticationPrincipal UserDetails operUser,
+ ModelMap map) {
+ try {
+
+ TOperator oper = (TOperator) operUser;
+ map.addAttribute("opercode", oper == null ? "unknow" : oper.getOpercode());
+
+ List<DailyReportShowBean> bean = dailyReportService.getDailyReportSearchData(searchBean);
+
+ map.addAttribute("showlist",bean);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return "restaurant/dailyreport/index::dailyreportTable";
+ }
+
+ @GetMapping("/excelexportdailyreport")
+ public void excelExportLaborfee(@ModelAttribute("searchBean") DailyReportSearchBean searchBean,
+ @AuthenticationPrincipal UserDetails operUser,
+ HttpServletRequest request, HttpServletResponse response, ModelMap map){
+ try {
+ List<DailyReportShowBean> datalist = dailyReportService.getDailyReportSearchData(searchBean);
+ TOperator oper = (TOperator) operUser;
+ String filename="食堂日结报表";
+ dailyReportService.doCreateDailyReportExcel(response, datalist, searchBean, filename, oper);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ @GetMapping("/print/printdailyreport")
+ public String printLaborfee(@ModelAttribute("searchBean") DailyReportSearchBean searchBean,
+ @RequestParam(value = "opercode",required = false) String opercode, ModelMap map) {
+ try {
+ map.addAttribute("showlist", dailyReportService.getDailyReportSearchData(searchBean));
+
+ TOperator oper = statementReportService.getOperatorByOpercode(opercode);
+ map.addAttribute("opername", oper == null ? "unknow" : oper.getOpername());
+ map.addAttribute("period", dailyReportService.getDailyReportSearchPeriod(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/dailyreport/print/printdailyreport";
+ }
+
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/controller/MealsDtlController.java b/src/main/java/com/supwisdom/dlpay/restaurant/controller/MealsDtlController.java
deleted file mode 100644
index 6f5e543..0000000
--- a/src/main/java/com/supwisdom/dlpay/restaurant/controller/MealsDtlController.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package com.supwisdom.dlpay.restaurant.controller;
-
-
-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.restaurant.bean.MealsDtlSearchBean;
-import com.supwisdom.dlpay.restaurant.bean.CustomerSearchBean;
-import com.supwisdom.dlpay.restaurant.bean.CustomerShowBean;
-import com.supwisdom.dlpay.restaurant.bean.MealsDtlShowBean;
-import com.supwisdom.dlpay.restaurant.service.CustomerService;
-import com.supwisdom.dlpay.restaurant.service.MealsdtlService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.*;
-
-@Controller
-@RequestMapping("/mealsdtl")
-public class MealsDtlController {
-
-
- @Autowired
- private MealsdtlService mealsdtlService;
-
- @RequestMapping("/index")
- public String indexView(ModelMap model) {
- String settledate = mealsdtlService.getCheckdateToday();
- if (StringUtil.isEmpty(settledate)) {
- settledate = DateUtil.getNow("yyyyMMdd");
- }
- model.addAttribute("maxdate", DateUtil.parseToDateFormat(DateUtil.getNewDay(settledate, -1)));
- return "restaurant/mealsdtl/index";
- }
-
- @RequestMapping("/mealsdtllist")
- // @PreAuthorize("hasPermission('/mealsdtl/mealsdtllist','')")
- @ResponseBody
- public PageResult<MealsDtlShowBean> getDataList(
- @RequestParam(value = "startdate", required = false) String startdate,
- @RequestParam(value = "enddate", required = false) String enddate,
- @RequestParam(value = "groupid", required = false) Integer groupid) {
- try {
- MealsDtlSearchBean searchBean = new MealsDtlSearchBean();
- searchBean.setEnddate(enddate);
- searchBean.setStartdate(startdate);
- searchBean.setGroupid(groupid);
-
- System.out.println(searchBean.toString());
-
- PageResult<MealsDtlShowBean> bean = mealsdtlService.getMealsdtlByKey(searchBean);
-
- return bean;
- } catch (Exception e) {
- e.printStackTrace();
- return new PageResult<>(99, "系统查询错误");
- }
- }
-
-
-}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/DailyReportService.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/DailyReportService.java
new file mode 100644
index 0000000..855d621
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/DailyReportService.java
@@ -0,0 +1,31 @@
+package com.supwisdom.dlpay.restaurant.service;
+
+import com.supwisdom.dlpay.framework.domain.TOperator;
+import com.supwisdom.dlpay.framework.util.PageResult;
+import com.supwisdom.dlpay.restaurant.bean.DailyReportSearchBean;
+import com.supwisdom.dlpay.restaurant.bean.DailyReportShowBean;
+import com.supwisdom.dlpay.restaurant.bean.MealsDtlShowBean;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+public interface DailyReportService {
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true)
+ PageResult<MealsDtlShowBean> getMealsdtlByKey(DailyReportSearchBean param);
+
+
+ @Transactional(rollbackFor = Exception.class,readOnly = true)
+ List<DailyReportShowBean> getDailyReportSearchData(DailyReportSearchBean searchBean);
+
+
+ @Transactional(rollbackFor = Exception.class,readOnly = true)
+ String getDailyReportSearchPeriod(DailyReportSearchBean searchBean);
+
+ @Transactional(rollbackFor = Exception.class,readOnly = true)
+ void doCreateDailyReportExcel(HttpServletResponse response, List<DailyReportShowBean> datalist, DailyReportSearchBean searchBean, String filename, TOperator oper);
+
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/MealsdtlService.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/MealsdtlService.java
deleted file mode 100644
index 7932b74..0000000
--- a/src/main/java/com/supwisdom/dlpay/restaurant/service/MealsdtlService.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.supwisdom.dlpay.restaurant.service;
-
-import com.supwisdom.dlpay.framework.util.PageResult;
-import com.supwisdom.dlpay.restaurant.bean.MealsDtlSearchBean;
-import com.supwisdom.dlpay.restaurant.bean.MealsDtlShowBean;
-import com.supwisdom.dlpay.restaurant.domain.TArea;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
-
-public interface MealsdtlService {
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true)
- PageResult<MealsDtlShowBean> getMealsdtlByKey(MealsDtlSearchBean param);
-
-
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true)
- String getCheckdateToday();
-
-
-}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DailyReportServiceImpl.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DailyReportServiceImpl.java
new file mode 100644
index 0000000..d1c7ed0
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DailyReportServiceImpl.java
@@ -0,0 +1,518 @@
+package com.supwisdom.dlpay.restaurant.service.impl;
+
+import com.supwisdom.dlpay.framework.dao.OperatorDao;
+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.MoneyUtil;
+import com.supwisdom.dlpay.framework.util.PageResult;
+import com.supwisdom.dlpay.framework.util.StringUtil;
+import com.supwisdom.dlpay.restaurant.bean.*;
+import com.supwisdom.dlpay.restaurant.dao.CheckCtlDao;
+import com.supwisdom.dlpay.restaurant.dao.DeviceGroupDao;
+import com.supwisdom.dlpay.restaurant.dao.MealTypeDao;
+import com.supwisdom.dlpay.restaurant.dao.MealsdtlDao;
+import com.supwisdom.dlpay.restaurant.service.DailyReportService;
+import com.supwisdom.dlpay.restaurant.util.ExcelPoiUtil;
+import com.supwisdom.dlpay.restaurant.util.RestaurantConstant;
+import org.apache.poi.hssf.usermodel.HSSFCellStyle;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.hibernate.query.internal.NativeQueryImpl;
+import org.hibernate.transform.Transformers;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.Query;
+import javax.servlet.http.HttpServletResponse;
+import java.io.OutputStream;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+public class DailyReportServiceImpl implements DailyReportService {
+
+ @Autowired
+ private MealsdtlDao mealsdtlDao;
+ @Autowired
+ private DeviceGroupDao deviceGroupDao;
+ @Autowired
+ private MealTypeDao mealTypeDao;
+ @Autowired
+ private SystemUtilService systemUtilService;
+ @Autowired
+ private CheckCtlDao checkCtlDao;
+ @Autowired
+ private OperatorDao operatorDao;
+
+
+ @PersistenceContext
+ private EntityManager entityManager;
+
+ private static final Logger logger = LoggerFactory.getLogger(DailyReportServiceImpl.class);
+
+ @Override
+ public PageResult<MealsDtlShowBean> getMealsdtlByKey(DailyReportSearchBean param) {
+ List<Integer> groupids;
+ if (null != param.getGroupid()) {
+ groupids = deviceGroupDao.findGroupidByDevgroupid(param.getGroupid());
+ } else {
+ groupids = deviceGroupDao.findAllGroupid();
+ }
+
+ List<MealsDtlShowBean> showBeans = new ArrayList<>();
+
+ for (Integer groupid : groupids) {
+ MealsDtlShowBean bean = new MealsDtlShowBean();
+ List<MealsDtlList> dtls = mealsdtlDao.getMealsDtl(param.getStartdate(), param.getEnddate(), groupid);
+
+ if (dtls.size() <= 0) {
+ continue;
+ }
+
+ Double totamt = 0d;
+ Integer totcnt = 0;
+ Double totfeeamt = 0d;
+ Integer totfeecnt = 0;
+
+ for (MealsDtlList dtl : dtls) {
+ String groupname = dtl.getGroupname();
+ /* if(StringUtil.isEmpty(groupname)){
+ groupname=deviceGroupDao.findById(groupid).get().getGroupname();
+ }*/
+ bean.setDevgroupname(groupname);
+ /* if(null==dtl.getAmount()){
+ bean.setB_amt(0d);
+ bean.setB_cnt(0);
+ bean.setB_feeamt(0d);
+ bean.setB_feecnt(0);
+ bean.setB_getamt(0d);
+ bean.setD_amt(0d);
+ bean.setD_cnt(0);
+ bean.setD_feeamt(0d);
+ bean.setD_feecnt(0);
+ bean.setD_getamt(0d);
+ bean.setL_amt(0d);
+ bean.setL_cnt(0);
+ bean.setL_feeamt(0d);
+ bean.setL_feecnt(0);
+ bean.setL_getamt(0d);
+ bean.setT_amt(0d);
+ bean.setT_cnt(0);
+ bean.setT_feeamt(0d);
+ bean.setT_feecnt(0);
+ bean.setT_getamt(0d);
+ break;
+ }*/
+
+ totamt += dtl.getAmount();
+ totcnt += dtl.getCnt();
+ totfeeamt += dtl.getFeeamount();
+ totfeecnt += dtl.getFeecount();
+
+
+ if (dtl.getMealtype().equalsIgnoreCase(RestaurantConstant.MEALTYPE_BREAKFAST)) {
+
+ bean.setB_amt(dtl.getAmount());
+ bean.setB_cnt(dtl.getCnt());
+ bean.setB_feeamt(dtl.getFeeamount());
+ bean.setB_feecnt(dtl.getFeecount());
+ bean.setB_getamt(dtl.getAmount() - dtl.getFeeamount());
+ } else if (dtl.getMealtype().equalsIgnoreCase(RestaurantConstant.MEALTYPE_LUNCH)) {
+ bean.setL_amt(dtl.getAmount());
+ bean.setL_cnt(dtl.getCnt());
+ bean.setL_feeamt(dtl.getFeeamount());
+ bean.setL_feecnt(dtl.getFeecount());
+ bean.setL_getamt(dtl.getAmount() - dtl.getFeeamount());
+ } else if (dtl.getMealtype().equalsIgnoreCase(RestaurantConstant.MEALTYPE_DINNER)) {
+ bean.setD_amt(dtl.getAmount());
+ bean.setD_cnt(dtl.getCnt());
+ bean.setD_feeamt(dtl.getFeeamount());
+ bean.setD_feecnt(dtl.getFeecount());
+ bean.setD_getamt(dtl.getAmount() - dtl.getFeeamount());
+ }
+ }
+
+ Double totgetamt = totamt - totfeeamt;
+ bean.setT_amt(totamt);
+ bean.setT_cnt(totcnt);
+ bean.setT_feeamt(totfeeamt);
+ bean.setT_feecnt(totfeecnt);
+ bean.setT_getamt(totgetamt);
+
+ showBeans.add(bean);
+ }
+
+ return new PageResult<>(showBeans);
+
+ }
+
+
+ @Override
+ public List<DailyReportShowBean> getDailyReportSearchData(DailyReportSearchBean searchBean) {
+ if (null != searchBean) {
+ String startdate = DateUtil.unParseToDateFormat(searchBean.getStartdate());
+ String enddate = DateUtil.unParseToDateFormat(searchBean.getEnddate());
+
+ StringBuffer sb = new StringBuffer("select t.checkdate," +
+ " sum(case when t.mealtype='breakfast' then t.totalamt+t.feeamt else 0 end) as btotalamt, " +
+ " sum(case when t.mealtype='breakfast' then t.totalcnt else 0 end) as btotalcnt, " +
+ " sum(case when t.mealtype='lunch' then t.totalamt+t.feeamt else 0 end) as ltotalamt, " +
+ " sum(case when t.mealtype='lunch' then t.totalcnt else 0 end) as ltotalcnt, " +
+ " sum(case when t.mealtype='dinner' then t.totalamt+t.feeamt else 0 end) as dtotalamt, " +
+ " sum(case when t.mealtype='dinner' then t.totalcnt else 0 end) as dtotalcnt, " +
+ " sum(case when t.mealtype='breakfast' then t.totalamt else 0 end) as bpayamt, " +
+ " sum(case when t.mealtype='breakfast' then t.feecnt else 0 end) as bpaycnt, " +
+ " sum(case when t.mealtype='lunch' then t.totalamt else 0 end) as lpayamt, " +
+ " sum(case when t.mealtype='lunch' then t.feecnt else 0 end) as lpaycnt, " +
+ " sum(case when t.mealtype='dinner' then t.totalamt else 0 end) as dpayamt, " +
+ " sum(case when t.mealtype='dinner' then t.feecnt else 0 end) as dpaycnt, " +
+ " 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 " +
+ "where t.checkdate>=:startdate and t.checkdate<=:enddate and t.devgroupid=:groupid " +
+ "group by t.checkdate order by t.checkdate ");
+
+ Query query = entityManager.createNativeQuery(sb.toString());
+ query.setParameter("startdate", startdate);
+ query.setParameter("enddate", enddate);
+ query.setParameter("groupid", searchBean.getGroupid());
+ query.unwrap(NativeQueryImpl.class).setResultTransformer(Transformers.aliasToBean(DailyReportSearchData.class));
+ List<DailyReportSearchData> list = query.getResultList();
+ if (null != list) return transforDailyReportShowBean(list);
+ }
+ return new ArrayList<>(0);
+
+ }
+
+ @Override
+ public String getDailyReportSearchPeriod(DailyReportSearchBean searchBean) {
+
+ String startdate = DateUtil.unParseToDateFormat(searchBean.getStartdate());
+ String enddate = DateUtil.unParseToDateFormat(searchBean.getEnddate());
+ if (startdate.equals(enddate)) {
+ return DateUtil.reformatDatetime(startdate, "yyyyMMdd", "yyyy年MM月dd日");
+ } else {
+ return DateUtil.reformatDatetime(startdate, "yyyyMMdd", "yyyy年MM月dd日") + " ~ " + DateUtil.reformatDatetime(enddate, "yyyyMMdd", "yyyy年MM月dd日");
+ }
+ }
+
+ @Override
+ public void doCreateDailyReportExcel(HttpServletResponse response, List<DailyReportShowBean> datalist, DailyReportSearchBean searchBean, String filename, TOperator oper) {
+ HSSFWorkbook workbook = new HSSFWorkbook();
+ HSSFSheet sheet = workbook.createSheet("食堂日结报表");
+
+ //TODO:设置列宽
+ //序号|单位|食堂|(正价:早餐|中餐|晚餐)|(折后:早餐|中餐|晚餐)|(劳务费:早餐|中餐|晚餐|小计)
+ int columns = 13; //
+ sheet.setColumnWidth(0, ExcelPoiUtil.columnWidth(25)); //日期
+ for (int i = 3; i < columns; i++) {
+ sheet.setColumnWidth(i, ExcelPoiUtil.columnWidth(12));
+ }
+
+ //标题样式
+ 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, getDailyReportSearchPeriod(searchBean));
+ ExcelPoiUtil.createCell(row1, 2, textStyle2, null);
+ ExcelPoiUtil.createCell(row1, 3, textStyle2, null);
+
+ sheet.addMergedRegion(new CellRangeAddress(1, 1, 1, 3));
+ 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, null);
+ ExcelPoiUtil.createCell(row2, 3, headStyle, null);
+ ExcelPoiUtil.createCell(row2, 4, headStyle, null);
+ ExcelPoiUtil.createCell(row2, 5, headStyle, null);
+ ExcelPoiUtil.createCell(row2, 6, headStyle, null);
+ ExcelPoiUtil.createCell(row2, 7, headStyle, null);
+ ExcelPoiUtil.createCell(row2, 8, headStyle, null);
+
+ sheet.addMergedRegion(new CellRangeAddress(2, 2, 1, 8)); //合并单元格CellRangeAddress构造参数依次表示 起始行,截至行,起始列, 截至列
+
+ ExcelPoiUtil.createCell(row2, 9, headStyle, "优惠后支付");
+ ExcelPoiUtil.createCell(row2, 10, headStyle, null);
+ ExcelPoiUtil.createCell(row2, 11, headStyle, null);
+ ExcelPoiUtil.createCell(row2, 12, headStyle, null);
+ ExcelPoiUtil.createCell(row2, 13, headStyle, null);
+ ExcelPoiUtil.createCell(row2, 14, headStyle, null);
+ ExcelPoiUtil.createCell(row2, 15, headStyle, null);
+ ExcelPoiUtil.createCell(row2, 16, headStyle, null);
+ sheet.addMergedRegion(new CellRangeAddress(2, 2, 9, 16)); //合并单元格CellRangeAddress构造参数依次表示 起始行,截至行,起始列, 截至列
+
+ ExcelPoiUtil.createCell(row2, 17, headStyle, "应支付劳务费");
+ ExcelPoiUtil.createCell(row2, 18, headStyle, null);
+ ExcelPoiUtil.createCell(row2, 19, headStyle, null);
+ ExcelPoiUtil.createCell(row2, 20, headStyle, null);
+ sheet.addMergedRegion(new CellRangeAddress(2, 2, 17, 20)); //合并单元格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, "早餐\n正价金额");
+ ExcelPoiUtil.createCell(row3, 2, headStyle, "早餐\n份数");
+ ExcelPoiUtil.createCell(row3, 3, headStyle, "午餐\n正价金额");
+ ExcelPoiUtil.createCell(row3, 4, headStyle, "午餐\n份数");
+ ExcelPoiUtil.createCell(row3, 5, headStyle, "晚餐\n正价金额");
+ ExcelPoiUtil.createCell(row3, 6, headStyle, "晚餐\n份数");
+ ExcelPoiUtil.createCell(row3, 7, headStyle, "合计\n正价金额");
+ ExcelPoiUtil.createCell(row3, 8, headStyle, "合计\n份数");
+
+ ExcelPoiUtil.createCell(row3, 9, headStyle, "早餐\n折后金额");
+ ExcelPoiUtil.createCell(row3, 10, headStyle, "早餐\n份数");
+ ExcelPoiUtil.createCell(row3, 11, headStyle, "午餐\n折后金额");
+ ExcelPoiUtil.createCell(row3, 12, headStyle, "午餐\n份数");
+ ExcelPoiUtil.createCell(row3, 13, headStyle, "晚餐\n折后金额");
+ ExcelPoiUtil.createCell(row3, 14, headStyle, "晚餐\n份数");
+ ExcelPoiUtil.createCell(row3, 15, headStyle, "合计\n折后金额");
+ ExcelPoiUtil.createCell(row3, 16, headStyle, "合计\n份数");
+
+ ExcelPoiUtil.createCell(row3, 17, headStyle, "早餐\n劳务费");
+ ExcelPoiUtil.createCell(row3, 18, headStyle, "午餐\n劳务费");
+ ExcelPoiUtil.createCell(row3, 19, headStyle, "晚餐\n劳务费");
+ ExcelPoiUtil.createCell(row3, 20, 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++) {
+ DailyReportShowBean detail = 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).getCheckdate()); //日期
+*/
+ /* for (int j = 0; j < rowData.getDatalist().size(); j++) {
+ }*/
+ HSSFRow row = ExcelPoiUtil.createRow(sheet, rowNum++, 500);
+ ExcelPoiUtil.createCell(row, 0, textStyle1, detail.getCheckdate());
+ ExcelPoiUtil.createCell(row, 1, textStyle1, MoneyUtil.formatYuanToString(detail.getBtotalamt())); //早餐
+ ExcelPoiUtil.createCell(row, 2, textStyle1, detail.getBtotalcnt().toString());
+ ExcelPoiUtil.createCell(row, 3, textStyle1, MoneyUtil.formatYuanToString(detail.getLtotalamt())); //午餐
+ ExcelPoiUtil.createCell(row, 4, textStyle1, detail.getLtotalcnt().toString());
+ ExcelPoiUtil.createCell(row, 5, textStyle1, MoneyUtil.formatYuanToString(detail.getDtotalamt())); //晚餐
+ ExcelPoiUtil.createCell(row, 6, textStyle1, detail.getDtotalcnt().toString());
+ ExcelPoiUtil.createCell(row, 7, textStyle1, MoneyUtil.formatYuanToString(detail.getDtotalamt() + detail.getLtotalamt() + detail.getBtotalamt())); //晚餐
+ BigInteger cttotcnt=detail.getDtotalcnt().add(detail.getBtotalcnt()).add(detail.getLtotalcnt()) ;
+ ExcelPoiUtil.createCell(row, 8, textStyle1, (cttotcnt.toString()));
+
+ ExcelPoiUtil.createCell(row, 9, textStyle1, MoneyUtil.formatYuanToString(detail.getBpayamt())); //早餐
+ ExcelPoiUtil.createCell(row, 10, textStyle1, detail.getBpaycnt().toString());
+ ExcelPoiUtil.createCell(row, 11, textStyle1, MoneyUtil.formatYuanToString(detail.getLpayamt())); //午餐
+ ExcelPoiUtil.createCell(row, 12, textStyle1, detail.getLpaycnt().toString());
+ ExcelPoiUtil.createCell(row, 13, textStyle1, MoneyUtil.formatYuanToString(detail.getDpayamt())); //晚餐
+ ExcelPoiUtil.createCell(row, 14, textStyle1, detail.getDpaycnt().toString());
+ ExcelPoiUtil.createCell(row, 15, textStyle1, MoneyUtil.formatYuanToString(detail.getDpayamt() + detail.getBpayamt() + detail.getLpayamt())); //晚餐
+ BigInteger ctptotcnt=detail.getDpaycnt().add(detail.getLpaycnt()).add( detail.getBpaycnt()) ;
+ ExcelPoiUtil.createCell(row, 16, textStyle1, ctptotcnt.toString());
+
+ ExcelPoiUtil.createCell(row, 17, textStyle1, MoneyUtil.formatYuanToString(detail.getBfeeamt())); //早餐
+ ExcelPoiUtil.createCell(row, 18, textStyle1, MoneyUtil.formatYuanToString(detail.getLfeeamt())); //午餐
+ ExcelPoiUtil.createCell(row, 19, textStyle1, MoneyUtil.formatYuanToString(detail.getDfeeamt())); //晚餐
+ ExcelPoiUtil.createCell(row, 20, textStyle1, MoneyUtil.formatYuanToString(detail.getBfeeamt() + detail.getLfeeamt() + detail.getDfeeamt())); //小计
+
+
+ }
+
+ //TODO: 总计
+ DailyReportShowBean sumBean = datalist.get(datalist.size() - 1);
+ HSSFRow sumRow = ExcelPoiUtil.createRow(sheet, rowNum, 500);
+ ExcelPoiUtil.createCell(sumRow, 0, textStyle1, sumBean.getCheckdate());
+ ExcelPoiUtil.createCell(sumRow, 0, textStyle1, sumBean.getCheckdate());
+ ExcelPoiUtil.createCell(sumRow, 1, textStyle1, MoneyUtil.formatYuanToString(sumBean.getBtotalamt())); //早餐
+ ExcelPoiUtil.createCell(sumRow, 2, textStyle1, sumBean.getBtotalcnt().toString());
+ ExcelPoiUtil.createCell(sumRow, 3, textStyle1, MoneyUtil.formatYuanToString(sumBean.getLtotalamt())); //午餐
+ ExcelPoiUtil.createCell(sumRow, 4, textStyle1, sumBean.getLtotalcnt().toString());
+ ExcelPoiUtil.createCell(sumRow, 5, textStyle1, MoneyUtil.formatYuanToString(sumBean.getDtotalamt())); //晚餐
+ ExcelPoiUtil.createCell(sumRow, 6, textStyle1, sumBean.getDtotalcnt().toString());
+ ExcelPoiUtil.createCell(sumRow, 7, textStyle1, MoneyUtil.formatYuanToString(sumBean.getDtotalamt() + sumBean.getLtotalamt() + sumBean.getBtotalamt())); //晚餐
+ BigInteger ttotcnt=sumBean.getDtotalcnt().add(sumBean.getBtotalcnt() ).add(sumBean.getLtotalcnt()) ;
+ ExcelPoiUtil.createCell(sumRow, 8, textStyle1, ttotcnt.toString());
+
+ ExcelPoiUtil.createCell(sumRow, 9, textStyle1, MoneyUtil.formatYuanToString(sumBean.getBpayamt())); //早餐
+ ExcelPoiUtil.createCell(sumRow, 10, textStyle1, sumBean.getBpaycnt().toString());
+ ExcelPoiUtil.createCell(sumRow, 11, textStyle1, MoneyUtil.formatYuanToString(sumBean.getLpayamt())); //午餐
+ ExcelPoiUtil.createCell(sumRow, 12, textStyle1, sumBean.getLpaycnt().toString());
+ ExcelPoiUtil.createCell(sumRow, 13, textStyle1, MoneyUtil.formatYuanToString(sumBean.getDpayamt())); //晚餐
+ ExcelPoiUtil.createCell(sumRow, 14, textStyle1, sumBean.getDpaycnt().toString());
+ ExcelPoiUtil.createCell(sumRow, 15, textStyle1, MoneyUtil.formatYuanToString(sumBean.getDpayamt() + sumBean.getLpayamt() + sumBean.getBpayamt())); //晚餐
+ BigInteger ptotcnt=sumBean.getDpaycnt().add( sumBean.getLpaycnt()).add(sumBean.getBpaycnt());
+ ExcelPoiUtil.createCell(sumRow, 16, textStyle1, ptotcnt.toString());
+
+ ExcelPoiUtil.createCell(sumRow, 17, textStyle1, MoneyUtil.formatYuanToString(sumBean.getBfeeamt())); //早餐
+ ExcelPoiUtil.createCell(sumRow, 18, textStyle1, MoneyUtil.formatYuanToString(sumBean.getLfeeamt())); //午餐
+ ExcelPoiUtil.createCell(sumRow, 19, textStyle1, MoneyUtil.formatYuanToString(sumBean.getDfeeamt())); //晚餐
+ ExcelPoiUtil.createCell(sumRow, 20, 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, 6, textStyle3, "苍山饭店审核盖章:");
+ sheet.addMergedRegion(new CellRangeAddress(rowNum + 3, rowNum + 3, 0, 5)); //合并列
+ sheet.addMergedRegion(new CellRangeAddress(rowNum + 3, rowNum + 3, 6, columns - 1)); //合并列
+ HSSFRow signRow11 = ExcelPoiUtil.createRow(sheet, rowNum + 4, 400);
+ ExcelPoiUtil.createCell(signRow11, 0, textStyle3, "审核人:");
+ ExcelPoiUtil.createCell(signRow11, 6, textStyle3, "审核人:");
+ sheet.addMergedRegion(new CellRangeAddress(rowNum + 4, rowNum + 4, 0, 5)); //合并列
+ sheet.addMergedRegion(new CellRangeAddress(rowNum + 4, rowNum + 4, 6, columns - 1)); //合并列
+
+ HSSFRow signRow20 = ExcelPoiUtil.createRow(sheet, rowNum + 8, 400);
+ ExcelPoiUtil.createCell(signRow20, 0, textStyle3, "市民卡公司审核盖章:");
+ ExcelPoiUtil.createCell(signRow20, 6, textStyle3, "建桥园审核盖章:");
+ sheet.addMergedRegion(new CellRangeAddress(rowNum + 8, rowNum + 8, 0, 5)); //合并列
+ sheet.addMergedRegion(new CellRangeAddress(rowNum + 8, rowNum + 8, 6, columns - 1)); //合并列
+ HSSFRow signRow21 = ExcelPoiUtil.createRow(sheet, rowNum + 9, 400);
+ ExcelPoiUtil.createCell(signRow21, 0, textStyle3, "审核人:");
+ ExcelPoiUtil.createCell(signRow21, 6, textStyle3, "审核人:");
+ sheet.addMergedRegion(new CellRangeAddress(rowNum + 9, rowNum + 9, 0, 5)); //合并列
+ sheet.addMergedRegion(new CellRangeAddress(rowNum + 9, rowNum + 9, 6, 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();
+ }
+
+ }
+
+
+ private List<DailyReportShowBean> transforDailyReportShowBean(List<DailyReportSearchData> list) {
+ if (StringUtil.isEmpty(list)) return new ArrayList<>(0);
+
+ List<DailyReportShowBean> result = new ArrayList<>(0);
+ BigInteger bitg=BigInteger.valueOf(0l);
+ DailyReportShowBean sumBean = new DailyReportShowBean("总 计", 0d,bitg,0d,bitg,0d,bitg,0d,bitg,0d,bitg,0d,bitg,0d,0d,0d);
+ for (DailyReportSearchData data : list) {
+ sumBean.setBtotalamt(sumBean.getBtotalamt() + data.getBtotalamt());
+ sumBean.setBtotalcnt(sumBean.getBtotalcnt().add(data.getBtotalcnt()) );
+ sumBean.setLtotalamt(sumBean.getLtotalamt() + data.getLtotalamt());
+ sumBean.setLtotalcnt(sumBean.getLtotalcnt().add(data.getLtotalcnt()));
+ sumBean.setDtotalamt(sumBean.getDtotalamt() + data.getDtotalamt());
+ sumBean.setDtotalcnt(sumBean.getDtotalcnt().add(data.getDtotalcnt()) );
+ sumBean.setBpayamt(sumBean.getBpayamt() + data.getBpayamt());
+ sumBean.setBpaycnt(sumBean.getBpaycnt().add(data.getBpaycnt()) );
+ sumBean.setLpayamt(sumBean.getLpayamt() + data.getLpayamt());
+ sumBean.setLpaycnt(sumBean.getLpaycnt().add(data.getLpaycnt()) );
+ sumBean.setDpayamt(sumBean.getDpayamt() + data.getDpayamt());
+ sumBean.setDpaycnt(sumBean.getDpaycnt().add(data.getDpaycnt()) );
+ sumBean.setBfeeamt(sumBean.getBfeeamt() + data.getBfeeamt());
+ sumBean.setLfeeamt(sumBean.getLfeeamt() + data.getLfeeamt());
+ sumBean.setDfeeamt(sumBean.getDfeeamt() + data.getDfeeamt()); //总计求和
+
+ DailyReportShowBean tmp = new DailyReportShowBean();
+
+ String chkdate = DateUtil.reformatDatetime(data.getCheckdate(), "yyyyMMdd", "yyyy-MM-dd");
+ tmp.setCheckdate(chkdate);
+ tmp.setBtotalamt(data.getBtotalamt());
+ tmp.setBtotalcnt(data.getBtotalcnt());
+ tmp.setLtotalamt(data.getLtotalamt());
+ tmp.setLtotalcnt(data.getLtotalcnt());
+ tmp.setDtotalamt(data.getDtotalamt());
+ tmp.setDtotalcnt(data.getDtotalcnt());
+ tmp.setBpayamt(data.getBpayamt());
+ tmp.setBpaycnt(data.getBpaycnt());
+ tmp.setLpayamt(data.getLpayamt());
+ tmp.setLpaycnt(data.getLpaycnt());
+ tmp.setDpayamt(data.getDpayamt());
+ tmp.setDpaycnt(data.getDpaycnt());
+ tmp.setBfeeamt(data.getBfeeamt());
+ tmp.setLfeeamt(data.getLfeeamt());
+ tmp.setDfeeamt(data.getDfeeamt());
+ result.add(tmp);
+ /* boolean exist = false;
+ for (DailyReportShowBean bean : result) {
+ if (bean.getDwid().intValue() == data.getDwid()) {
+ exist = true;
+ bean.getDatalist().add(data);
+ bean.setBtotalamt(bean.getBtotalamt() + data.getBtotalamt());
+ bean.setLtotalamt(bean.getLtotalamt() + data.getLtotalamt());
+ bean.setDtotalamt(bean.getDtotalamt() + data.getDtotalamt());
+
+ bean.setBpayamt(bean.getBpayamt() + data.getBpayamt());
+ bean.setLpayamt(bean.getLpayamt() + data.getLpayamt());
+ bean.setDpayamt(bean.getDpayamt() + data.getDpayamt());
+
+ bean.setBfeeamt(bean.getBfeeamt() + data.getBfeeamt());
+ bean.setLfeeamt(bean.getLfeeamt() + data.getLfeeamt());
+ bean.setDfeeamt(bean.getDfeeamt() + data.getDfeeamt());
+ break;
+ }
+ }*/
+
+ /*if (!exist) {
+ LaborfeeShowBean tmp = new LaborfeeShowBean();
+ tmp.setDwid(data.getDwid());
+ tmp.setDwname(data.getDwname());
+ tmp.setBtotalamt(data.getBtotalamt());
+ tmp.setLtotalamt(data.getLtotalamt());
+ tmp.setDtotalamt(data.getDtotalamt());
+
+ tmp.setBpayamt(data.getBpayamt());
+ tmp.setLpayamt(data.getLpayamt());
+ tmp.setDpayamt(data.getDpayamt());
+
+ tmp.setBfeeamt(data.getBfeeamt());
+ tmp.setLfeeamt(data.getLfeeamt());
+ tmp.setDfeeamt(data.getDfeeamt());
+ tmp.getDatalist().add(data);
+
+ result.add(tmp);
+ }*/
+
+ }
+
+ result.add(sumBean); //最后加上总计
+ return result;
+ }
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DeviceParamServiceImpl.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DeviceParamServiceImpl.java
index 15187d1..bc470fc 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DeviceParamServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DeviceParamServiceImpl.java
@@ -272,6 +272,7 @@
node.setId(String.valueOf(gp.getDevgroupid()));
node.setName(gp.getGroupname());
node.setOpen(true);
+ node.setGrouptype(gp.getGrouptype());
node.setChecked(false);
List<TreeSelectNode> children = getDevgroupTree(groupList, gp.getDevgroupid().intValue());
if (!StringUtil.isEmpty(children)) {
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/MealsdtlServiceImpl.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/MealsdtlServiceImpl.java
deleted file mode 100644
index 7dd02f4..0000000
--- a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/MealsdtlServiceImpl.java
+++ /dev/null
@@ -1,139 +0,0 @@
-package com.supwisdom.dlpay.restaurant.service.impl;
-
-import com.supwisdom.dlpay.framework.util.PageResult;
-import com.supwisdom.dlpay.framework.util.StringUtil;
-import com.supwisdom.dlpay.restaurant.bean.MealsDtlList;
-import com.supwisdom.dlpay.restaurant.bean.MealsDtlSearchBean;
-import com.supwisdom.dlpay.restaurant.bean.MealsDtlShowBean;
-import com.supwisdom.dlpay.restaurant.dao.DeviceGroupDao;
-import com.supwisdom.dlpay.restaurant.dao.MealTypeDao;
-import com.supwisdom.dlpay.restaurant.dao.MealsdtlDao;
-import com.supwisdom.dlpay.restaurant.domain.TMealsDtl;
-import com.supwisdom.dlpay.restaurant.domain.TMealtype;
-import com.supwisdom.dlpay.restaurant.service.AreaService;
-import com.supwisdom.dlpay.restaurant.service.DeviceGroupService;
-import com.supwisdom.dlpay.restaurant.service.MealsdtlService;
-import com.supwisdom.dlpay.restaurant.util.RestaurantConstant;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.List;
-
-@Service
-public class MealsdtlServiceImpl implements MealsdtlService {
-
- @Autowired
- private MealsdtlDao mealsdtlDao;
- @Autowired
- private DeviceGroupDao deviceGroupDao;
- @Autowired
- private MealTypeDao mealTypeDao;
-
- private static final Logger logger = LoggerFactory.getLogger(MealsdtlServiceImpl.class);
-
- @Override
- public PageResult<MealsDtlShowBean> getMealsdtlByKey(MealsDtlSearchBean param) {
- List<Integer> groupids;
- if (null != param.getGroupid()) {
- groupids = deviceGroupDao.findGroupidByDevgroupid(param.getGroupid());
- } else {
- groupids = deviceGroupDao.findAllGroupid();
- }
-
- List<MealsDtlShowBean> showBeans = new ArrayList<>();
-
- for (Integer groupid : groupids) {
- MealsDtlShowBean bean = new MealsDtlShowBean();
- List<MealsDtlList> dtls = mealsdtlDao.getMealsDtl(param.getStartdate(), param.getEnddate(), groupid);
-
- if(dtls.size()<=0){
- continue;
- }
-
- Double totamt=0d;
- Integer totcnt=0;
- Double totfeeamt=0d;
- Integer totfeecnt=0;
-
- for(MealsDtlList dtl:dtls){
- String groupname=dtl.getGroupname();
- /* if(StringUtil.isEmpty(groupname)){
- groupname=deviceGroupDao.findById(groupid).get().getGroupname();
- }*/
- bean.setDevgroupname(groupname);
- /* if(null==dtl.getAmount()){
- bean.setB_amt(0d);
- bean.setB_cnt(0);
- bean.setB_feeamt(0d);
- bean.setB_feecnt(0);
- bean.setB_getamt(0d);
- bean.setD_amt(0d);
- bean.setD_cnt(0);
- bean.setD_feeamt(0d);
- bean.setD_feecnt(0);
- bean.setD_getamt(0d);
- bean.setL_amt(0d);
- bean.setL_cnt(0);
- bean.setL_feeamt(0d);
- bean.setL_feecnt(0);
- bean.setL_getamt(0d);
- bean.setT_amt(0d);
- bean.setT_cnt(0);
- bean.setT_feeamt(0d);
- bean.setT_feecnt(0);
- bean.setT_getamt(0d);
- break;
- }*/
-
- totamt+=dtl.getAmount();
- totcnt+=dtl.getCnt();
- totfeeamt+=dtl.getFeeamount();
- totfeecnt+=dtl.getFeecount();
-
-
- if(dtl.getMealtype().equalsIgnoreCase(RestaurantConstant.MEALTYPE_BREAKFAST)){
-
- bean.setB_amt(dtl.getAmount());
- bean.setB_cnt(dtl.getCnt());
- bean.setB_feeamt(dtl.getFeeamount());
- bean.setB_feecnt(dtl.getFeecount());
- bean.setB_getamt(dtl.getAmount()-dtl.getFeeamount());
- }else if(dtl.getMealtype().equalsIgnoreCase(RestaurantConstant.MEALTYPE_LUNCH)){
- bean.setL_amt(dtl.getAmount());
- bean.setL_cnt(dtl.getCnt());
- bean.setL_feeamt(dtl.getFeeamount());
- bean.setL_feecnt(dtl.getFeecount());
- bean.setL_getamt(dtl.getAmount()-dtl.getFeeamount());
- }else if(dtl.getMealtype().equalsIgnoreCase(RestaurantConstant.MEALTYPE_DINNER)){
- bean.setD_amt(dtl.getAmount());
- bean.setD_cnt(dtl.getCnt());
- bean.setD_feeamt(dtl.getFeeamount());
- bean.setD_feecnt(dtl.getFeecount());
- bean.setD_getamt(dtl.getAmount()-dtl.getFeeamount());
- }
- }
-
- Double totgetamt=totamt-totfeeamt;
- bean.setT_amt(totamt);
- bean.setT_cnt(totcnt);
- bean.setT_feeamt(totfeeamt);
- bean.setT_feecnt(totfeecnt);
- bean.setT_getamt(totgetamt);
-
- showBeans.add(bean);
- }
-
- return new PageResult<>(showBeans);
-
- }
-
- @Override
- public String getCheckdateToday() {
- String date=mealsdtlDao.findMaxCheckdate();
-
- return null;
- }
-}
diff --git a/src/main/java/com/supwisdom/dlpay/system/bean/TreeSelectNode.java b/src/main/java/com/supwisdom/dlpay/system/bean/TreeSelectNode.java
index 90cf9b3..e32cde7 100644
--- a/src/main/java/com/supwisdom/dlpay/system/bean/TreeSelectNode.java
+++ b/src/main/java/com/supwisdom/dlpay/system/bean/TreeSelectNode.java
@@ -5,6 +5,7 @@
public class TreeSelectNode {
private String id;
private String name;
+ private String grouptype;
private boolean open;
private boolean checked;
private List<TreeSelectNode> children;
@@ -49,6 +50,14 @@
this.children = children;
}
+ public String getGrouptype() {
+ return grouptype;
+ }
+
+ public void setGrouptype(String grouptype) {
+ this.grouptype = grouptype;
+ }
+
@Override
public String toString() {
return "TreeSelectNode{" +
diff --git a/src/main/kotlin/com/supwisdom/dlpay/security.kt b/src/main/kotlin/com/supwisdom/dlpay/security.kt
index 0d711ef..8e9ffce 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/security.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/security.kt
@@ -190,6 +190,7 @@
.antMatchers("/static/**").permitAll()
.antMatchers("/code/image").permitAll()
.antMatchers("/report/print/**").permitAll() //报表打印
+ .antMatchers("/dailyreport/print/**").permitAll() //报表打印
.antMatchers("/**").hasAnyRole("USER", "ADMIN")
.anyRequest().authenticated()
.and()
diff --git a/src/main/resources/templates/restaurant/dailyreport/index.html b/src/main/resources/templates/restaurant/dailyreport/index.html
new file mode 100644
index 0000000..4c087dc
--- /dev/null
+++ b/src/main/resources/templates/restaurant/dailyreport/index.html
@@ -0,0 +1,310 @@
+<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="dailyreport-search-form">
+ <input type="hidden" id="dailyreport-hidden-maxdate" th:value="${maxdate}" />
+ <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="dailyreport-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="dailyreport-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="groupid" id="dailyreport-search-devgroup" lay-filter="dailyreport-search-devgroup-filter"
+ autocomplete="off" class="layui-input"/>
+ </div>
+ </div>
+
+ <div class="layui-inline">
+ <button id="dailyreport-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-dailyreport-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-dailyreport-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-dailyreport-table" th:fragment="dailyreportTable">
+ <thead>
+ <tr>
+ <th rowspan="3" style="text-align: center;min-width: 100px;">日期</th>
+ <th colspan="8" style="text-align: center;">消费正价</th>
+ <th colspan="8" 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;">早餐<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>
+ <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>
+ <!--<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>
+ <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>
+ <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>
+ <th rowspan="2" style="text-align: center;min-width: 60px;">应支付劳<br/>务费小计</th>
+ </tr>
+ </thead>
+ <tbody id="shopreport-dailyreport-tbody" th:data-startdate="${searchBean.startdate}" th:data-enddate="${searchBean.enddate}" th:data-groupid="${searchBean.groupid}" th:data-opercode="${opercode}">
+ <tr th:if="${null==showlist || showlist.size()==0}">
+ <td colspan="23">无数据</td>
+ </tr>
+
+ <div th:remove="tag" th:if="${null!=showlist && showlist.size()>0}" th:each="data:${showlist}" >
+ <!-- <tr th:if=${!dataStat.last}>
+ <td th:text="${childCount>0}?${data.datalist[0].checkdate}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].btotalamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].btotalcnt}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].ltotalamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].ltotalcnt}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].dtotalamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].dtotalcnt}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].ttotalamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].ttotalcnt}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].bpayamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].bpaycnt}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].lpayamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].lpaycnt}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].dpayamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].dpaycnt}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].tpayamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].tpaycnt}:''"></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:if="${!dataStat.last}">
+ <td th:text="${data.checkdate}"></td>
+ <td th:text="${#numbers.formatDecimal(data.btotalamt,1,2)}"></td>
+ <td th:text="${data.btotalcnt}"></td>
+ <td th:text="${#numbers.formatDecimal(data.ltotalamt,1,2)}"></td>
+ <td th:text="${data.ltotalcnt}"></td>
+ <td th:text="${#numbers.formatDecimal(data.dtotalamt,1,2)}"></td>
+ <td th:text="${data.dtotalcnt}"></td>
+ <td th:text="${#numbers.formatDecimal(data.btotalamt+data.ltotalamt+data.dtotalamt,1,2)}"></td>
+ <td th:text="${data.btotalcnt+data.ltotalcnt+data.dtotalcnt}"></td>
+ <td th:text="${#numbers.formatDecimal(data.bpayamt,1,2)}"></td>
+ <td th:text="${data.bpaycnt}"></td>
+ <td th:text="${#numbers.formatDecimal(data.lpayamt,1,2)}"></td>
+ <td th:text="${data.lpaycnt}"></td>
+ <td th:text="${#numbers.formatDecimal(data.dpayamt,1,2)}"></td>
+ <td th:text="${data.dpaycnt}"></td>
+ <td th:text="${#numbers.formatDecimal(data.bpayamt+data.lpayamt+data.dpayamt,1,2)}"></td>
+ <td th:text="${data.bpaycnt+data.lpaycnt+data.dpaycnt}"></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;" th:text="${data.checkdate}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.btotalamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${data.btotalcnt}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.ltotalamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${data.ltotalcnt}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.dtotalamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${data.dtotalcnt}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.btotalamt+data.ltotalamt+data.dtotalamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${data.btotalcnt+data.ltotalcnt+data.dtotalcnt}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.bpayamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${data.bpaycnt}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.lpayamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${data.lpaycnt}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.dpayamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${data.dpaycnt}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.bpayamt+data.lpayamt+data.dpayamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${data.bpaycnt+data.lpaycnt+data.dpaycnt}"></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', 'element', 'laydate', 'treeSelect'], function () {
+ var form = layui.form;
+ var laydate = layui.laydate;
+ var treeSelect = layui.treeSelect;
+ var layer = layui.layer;
+ var $ = layui.jquery;
+
+ laydate.render({
+ elem: '#dailyreport-search-startdate',
+ max: $("#dailyreport-hidden-maxdate").val(),
+ trigger: 'click'
+ });
+ laydate.render({
+ elem: '#dailyreport-search-enddate',
+ max: $("#dailyreport-hidden-maxdate").val(),
+ trigger: 'click'
+ });
+
+ treeSelect.render({
+ elem: '#dailyreport-search-devgroup',
+ data: '[[@{/whitelistbind/devgrouptree}]]',
+ type: 'get',
+ placeholder: '选择设备组',
+ search: false,
+ style: {
+ folder: {
+ enable: false
+ },
+ line: {
+ enable: true
+ }
+ },
+ // 点击回调
+ click: function (d) {
+ var treeNode = d.current;
+ console.log(treeNode);
+ if(treeNode.grouptype == 'branch'){
+ layer.msg("请选择末级商户", {icon: 2, time:1500});
+ $("#dailyreport-search-devgroup").val("");
+ treeSelect.revokeNode('dailyreport-search-devgroup-filter');
+ return false;
+ }
+ return true;
+ },
+ success: function (d) {
+ console.log(d); // 加载完成后的回调函数
+ }
+ });
+
+
+ $('#dailyreport-search-btn').click(function () {
+ var startdate = $("#dailyreport-search-startdate").val();
+ var enddate = $("#dailyreport-search-enddate").val();
+ // var nodealshow = $("#dailyreport-search-nodealshow").is(':checked');
+ var groupid=$("#dailyreport-search-devgroup").val();
+ if (null == startdate || "" == $.trim(startdate)) {
+ layer.msg('请选择起始日期', {icon: 2, time: 1500});
+ return;
+ }
+ if (null == enddate || "" == $.trim(enddate)) {
+ layer.msg('请选择截止日期', {icon: 2, time: 1500});
+ return;
+ }
+ if (null == groupid || "" == $.trim(groupid)) {
+ layer.msg('请选择设备组', {icon: 2, time: 1500});
+ return;
+ }
+ $.ajax({
+ url: '[[@{/dailyreport/dailyreportlist}]]',
+ type: "POST",
+ data: {
+ startdate: startdate,
+ enddate: enddate,
+ groupid: groupid,
+ _csrf: $("meta[name='_csrf_token']").attr("value")
+ },
+ success: function (data) {
+ $("#shopreport-dailyreport-table").html(data);
+ layer.closeAll('loading');
+ },
+ error: function (status, err) {
+ layer.closeAll('loading');
+ layer.msg('查询失败了', {icon: 2});
+ }
+ });
+ });
+
+ $("#shopreport-dailyreport-export-excel").click(function(){
+ var startdate= $("#shopreport-dailyreport-tbody").attr("data-startdate");
+ var enddate= $("#shopreport-dailyreport-tbody").attr("data-enddate");
+ var groupid= $("#shopreport-dailyreport-tbody").attr("data-groupid");
+
+ var dataUrl='[[@{/dailyreport/excelexportdailyreport}]]?startdate='+startdate+'&enddate='+enddate+'&groupid='+groupid;
+ 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();
+ });
+
+ var LODOP; //声明为全局变量
+ $("#shopreport-dailyreport-print-table").click(function(){
+ var startdate= $("#shopreport-dailyreport-tbody").attr("data-startdate");
+ var enddate= $("#shopreport-dailyreport-tbody").attr("data-enddate");
+ var groupid= $("#shopreport-dailyreport-tbody").attr("data-groupid");
+ var opercode = $("#shopreport-dailyreport-tbody").attr("data-opercode");
+ var url = '/dailyreport/print/printdailyreport?startdate=' + startdate + '&enddate=' + enddate + '&groupid=' + groupid + '&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();
+ });
+
+
+ });
+</script>
\ No newline at end of file
diff --git a/src/main/resources/templates/restaurant/dailyreport/print/printdailyreport.html b/src/main/resources/templates/restaurant/dailyreport/print/printdailyreport.html
new file mode 100644
index 0000000..f5ca33d
--- /dev/null
+++ b/src/main/resources/templates/restaurant/dailyreport/print/printdailyreport.html
@@ -0,0 +1,167 @@
+<!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;min-width: 100px;">日期</th>
+ <th colspan="8" style="text-align: center;">消费正价</th>
+ <th colspan="8" 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;">早餐<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>
+ <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>
+ <!--<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>
+ <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>
+ <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>
+ <th rowspan="2" style="text-align: center;min-width: 60px;">应支付劳<br/>务费小计</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr th:if="${null==showlist || showlist.size()==0}">
+ <td colspan="23">无数据</td>
+ </tr>
+
+ <div th:remove="tag" th:if="${null!=showlist && showlist.size()>0}" th:each="data:${showlist}" >
+ <!-- <tr th:if=${!dataStat.last}>
+ <td th:text="${childCount>0}?${data.datalist[0].checkdate}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].btotalamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].btotalcnt}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].ltotalamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].ltotalcnt}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].dtotalamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].dtotalcnt}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].ttotalamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].ttotalcnt}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].bpayamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].bpaycnt}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].lpayamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].lpaycnt}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].dpayamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].dpaycnt}:''"></td>
+ <td th:text="${childCount>0}?${#numbers.formatDecimal(data.datalist[0].tpayamt,1,2)}:''"></td>
+ <td th:text="${childCount>0}?${data.datalist[0].tpaycnt}:''"></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:if="${!dataStat.last}">
+ <td th:text="${data.checkdate}"></td>
+ <td th:text="${#numbers.formatDecimal(data.btotalamt,1,2)}"></td>
+ <td th:text="${data.btotalcnt}"></td>
+ <td th:text="${#numbers.formatDecimal(data.ltotalamt,1,2)}"></td>
+ <td th:text="${data.ltotalcnt}"></td>
+ <td th:text="${#numbers.formatDecimal(data.dtotalamt,1,2)}"></td>
+ <td th:text="${data.dtotalcnt}"></td>
+ <td th:text="${#numbers.formatDecimal(data.btotalamt+data.ltotalamt+data.dtotalamt,1,2)}"></td>
+ <td th:text="${data.btotalcnt+data.ltotalcnt+data.dtotalcnt}"></td>
+ <td th:text="${#numbers.formatDecimal(data.bpayamt,1,2)}"></td>
+ <td th:text="${data.bpaycnt}"></td>
+ <td th:text="${#numbers.formatDecimal(data.lpayamt,1,2)}"></td>
+ <td th:text="${data.lpaycnt}"></td>
+ <td th:text="${#numbers.formatDecimal(data.dpayamt,1,2)}"></td>
+ <td th:text="${data.dpaycnt}"></td>
+ <td th:text="${#numbers.formatDecimal(data.bpayamt+data.lpayamt+data.dpayamt,1,2)}"></td>
+ <td th:text="${data.bpaycnt+data.lpaycnt+data.dpaycnt}"></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;" th:text="${data.checkdate}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.btotalamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${data.btotalcnt}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.ltotalamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${data.ltotalcnt}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.dtotalamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${data.dtotalcnt}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.btotalamt+data.ltotalamt+data.dtotalamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${data.btotalcnt+data.ltotalcnt+data.dtotalcnt}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.bpayamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${data.bpaycnt}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.lpayamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${data.lpaycnt}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.dpayamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${data.dpaycnt}"></td>
+ <td style="font-weight: bold;" th:text="${#numbers.formatDecimal(data.bpayamt+data.lpayamt+data.dpayamt,1,2)}"></td>
+ <td style="font-weight: bold;" th:text="${data.bpaycnt+data.lpaycnt+data.dpaycnt}"></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
diff --git a/src/main/resources/templates/restaurant/mealsdtl/index.html b/src/main/resources/templates/restaurant/mealsdtl/index.html
deleted file mode 100644
index cc6fbc8..0000000
--- a/src/main/resources/templates/restaurant/mealsdtl/index.html
+++ /dev/null
@@ -1,310 +0,0 @@
-<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="mealsdtl-search-form">
- <input type="hidden" id="mealsdtl-hidden-maxdate" th:value="${maxdate}" />
- <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="mealsdtl-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="mealsdtl-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="groupid" id="mealsdtl-search-devgroup" lay-filter="mealsdtl-search-devgroup-filter"
- autocomplete="off" class="layui-input"/>
- </div>
- </div>
-
- <div class="layui-inline">
- <button id="mealsdtl-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-btn-group">-->
- <!--<button class="layui-btn" id="btn-fold-mealsdtl">仅看一级</button>-->
- <!--<button class="layui-btn" id="btn-expand-mealsdtl">查看二级</button>-->
- <!--</div>-->
- <table class="layui-table" id="mealsdtlTable" lay-filter="mealsdtlTable-filter"></table>
- </div>
-</div>
-
-<!--<script type="text/html" id="mealsdtl-toolbar">
- <div class="layui-btn-container">
- <button class="layui-btn layui-btn-sm" id="btn-fold-mealsdtl" lay-event="mealsdtlShowFold">仅看一级</button>
- <button class="layui-btn layui-btn-sm" id="btn-expand-mealsdtl" lay-event="mealsdtlExpandAll">查看二级</button>
- </div>
-</script>-->
-
-<script>
- layui.use(['form', 'table', 'layer', 'admin', 'element', 'laydate', 'treetable','treeSelect'], function () {
- var form = layui.form;
- var table = layui.table;
- var admin = layui.admin;
- var laydate = layui.laydate;
- var treetable = layui.treetable;
- var treeSelect = layui.treeSelect;
-
- form.render("checkbox");
- laydate.render({
- elem: '#mealsdtl-search-startdate',
- max: $("#mealsdtl-hidden-maxdate").val(),
- trigger: 'click'
- });
- laydate.render({
- elem: '#mealsdtl-search-enddate',
- max: $("#mealsdtl-hidden-maxdate").val(),
- trigger: 'click'
- });
-
- treeSelect.render({
- elem: '#mealsdtl-search-devgroup',
- data: '[[@{/whitelistbind/devgrouptree}]]',
- type: 'get',
- placeholder: '选择设备组',
- search: false,
- style: {
- folder: {
- enable: false
- },
- line: {
- enable: true
- }
- },
- // 点击回调
- click: function (d) {
- var treeNode = d.current;
- console.log(treeNode);
- if(treeNode.accno == '0'){
- layer.msg("请选择末级科目", {icon: 2, time:1500});
- $("#mealsdtl-search-devgroup").val("");
- treeSelect.revokeNode('mealsdtl-search-devgroup-filter');
- return false;
- }
- return true;
- },
- success: function (d) {
- console.log(d); // 加载完成后的回调函数
- }
- });
-
- var renderTable = function (obj) {
- layer.load(2);
- table.render({
- id: 'mealsdtlReport',
- title: '食堂分餐表',
- // treeColIndex: 0,
- // treeSpid: '-1',
- // treeIdName: 'subjno',
- // treePidName: 'fsubjno',
- // treeDefaultClose: false,
- // treeLinkage: false,
- elem: '#mealsdtlTable',
- url: '[[@{/mealsdtl/mealsdtllist}]]',
- page: false,
- where: obj,
- // showicon: false,
- // toolbar:'#mealsdtl-toolbar',
- cols: [
- [
- {
- field: 'devgroupname', title: '商户名称', align: 'left', rowspan: 2, width:150,templet: function (d) {
- if (d.subjlevel == 1) {
- return '<span>' + d.devgroupname + '</span>';
- } else {
- return '<span> ' + d.devgroupname + '</span>';
- }
-
- }
- },
- // {align: 'center', title: '期初余额', colspan: 2},
- {align: 'center', title: '早餐', colspan: 5},
- {align: 'center', title: '午餐', colspan: 5},
- {align: 'center', title: '晚餐', colspan: 5},
- {align: 'center', title: '合计', colspan: 5},
- ], [
- // {field: 'lastdaydrbal', title: '借方', align: 'center'},
- // {field: 'lastdaycrbal', title: '贷方', align: 'center'},
- {
- field: 'b_amt', title: '金额', width:150, align: 'center', templet: function (e) {
- return parseFloat(e.b_amt).toFixed(2);
- }
- },
- {
- field: 'b_cnt', title: '份数', width:150, align: 'center', templet: function (e) {
- return e.b_cnt;
- }
- },
- {
- field: 'b_feeamt', title: '餐补金额', width:150, align: 'center', templet: function (e) {
- return parseFloat(e.b_feeamt).toFixed(2);
- }
- },
- {
- field: 'b_feecnt', title: '餐补份数', width:150, align: 'center', templet: function (e) {
- return e.b_feecnt;
- }
- },
- {
- field: 'b_getamt', title: '劳务费金额', width:150, align: 'center', templet: function (e) {
- return parseFloat(e.b_getamt).toFixed(2);
- }
- },
- {
- field: 'l_amt', title: '金额', width:150, align: 'center', templet: function (e) {
- return parseFloat(e.l_amt).toFixed(2);
- }
- },
- {
- field: 'l_cnt', title: '份数', width:150, align: 'center', templet: function (e) {
- return e.l_cnt;
- }
- },
- {
- field: 'l_feeamt', title: '餐补金额', width:150, align: 'center', templet: function (e) {
- return parseFloat(e.l_feeamt).toFixed(2);
- }
- },
- {
- field: 'l_feecnt', title: '餐补份数', width:150, align: 'center', templet: function (e) {
- return e.l_feecnt;
- }
- },
- {
- field: 'l_getamt', title: '劳务费金额', width:150, align: 'center', templet: function (e) {
- return parseFloat(e.l_getamt).toFixed(2);
- }
- },
- {
- field: 'd_amt', title: '金额', width:150, align: 'center', templet: function (e) {
- return parseFloat(e.d_amt).toFixed(2);
- }
- },
- {
- field: 'd_cnt', title: '份数', width:150, align: 'center', templet: function (e) {
- return e.d_cnt;
- }
- },
- {
- field: 'd_feeamt', title: '餐补金额', width:150, align: 'center', templet: function (e) {
- return parseFloat(e.d_feeamt).toFixed(2);
- }
- },
- {
- field: 'd_feecnt', title: '餐补份数', width:150, align: 'center', templet: function (e) {
- return e.d_feecnt;
- }
- },
- {
- field: 'd_getamt', title: '劳务费金额', width:150, align: 'center', templet: function (e) {
- return parseFloat(e.d_getamt).toFixed(2);
- }
- },
- {
- field: 't_amt', title: '金额', width:150, align: 'center', templet: function (e) {
- return parseFloat(e.t_amt).toFixed(2);
- }
- },
- {
- field: 't_cnt', title: '份数', width:150, align: 'center', templet: function (e) {
- return e.t_cnt;
- }
- },
- {
- field: 't_feeamt', title: '餐补金额', width:150, align: 'center', templet: function (e) {
- return parseFloat(e.t_feeamt).toFixed(2);
- }
- },
- {
- field: 't_feecnt', title: '餐补份数', width:150, align: 'center', templet: function (e) {
- return e.t_feecnt;
- }
- },
- {
- field: 't_getamt', title: '劳务费金额', width:150, align: 'center', templet: function (e) {
- return parseFloat(e.t_getamt).toFixed(2);
- }
- }
-
- ]
- ],
- done: function (res, curr, count) {
- console.log(res);
- layer.closeAll('loading');
- }
- });
- }
- /* renderTable({
- startdate: $("#mealsdtl-search-startdate").val(),
- enddate: $("#mealsdtl-search-enddate").val(),
- // nodealshow: false
- });*/
-
- $('#btn-expand-mealsdtl').click(function () {
- treetable.expandAll('#mealsdtlTable');
- });
-
- $('#btn-fold-mealsdtl').click(function () {
- treetable.foldAll('#mealsdtlTable');
- });
-
-
-
-
-
-
- $('#mealsdtl-search-btn').click(function () {
- var startdate = $("#mealsdtl-search-startdate").val();
- var enddate = $("#mealsdtl-search-enddate").val();
- // var nodealshow = $("#mealsdtl-search-nodealshow").is(':checked');
- var groupid=$("#mealsdtl-search-devgroup").val();
- if (null == startdate || "" == $.trim(startdate)) {
- layer.msg('请选择起始日期', {icon: 2, time: 1500});
- return;
- }
- if (null == enddate || "" == $.trim(enddate)) {
- layer.msg('请选择截止日期', {icon: 2, time: 1500});
- return;
- }
- if (null == groupid || "" == $.trim(groupid)) {
- layer.msg('请选择设备组', {icon: 2, time: 1500});
- return;
- }
- renderTable({
- startdate: startdate,
- enddate: enddate,
- groupid: groupid
- });
- });
-
- table.on('toolbar(mealsdtlTable-filter)', function(obj){
- switch(obj.event){
- case 'mealsdtlShowFold':
- treetable.foldAll('#mealsdtlTable');
- break;
- case 'mealsdtlExpandAll':
- treetable.expandAll('#mealsdtlTable');
- break;
- }
- });
- });
-</script>
\ No newline at end of file