Merge branch 'feature/multi_tenancy' into develop
diff --git a/src/main/java/com/supwisdom/dlpay/api/service/impl/PosPayServiceImpl.java b/src/main/java/com/supwisdom/dlpay/api/service/impl/PosPayServiceImpl.java
index 7d42137..5a3bb0c 100644
--- a/src/main/java/com/supwisdom/dlpay/api/service/impl/PosPayServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/api/service/impl/PosPayServiceImpl.java
@@ -171,18 +171,18 @@
cardno = req.getCardno();
}
- TBusinesspara ignoreflag=businessparaDao.findByParakey("customer.ignore");
- if(null!=(ignoreflag)&&"true".equalsIgnoreCase(ignoreflag.getParaval())){
- tCard = cardService.getCardByCardno(cardno);
- customer=customerService.getCustomerByCardno(cardno);
- if(null==tCard||null==customer){
- logger.info("用户未在用户表中");
- QueryUserParam param=new QueryUserParam();
- param.setCitizencardno(cardno);
- UserInforResponse usrresp=userProxy.querybycardno(param);
+ TBusinesspara ignoreflag = businessparaDao.findByParakey("customer.ignore");
+ if (null != (ignoreflag) && "true".equalsIgnoreCase(ignoreflag.getParaval())) {
+ tCard = cardService.getCardByCardno(cardno);
+ customer = customerService.getCustomerByCardno(cardno);
+ if (null == tCard || null == customer) {
+ logger.info("用户未在用户表中");
+ QueryUserParam param = new QueryUserParam();
+ param.setCitizencardno(cardno);
+ UserInforResponse usrresp = userProxy.querybycardno(param);
- logger.info(usrresp.getRetcode()+"|||"+usrresp.getRetmsg());
- if(usrresp.getRetcode()==0){
+ logger.info(usrresp.getRetcode() + "|||" + usrresp.getRetmsg());
+ if (usrresp.getRetcode() == 0) {
/*CustomerSaveBean customer=new CustomerSaveBean();
customer.setCusttype(2);
@@ -197,57 +197,57 @@
customer.setStatus(RestaurantConstant.STATUS_CARD_NORMAL);
customer.setCheckstatus(RestaurantConstant.STATUS_CHECKSTATUS_NORMAL);
customerService.saveCustomer(customer);*/
- customer=new TCustomer();
- customer.setCusttype(2);
- customer.setLastsaved(DateUtil.getNow("yyyyMMddHHmmss"));
- customer.setPhone(usrresp.getPhone());
- customer.setCustname(usrresp.getUsername());
- customer.setIdno(usrresp.getIdno());
- customer.setIdtype(usrresp.getIdtype());
- customer.setStatus(RestaurantConstant.STATUS_CARD_NORMAL);
- customer.setCheckstatus(RestaurantConstant.STATUS_CHECKSTATUS_NORMAL);
+ customer = new TCustomer();
+ customer.setCusttype(2);
+ customer.setLastsaved(DateUtil.getNow("yyyyMMddHHmmss"));
+ customer.setPhone(usrresp.getPhone());
+ customer.setCustname(usrresp.getUsername());
+ customer.setIdno(usrresp.getIdno());
+ customer.setIdtype(usrresp.getIdtype());
+ customer.setStatus(RestaurantConstant.STATUS_CARD_NORMAL);
+ customer.setCheckstatus(RestaurantConstant.STATUS_CHECKSTATUS_NORMAL);
- customer = customerDao.save(customer);
- if(null!=customer){
- String cardverno = systemUtilService.getCardverno();
- tCard=new TCard();
- tCard.setCardno(cardno);
- tCard.setOpendate(DateUtil.getNow("yyyyMMdd"));
- tCard.setCustid(customer.getCustid());
- tCard.setStatus(RestaurantConstant.STATUS_CARD_NORMAL);
- tCard.setTransstatus(RestaurantConstant.STATUS_CARD_NORMAL);
- if(null!=usrresp.getCardphyid()){
- tCard.setCardphyid(usrresp.getCardphyid());
- }
- tCard.setCardverno(cardverno);
- tCard.setBankcardno(usrresp.getBankcardno());
- tCard.setExpiredate(usrresp.getExpiredate());
- tCard = cardDao.save(tCard);
-
- TCardver tCardver = new TCardver();
- tCardver.setAccdate(DateUtil.getNow("yyyyMMdd"));
- tCardver.setCardno(tCard.getCardno());
- tCardver.setCardphyid(tCard.getCardphyid());
- tCardver.setAdderflag(1);
- tCardver.setOptype(RestaurantConstant.OPTYPE_CARD_OPEN);
- tCardver.setStatus(RestaurantConstant.STATUS_CARD_NORMAL);
- tCardver.setCustid(tCard.getCustid());
- tCardver.setCreatetime(DateUtil.getNow("yyyyMMddHHmmss"));
- tCardver.setCardverno(cardverno);
- cardverDao.save(tCardver);
- }else{
- resp.setRetcode(ErrorCode.ERRIF_CARD_NOTEXIST);
- resp.setRetmsg("保存客户出错");
- return resp;
+ customer = customerDao.save(customer);
+ if (null != customer) {
+ String cardverno = systemUtilService.getCardverno();
+ tCard = new TCard();
+ tCard.setCardno(cardno);
+ tCard.setOpendate(DateUtil.getNow("yyyyMMdd"));
+ tCard.setCustid(customer.getCustid());
+ tCard.setStatus(RestaurantConstant.STATUS_CARD_NORMAL);
+ tCard.setTransstatus(RestaurantConstant.STATUS_CARD_NORMAL);
+ if (null != usrresp.getCardphyid()) {
+ tCard.setCardphyid(usrresp.getCardphyid());
}
+ tCard.setCardverno(cardverno);
+ tCard.setBankcardno(usrresp.getBankcardno());
+ tCard.setExpiredate(usrresp.getExpiredate());
+ tCard = cardDao.save(tCard);
- }else{
+ TCardver tCardver = new TCardver();
+ tCardver.setAccdate(DateUtil.getNow("yyyyMMdd"));
+ tCardver.setCardno(tCard.getCardno());
+ tCardver.setCardphyid(tCard.getCardphyid());
+ tCardver.setAdderflag(1);
+ tCardver.setOptype(RestaurantConstant.OPTYPE_CARD_OPEN);
+ tCardver.setStatus(RestaurantConstant.STATUS_CARD_NORMAL);
+ tCardver.setCustid(tCard.getCustid());
+ tCardver.setCreatetime(DateUtil.getNow("yyyyMMddHHmmss"));
+ tCardver.setCardverno(cardverno);
+ cardverDao.save(tCardver);
+ } else {
resp.setRetcode(ErrorCode.ERRIF_CARD_NOTEXIST);
- resp.setRetmsg("卡号[" + cardno + "]未在核心平台查询到");
+ resp.setRetmsg("保存客户出错");
return resp;
}
+
+ } else {
+ resp.setRetcode(ErrorCode.ERRIF_CARD_NOTEXIST);
+ resp.setRetmsg("卡号[" + cardno + "]未在核心平台查询到");
+ return resp;
}
- }else{
+ }
+ } else {
tCard = cardService.getCardByCardno(cardno);
if (null == tCard) {
@@ -345,17 +345,47 @@
}
private Double getDiscountAmount(String termdate, String custid, Double amount, DiscountBean bean) {
- Integer limit = transDtlService.getDiscountLimitToday(termdate, custid, bean.getRuleid());
- if (bean.getLimitcnt() > limit) {
-
- if (RestaurantConstant.RULETYPE_REDUCTION.equals(bean.getRuletype())) {
- amount = amount - bean.getAmount();
- } else if (RestaurantConstant.RULETYPE_DISCOUNT.equals(bean.getRuletype())) {
- amount = amount * (bean.getAmount() / 10);
- } else if (RestaurantConstant.RULETYPE_QUOTA.equals(bean.getRuletype())) {
- BigDecimal amt = BigDecimal.valueOf(bean.getAmount());
- amount = amt.doubleValue();
+ Integer discount_cnt;
+ Integer limit = bean.getLimitcnt();
+ boolean monthflag = RestaurantConstant.RULEMODE_MONTH.equals(bean.getRulemode());
+ try {
+ if (monthflag) {
+ logger.info("按月计费");
+ discount_cnt = transDtlService.getDiscountLimitMonth(termdate.substring(0, 6), custid, bean.getRuleid());
+ } else {
+ discount_cnt = transDtlService.getDiscountLimitToday(termdate, custid, bean.getRuleid());
}
+
+ if (limit > discount_cnt) {
+ if (monthflag) {
+ TBusinesspara cntflag = businessparaDao.findByParakey("discounttime.month");
+ Integer i = 0;
+ if (null != cntflag) {
+ String value = cntflag.getParaval();
+ if (!StringUtil.isEmpty(value)) {
+ i = Integer.parseInt(value);
+ }
+ }
+ if (i > 0) {
+ Integer daycnt=transDtlService.getDiscountLimitTodayWithPeriod(termdate,custid,bean.getRuleid(),bean.getStarttime(),bean.getEndtime());
+ if(daycnt>=i){
+ return amount;
+ }
+ }
+ }
+
+ if (RestaurantConstant.RULETYPE_REDUCTION.equals(bean.getRuletype())) {
+ amount = amount - bean.getAmount();
+ } else if (RestaurantConstant.RULETYPE_DISCOUNT.equals(bean.getRuletype())) {
+ amount = amount * (bean.getAmount() / 10);
+ } else if (RestaurantConstant.RULETYPE_QUOTA.equals(bean.getRuletype())) {
+ BigDecimal amt = BigDecimal.valueOf(bean.getAmount());
+ amount = amt.doubleValue();
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ return amount;
}
return amount;
}
@@ -386,15 +416,18 @@
return resp;
}
Double amount = req.getAmount() / 100.0;
- Double cntamount=0.0;
+ Double cntamount = 0.0;
+ logger.info("交易号:" + tTransdtl.getBillno() + ",,,交易金额:" + req.getAmount());
DiscountBean bean = deviceDiscountRuleService.getCustomerDiscount(tDevice.getId(), req.getTermtime(), cus.getCustid());
if (null != bean) {
- tTransdtl.setRuleid(bean.getRuleid());
cntamount = getDiscountAmount(req.getTermdate(), cus.getCustid(), amount, bean);
- tTransdtl.setManagefee(amount-cntamount);
+ if(cntamount!=amount){
+ tTransdtl.setRuleid(bean.getRuleid());
+ }
+ tTransdtl.setManagefee(amount - cntamount);
tTransdtl.setManagefeetype(bean.getRuletype());
tTransdtl.setAmount(cntamount);
- }else{
+ } else {
tTransdtl.setManagefeetype(RestaurantConstant.RULETYPE_NORMAL);
tTransdtl.setAmount(amount);
tTransdtl.setManagefee(cntamount);
@@ -407,10 +440,10 @@
} else {
group = deviceParamService.getDevparaGroupByGroupid(bind.getGroupid());
}
- TDevpara para=deviceParamService.getDevparaInfoByParaname(group.getGroupid(),"once_limit_amt");
- if(null!=para){
- Double oncelimit=Double.parseDouble(para.getParaval())/100;
- if(amount>oncelimit&&cntamount>oncelimit){
+ TDevpara para = deviceParamService.getDevparaInfoByParaname(group.getGroupid(), "once_limit_amt");
+ if (null != para || StringUtil.isEmpty(para.getParaval())) {
+ Double oncelimit = Double.parseDouble(para.getParaval()) / 100;
+ if (amount > oncelimit && cntamount > oncelimit) {
resp.setRetcode("99");
resp.setRetmsg("消费金额超出单笔消费限额");
return resp;
@@ -469,12 +502,14 @@
tTransdtl.setAttr1(confirmResp.getRetmsg() + "," + confirmResp.getException());
resp.setRetcode(confirmResp.getRetcode().toString());
resp.setRetmsg(confirmResp.getRetmsg());
+ return resp;
}
} else {
tTransdtl.setStatus(RestaurantConstant.STATUS_TRANSDTL_FAIL);
tTransdtl.setAttr1(response.getRetmsg() + "," + response.getException());
resp.setRetcode(response.getRetcode().toString());
resp.setRetmsg(response.getRetmsg());
+ return resp;
}
// }
@@ -827,8 +862,8 @@
cardno = qrcoderesp.getCitycardno();
cardphyid = qrcoderesp.getCardphyid();
} else {
- cardno="";
- cardphyid="";
+ cardno = "";
+ cardphyid = "";
}
} else {
cardno = req.getCardno();
@@ -847,8 +882,11 @@
transDtl.setCustname(customer.getCustname());
DiscountBean bean = deviceDiscountRuleService.getCustomerDiscount(device.getId(), req.getTranstime(), customer.getCustid());
if (null != bean) {
- transDtl.setRuleid(bean.getRuleid());
- amount = getDiscountAmount(req.getTransdate(), customer.getCustid(), amount, bean);
+
+ Double discountedamt = getDiscountAmount(req.getTransdate(), customer.getCustid(), amount, bean);
+ if(discountedamt!=amount){
+ transDtl.setRuleid(bean.getRuleid());
+ }
}
}
}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/bean/CustomerShowBean.java b/src/main/java/com/supwisdom/dlpay/restaurant/bean/CustomerShowBean.java
index b03083d..74b5e99 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/bean/CustomerShowBean.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/bean/CustomerShowBean.java
@@ -13,6 +13,7 @@
private String bankcardno;
private String checkstatus;
private String status;
+ private String inputdate;
public CustomerShowBean(){
@@ -101,4 +102,12 @@
public void setStatus(String status) {
this.status = status;
}
+
+ public String getInputdate() {
+ return inputdate;
+ }
+
+ public void setInputdate(String inputdate) {
+ this.inputdate = inputdate;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/bean/DeptReportSearchBean.java b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DeptReportSearchBean.java
new file mode 100644
index 0000000..cf2f7d2
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DeptReportSearchBean.java
@@ -0,0 +1,33 @@
+package com.supwisdom.dlpay.restaurant.bean;
+
+import com.supwisdom.dlpay.system.bean.PageBean;
+
+public class DeptReportSearchBean extends PageBean {
+ private String startdate;
+ private String enddate;
+ private String deptcode;
+
+ public String getStartdate() {
+ return startdate;
+ }
+
+ public void setStartdate(String startdate) {
+ this.startdate = startdate;
+ }
+
+ public String getEnddate() {
+ return enddate;
+ }
+
+ public void setEnddate(String enddate) {
+ this.enddate = enddate;
+ }
+
+ public String getDeptcode() {
+ return deptcode;
+ }
+
+ public void setDeptcode(String deptcode) {
+ this.deptcode = deptcode;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/bean/DeptReportSearchData.java b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DeptReportSearchData.java
new file mode 100644
index 0000000..aebeae7
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DeptReportSearchData.java
@@ -0,0 +1,181 @@
+package com.supwisdom.dlpay.restaurant.bean;
+
+import java.math.BigInteger;
+
+public class DeptReportSearchData {
+ private String deptname;
+ private String deptcode;
+ private String childdeptname;
+ private String childdeptcode;
+
+
+ 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 getDeptname() {
+ return deptname;
+ }
+
+ public void setDeptname(String deptname) {
+ this.deptname = deptname;
+ }
+
+ public String getDeptcode() {
+ return deptcode;
+ }
+
+ public void setDeptcode(String deptcode) {
+ this.deptcode = deptcode;
+ }
+
+ public String getChilddeptname() {
+ return childdeptname;
+ }
+
+ public void setChilddeptname(String childdeptname) {
+ this.childdeptname = childdeptname;
+ }
+
+ public String getChilddeptcode() {
+ return childdeptcode;
+ }
+
+ public void setChilddeptcode(String childdeptcode) {
+ this.childdeptcode = childdeptcode;
+ }
+
+ 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/DeptReportShowBean.java b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DeptReportShowBean.java
new file mode 100644
index 0000000..9b0f7ff
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DeptReportShowBean.java
@@ -0,0 +1,218 @@
+package com.supwisdom.dlpay.restaurant.bean;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+
+public class DeptReportShowBean {
+ private String deptname;
+ private String deptcode;
+ private String childdeptname;
+ private String childdeptcode;
+
+ 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<DeptReportSearchData> datalist = new ArrayList<DeptReportSearchData>(0);
+
+ public DeptReportShowBean(){
+
+ }
+
+ public DeptReportShowBean(String deptname, String deptcode, String childdeptname, String childdeptcode, 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.deptname = deptname;
+ this.deptcode = deptcode;
+ this.childdeptname = childdeptname;
+ this.childdeptcode = childdeptcode;
+ 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<DeptReportSearchData> getDatalist() {
+ return datalist;
+ }
+
+ public void setDatalist(List<DeptReportSearchData> datalist) {
+ this.datalist = datalist;
+ }
+
+ public String getDeptcode() {
+ return deptcode;
+ }
+
+ public void setDeptcode(String deptcode) {
+ this.deptcode = deptcode;
+ }
+
+ public String getDeptname() {
+ return deptname;
+ }
+
+ public void setDeptname(String deptname) {
+ this.deptname = deptname;
+ }
+
+ public String getChilddeptname() {
+ return childdeptname;
+ }
+
+ public void setChilddeptname(String childdeptname) {
+ this.childdeptname = childdeptname;
+ }
+
+ public String getChilddeptcode() {
+ return childdeptcode;
+ }
+
+ public void setChilddeptcode(String childdeptcode) {
+ this.childdeptcode = childdeptcode;
+ }
+
+ 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/DeptSearchBean.java b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DeptSearchBean.java
new file mode 100644
index 0000000..da93407
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DeptSearchBean.java
@@ -0,0 +1,24 @@
+package com.supwisdom.dlpay.restaurant.bean;
+
+import com.supwisdom.dlpay.system.bean.PageBean;
+
+public class DeptSearchBean extends PageBean {
+ private String deptname;
+ private String deptcode;
+
+ public String getDeptname() {
+ return deptname;
+ }
+
+ public void setDeptname(String deptname) {
+ this.deptname = deptname;
+ }
+
+ public String getDeptcode() {
+ return deptcode;
+ }
+
+ public void setDeptcode(String deptcode) {
+ this.deptcode = deptcode;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/bean/DiscountBean.java b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DiscountBean.java
index 2da979b..20ae7a9 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/bean/DiscountBean.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DiscountBean.java
@@ -6,16 +6,22 @@
private Integer limitcnt;
private Double amount;
private Integer ruleid;
+ private String rulemode;
+ private String starttime;
+ private String endtime;
public DiscountBean(){
}
- public DiscountBean(String ruletype, Integer limitcnt, Double amount, Integer ruleid) {
+ public DiscountBean(String ruletype, Integer limitcnt, Double amount, Integer ruleid, String rulemode, String starttime, String endtime) {
this.ruletype = ruletype;
this.limitcnt = limitcnt;
this.amount = amount;
this.ruleid = ruleid;
+ this.rulemode = rulemode;
+ this.starttime = starttime;
+ this.endtime = endtime;
}
public Integer getRuleid() {
@@ -49,4 +55,28 @@
public void setAmount(Double amount) {
this.amount = amount;
}
+
+ public String getRulemode() {
+ return rulemode;
+ }
+
+ public void setRulemode(String rulemode) {
+ this.rulemode = rulemode;
+ }
+
+ public String getStarttime() {
+ return starttime;
+ }
+
+ public void setStarttime(String starttime) {
+ this.starttime = starttime;
+ }
+
+ public String getEndtime() {
+ return endtime;
+ }
+
+ public void setEndtime(String endtime) {
+ this.endtime = endtime;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/bean/DiscountRuleShowBean.java b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DiscountRuleShowBean.java
index bcdd42e..080e8ff 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/bean/DiscountRuleShowBean.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/bean/DiscountRuleShowBean.java
@@ -12,6 +12,7 @@
private String remark;
private String starttime;
private String endtime;
+ private String rulemode;
public Integer getRuleid() {
return ruleid;
@@ -100,4 +101,12 @@
public void setEndtime(String endtime) {
this.endtime = endtime;
}
+
+ public String getRulemode() {
+ return rulemode;
+ }
+
+ public void setRulemode(String rulemode) {
+ this.rulemode = rulemode;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/bean/TDeptShowBean.java b/src/main/java/com/supwisdom/dlpay/restaurant/bean/TDeptShowBean.java
new file mode 100644
index 0000000..e6c695d
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/bean/TDeptShowBean.java
@@ -0,0 +1,62 @@
+package com.supwisdom.dlpay.restaurant.bean;
+
+
+import java.math.BigInteger;
+
+public class TDeptShowBean {
+ private BigInteger deptno;
+ private String deptcode;
+ private String deptname;
+ private String fdeptcode;
+ private String ename;
+ private String lastsaved;
+
+
+ public BigInteger getDeptno() {
+ return deptno;
+ }
+
+ public void setDeptno(BigInteger deptno) {
+ this.deptno = deptno;
+ }
+
+ public String getDeptcode() {
+ return deptcode;
+ }
+
+ public void setDeptcode(String deptcode) {
+ this.deptcode = deptcode;
+ }
+
+ public String getDeptname() {
+ return deptname;
+ }
+
+ public void setDeptname(String deptname) {
+ this.deptname = deptname;
+ }
+
+ public String getFdeptcode() {
+ return fdeptcode;
+ }
+
+ public void setFdeptcode(String fdeptcode) {
+ this.fdeptcode = fdeptcode;
+ }
+
+ public String getEname() {
+ return ename;
+ }
+
+ public void setEname(String ename) {
+ this.ename = ename;
+ }
+
+ public String getLastsaved() {
+ return lastsaved;
+ }
+
+ public void setLastsaved(String lastsaved) {
+ this.lastsaved = lastsaved;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/controller/CustomerController.java b/src/main/java/com/supwisdom/dlpay/restaurant/controller/CustomerController.java
index 42cc705..5b50f30 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/controller/CustomerController.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/controller/CustomerController.java
@@ -106,9 +106,7 @@
@GetMapping("/loadimport")
-
@PreAuthorize("hasPermission('/customer/loadimport','')")
-
public String loadimport(Model model) {
return "restaurant/customer/import";
}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/controller/DeptController.java b/src/main/java/com/supwisdom/dlpay/restaurant/controller/DeptController.java
new file mode 100644
index 0000000..50280a9
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/controller/DeptController.java
@@ -0,0 +1,140 @@
+package com.supwisdom.dlpay.restaurant.controller;
+
+
+import com.google.gson.Gson;
+import com.supwisdom.dlpay.api.bean.JsonResult;
+import com.supwisdom.dlpay.framework.util.ExportExcel;
+import com.supwisdom.dlpay.framework.util.PageResult;
+import com.supwisdom.dlpay.framework.util.WebConstant;
+import com.supwisdom.dlpay.restaurant.bean.DeptSearchBean;
+import com.supwisdom.dlpay.restaurant.bean.TDeptShowBean;
+import com.supwisdom.dlpay.restaurant.domain.TDept;
+import com.supwisdom.dlpay.restaurant.service.DeptService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Controller
+@RequestMapping("/dept")
+public class DeptController {
+
+ @Autowired
+ private DeptService deptService;
+
+ @RequestMapping("/index")
+ public String indexView(ModelMap model) {
+ List<TDept> lst = deptService.findAll();
+ Map<String, String> map = new HashMap<>();
+ for (TDept dept : lst) {
+ map.put(dept.getDeptcode(), dept.getDeptname());
+ }
+ Gson gson = new Gson();
+ String gsonString = gson.toJson(map);
+ model.put("deptList", gsonString);
+ return "restaurant/dept/index";
+ }
+
+ @RequestMapping("/list")
+ @PreAuthorize("hasPermission('/dept/index','')")
+ @ResponseBody
+ public PageResult<TDeptShowBean> getDataList(@RequestParam("page") Integer pageNo,
+ @RequestParam("limit") Integer pageSize,
+ @RequestParam(value = "deptname", required = false) String deptname,
+ @RequestParam(value = "deptcode", required = false) String deptcode) {
+ try {
+ if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
+ if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
+ DeptSearchBean searchBean = new DeptSearchBean();
+ searchBean.setPageNo(pageNo);
+ searchBean.setDeptname(deptname);
+ searchBean.setDeptcode(deptcode);
+ searchBean.setPageSize(pageSize);
+ return deptService.getDeptByKey(searchBean);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return new PageResult<>(99, "系统查询错误");
+ }
+ }
+
+
+ @GetMapping("/loadadd")
+ @PreAuthorize("hasPermission('/dept/loadadd','')")
+ public String loadadd(Model model) {
+ List<TDept> list = deptService.findFDept();
+ model.addAttribute("fdeptlist", list);
+ return "restaurant/dept/form";
+ }
+
+ @PostMapping("/add")
+ @PreAuthorize("hasPermission('/dept/add','')")
+ @ResponseBody
+ public JsonResult add(@RequestBody TDept dept) {
+ System.out.println(dept);
+ if (dept != null) {
+ return deptService.saveDept(dept);
+ } else {
+ return JsonResult.error("添加失败");
+ }
+ }
+
+ @GetMapping("/checkdeptno")
+ @ResponseBody
+ public JsonResult delete(@RequestParam String deptno) {
+ if(deptService.checkDeptnoExists(deptno)){
+ return JsonResult.ok();
+ }
+
+ return JsonResult.error("部门代码已存在");
+ }
+
+
+ @PostMapping("/delete")
+ @PreAuthorize("hasPermission('/dept/delete','')")
+ @ResponseBody
+ public JsonResult delete(@RequestParam Long deptno) {
+ return deptService.delete(deptno);
+ }
+
+ @GetMapping("/loadimport")
+ public String loadimport(Model model) {
+ return "restaurant/dept/import";
+ }
+
+
+ @RequestMapping("/download")
+ @ResponseBody
+ public JsonResult downloadfile(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ String[] titles0 = {"部门编号", "部门名称", "上级部门编号(若为根部门则填0)","部门英文名称(选填)"
+ }; //表头
+ String[][] info0 = {{"01", "测试部门", "0",""
+ }}; // 示例内容
+ String fileName0 = "部门导入模板";// 保存数据
+
+ try {
+ ExportExcel.queryexcel(fileName0, titles0,info0,request, response);
+ return JsonResult.ok("操作成功");
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return JsonResult.error("操作失败");
+ }
+
+ @PostMapping("/import")
+ @PreAuthorize("hasPermission('/dept/import','')")
+ @ResponseBody
+ public JsonResult importFile(@RequestParam(value = "file",required = false) MultipartFile file, HttpServletRequest request) throws Exception{
+// System.out.println("---------under the upload file:"+file);
+ return deptService.importFile(file,request);
+ }
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/controller/DeptReportController.java b/src/main/java/com/supwisdom/dlpay/restaurant/controller/DeptReportController.java
new file mode 100644
index 0000000..27fc99a
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/controller/DeptReportController.java
@@ -0,0 +1,110 @@
+package com.supwisdom.dlpay.restaurant.controller;
+
+
+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.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 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.GetMapping;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+@Controller
+@RequestMapping("/deptreport")
+public class DeptReportController {
+
+ @Autowired
+ private SystemUtilService systemUtilService;
+ @Autowired
+ private DailyReportService dailyReportService;
+ @Autowired
+ private StatementReportService statementReportService;
+
+ //TODO
+ @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/deptreport/index";
+ }
+
+ @RequestMapping("/deptreportlist")
+ @PreAuthorize("hasPermission('/deptreport/deptreportlist','')")
+ 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/deptreport/index::deptreportTable";
+ }
+
+ @GetMapping("/excelexportdeptreport")
+ public void excelExportDeptfee(@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/printdeptreport")
+ 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/deptreport/print/printdeptreport";
+ }
+
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/controller/DeviceDiscountRuleController.java b/src/main/java/com/supwisdom/dlpay/restaurant/controller/DeviceDiscountRuleController.java
index e62d925..0cfc2cd 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/controller/DeviceDiscountRuleController.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/controller/DeviceDiscountRuleController.java
@@ -140,6 +140,7 @@
@RequestParam("amount") String amount,
@RequestParam("limitcnt") Integer limitcnt,
@RequestParam("listid") String listid,
+ @RequestParam("rulemode") String rulemode,
// @RequestParam(value = "file", required = false) MultipartFile file,
@AuthenticationPrincipal UserDetails operUser) {
try {
@@ -164,7 +165,7 @@
return JsonResult.error("登录过期,请重新登录");
}
- if (deviceDiscountRuleService.saveNewDiscountRule(rulename.trim(), ruletype, DateUtil.unParseToDateFormat(starttime), DateUtil.unParseToDateFormat(endtime), Double.parseDouble(amount), limitcnt, listid, oper)) {
+ if (deviceDiscountRuleService.saveNewDiscountRule(rulename.trim(), ruletype, DateUtil.unParseToDateFormat(starttime), DateUtil.unParseToDateFormat(endtime), Double.parseDouble(amount), limitcnt, listid, oper,rulemode)) {
return JsonResult.ok("新增成功");
} else {
return JsonResult.error("新增失败");
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/dao/CustTypeDao.java b/src/main/java/com/supwisdom/dlpay/restaurant/dao/CustTypeDao.java
index 22208ed..7beb09c 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/dao/CustTypeDao.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/dao/CustTypeDao.java
@@ -1,7 +1,6 @@
package com.supwisdom.dlpay.restaurant.dao;
-import com.supwisdom.dlpay.restaurant.domain.TArea;
import com.supwisdom.dlpay.restaurant.domain.TCustType;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/dao/DeptDao.java b/src/main/java/com/supwisdom/dlpay/restaurant/dao/DeptDao.java
index fdcb31d..2506a7b 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/dao/DeptDao.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/dao/DeptDao.java
@@ -8,8 +8,22 @@
import java.util.List;
@Repository
-public interface DeptDao extends JpaRepository<TDept, String> {
+public interface DeptDao extends JpaRepository<TDept, Long> {
@Query("from TDept t where t.status='normal' ")
List<TDept> findNormalDept();
+
+ List<TDept> findByFdeptcode(String fdeptcode);
+
+ List<TDept> findByDeptcode(String deptcode);
+
+ Integer countByDeptcode(String deptcode);
+
+ Integer countByFdeptcode(String fdeptcode);
+
+
+ @Query(value = "select distinct deptno from tb_dept where deptno=?1 or fdept=?1",nativeQuery = true)
+ List<String> findDeptnoByDeptno(String deptno);
+ @Query(value = "select distinct deptno from tb_dept",nativeQuery = true)
+ List<String> findAllDeptno();
}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/dao/DeviceGroupDao.java b/src/main/java/com/supwisdom/dlpay/restaurant/dao/DeviceGroupDao.java
index 6762816..64d5678 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/dao/DeviceGroupDao.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/dao/DeviceGroupDao.java
@@ -16,7 +16,6 @@
int deleteByDevgroupid(Integer Devgroupid);
-
Integer countByPid(Integer Devgroupid);
List<TDeviceGroup> findByGrouptype(String grouptype);
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/dao/TransDtlDao.java b/src/main/java/com/supwisdom/dlpay/restaurant/dao/TransDtlDao.java
index 1c5f920..45981ec 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/dao/TransDtlDao.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/dao/TransDtlDao.java
@@ -44,10 +44,24 @@
List<TTransDtl> findAllByStatusAndTransdate(String status,String date);
+
TTransDtl getByTransdateAndTermidAndTermsqlno(String transdate,Integer termid,Integer termsqlno);
Integer countByAccdateAndCustidAndRuleid(String accdate,String custid,Integer ruleid);
+ @Query(value = "select count(refno) from tb_transdtl where substr(accdate,1,6)=?1" +
+ " and custid=?2 and ruleid=?3",nativeQuery = true)
+ Integer countTrandtlByAccdateAndCustidAndRuleidWithMonth(String accdate,String custid,Integer ruleid);
+
+ @Query(value = "select count(refno) from tb_transdtl where substr(accdate,1,6)=?1" +
+ " and custid=?2 and ruleid=?3 and substr(acctime,1,4) BETWEEN ?4 and ?5",nativeQuery = true)
+ Integer countTrandtlByAccdateAndCustidAndRuleidWithMonthAndPeriod(String accdate,String custid,Integer ruleid,String starttime,String endtime);
+
+ @Query(value = "select count(refno) from tb_transdtl where accdate=?1" +
+ " and custid=?2 and ruleid=?3 and substr(acctime,1,4) BETWEEN ?4 and ?5",nativeQuery = true)
+ Integer countTrandtlByAccdateAndCustidAndRuleidWithPeriod(String accdate,String custid,Integer ruleid,String starttime,String endtime);
+
+
@Query("select min(accdate) from TTransDtl")
String getMinTransdate();
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/domain/TCustType.java b/src/main/java/com/supwisdom/dlpay/restaurant/domain/TCustType.java
index 23351c1..0984abf 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/domain/TCustType.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/domain/TCustType.java
@@ -10,6 +10,7 @@
private Integer custtypeid;
private String custtypename;
private Integer feetype;
+ private Integer expireday;
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_CUSTTYPE")
@@ -39,4 +40,14 @@
public void setFeetype(Integer feetype) {
this.feetype = feetype;
}
+
+
+ @Column(name = "expireday" ,length = 9)
+ public Integer getExpireday() {
+ return expireday;
+ }
+
+ public void setExpireday(Integer expireday) {
+ this.expireday = expireday;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/domain/TCustomer.java b/src/main/java/com/supwisdom/dlpay/restaurant/domain/TCustomer.java
index 276225b..01bafaf 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/domain/TCustomer.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/domain/TCustomer.java
@@ -21,8 +21,8 @@
private String lastsaved;
private String status;
private String checkstatus;
-
- private String deptcode;
+ private String inputdate;
+ private String deptno;
@Id
@GenericGenerator(name = "idGenerator", strategy = "uuid")
@@ -132,12 +132,21 @@
this.checkstatus = checkstatus;
}
- @Column(name = "DEPTCODE", length = 32)
- public String getDeptcode() {
- return deptcode;
+ @Column(name = "DEPTNO", length = 32)
+ public String getDeptno() {
+ return deptno;
}
- public void setDeptcode(String deptcode) {
- this.deptcode = deptcode;
+ public void setDeptno(String deptno) {
+ this.deptno = deptno;
+ }
+
+ @Column(name = "inputdate", length = 8)
+ public String getInputdate() {
+ return inputdate;
+ }
+
+ public void setInputdate(String inputdate) {
+ this.inputdate = inputdate;
}
}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/domain/TDept.java b/src/main/java/com/supwisdom/dlpay/restaurant/domain/TDept.java
index b901fdc..64727b9 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/domain/TDept.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/domain/TDept.java
@@ -9,11 +9,11 @@
@Id
@SequenceGenerator(name = "pk_dept_deptcode", sequenceName = "SEQ_DEPTCODE", allocationSize = 1, initialValue = 10)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "pk_dept_deptcode")
- @Column(name="DEPTCODE", nullable = false, length = 32)
- private String deptcode; //ID
+ @Column(name="deptno", nullable = false, length = 32)
+ private Long deptno; //ID
- @Column(name="DEPTNO", nullable = false, length = 20)
- private String deptno; //部门编号,可能会要修改,不能为主键,唯一索引
+ @Column(name="deptcode", nullable = false, length = 20)
+ private String deptcode; //部门编号,可能会要修改,不能为主键,唯一索引
@Column(name="DEPTNAME", precision = 600)
private String deptname; //部门名称
@@ -30,6 +30,14 @@
@Column(name="LASTSAVED", length = 20)
private String lastsaved; //最后更新时间
+ public Long getDeptno() {
+ return deptno;
+ }
+
+ public void setDeptno(Long deptno) {
+ this.deptno = deptno;
+ }
+
public String getDeptcode() {
return deptcode;
}
@@ -38,14 +46,6 @@
this.deptcode = deptcode;
}
- public String getDeptno() {
- return deptno;
- }
-
- public void setDeptno(String deptno) {
- this.deptno = deptno;
- }
-
public String getDeptname() {
return deptname;
}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/domain/TDiscountRule.java b/src/main/java/com/supwisdom/dlpay/restaurant/domain/TDiscountRule.java
index 7ada260..df03d6d 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/domain/TDiscountRule.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/domain/TDiscountRule.java
@@ -55,6 +55,9 @@
@Column(name = "REMARK", length = 600)
private String remark;
+ @Column(name = "RULEMODE", length = 10)
+ private String rulemode;
+
public Integer getRuleid() {
return ruleid;
}
@@ -174,4 +177,12 @@
public void setDetailStatus(Integer detailStatus) {
this.detailStatus = detailStatus;
}
+
+ public String getRulemode() {
+ return rulemode;
+ }
+
+ public void setRulemode(String rulemode) {
+ this.rulemode = rulemode;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/DailyReportService.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/DailyReportService.java
index 855d621..cde8d49 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/service/DailyReportService.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/DailyReportService.java
@@ -13,9 +13,6 @@
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);
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/DeptReportService.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/DeptReportService.java
new file mode 100644
index 0000000..db873bc
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/DeptReportService.java
@@ -0,0 +1,22 @@
+package com.supwisdom.dlpay.restaurant.service;
+
+import com.supwisdom.dlpay.framework.domain.TOperator;
+import com.supwisdom.dlpay.restaurant.bean.*;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+public interface DeptReportService {
+
+ @Transactional(rollbackFor = Exception.class,readOnly = true)
+ List<DeptReportShowBean> getDeptReportSearchData(DeptReportSearchBean searchBean);
+
+ @Transactional(rollbackFor = Exception.class,readOnly = true)
+ String getDeptReportSearchPeriod(DeptReportSearchBean searchBean);
+
+ @Transactional(rollbackFor = Exception.class,readOnly = true)
+ void doCreateDeptReportExcel(HttpServletResponse response, List<DeptReportShowBean> datalist, DeptReportSearchBean searchBean, String filename, TOperator oper);
+
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/DeptService.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/DeptService.java
new file mode 100644
index 0000000..2ee5589
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/DeptService.java
@@ -0,0 +1,48 @@
+package com.supwisdom.dlpay.restaurant.service;
+
+import com.supwisdom.dlpay.api.bean.JsonResult;
+import com.supwisdom.dlpay.framework.util.PageResult;
+import com.supwisdom.dlpay.restaurant.bean.AreaSearchBean;
+import com.supwisdom.dlpay.restaurant.bean.DeptSearchBean;
+import com.supwisdom.dlpay.restaurant.bean.TDeptShowBean;
+import com.supwisdom.dlpay.restaurant.domain.TArea;
+import com.supwisdom.dlpay.restaurant.domain.TDeviceGroup;
+import com.supwisdom.dlpay.system.bean.ZTreeNode;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.supwisdom.dlpay.restaurant.domain.TDept;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+public interface DeptService {
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, readOnly = true)
+ PageResult<ZTreeNode> getDeptTree();
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, readOnly = true)
+ PageResult<TDeptShowBean> getDeptByKey(DeptSearchBean param);
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, readOnly = true)
+ List<TDept> findAll();
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, readOnly = true)
+ boolean checkDeptnoExists(String deptno);
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, readOnly = true)
+ List<TDept> findFDept();
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+ JsonResult saveDept(TDept dept);
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+ JsonResult delete(Long deptcode);
+
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+ JsonResult importFile(MultipartFile file, HttpServletRequest request) throws Exception;
+
+
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/DeviceDiscountRuleService.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/DeviceDiscountRuleService.java
index bf3baef..5feeb1c 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/service/DeviceDiscountRuleService.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/DeviceDiscountRuleService.java
@@ -26,7 +26,7 @@
@Transactional(rollbackFor = Exception.class)
boolean saveNewDiscountRule(String rulename, String ruletype, String starttime,
- String endtime, Double amount, Integer limitcnt, String listid, TOperator oper) throws Exception;
+ String endtime, Double amount, Integer limitcnt, String listid, TOperator oper,String rulemode) throws Exception;
@Transactional(rollbackFor = Exception.class, readOnly = true)
PageResult<TDiscountDetail> getDiscountRuleDetails(String searchkey, int ruleid, int pageNo, int pageSize);
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/TransDtlService.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/TransDtlService.java
index cb9be96..af06e93 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/service/TransDtlService.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/TransDtlService.java
@@ -53,4 +53,13 @@
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true)
Integer getDiscountLimitToday(String termdate,String custid,Integer ruleid);
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true)
+ Integer getDiscountLimitTodayWithPeriod(String termdate,String custid,Integer ruleid,String starttime,String endtime);
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true)
+ Integer getDiscountLimitMonth(String termdate,String custid,Integer ruleid);
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true)
+ Integer getDiscountLimitMonthWithPeriod(String termdate,String custid,Integer ruleid,String starttime,String endtime);
}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/CheckTransdtlServiceImpl.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/CheckTransdtlServiceImpl.java
index 6f2eea3..32258a5 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/CheckTransdtlServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/CheckTransdtlServiceImpl.java
@@ -429,7 +429,7 @@
private String getDefaultDeptcode() {
List<TDept> list = deptDao.findNormalDept();
- if (!StringUtil.isEmpty(list)) return list.get(0).getDeptcode();
+ if (!StringUtil.isEmpty(list)) return list.get(0).getDeptcode().toString();
return "unknow";
}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/CustomerServiceImpl.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/CustomerServiceImpl.java
index 23dfb56..25ff130 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/CustomerServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/CustomerServiceImpl.java
@@ -46,7 +46,7 @@
@Override
public PageResult<CustomerShowBean> getCustomerPage(CustomerSearchBean param) {
- StringBuffer querySql = new StringBuffer("select t.cardno,c.custid,c.custname, " +
+ StringBuffer querySql = new StringBuffer("select t.cardno,c.custid,c.custname,c.inputdate, " +
"t.bankcardno,t.cardphyid,c.phone,c.custtype,c.checkstatus,t.status from tb_customer c " +
"left join Tb_card t on t.custid=c.custid where 1=1 ");
StringBuffer countSql = new StringBuffer("select count(*) as cnt from tb_customer c " +
@@ -108,6 +108,7 @@
cus.setBatchno(customer.getBatchno());
cus.setStatus(customer.getStatus());
cus.setCheckstatus(customer.getCheckstatus());
+ cus.setInputdate(DateUtil.getNow("yyyyMMdd"));
cus = customerDao.save(cus);
if (null != cus) {
if(0==customer.getSavecardflag()){
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
index d1c7ed0..d29a26d 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DailyReportServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DailyReportServiceImpl.java
@@ -58,7 +58,7 @@
private static final Logger logger = LoggerFactory.getLogger(DailyReportServiceImpl.class);
- @Override
+ /* @Override
public PageResult<MealsDtlShowBean> getMealsdtlByKey(DailyReportSearchBean param) {
List<Integer> groupids;
if (null != param.getGroupid()) {
@@ -84,11 +84,11 @@
for (MealsDtlList dtl : dtls) {
String groupname = dtl.getGroupname();
- /* if(StringUtil.isEmpty(groupname)){
+ *//* if(StringUtil.isEmpty(groupname)){
groupname=deviceGroupDao.findById(groupid).get().getGroupname();
- }*/
+ }*//*
bean.setDevgroupname(groupname);
- /* if(null==dtl.getAmount()){
+ *//* if(null==dtl.getAmount()){
bean.setB_amt(0d);
bean.setB_cnt(0);
bean.setB_feeamt(0d);
@@ -110,7 +110,7 @@
bean.setT_feecnt(0);
bean.setT_getamt(0d);
break;
- }*/
+ }*//*
totamt += dtl.getAmount();
totcnt += dtl.getCnt();
@@ -152,7 +152,7 @@
return new PageResult<>(showBeans);
- }
+ }*/
@Override
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DeptReportServiceImpl.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DeptReportServiceImpl.java
new file mode 100644
index 0000000..bf9e8a3
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DeptReportServiceImpl.java
@@ -0,0 +1,190 @@
+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.*;
+import com.supwisdom.dlpay.restaurant.service.DailyReportService;
+import com.supwisdom.dlpay.restaurant.service.DeptReportService;
+import com.supwisdom.dlpay.restaurant.service.DeptService;
+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 DeptReportServiceImpl implements DeptReportService {
+
+ @Autowired
+ private MealsdtlDao mealsdtlDao;
+ @Autowired
+ private DeptDao deptDao;
+ @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(DeptReportServiceImpl.class);
+
+
+ @Override
+ public List<DeptReportShowBean> getDeptReportSearchData(DeptReportSearchBean searchBean) {
+ if (null != searchBean) {
+ String startdate = DateUtil.unParseToDateFormat(searchBean.getStartdate());
+ String enddate = DateUtil.unParseToDateFormat(searchBean.getEnddate());
+
+ StringBuffer sb = new StringBuffer("select case when a2.deptcode is not null then a2.deptcode when a1.deptcode is not null then a1.deptcode else t.deptcode end as deptcode," +
+ " case when a2.deptcode is not null then a2.deptname when a1.deptcode is not null then a1.deptname else '' end as deptname, " +
+ " t.deptcode as childdeptcode, case when a1.deptcode is not null then a1.deptname else '' end as childdeptname, " +
+ " 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 " +
+ "left join tb_dept a1 on t.deptcode=a1.deptcode " +
+ "left join tb_dept a2 on a1.fdeptcode=a2.deptcode " +
+ "where t.checkdate>=:startdate and t.checkdate<=:enddate and t.deptcode=:deptcode " +
+ "group by t.deptcode,a1.deptname,a2.deptname,a1.deptcode,a2.deptcode order by t.deptcode ");
+
+ Query query = entityManager.createNativeQuery(sb.toString());
+ query.setParameter("startdate", startdate);
+ query.setParameter("enddate", enddate);
+ query.setParameter("groupid", searchBean.getDeptcode());
+ query.unwrap(NativeQueryImpl.class).setResultTransformer(Transformers.aliasToBean(DeptReportSearchData.class));
+ List<DeptReportSearchData> list = query.getResultList();
+ if (null != list) return transforDeptReportShowBean(list);
+ }
+ return new ArrayList<>(0);
+
+ }
+
+ @Override
+ public String getDeptReportSearchPeriod(DeptReportSearchBean searchBean) {
+ return null;
+ }
+
+ @Override
+ public void doCreateDeptReportExcel(HttpServletResponse response, List<DeptReportShowBean> datalist, DeptReportSearchBean searchBean, String filename, TOperator oper) {
+
+ }
+
+ private List<DeptReportShowBean> transforDeptReportShowBean(List<DeptReportSearchData> list) {
+ if (StringUtil.isEmpty(list)) return new ArrayList<>(0);
+
+ List<DeptReportShowBean> result = new ArrayList<>(0);
+ BigInteger bitg=BigInteger.valueOf(0l);
+ DeptReportShowBean sumBean = new DeptReportShowBean("总 计","","","", 0d,bitg,0d,bitg,0d,bitg,0d,bitg,0d,bitg,0d,bitg,0d,0d,0d);
+ for (DeptReportSearchData 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()); //总计求和
+
+
+ boolean exist = false;
+ for (DeptReportShowBean bean : result) {
+ if (bean.getDeptcode() == data.getDeptcode()) {
+ exist = true;
+ bean.getDatalist().add(data);
+ bean.setBtotalamt(bean.getBtotalamt() + data.getBtotalamt());
+ bean.setBtotalcnt(bean.getBtotalcnt().add(data.getBtotalcnt()) );
+ bean.setLtotalamt(bean.getLtotalamt() + data.getLtotalamt());
+ bean.setLtotalcnt(bean.getLtotalcnt().add(data.getLtotalcnt()));
+ bean.setDtotalamt(bean.getDtotalamt() + data.getDtotalamt());
+ bean.setDtotalcnt(bean.getDtotalcnt().add(data.getDtotalcnt()) );
+ bean.setBpayamt(bean.getBpayamt() + data.getBpayamt());
+ bean.setBpaycnt(bean.getBpaycnt().add(data.getBpaycnt()) );
+ bean.setLpayamt(bean.getLpayamt() + data.getLpayamt());
+ bean.setLpaycnt(bean.getLpaycnt().add(data.getLpaycnt()) );
+ bean.setDpayamt(bean.getDpayamt() + data.getDpayamt());
+ bean.setDpaycnt(bean.getDpaycnt().add(data.getDpaycnt()) );
+ bean.setBfeeamt(bean.getBfeeamt() + data.getBfeeamt());
+ bean.setLfeeamt(bean.getLfeeamt() + data.getLfeeamt());
+ bean.setDfeeamt(bean.getDfeeamt() + data.getDfeeamt());
+ break;
+ }
+ }
+
+ if (!exist) {
+ DeptReportShowBean tmp = new DeptReportShowBean();
+
+ // String chkdate = DateUtil.reformatDatetime(data.getDeptname(), "yyyyMMdd", "yyyy-MM-dd");
+ tmp.setDeptcode(data.getDeptcode());
+ tmp.setDeptname(data.getDeptname());
+ 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);
+ }
+
+ }
+
+ result.add(sumBean); //最后加上总计
+ return result;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DeptServiceImpl.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DeptServiceImpl.java
new file mode 100644
index 0000000..96ffa1d
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DeptServiceImpl.java
@@ -0,0 +1,203 @@
+package com.supwisdom.dlpay.restaurant.service.impl;
+
+import com.supwisdom.dlpay.api.bean.JsonResult;
+import com.supwisdom.dlpay.framework.util.DateUtil;
+import com.supwisdom.dlpay.framework.util.ImportExcelUtil;
+import com.supwisdom.dlpay.framework.util.PageResult;
+import com.supwisdom.dlpay.framework.util.StringUtil;
+import com.supwisdom.dlpay.restaurant.bean.DeptSearchBean;
+import com.supwisdom.dlpay.restaurant.bean.TDeptShowBean;
+import com.supwisdom.dlpay.restaurant.dao.DeptDao;
+import com.supwisdom.dlpay.restaurant.domain.TDept;
+import com.supwisdom.dlpay.restaurant.service.DeptService;
+import com.supwisdom.dlpay.system.bean.ZTreeNode;
+import org.hibernate.query.internal.NativeQueryImpl;
+import org.hibernate.transform.Transformers;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.domain.Sort;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.Query;
+import javax.servlet.http.HttpServletRequest;
+import java.io.InputStream;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+@Service
+public class DeptServiceImpl implements DeptService {
+ @Autowired
+ private DeptDao deptDao;
+
+
+ @PersistenceContext
+ private EntityManager entityManager;
+
+
+ @Override
+ public PageResult<ZTreeNode> getDeptTree() {
+ List<TDept> groups=deptDao.findAll();
+ List<ZTreeNode> zlist=new ArrayList<>();
+ for(TDept g:groups){
+ ZTreeNode z=new ZTreeNode();
+ z.setId(g.getDeptcode().toString());
+ z.setName(g.getDeptname());
+ if(g.getFdeptcode()==null){
+ z.setpId("0");
+ }else{
+ z.setpId(g.getDeptcode().toString());
+ }
+ z.setChecked(false);
+ z.setOpen(true);
+ zlist.add(z);
+ }
+ PageResult<ZTreeNode> p=new PageResult<>(zlist);
+ p.setCode(0);
+ return p;
+ }
+
+ @Override
+ public PageResult<TDeptShowBean> getDeptByKey(DeptSearchBean param) {
+
+ StringBuffer querySql = new StringBuffer("select t.deptcode,t.deptno,t.deptname, " +
+ "t.fdeptcode,t.ename,t.lastsaved from tb_dept t where 1=1 ");
+ StringBuffer countSql = new StringBuffer("select count(*) as cnt from tb_dept t " +
+ " where 1=1 ");
+ if (!StringUtil.isEmpty(param.getDeptname())) {
+ querySql.append(" and t.deptname like :str ");
+ countSql.append(" and t.deptname like :str ");
+ }
+ if (!StringUtil.isEmpty(param.getDeptcode())) {
+ querySql.append(" and t.deptcode = :deptcode ");
+ countSql.append(" and t.deptcode = :deptcode ");
+ }
+ querySql.append(" order by t.deptcode ");
+ Query query = entityManager.createNativeQuery(querySql.toString());
+ Query countQuery = entityManager.createNativeQuery(countSql.toString());
+ if (!StringUtil.isEmpty(param.getDeptname())) {
+ query.setParameter("str", "%" + param.getDeptname().trim() + "%");
+ countQuery.setParameter("str", "%" + param.getDeptname().trim() + "%");
+ }
+ if (!StringUtil.isEmpty(param.getDeptcode())) {
+ query.setParameter("deptcode", "%" + param.getDeptcode().trim() + "%");
+ countQuery.setParameter("deptcode", "%" + param.getDeptcode().trim() + "%");
+ }
+ query.setFirstResult((param.getPageNo() - 1) * param.getPageSize());
+ query.setMaxResults(param.getPageSize()); //分页显示
+ query.unwrap(NativeQueryImpl.class).setResultTransformer(Transformers.aliasToBean(TDeptShowBean.class));
+ List<TDeptShowBean> list = query.getResultList();
+ BigInteger count = (BigInteger) countQuery.getSingleResult();
+ return new PageResult<>(count.longValue(), list);
+ }
+
+ @Override
+ public List<TDept> findAll() {
+ return deptDao.findAll();
+ }
+
+ @Override
+ public boolean checkDeptnoExists(String deptcode) {
+ List<TDept> depts=deptDao.findByDeptcode(deptcode);
+ if(depts.size()>0){
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public List<TDept> findFDept() {
+ return deptDao.findByFdeptcode("0");
+ }
+
+ @Override
+ public JsonResult saveDept(TDept dept) {
+ dept.setLastsaved(DateUtil.getNow());
+ dept.setStatus("normal");
+ deptDao.save(dept);
+
+ return JsonResult.ok("保存成功");
+ }
+
+ @Override
+ public JsonResult delete(Long deptcode) {
+ deptDao.deleteById(deptcode);
+ return JsonResult.ok("成功");
+ }
+
+ @Override
+ public JsonResult importFile(MultipartFile file, HttpServletRequest request) throws Exception {
+ String fname = file.getOriginalFilename();
+ if (!fname.endsWith(".xls") && !fname.endsWith(".xlsx")) {
+
+ return JsonResult.error("文件格式错误,请选择excel文件格式(.xls/.xlsx)");
+ }
+
+// InputStream excelstream = new FileInputStream(savePath+"/"+fname);
+ InputStream excelstream = file.getInputStream();
+ List<Object[][]> oList = null;
+ try {
+ if (fname.endsWith(".xls")) {
+ oList = ImportExcelUtil.getIntegralData(excelstream);//2003版本
+ } else {
+ oList = ImportExcelUtil.getIntegralData07(excelstream);//2007版本以上
+ }
+ } catch (Exception e) {
+ return JsonResult.error("模板格式错误,请重新下载模板");
+ }
+
+
+ String msg = "";
+ Integer successCnt = 0;
+ Integer failCnt = 0;
+ String batchno = DateUtil.getNow("yyyyMMddHHmmss");
+ for (Object[][] data : oList) {
+ for (int i = 1; i < data.length; i++) {
+ String deptcode=(String) data[i][0];
+ String deptname=(String) data[i][1];
+ String fdeptcode=(String) data[i][2];
+
+ if (StringUtil.isEmpty((String) data[i][0]) || StringUtil.isEmpty((String) data[i][1]) || StringUtil.isEmpty((String) data[i][2])) {
+ msg = msg + "第" + i + "行,关键字段缺失。<br/>";
+ failCnt += 1;
+ } else if (deptDao.countByDeptcode(deptcode) > 0) {
+ msg = msg + "第" + i + "行,该部门编号在系统中已存在。<br/>";
+ failCnt += 1;
+ } else if (deptDao.countByFdeptcode(fdeptcode) > 0) {
+ msg = msg + "第" + i + "行,上级部门系统中不存在。<br/>";
+ failCnt += 1;
+ } else {
+ TDept d = new TDept();
+ d.setDeptname(deptname);
+ d.setDeptcode(deptcode);
+ d.setFdeptcode(fdeptcode);
+ d.setLastsaved(batchno);
+ if (null != data[i][3]) {
+ d.setEname((String) data[i][3]);
+ }
+
+ d.setStatus("normal");
+ saveDept(d);
+ successCnt += 1;
+ }
+ }
+ }
+ /*resp.setCode(Code.SUCCESS);
+ // resp.setMsg("成功导入了"+sList.size()+"条信息");
+ resp.setMsg(String.format(Locale.CHINESE, msg));
+ return resp;*/
+
+
+ if (StringUtil.isEmpty(msg)) {
+ return JsonResult.ok("成功导入" + oList.size() + "条信息");
+ }
+ msg = "导入成功" + successCnt + "条,导入失败" + failCnt + "条<br/>" + msg;
+
+ return JsonResult.error(String.format(Locale.CHINESE, msg));
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DeviceDiscountRuleServiceImpl.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DeviceDiscountRuleServiceImpl.java
index 39a7177..7d6a6db 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DeviceDiscountRuleServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/DeviceDiscountRuleServiceImpl.java
@@ -47,12 +47,10 @@
private DiscountDetailDao discountDetailDao;
@Autowired
private SystemUtilService systemUtilService;
- @Autowired
- private CustomerDao customerDao;
+
@Autowired
private DeviceDao deviceDao;
- @Autowired
- private CardDao cardDao;
+
@Autowired
private CustomerListService customerListService;
@@ -96,6 +94,7 @@
bean.setStarttime(rule.getStarttime().substring(0, 2) + ":" + rule.getStarttime().substring(2));
bean.setEndtime(rule.getEndtime().substring(0, 2) + ":" + rule.getEndtime().substring(2));
bean.setTimeperiod(bean.getStarttime() + " ~ " + bean.getEndtime());
+ bean.setRulemode(rule.getRulemode());
result.add(bean);
}
}
@@ -174,7 +173,7 @@
@Override
public boolean saveNewDiscountRule(String rulename, String ruletype, String starttime,
- String endtime, Double amount, Integer limitcnt, String listid, TOperator oper) throws Exception {
+ String endtime, Double amount, Integer limitcnt, String listid, TOperator oper,String rulemode) throws Exception {
TDiscountRule rule = new TDiscountRule();
if (discountRuleDao.checkRulenameExists(rulename) > 0) {
throw new WebCheckException("餐补名称已经存在!");
@@ -192,6 +191,7 @@
rule.setCreatetime(systime);
rule.setLastsaved(systime);
rule.setVerno(1);
+ rule.setRulemode(rulemode);
rule = discountRuleDao.save(rule);
/*String filename = file.getOriginalFilename();
@@ -400,10 +400,10 @@
@Override
public DiscountBean getCustomerDiscount(Integer deviceid, String termtime, String custid) {
- StringBuffer sql = new StringBuffer("select d.limitcnt,d.ruletype,d.amount,d.ruleid from tb_discount_rule d " +
+ StringBuffer sql = new StringBuffer("select d.limitcnt,d.ruletype,d.amount,d.ruleid,d.starttime,d.endtime,d.rulemode from tb_discount_rule d " +
"left join tb_discount_devbind t on t.ruleid=d.ruleid " +
"left join tb_discount_detail c on t.ruleid=c.ruleid " +
- "where c.status='normal' and t.deviceid=:deviceid " +
+ "where d.status='normal' and t.deviceid=:deviceid " +
"and d.starttime<:termtime and d.endtime>:termtime " +
"and c.userid=:custid");
Query query = entityManager.createNativeQuery(sql.toString());
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 bc470fc..0ad7897 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
@@ -30,283 +30,284 @@
@Service
public class DeviceParamServiceImpl implements DeviceParamService {
- @Autowired
- private DevparaGroupDao devparaGroupDao;
- @Autowired
- private DevparaBindDao devparaBindDao;
- @Autowired
- private DevparaDao devparaDao;
- @Autowired
- private DeviceDao deviceDao;
- @Autowired
- private DeviceGroupDao deviceGroupDao;
+ @Autowired
+ private DevparaGroupDao devparaGroupDao;
+ @Autowired
+ private DevparaBindDao devparaBindDao;
+ @Autowired
+ private DevparaDao devparaDao;
+ @Autowired
+ private DeviceDao deviceDao;
+ @Autowired
+ private DeviceGroupDao deviceGroupDao;
- @Autowired
- private SystemUtilService systemUtilService;
+ @Autowired
+ private SystemUtilService systemUtilService;
- @PersistenceContext
- private EntityManager entityManager;
+ @PersistenceContext
+ private EntityManager entityManager;
- @Override
- public PageResult<TDevparaGroup> getDevparaGroupPage(String groupname, int pageNo, int pageSize) {
- Pageable pageable = PageRequest.of(pageNo - 1, pageSize, Sort.by("groupid"));
- if (StringUtil.isEmpty(groupname)) {
- return new PageResult<>(devparaGroupDao.findAll(pageable));
- }
- return new PageResult<>(devparaGroupDao.findAllByGroupnameIsContaining(groupname.trim(), pageable));
- }
-
- @Override
- public TDevparaGroup getDevparaGroupByGroupid(int groupid) {
- Optional<TDevparaGroup> opt= devparaGroupDao.findById(groupid);
- if(opt.isPresent()){
- return opt.get();
- }
- return null;
- }
-
- @Override
- public TDevparaGroup getDefaultDevparaGroup() {
- return devparaGroupDao.findGlobalParaGroup();
- }
-
- @Override
- public boolean deleteDevparaGroup(TDevparaGroup group) throws WebCheckException {
- if (null != group) {
- if (group.getGlobalflag()) {
- throw new WebCheckException("默认参数组不能删除");
- }
- if (devparaBindDao.getDevparaBindRecordcnt(group.getGroupid()) > 0) {
- throw new WebCheckException("该参数组下绑定了设备,请先解绑。");
- }
-
- devparaDao.deleteAllByGroupid(group.getGroupid());
- devparaGroupDao.delete(group);
- return true;
- }
- return false;
- }
-
- @Override
- public List<TDevpara> getDevparaInfo(Integer groupid) {
- List<TDevpara> result;
- if (null != groupid && groupid > 0) {
- result = devparaDao.findAllByGroupid(groupid);
- } else {
- result = devparaDao.findSystemDefaultDevpara(); //默认
- }
- if (!StringUtil.isEmpty(result)) {
- return result;
- } else {
- return new ArrayList<>(0);
- }
- }
-
- @Override
- public TDevpara getDevparaInfoByParaname(Integer groupid,String paraname) {
- TDevpara result;
- if (null != groupid && groupid > 0) {
- result = devparaDao.findByGroupidAndParaname(groupid,paraname).get(0);
- } else {
- result = devparaDao.findSystemDefaultDevparaByParaname(paraname).get(0); //默认
- }
- if (null!=result) {
- return result;
- } else {
- return null;
- }
- }
-
- @Override
- public boolean saveOrUpdateDevpara(int groupid, String groupname, Map<String, String> param) throws WebCheckException {
- TDevparaGroup group;
- if (groupid == 0) {
- if (devparaGroupDao.checkGroupnameExists(groupname) > 0) {
- throw new WebCheckException("参数名称已经存在");
- }
- group = new TDevparaGroup();
- group.setGlobalflag(false);
- group.setGroupname(groupname);
- group.setLastsaved(systemUtilService.getSysdatetime().getHostdatetime());
- group.setVerno(1L);
- group = devparaGroupDao.save(group);
-
- List<TDevpara> configList = devparaDao.findSystemDefaultDevpara(); //默认
- for (TDevpara devpara : configList) {
- TDevpara bean = new TDevpara();
- bean.setGroupid(group.getGroupid());
- bean.setParaname(devpara.getParaname());
- bean.setParaval(param.get(devpara.getParaname()));
- bean.setParadesc(devpara.getParadesc());
- bean.setValtype(devpara.getValtype());
- bean.setMinval(devpara.getMinval());
- bean.setMaxval(devpara.getMaxval());
- if (!bean.checkValue()) {
- throw new WebCheckException(bean.getErrmsg());
+ @Override
+ public PageResult<TDevparaGroup> getDevparaGroupPage(String groupname, int pageNo, int pageSize) {
+ Pageable pageable = PageRequest.of(pageNo - 1, pageSize, Sort.by("groupid"));
+ if (StringUtil.isEmpty(groupname)) {
+ return new PageResult<>(devparaGroupDao.findAll(pageable));
}
- devparaDao.save(bean);
- }
- } else {
- group = devparaGroupDao.findByGroupid(groupid);
- if (null == group) {
- throw new WebCheckException("原设备参数组不存在");
- }
- if (devparaGroupDao.checkGroupnameExists(groupname, groupid) > 0) {
- throw new WebCheckException("参数名称已经存在");
- }
- group.setGroupname(groupname);
- group.setLastsaved(systemUtilService.getSysdatetime().getHostdatetime());
- devparaGroupDao.save(group);
+ return new PageResult<>(devparaGroupDao.findAllByGroupnameIsContaining(groupname.trim(), pageable));
+ }
- for (String key : param.keySet()) {
- TDevpara bean = devparaDao.findById(groupid, key);
- if (null == bean) {
- throw new WebCheckException("设备参数[" + key + "]在参数组【" + group.getGroupname() + "】中不存在");
+ @Override
+ public TDevparaGroup getDevparaGroupByGroupid(int groupid) {
+ Optional<TDevparaGroup> opt = devparaGroupDao.findById(groupid);
+ if (opt.isPresent()) {
+ return opt.get();
}
- bean.setParaval(param.get(key));
- if (!bean.checkValue()) {
- throw new WebCheckException(bean.getErrmsg());
+ return null;
+ }
+
+ @Override
+ public TDevparaGroup getDefaultDevparaGroup() {
+ return devparaGroupDao.findGlobalParaGroup();
+ }
+
+ @Override
+ public boolean deleteDevparaGroup(TDevparaGroup group) throws WebCheckException {
+ if (null != group) {
+ if (group.getGlobalflag()) {
+ throw new WebCheckException("默认参数组不能删除");
+ }
+ if (devparaBindDao.getDevparaBindRecordcnt(group.getGroupid()) > 0) {
+ throw new WebCheckException("该参数组下绑定了设备,请先解绑。");
+ }
+
+ devparaDao.deleteAllByGroupid(group.getGroupid());
+ devparaGroupDao.delete(group);
+ return true;
}
- devparaDao.save(bean);
- }
- }
- return true;
- }
-
- @Override
- public PageResult<DevparaBindBean> getDevparaBindInfos(String searchkey, int pageNo, int pageSize) {
- StringBuffer querySql = new StringBuffer("select t.groupid,a.groupname,t.deviceid,b.devicename,b.devphyid,t.lastsaved " +
- " from TB_DEVPARA_BIND t left join TB_DEVPARA_GROUP a on t.groupid=a.groupid " +
- " left join TB_DEVICE b on t.deviceid=b.id where 1=1 ");
- StringBuffer countSql = new StringBuffer("select count(t.deviceid) as cnt from TB_DEVPARA_BIND t left join TB_DEVPARA_GROUP a on t.groupid=a.groupid " +
- " left join TB_DEVICE b on t.deviceid=b.id where 1=1 ");
- if (!StringUtil.isEmpty(searchkey)) {
- querySql.append(" and (a.groupname like :str or b.devicename like :str or b.devphyid like :str) ");
- countSql.append(" and (a.groupname like :str or b.devicename like :str or b.devphyid like :str) ");
- }
- querySql.append(" order by t.deviceid ");
- Query query = entityManager.createNativeQuery(querySql.toString());
- Query countQuery = entityManager.createNativeQuery(countSql.toString());
- if (!StringUtil.isEmpty(searchkey)) {
- query.setParameter("str", "%" + searchkey.trim() + "%");
- countQuery.setParameter("str", "%" + searchkey.trim() + "%");
- }
- query.setFirstResult((pageNo - 1) * pageSize);
- query.setMaxResults(pageSize); //分页显示
- query.unwrap(NativeQueryImpl.class).setResultTransformer(Transformers.aliasToBean(DevparaBindBean.class));
- List<DevparaBindBean> list = query.getResultList();
- BigInteger count = (BigInteger) countQuery.getSingleResult();
- return new PageResult<>(count.longValue(), list);
- }
-
- @Override
- public TDevparaBind getDevparaBindByDeviceid(Integer deviceid) {
- if (null != deviceid) {
- return devparaBindDao.getByDeviceid(deviceid);
- }
- return null;
- }
-
- @Override
- public boolean deleteDevparaBind(TDevparaBind bind) {
- if (null != bind) {
- devparaBindDao.delete(bind);
- return true;
- }
- return false;
- }
-
- @Override
- public List<TDevparaGroup> getDevparaGroups() {
- List<TDevparaGroup> list = devparaGroupDao.findAll();
- if (!StringUtil.isEmpty(list)) {
- return list;
- }
- return new ArrayList<>(0);
- }
-
- @Override
- public PageResult<DevparaBinddevShowBean> getBindDevicesBySearch(Integer devgroupid, String searchkey) {
- List<Integer> chirdGroupids = null;
- if (null != devgroupid) {
- Query chirdGroupQuery = entityManager.createNativeQuery(" WITH RECURSIVE r AS ( " +
- " SELECT * FROM tb_devicegroup WHERE devgroupid = :gid " +
- " union ALL " +
- " SELECT a.* FROM tb_devicegroup a, r WHERE a.pid = r.devgroupid ) " +
- " SELECT devgroupid FROM r ORDER BY devgroupid ");
- chirdGroupQuery.setParameter("gid", devgroupid.intValue());
- chirdGroupids = chirdGroupQuery.getResultList(); //递归查询所有的子节点
+ return false;
}
- StringBuffer sql = new StringBuffer("select t.id as deviceid,t.devicename,t.devphyid,t.devgroupid,a.groupname as devgroupname " +
- " from TB_DEVICE t left join TB_DEVICEGROUP a on t.devgroupid=a.devgroupid " +
- " left join TB_DEVPARA_BIND b on t.id=b.deviceid where b.groupid is null and t.state=1 ");
- if (!StringUtil.isEmpty(chirdGroupids)) {
- sql.append(" and t.devgroupid in ("+StringUtils.join(chirdGroupids.toArray(),",")+") ");
- }
- if (!StringUtil.isEmpty(searchkey)) {
- sql.append(" and (t.devicename like :str or t.devphyid like :str) ");
- }
- sql.append(" order by t.id ");
- Query query = entityManager.createNativeQuery(sql.toString());
- if (!StringUtil.isEmpty(searchkey)) {
- query.setParameter("str", "%" + searchkey.trim() + "%");
- }
- query.unwrap(NativeQueryImpl.class).setResultTransformer(Transformers.aliasToBean(DevparaBinddevShowBean.class));
- List<DevparaBinddevShowBean> list = query.getResultList();
- return new PageResult<>(list);
- }
-
- @Override
- public List<TreeSelectNode> getDeviceGroupSelectTree() {
- List<TDeviceGroup> groupList = deviceGroupDao.findAll();
- if (StringUtil.isEmpty(groupList)) return new ArrayList<>(0);
- return getDevgroupTree(groupList, 0);
- }
-
- private List<TreeSelectNode> getDevgroupTree(List<TDeviceGroup> groupList, Integer pid) {
- List<TreeSelectNode> result = new ArrayList<>(0);
- for (TDeviceGroup gp : groupList) {
- if ((0 == pid && gp.getPid() == 0) || (null != pid && pid.equals(gp.getPid()))) {
- TreeSelectNode node = new TreeSelectNode();
- 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)) {
- node.setChildren(children);
+ @Override
+ public List<TDevpara> getDevparaInfo(Integer groupid) {
+ List<TDevpara> result;
+ if (null != groupid && groupid > 0) {
+ result = devparaDao.findAllByGroupid(groupid);
} else {
- node.setChildren(null);
+ result = devparaDao.findSystemDefaultDevpara(); //默认
}
- result.add(node);
- }
+ if (!StringUtil.isEmpty(result)) {
+ return result;
+ } else {
+ return new ArrayList<>(0);
+ }
}
- return result;
- }
- @Override
- public boolean saveBindDevpara(int groupid, List<Integer> deviceIds) throws WebCheckException {
- TDevparaGroup group = devparaGroupDao.findByGroupid(groupid);
- if (null == group) {
- throw new WebCheckException("所选设备参数组不存在");
- }
- for (Integer id : deviceIds) {
- TDevice device = deviceDao.findTDeviceById(id);
- if (null == device) {
- throw new WebCheckException("终端编号为[" + id + "]的设备不存在");
- } else if (1 != device.getState()) {
- throw new WebCheckException("终端编号为[" + id + "]的设备状态异常");
- }
+ @Override
+ public TDevpara getDevparaInfoByParaname(Integer groupid, String paraname) {
+ List<TDevpara> result;
+ if (null != groupid && groupid > 0) {
+ result=devparaDao.findByGroupidAndParaname(groupid, paraname);
- TDevparaBind bind = new TDevparaBind();
- bind.setDeviceid(device.getId());
- bind.setGroupid(group.getGroupid());
- bind.setLastsaved(systemUtilService.getSysdatetime().getHostdatetime());
- devparaBindDao.save(bind);
+ } else {
+ result = devparaDao.findSystemDefaultDevparaByParaname(paraname); //默认
+ }
+ if (null != result||result.size()>0) {
+ return result.get(0);
+ } else {
+ return null;
+ }
}
- return true;
- }
+
+ @Override
+ public boolean saveOrUpdateDevpara(int groupid, String groupname, Map<String, String> param) throws WebCheckException {
+ TDevparaGroup group;
+ if (groupid == 0) {
+ if (devparaGroupDao.checkGroupnameExists(groupname) > 0) {
+ throw new WebCheckException("参数名称已经存在");
+ }
+ group = new TDevparaGroup();
+ group.setGlobalflag(false);
+ group.setGroupname(groupname);
+ group.setLastsaved(systemUtilService.getSysdatetime().getHostdatetime());
+ group.setVerno(1L);
+ group = devparaGroupDao.save(group);
+
+ List<TDevpara> configList = devparaDao.findSystemDefaultDevpara(); //默认
+ for (TDevpara devpara : configList) {
+ TDevpara bean = new TDevpara();
+ bean.setGroupid(group.getGroupid());
+ bean.setParaname(devpara.getParaname());
+ bean.setParaval(param.get(devpara.getParaname()));
+ bean.setParadesc(devpara.getParadesc());
+ bean.setValtype(devpara.getValtype());
+ bean.setMinval(devpara.getMinval());
+ bean.setMaxval(devpara.getMaxval());
+ if (!bean.checkValue()) {
+ throw new WebCheckException(bean.getErrmsg());
+ }
+ devparaDao.save(bean);
+ }
+ } else {
+ group = devparaGroupDao.findByGroupid(groupid);
+ if (null == group) {
+ throw new WebCheckException("原设备参数组不存在");
+ }
+ if (devparaGroupDao.checkGroupnameExists(groupname, groupid) > 0) {
+ throw new WebCheckException("参数名称已经存在");
+ }
+ group.setGroupname(groupname);
+ group.setLastsaved(systemUtilService.getSysdatetime().getHostdatetime());
+ devparaGroupDao.save(group);
+
+ for (String key : param.keySet()) {
+ TDevpara bean = devparaDao.findById(groupid, key);
+ if (null == bean) {
+ throw new WebCheckException("设备参数[" + key + "]在参数组【" + group.getGroupname() + "】中不存在");
+ }
+ bean.setParaval(param.get(key));
+ if (!bean.checkValue()) {
+ throw new WebCheckException(bean.getErrmsg());
+ }
+ devparaDao.save(bean);
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public PageResult<DevparaBindBean> getDevparaBindInfos(String searchkey, int pageNo, int pageSize) {
+ StringBuffer querySql = new StringBuffer("select t.groupid,a.groupname,t.deviceid,b.devicename,b.devphyid,t.lastsaved " +
+ " from TB_DEVPARA_BIND t left join TB_DEVPARA_GROUP a on t.groupid=a.groupid " +
+ " left join TB_DEVICE b on t.deviceid=b.id where 1=1 ");
+ StringBuffer countSql = new StringBuffer("select count(t.deviceid) as cnt from TB_DEVPARA_BIND t left join TB_DEVPARA_GROUP a on t.groupid=a.groupid " +
+ " left join TB_DEVICE b on t.deviceid=b.id where 1=1 ");
+ if (!StringUtil.isEmpty(searchkey)) {
+ querySql.append(" and (a.groupname like :str or b.devicename like :str or b.devphyid like :str) ");
+ countSql.append(" and (a.groupname like :str or b.devicename like :str or b.devphyid like :str) ");
+ }
+ querySql.append(" order by t.deviceid ");
+ Query query = entityManager.createNativeQuery(querySql.toString());
+ Query countQuery = entityManager.createNativeQuery(countSql.toString());
+ if (!StringUtil.isEmpty(searchkey)) {
+ query.setParameter("str", "%" + searchkey.trim() + "%");
+ countQuery.setParameter("str", "%" + searchkey.trim() + "%");
+ }
+ query.setFirstResult((pageNo - 1) * pageSize);
+ query.setMaxResults(pageSize); //分页显示
+ query.unwrap(NativeQueryImpl.class).setResultTransformer(Transformers.aliasToBean(DevparaBindBean.class));
+ List<DevparaBindBean> list = query.getResultList();
+ BigInteger count = (BigInteger) countQuery.getSingleResult();
+ return new PageResult<>(count.longValue(), list);
+ }
+
+ @Override
+ public TDevparaBind getDevparaBindByDeviceid(Integer deviceid) {
+ if (null != deviceid) {
+ return devparaBindDao.getByDeviceid(deviceid);
+ }
+ return null;
+ }
+
+ @Override
+ public boolean deleteDevparaBind(TDevparaBind bind) {
+ if (null != bind) {
+ devparaBindDao.delete(bind);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public List<TDevparaGroup> getDevparaGroups() {
+ List<TDevparaGroup> list = devparaGroupDao.findAll();
+ if (!StringUtil.isEmpty(list)) {
+ return list;
+ }
+ return new ArrayList<>(0);
+ }
+
+ @Override
+ public PageResult<DevparaBinddevShowBean> getBindDevicesBySearch(Integer devgroupid, String searchkey) {
+ List<Integer> chirdGroupids = null;
+ if (null != devgroupid) {
+ Query chirdGroupQuery = entityManager.createNativeQuery(" WITH RECURSIVE r AS ( " +
+ " SELECT * FROM tb_devicegroup WHERE devgroupid = :gid " +
+ " union ALL " +
+ " SELECT a.* FROM tb_devicegroup a, r WHERE a.pid = r.devgroupid ) " +
+ " SELECT devgroupid FROM r ORDER BY devgroupid ");
+ chirdGroupQuery.setParameter("gid", devgroupid.intValue());
+ chirdGroupids = chirdGroupQuery.getResultList(); //递归查询所有的子节点
+ }
+
+ StringBuffer sql = new StringBuffer("select t.id as deviceid,t.devicename,t.devphyid,t.devgroupid,a.groupname as devgroupname " +
+ " from TB_DEVICE t left join TB_DEVICEGROUP a on t.devgroupid=a.devgroupid " +
+ " left join TB_DEVPARA_BIND b on t.id=b.deviceid where b.groupid is null and t.state=1 ");
+ if (!StringUtil.isEmpty(chirdGroupids)) {
+ sql.append(" and t.devgroupid in (" + StringUtils.join(chirdGroupids.toArray(), ",") + ") ");
+ }
+ if (!StringUtil.isEmpty(searchkey)) {
+ sql.append(" and (t.devicename like :str or t.devphyid like :str) ");
+ }
+ sql.append(" order by t.id ");
+ Query query = entityManager.createNativeQuery(sql.toString());
+ if (!StringUtil.isEmpty(searchkey)) {
+ query.setParameter("str", "%" + searchkey.trim() + "%");
+ }
+ query.unwrap(NativeQueryImpl.class).setResultTransformer(Transformers.aliasToBean(DevparaBinddevShowBean.class));
+ List<DevparaBinddevShowBean> list = query.getResultList();
+ return new PageResult<>(list);
+ }
+
+ @Override
+ public List<TreeSelectNode> getDeviceGroupSelectTree() {
+ List<TDeviceGroup> groupList = deviceGroupDao.findAll();
+ if (StringUtil.isEmpty(groupList)) return new ArrayList<>(0);
+ return getDevgroupTree(groupList, 0);
+ }
+
+ private List<TreeSelectNode> getDevgroupTree(List<TDeviceGroup> groupList, Integer pid) {
+ List<TreeSelectNode> result = new ArrayList<>(0);
+ for (TDeviceGroup gp : groupList) {
+ if ((0 == pid && gp.getPid() == 0) || (null != pid && pid.equals(gp.getPid()))) {
+ TreeSelectNode node = new TreeSelectNode();
+ 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)) {
+ node.setChildren(children);
+ } else {
+ node.setChildren(null);
+ }
+ result.add(node);
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public boolean saveBindDevpara(int groupid, List<Integer> deviceIds) throws WebCheckException {
+ TDevparaGroup group = devparaGroupDao.findByGroupid(groupid);
+ if (null == group) {
+ throw new WebCheckException("所选设备参数组不存在");
+ }
+ for (Integer id : deviceIds) {
+ TDevice device = deviceDao.findTDeviceById(id);
+ if (null == device) {
+ throw new WebCheckException("终端编号为[" + id + "]的设备不存在");
+ } else if (1 != device.getState()) {
+ throw new WebCheckException("终端编号为[" + id + "]的设备状态异常");
+ }
+
+ TDevparaBind bind = new TDevparaBind();
+ bind.setDeviceid(device.getId());
+ bind.setGroupid(group.getGroupid());
+ bind.setLastsaved(systemUtilService.getSysdatetime().getHostdatetime());
+ devparaBindDao.save(bind);
+ }
+ return true;
+ }
}
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 3472a38..394849d 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
@@ -87,7 +87,8 @@
" 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 " +
+ "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());
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/TransDtlServiceImpl.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/TransDtlServiceImpl.java
index f5f5344..00c5ad9 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/TransDtlServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/TransDtlServiceImpl.java
@@ -299,5 +299,20 @@
return transDtlDao.countByAccdateAndCustidAndRuleid(termdate,custid,ruleid);
}
+ @Override
+ public Integer getDiscountLimitTodayWithPeriod(String termdate, String custid, Integer ruleid, String starttime, String endtime) {
+ return transDtlDao.countTrandtlByAccdateAndCustidAndRuleidWithPeriod(termdate,custid,ruleid,starttime,endtime);
+ }
+
+ @Override
+ public Integer getDiscountLimitMonth(String termdate, String custid, Integer ruleid) {
+ return transDtlDao.countTrandtlByAccdateAndCustidAndRuleidWithMonth(termdate,custid,ruleid);
+ }
+
+ @Override
+ public Integer getDiscountLimitMonthWithPeriod(String termdate, String custid, Integer ruleid, String starttime, String endtime) {
+ return transDtlDao.countTrandtlByAccdateAndCustidAndRuleidWithMonthAndPeriod(termdate,custid,ruleid,starttime,endtime);
+ }
+
}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/task/RestaurantTask.java b/src/main/java/com/supwisdom/dlpay/restaurant/task/RestaurantTask.java
index 19eb831..0208f54 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/task/RestaurantTask.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/task/RestaurantTask.java
@@ -102,4 +102,11 @@
}
}
+ //TODO
+ @Scheduled(cron = "0 0/1 * * * ? ")
+ private void deleteExpiredWhitelist(){
+ List<TCustomer> expiredCustomer=customerDao.findAll();
+
+ }
+
}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/util/RestaurantConstant.java b/src/main/java/com/supwisdom/dlpay/restaurant/util/RestaurantConstant.java
index d5732cc..a231f87 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/util/RestaurantConstant.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/util/RestaurantConstant.java
@@ -78,6 +78,9 @@
public static final String CHKDTL_RESOLVED_FAIL = "fail"; //补账失败
public static final String CHKDTL_RESOLVED_HANGUP="hangup"; //挂起
+ public static final String RULEMODE_MONTH="month"; //按月
+ public static final String RULEMODE_DAY="day"; //按日
+
public static final String TRANSDTL_STATEMENT_LASTDATE = "transdtl.statement.lastdate"; //统计日期
}
diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql
index 1c16953..da059e5 100644
--- a/src/main/resources/data.sql
+++ b/src/main/resources/data.sql
@@ -511,6 +511,7 @@
INSERT INTO "tb_businesspara" (parakey,paraval) VALUES ('payapi.appid', '200001');
INSERT INTO "tb_businesspara" (parakey,paraval) VALUES ('payapi.secret', 'dc1d26c0d43e442588092c8d45c21bce');
INSERT INTO "tb_businesspara" (parakey,paraval) VALUES ('customer.ignore', 'false');
+INSERT INTO "tb_businesspara" (parakey,paraval) VALUES ('discounttime.month', '0');
-- 多租户jwt秘钥配置,不同的租户secret最好配置不同
INSERT INTO "tb_tenant_jwtconfig"("id", "jwt_secret") VALUES ('main', 'DLLSHLomEbrM0lk+NMQZbHfSxaDU1wekjT+kiC3YzDw=');
diff --git a/src/main/resources/templates/restaurant/customer/index.html b/src/main/resources/templates/restaurant/customer/index.html
index 4ac3c6c..3e91ddc 100644
--- a/src/main/resources/templates/restaurant/customer/index.html
+++ b/src/main/resources/templates/restaurant/customer/index.html
@@ -44,6 +44,7 @@
{field: 'cardno', sort: true,width: 120, title: '市名卡号'},
{field: 'phone', title: '联系电话'},
{field: 'bankcardno', sort: true, width: 200, title: '银行卡号'},
+ {field: 'inputdate', sort: true, width: 120, title: '保存日期'},
{
field: 'checkstatus', title: '审核状态', align: 'center', width: 120, sort: true, templet: function (d) {
if ('uncheck' == d.checkstatus) {
diff --git a/src/main/resources/templates/restaurant/custtype/form.html b/src/main/resources/templates/restaurant/custtype/form.html
index 574b725..6518e04 100644
--- a/src/main/resources/templates/restaurant/custtype/form.html
+++ b/src/main/resources/templates/restaurant/custtype/form.html
@@ -2,13 +2,21 @@
<form id="custtype-form" lay-filter="custtype-form" class="layui-form model-form">
<input name="custtypeid" id="custtypeid" type="hidden"/>
<div class="layui-form-item">
- <label class="layui-form-label">客户类别名称</label>
+ <label class="layui-form-label"><span style="color: red">* </span>客户类别名称</label>
<div class="layui-input-block">
<input name="custtypename" placeholder="" type="text" class="layui-input" maxlength="20"
lay-verify="required" required/>
</div>
</div>
+ <div class="layui-form-item">
+ <label class="layui-form-label"><span style="color: red">* </span>过期时间(天)</label>
+ <div class="layui-input-block">
+ <input name="expireday" placeholder="" type="text" class="layui-input" maxlength="20"
+ lay-verify="required|number" required/>
+ </div>
+ </div>
+
<div class="layui-form-item model-form-footer">
<button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
<button class="layui-btn" lay-filter="custtype-form-submit" lay-submit id="custtype-submitbtn">保存</button>
diff --git a/src/main/resources/templates/restaurant/custtype/index.html b/src/main/resources/templates/restaurant/custtype/index.html
index 8abc183..3aacc4d 100644
--- a/src/main/resources/templates/restaurant/custtype/index.html
+++ b/src/main/resources/templates/restaurant/custtype/index.html
@@ -35,6 +35,7 @@
[
{field: 'custtypeid', title: '类别号', fixed: 'left', sort: true},
{field: 'custtypename', title: '类别名称', sort: true},
+ {field: 'expireday', title: '过期时间(天)', sort: true},
{
field: 'custtypeid', align: 'center',width:160, title: '操作', fixed: 'right', templet: function (item) {
return ' <a class="layui-btn layui-btn-xs" lay-event="custtype-edit"><i class="layui-icon layui-icon-edit"></i>编辑</a> ' +
diff --git a/src/main/resources/templates/restaurant/dept/form.html b/src/main/resources/templates/restaurant/dept/form.html
new file mode 100644
index 0000000..e828411
--- /dev/null
+++ b/src/main/resources/templates/restaurant/dept/form.html
@@ -0,0 +1,138 @@
+
+<form id="dept-form" lay-filter="form" class="layui-form model-form">
+ <input name="deptno" id="dept-id" type="hidden"/>
+ <div class="layui-form-item">
+ <label class="layui-form-label"><span style="color: red">* </span>部门代码</label>
+ <div class="layui-input-block">
+ <input name="deptcode" placeholder="不能重复" type="text" class="layui-input" maxlength="20"
+ lay-verify="required|deptcode" required/>
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label"><span style="color: red">* </span>部门名称</label>
+ <div class="layui-input-block">
+ <input name="deptname" type="text" class="layui-input"
+ required/>
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label"></span>部门英语名称</label>
+ <div class="layui-input-block">
+ <input name="ename" type="text" class="layui-input" maxlength="20"
+ />
+ </div>
+ </div>
+
+ <div class="layui-form-item">
+ <label class="layui-form-label">上级部门</label>
+ <div class="layui-input-block">
+ <select name="fdeptcode" id="dept-fdeptcode" lay-verify="required">
+ <option value="0">根部门</option>
+ <option th:each="type : ${fdeptlist}" th:value="${type.deptcode}">[[${type.deptname}]]</option>
+ </select>
+ </div>
+ </div>
+
+ <!-- <div class="layui-form-item">
+ <label class="layui-form-label">上级部门</label>
+ <div class="layui-input-block">
+ <input type="text" name="fdeptcode" id="dept-fdeptcode" lay-filter="dept-search-fdeptcode-filter"
+ autocomplete="off" class="layui-input"/>
+ </div>
+ </div>-->
+
+
+ <div class="layui-form-item model-form-footer">
+ <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
+ <button class="layui-btn" lay-filter="dept-form-submit" lay-submit id="submitbtn">保存</button>
+ </div>
+</form>
+
+<script>
+ layui.use(['layer', 'admin', 'form', 'formSelects'], function () {
+ var layer = layui.layer;
+ var admin = layui.admin;
+ var form = layui.form;
+ form.render('select');
+ form.render('radio');
+ form.verify({
+
+ "deptcode": function (e) {
+ if(""==e|| ""==$.trim(e)){
+ return "部门代码不能为空";
+ }
+
+ var msg = "";
+ $.ajax({
+ type: "GET",
+ url: '[[@{/dept/checkdeptcode}]]',
+ async: false, //同步提交。不设置则默认异步,异步的话,最后执行ajax
+ data: {
+ deptcode: e,
+ },
+ success: function (result) {
+ if (result.code != 200) {
+ msg = result.msg;
+ }
+ },
+ error: function (error) {
+ msg = "请求服务器校验账号失败";
+ }
+ });
+ if (msg != "") {
+ return msg;
+ }
+ }
+ });
+
+ var url = '[[@{/dept/add}]]';
+ // 回显user数据
+ var dev = admin.getTempData('t_dev');
+ if (dev) {
+ $('input[name="deptcode"]').attr('readonly', 'readonly');
+ form.val('form', dev);
+ }
+ /* let fid = admin.getTempData("fid");
+ if (fid) {
+ form.val('form', {"fid": fid});
+ }*/
+ // 表单提交事件
+ form.on('submit(dept-form-submit)', function (data) {
+ console.log(data);
+ layer.load(2);
+ let token = $("meta[name='_csrf_token']").attr("value");
+ console.log(token);
+ $.ajax({
+ type: "POST",
+ dataType: "json",
+ url: url,
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json',
+ 'X-CSRF-TOKEN': token,
+ },
+ data: JSON.stringify(data.field),
+ success: function (result) {
+ layer.closeAll('loading');
+ if (result.code == 200) {
+ layer.msg(result.msg, {icon: 1});
+ admin.finishPopupCenter();
+ } else if (result.code == 401) {
+ layer.msg(result.msg, {icon: 2, time: 1500}, function () {
+ location.replace('/login');
+ }, 1000);
+ return;
+ } else {
+ console.log('err:' + result.code);
+ layer.msg(result.msg, {icon: 2});
+ }
+ },
+ error: function () {
+ layer.closeAll('loading');
+ layer.msg("请求服务器失败!", {icon: 2});
+ }
+ });
+ return false;
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/main/resources/templates/restaurant/dept/import.html b/src/main/resources/templates/restaurant/dept/import.html
new file mode 100644
index 0000000..6249a7a
--- /dev/null
+++ b/src/main/resources/templates/restaurant/dept/import.html
@@ -0,0 +1,97 @@
+<div style="color: #0c91e5" align="right">
+ <a th:href="@{/device/download}" class="layui-btn layui-btn-primary" style="margin: 5px">点击此处下载导入模板</a>
+</div>
+<form lay-filter="form" class="layui-form model-form" >
+ <!-- row -->
+ <div class="layui-form-item">
+ <label class="control-label">请选择导入文件<span class="required"> * </span></label>
+ <input type="file" name="file" id="device-file" placeholder="请选择xls格式文件">
+ </div>
+ <!-- <div class="layui-input-inline" style="width: auto;margin-left:3%">
+ <button type="button" class="layui-btn upoadfile-btn" >
+ <i class="layui-icon"></i>点击上传
+ <input type="file" name="file" id="file" style="width:auto;"/>
+ </button>
+ </div>-->
+
+ <!-- /row -->
+ <!-- row -->
+ <div class="layui-form-item" align="center">
+ <div id="device-importError" style="color:red">
+ </div>
+ <div id="importInfo" >
+ </div>
+ </div>
+
+ <!-- <div class="form-actions right">
+ <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+ <button type="submit" class="btn btn-success" >保存</button>
+ </div>-->
+ <div class="layui-form-item model-form-footer">
+ <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
+ <button class="layui-btn" lay-filter="device-form-import" lay-submit id="importbtn">保存</button>
+ </div>
+</form>
+
+<script>
+ layui.use(['layer', 'admin', 'form', 'formSelects'], function () {
+ var layer = layui.layer;
+ var admin = layui.admin;
+ var form = layui.form;
+
+ var url = '[[@{/device/import}]]';
+ // 回显user数据
+
+ /* let fid = admin.getTempData("fid");
+ if (fid) {
+ form.val('form', {"fid": fid});
+ }*/
+ // 表单提交事件
+ form.on('submit(device-form-import)', function (data) {
+ $("#device-importError").html("");
+ var files = $('#device-file').prop('files');
+ var formData = new FormData();
+ $.each(files, function (i, file) {
+
+ formData.append('file', file);
+ });
+ console.log(formData);
+ layer.load(2);
+ let token = $("meta[name='_csrf_token']").attr("value");
+ $.ajax({
+ type: "POST",
+ url: url,
+ dataType: 'json',
+ processData:false,
+ contentType: false,
+ data: formData,
+ headers: {
+ 'Accept': 'application/json',
+ 'X-CSRF-TOKEN': token,
+ },
+ success: function (result) {
+ layer.closeAll('loading');
+ if (result.code == 200) {
+ layer.msg(result.msg, {icon: 1});
+ admin.finishPopupCenter();
+ } else if (result.code == 401) {
+ layer.msg(result.msg, {icon: 2, time: 1500}, function () {
+ location.replace('/login');
+ }, 1000);
+ return;
+ } else {
+ $("#device-importError").html("导入结束,导入失败信息:<br/>" + result.msg);
+
+ console.log('err:' + result.code);
+ /* layer.msg(result.msg, {icon: 2});*/
+ }
+ },
+ error: function () {
+ layer.closeAll('loading');
+ layer.msg("请求服务器失败!", {icon: 2});
+ }
+ });
+ return false;
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/main/resources/templates/restaurant/dept/index.html b/src/main/resources/templates/restaurant/dept/index.html
new file mode 100644
index 0000000..718795c
--- /dev/null
+++ b/src/main/resources/templates/restaurant/dept/index.html
@@ -0,0 +1,148 @@
+<div class="layui-card">
+ <div class="layui-card-header">
+ <h2 class="header-title">部门管理</h2>
+ <span class="layui-breadcrumb pull-right">
+ <a href="#">部门管理</a>
+ <a><cite>部门管理</cite></a>
+ </span>
+ </div>
+ <div class="layui-card-body">
+ <div class="layui-form toolbar">
+ 搜索:
+ <input id="dept-deptname" class="layui-input search-input" type="text" placeholder="部门名称"/> 
+ <input id="dept-deptcode" class="layui-input search-input" type="text" placeholder="部门代码"/> 
+
+ <button id="dept-btn-search" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
+ </button>
+ <button id="dept-btn-add" class="layui-btn icon-btn" data-type="add"><i class="layui-icon"></i>添加部门</button>
+ <button id="dept-btn-import" class="layui-btn icon-btn" ><i class="layui-icon"></i>批量导入</button>
+
+ </div>
+ <table class="layui-table" id="dept-table" lay-filter="dept-table"></table>
+ </div>
+</div>
+<input hidden th:value="${deptList}" id="deptlist">
+<script>
+
+ var rawlist=$("#deptlist").val();
+ var deptlist=JSON.parse(rawlist);
+
+ layui.use(['form', 'table', 'layer', 'admin', 'element'], function () {
+ let form = layui.form;
+ let table = layui.table;
+ let admin = layui.admin;
+
+ form.render('select');
+
+ // 渲染表格
+ table.render({
+ elem: '#dept-table',
+ url: '[[@{/dept/list}]]',
+ page: true,
+ cols: [
+ [
+ {field: 'deptcode', title: '部门代码', sort: true},
+ {field: 'deptname', sort: true, width: 200, title: '部门名称'},
+ {field: 'fdeptcode',
+ sort: true, width: 200,
+ title: '上级部门名称',
+ templet: function (item) {
+ if (item.fdeptcode == '0') {
+ return '根部门';
+ } else {
+ return deptlist[item.deptcode];
+ }
+
+ // return areaList.get(item.id);
+ }},
+ {field: 'ename', sort: true, width: 200, title: '部门英语名称'},
+ {field: 'lastsaved', sort: true, width: 170, title: '保存时间'},
+
+
+ {
+ field: 'id', align: 'center', title: '操作', fixed: 'right', templet: function (item) {
+ return ' <a class="layui-btn layui-btn-xs" lay-event="dept-edit"><i class="layui-icon layui-icon-edit"></i>编辑</a> '+
+ ' <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="dept-del"><i class="layui-icon layui-icon-delete"></i>删除</a>';;
+ }
+ }
+ ]
+ ]
+ });
+ // 搜索按钮点击事件
+ $('#dept-btn-search').click(function () {
+ let key = $('#dept-search-value').val().trim();
+ table.reload('dept-table', {where: {searchkey: key}, page: {curr: 1}});
+ });
+ $('#dept-btn-add').click(function () {
+ showDeptModel();
+ });
+ $('#dept-btn-import').click(function () {
+ showDownload();
+ });
+ let showDownload = function () {
+ let title ='导入';
+ admin.popupCenter({
+ title: title,
+ path: '[[@{/dept/loadimport}]]',
+ finish: function () {
+ table.reload('dept-table', {});
+ }
+ });
+ };
+ let showDeptModel = function (data) {
+ let title = data ? '修改部门' : '添加部门';
+ admin.putTempData('t_dev', data);
+ admin.popupCenter({
+ title: title,
+ path: '[[@{/dept/loadadd}]]',
+ finish: function () {
+ table.reload('dept-table', {});
+ }
+ });
+ };
+
+
+ // 工具条点击事件
+ table.on('tool(dept-table)', function (obj) {
+ let data = obj.data;
+ let layEvent = obj.event;
+ console.log(data);
+ if (layEvent === 'dept-edit') {
+ showDeptModel(data);
+ }else if (layEvent === 'dept-del') {
+ showDeptDelete(data);
+ }
+ });
+ let showDeptDelete = function (data) {
+ layer.confirm('确定要删除吗?', function (i) {
+ layer.close(i);
+ layer.load(2);
+ let token = $("meta[name='_csrf_token']").attr("value");
+ admin.go('[[@{/dept/delete}]]', {
+ deptno: data.deptno,
+ _csrf: token
+ }, function (data) {
+ console.log(data.code);
+ layer.closeAll('loading');
+ if (data.code == 200) {
+ layer.msg(data.msg, {icon: 1});
+ } else if (data.code == 401) {
+ layer.msg(data.msg, {icon: 2, time: 1500}, function () {
+ location.replace('/login');
+ }, 1000);
+ return;
+ } else {
+ layer.msg(data.msg, {icon: 2});
+ }
+ table.reload('dept-table', {});
+ }, function (ret) {
+ console.log(ret);
+ layer.closeAll('loading');
+ layer.msg('请求失败了,请稍后再试', {icon: 2});
+ });
+ });
+ };
+
+
+ });
+</script>
diff --git a/src/main/resources/templates/restaurant/deptreport/index.html b/src/main/resources/templates/restaurant/deptreport/index.html
new file mode 100644
index 0000000..d13199d
--- /dev/null
+++ b/src/main/resources/templates/restaurant/deptreport/index.html
@@ -0,0 +1,358 @@
+<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="deptreport-search-form">
+ <input type="hidden" id="deptreport-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="deptreport-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="deptreport-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="deptreport-search-devgroup" lay-filter="deptreport-search-devgroup-filter"
+ autocomplete="off" class="layui-input"/>
+ </div>
+ </div>
+
+ <div class="layui-inline">
+ <button id="deptreport-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-deptreport-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-deptreport-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-deptreport-table" th:fragment="deptreportTable">
+ <thead>
+ <tr>
+ <th rowspan="3" style="text-align: center;min-width: 100px;">部门</th>
+ <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-deptreport-tbody" th:data-startdate="${searchBean.startdate}" th:data-enddate="${searchBean.enddate}" th:data-groupid="${searchBean.deptcode}" 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="${data.datalist[0].deptname}" th:rowspan="${data.datalist.size()}"></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:each="article,stats:${data.datalist}" th:if="${!stats.first}">
+ <td th:text="${article.deptname}"></td>
+ <td th:text="${#numbers.formatDecimal(article.btotalamt,1,2)}"></td>
+ <td th:text="${article.btotalcnt}"></td>
+ <td th:text="${#numbers.formatDecimal(article.ltotalamt,1,2)}"></td>
+ <td th:text="${article.ltotalcnt}"></td>
+ <td th:text="${#numbers.formatDecimal(article.dtotalamt,1,2)}"></td>
+ <td th:text="${article.dtotalcnt}"></td>
+ <td th:text="${#numbers.formatDecimal(article.btotalamt+article.ltotalamt+article.dtotalamt,1,2)}"></td>
+ <td th:text="${article.btotalcnt+article.ltotalcnt+article.dtotalcnt}"></td>
+ <td th:text="${#numbers.formatDecimal(article.bpayamt,1,2)}"></td>
+ <td th:text="${article.bpaycnt}"></td>
+ <td th:text="${#numbers.formatDecimal(article.lpayamt,1,2)}"></td>
+ <td th:text="${article.lpaycnt}"></td>
+ <td th:text="${#numbers.formatDecimal(article.dpayamt,1,2)}"></td>
+ <td th:text="${article.dpaycnt}"></td>
+ <td th:text="${#numbers.formatDecimal(article.bpayamt+article.lpayamt+article.dpayamt,1,2)}"></td>
+ <td th:text="${article.bpaycnt+article.lpaycnt+article.dpaycnt}"></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 th:text="${data.deptname}"></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 th:text="${data.deptname}"></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.deptname}"></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: '#deptreport-search-startdate',
+ max: $("#deptreport-hidden-maxdate").val(),
+ trigger: 'click'
+ });
+ laydate.render({
+ elem: '#deptreport-search-enddate',
+ max: $("#deptreport-hidden-maxdate").val(),
+ trigger: 'click'
+ });
+
+ treeSelect.render({
+ elem: '#deptreport-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});
+ $("#deptreport-search-devgroup").val("");
+ treeSelect.revokeNode('deptreport-search-devgroup-filter');
+ return false;
+ }
+ return true;
+ },
+ success: function (d) {
+ console.log(d); // 加载完成后的回调函数
+ }
+ });
+
+
+ $('#deptreport-search-btn').click(function () {
+ var startdate = $("#deptreport-search-startdate").val();
+ var enddate = $("#deptreport-search-enddate").val();
+ // var nodealshow = $("#deptreport-search-nodealshow").is(':checked');
+ var groupid=$("#deptreport-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: '[[@{/deptreport/deptreportlist}]]',
+ type: "POST",
+ data: {
+ startdate: startdate,
+ enddate: enddate,
+ groupid: groupid,
+ _csrf: $("meta[name='_csrf_token']").attr("value")
+ },
+ success: function (data) {
+ $("#shopreport-deptreport-table").html(data);
+ layer.closeAll('loading');
+ },
+ error: function (status, err) {
+ layer.closeAll('loading');
+ layer.msg('查询失败了', {icon: 2});
+ }
+ });
+ });
+
+ $("#shopreport-deptreport-export-excel").click(function(){
+ var startdate= $("#shopreport-deptreport-tbody").attr("data-startdate");
+ var enddate= $("#shopreport-deptreport-tbody").attr("data-enddate");
+ var groupid= $("#shopreport-deptreport-tbody").attr("data-groupid");
+
+ var dataUrl='[[@{/deptreport/excelexportdeptreport}]]?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-deptreport-print-table").click(function(){
+ var startdate= $("#shopreport-deptreport-tbody").attr("data-startdate");
+ var enddate= $("#shopreport-deptreport-tbody").attr("data-enddate");
+ var groupid= $("#shopreport-deptreport-tbody").attr("data-groupid");
+ var opercode = $("#shopreport-deptreport-tbody").attr("data-opercode");
+ var url = '/deptreport/print/printdeptreport?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/deptreport/print/printdeptreport.html b/src/main/resources/templates/restaurant/deptreport/print/printdeptreport.html
new file mode 100644
index 0000000..0dda404
--- /dev/null
+++ b/src/main/resources/templates/restaurant/deptreport/print/printdeptreport.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.deptname}"></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.deptname}"></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/devicegroup/deviceform.html b/src/main/resources/templates/restaurant/devicegroup/deviceform.html
index 4ceb6d4..69ff544 100644
--- a/src/main/resources/templates/restaurant/devicegroup/deviceform.html
+++ b/src/main/resources/templates/restaurant/devicegroup/deviceform.html
@@ -59,8 +59,6 @@
layer.msg("请选择设备", {icon: 2, time: 1500});
return;
}
- console.log(groupid);
- console.log(deviceids);
layer.load(2);
var token = $("meta[name='_csrf_token']").attr("value");
$.ajax({
diff --git a/src/main/resources/templates/restaurant/discountrule/rule.html b/src/main/resources/templates/restaurant/discountrule/rule.html
index 7d4706c..87ffeb4 100644
--- a/src/main/resources/templates/restaurant/discountrule/rule.html
+++ b/src/main/resources/templates/restaurant/discountrule/rule.html
@@ -66,6 +66,17 @@
}
},
{
+ field: 'rulemode', title: '餐补模式', align: 'center', width: 120, sort: true, templet: function (d) {
+ if ('day' == d.rulemode) {
+ return '按日';
+ } else if ('month' == d.rulemode) {
+ return '按月';
+ } else {
+ return '按日';
+ }
+ }
+ },
+ {
field: 'amount', title: '金额/折率', align: 'center', sort: true, templet: function (d) {
if ('discount' == d.ruletype) {
return d.amount + '折';
@@ -89,7 +100,7 @@
}
}
},
- {field: 'remark', title: '备注', align: 'center'},
+ /* {field: 'remark', title: '备注', align: 'center'},*/
{align: 'center', title: '操作', width: 250, toolbar: '#discountrule-table-bar', fixed: 'right'}
]
]
diff --git a/src/main/resources/templates/restaurant/discountrule/rulecheck.html b/src/main/resources/templates/restaurant/discountrule/rulecheck.html
index 75bcab1..96891f9 100644
--- a/src/main/resources/templates/restaurant/discountrule/rulecheck.html
+++ b/src/main/resources/templates/restaurant/discountrule/rulecheck.html
@@ -51,7 +51,7 @@
cols: [
[
{field: 'rulename', title: '餐补名称', align: 'center', fixed: 'left'},
- {field: 'timeperiod', title: '优惠时间段',width:100,align: 'center'},
+ {field: 'timeperiod', title: '优惠时间段',width:150,align: 'center'},
{
field: 'ruletype',
title: '餐补类型',
@@ -71,6 +71,17 @@
}
},
{
+ field: 'rulemode', title: '餐补模式', align: 'center', width: 120, sort: true, templet: function (d) {
+ if ('day' == d.rulemode) {
+ return '按日';
+ } else if ('month' == d.rulemode) {
+ return '按月';
+ } else {
+ return '按日';
+ }
+ }
+ },
+ {
field: 'amount', title: '金额/折率', align: 'center', sort: true, templet: function (d) {
if ('discount' == d.ruletype) {
return d.amount + '折';
@@ -83,7 +94,6 @@
field: 'status',
title: '状态',
align: 'center',
- width: 120,
sort: true,
templet: function (d) {
if ('uncheck' == d.status) {
@@ -102,7 +112,6 @@
{
align: 'center',
title: '操作',
- width: 250,
toolbar: '#discountrule-check-table-bar',
fixed: 'right'
}
diff --git a/src/main/resources/templates/restaurant/discountrule/ruleform.html b/src/main/resources/templates/restaurant/discountrule/ruleform.html
index 0eed2ad..b521c85 100644
--- a/src/main/resources/templates/restaurant/discountrule/ruleform.html
+++ b/src/main/resources/templates/restaurant/discountrule/ruleform.html
@@ -10,6 +10,15 @@
</div>
<div class="layui-form-item">
+ <label class="layui-form-label">餐补模式</label>
+ <div class="layui-input-block">
+ <input type="radio" name="rulemode" id="form-discountrule-rulemode-day" lay-filter="discountrule-rulemode-filter" value="day" title="按日" checked/>
+ <input type="radio" name="rulemode" id="form-discountrule-rulemode-month" lay-filter="discountrule-rulemode-filter" value="month" title="按月" />
+
+ </div>
+ </div>
+
+ <div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">* </span>餐补名称</label>
<div class="layui-input-block">
<input type="text" class="layui-input" name="rulename" id="form-discountrule-rulename" maxlength="20" style="width: 90%;"
@@ -172,7 +181,7 @@
formData.append("endtime", vdata.endtime);
formData.append("amount", vdata.amount);
formData.append("limitcnt", vdata.limitcnt);
-
+ formData.append("rulemode", vdata.rulemode);
formData.append("listid",vdata.listid);
// var flag = false;
// var files = $('#form-discountrule-records').prop('files');