人员状态更新修改
diff --git a/sql/restarant_create_table.sql b/sql/restarant_create_table.sql
index 6eebdec..dfdb9cb 100644
--- a/sql/restarant_create_table.sql
+++ b/sql/restarant_create_table.sql
@@ -674,11 +674,11 @@
deptcode varchar(32) NOT NULL,
devgroupid int4 NOT NULL,
deviceid int4 NOT NULL,
- feeamt numeric(15,2),
+ feeamt float8,
feecnt int4,
mealtype varchar(20) NOT NULL,
paytype varchar(32) NOT NULL,
- totalamt numeric(15,2),
+ totalamt float8,
totalcnt int4
);
ALTER TABLE tb_rpt_mealsdtl ADD CONSTRAINT tb_rpt_mealsdtl_pkey PRIMARY KEY (id);
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/controller/CusttypeReportController.java b/src/main/java/com/supwisdom/dlpay/restaurant/controller/CusttypeReportController.java
new file mode 100644
index 0000000..4b7e38f
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/controller/CusttypeReportController.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("/custtypereport")
+public class CusttypeReportController {
+
+ @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/DailyReportController.java b/src/main/java/com/supwisdom/dlpay/restaurant/controller/DailyReportController.java
index aa7f71c..7b0f60d 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/controller/DailyReportController.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/controller/DailyReportController.java
@@ -3,20 +3,21 @@
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 com.supwisdom.dlpay.framework.util.DateUtil;
-import com.supwisdom.dlpay.framework.util.PageResult;
-import com.supwisdom.dlpay.restaurant.bean.MealsDtlShowBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.*;
+import 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;
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/dao/CardDao.java b/src/main/java/com/supwisdom/dlpay/restaurant/dao/CardDao.java
index 846bf24..bf289b2 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/dao/CardDao.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/dao/CardDao.java
@@ -27,6 +27,11 @@
TCard findByCardno(String cardno);
+ @Query(value = "update TB_CARD set STATUS=:status,TRANSSTATUS=:transstatus,EXPIREDATE=:expiredate," +
+ "bankcardno=:bankcardno,cardphyid=:cardphyid where CARDNO=:cardno", nativeQuery = true)
+ void updateCardInfo(@Param("cardno") String cardno,@Param("status") String status,@Param("transstatus") String transstatus,
+ @Param("expiredate") String expiredate,@Param("bankcardno") String bankcardno,@Param("cardphyid") String cardphyid);
+
Integer countByBankcardno(String bankcardno);
List<TCard> findAllByCardnoAndCardphyidAndStatus(String cardno,String cardphyid,String status);
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/domain/TCard.java b/src/main/java/com/supwisdom/dlpay/restaurant/domain/TCard.java
index 6091237..70439c0 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/domain/TCard.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/domain/TCard.java
@@ -18,7 +18,7 @@
private String expiredate;
private String bankcardno;
- @Id
+
@NotNull
@Column(name = "bankcardno" ,length = 20 ,unique = true)
public String getBankcardno() {
@@ -29,6 +29,7 @@
this.bankcardno = bankcardno;
}
+ @Id
@Column(name = "cardno", length =32,unique = true)
public String getCardno() {
return cardno;
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/domain/TRptMealsDtl.java b/src/main/java/com/supwisdom/dlpay/restaurant/domain/TRptMealsDtl.java
index 7496b1d..9da8b5f 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/domain/TRptMealsDtl.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/domain/TRptMealsDtl.java
@@ -162,4 +162,22 @@
public void setFeeamt(Double feeamt) {
this.feeamt = feeamt;
}
+
+ @Override
+ public String toString() {
+ return "TRptMealsDtl{" +
+ "id='" + id + '\'' +
+ ", checkdate='" + checkdate + '\'' +
+ ", deptcode='" + deptcode + '\'' +
+ ", custtype=" + custtype +
+ ", devgroupid=" + devgroupid +
+ ", deviceid=" + deviceid +
+ ", mealtype='" + mealtype + '\'' +
+ ", paytype='" + paytype + '\'' +
+ ", totalcnt=" + totalcnt +
+ ", totalamt=" + totalamt +
+ ", feecnt=" + feecnt +
+ ", feeamt=" + feeamt +
+ '}';
+ }
}
\ No newline at end of file
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/CardService.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/CardService.java
index 466ad11..db7abaa 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/service/CardService.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/CardService.java
@@ -15,6 +15,9 @@
JsonResult saveCard(TCard card);
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+ JsonResult updateCard(TCard card);
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
JsonResult closeCard(Integer cardno);
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/CusttypeReportService.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/CusttypeReportService.java
new file mode 100644
index 0000000..ebd82ea
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/CusttypeReportService.java
@@ -0,0 +1,25 @@
+package com.supwisdom.dlpay.restaurant.service;
+
+import com.supwisdom.dlpay.framework.domain.TOperator;
+import com.supwisdom.dlpay.restaurant.bean.DailyReportSearchBean;
+import com.supwisdom.dlpay.restaurant.bean.DailyReportShowBean;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+public interface CusttypeReportService {
+
+
+ @Transactional(rollbackFor = Exception.class,readOnly = true)
+ List<DailyReportShowBean> getDailyReportSearchData(DailyReportSearchBean searchBean);
+
+
+ @Transactional(rollbackFor = Exception.class,readOnly = true)
+ String getDailyReportSearchPeriod(DailyReportSearchBean searchBean);
+
+ @Transactional(rollbackFor = Exception.class,readOnly = true)
+ void doCreateDailyReportExcel(HttpServletResponse response, List<DailyReportShowBean> datalist, DailyReportSearchBean searchBean, String filename, TOperator oper);
+
+
+}
diff --git a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/CardServiceImpl.java b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/CardServiceImpl.java
index 76c57f2..b7557b0 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/CardServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/service/impl/CardServiceImpl.java
@@ -28,6 +28,12 @@
}
@Override
+ public JsonResult updateCard(TCard card) {
+ cardDao.updateCardInfo(card.getCardno(),card.getStatus(),card.getTransstatus(),card.getExpiredate(),card.getBankcardno(),card.getCardphyid());
+ return null;
+ }
+
+ @Override
public JsonResult closeCard(Integer cardno) {
return null;
}
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 1ae54cb..d177ff6 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
@@ -396,7 +396,7 @@
TRptMealsDtl tmd = new TRptMealsDtl();
tmd.setCheckdate(bean.getAccdate());
tmd.setDeptcode(bean.getDeptcode() == null ? "unknow" : bean.getDeptcode());
- tmd.setCusttype(bean.getCusttype() == null ? -1 : bean.getCusttype());
+ tmd.setCusttype(bean.getCusttype() == null ? 1 : bean.getCusttype());
tmd.setDevgroupid(bean.getGroupid() == null ? -1 : bean.getGroupid());
tmd.setDeviceid(bean.getTermid() == null ? -1 : bean.getTermid());
tmd.setMealtype(bean.getMealtype() == null ? "unknow" : bean.getMealtype());
@@ -423,6 +423,10 @@
tmd.setFeeamt(0D);
data.add(tmd);
}
+ for(TRptMealsDtl dtl:data){
+ System.out.println(dtl.toString());
+ }
+
rptMealsDtlDao.saveAll(data);
return true;
}
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 1763742..1144a89 100644
--- a/src/main/java/com/supwisdom/dlpay/restaurant/task/RestaurantTask.java
+++ b/src/main/java/com/supwisdom/dlpay/restaurant/task/RestaurantTask.java
@@ -6,7 +6,6 @@
import com.supwisdom.dlpay.paysdk.proxy.UserProxy;
import com.supwisdom.dlpay.restaurant.bean.CustomerSearchBean;
import com.supwisdom.dlpay.restaurant.bean.CustomerShowBean;
-import com.supwisdom.dlpay.restaurant.dao.CardDao;
import com.supwisdom.dlpay.restaurant.dao.CustomerDao;
import com.supwisdom.dlpay.restaurant.domain.TCard;
import com.supwisdom.dlpay.restaurant.domain.TCustomer;
@@ -41,8 +40,6 @@
@Autowired
private CardService cardService;
@Autowired
- private CardDao cardDao;
- @Autowired
private CustomerService customerService;
@Autowired
private CustomerDao customerDao;
@@ -88,7 +85,7 @@
card.setBankcardno(resp.getBankcardno());
card.setStatus(resp.getCardstatus());
card.setTransstatus(resp.getTransstatus());
- cardDao.save(card);
+ cardService.updateCard(card);
}
customer.setPhone(resp.getPhone());
customer.setCheckstatus(RestaurantConstant.STATUS_CHECKSTATUS_NORMAL);