储值卡支付

This commit is contained in:
wangw 2024-06-20 16:11:54 +08:00
parent f345ba9b7f
commit cccf927b53
3 changed files with 19 additions and 7 deletions

View File

@ -71,6 +71,7 @@ public interface TbOrderInfoRepository extends JpaRepository<TbOrderInfo, Intege
@Query("SELECT new cn.ysk.cashier.vo.TbOrderPayCountByDayVo(" +
"info.tradeDay," +
"SUM( CASE WHEN info.payType = 'scanCode' THEN info.orderAmount ELSE 0 END )," +
"SUM( CASE WHEN info.payType = 'deposit' THEN info.orderAmount ELSE 0 END )," +
"SUM( CASE WHEN info.payType = 'wx_lite' THEN info.orderAmount ELSE 0 END )," +
"SUM( CASE WHEN info.payType = 'cash' THEN info.orderAmount ELSE 0 END )," +
"SUM( info.orderAmount)) " +
@ -124,6 +125,7 @@ public interface TbOrderInfoRepository extends JpaRepository<TbOrderInfo, Intege
@Query("SELECT new cn.ysk.cashier.vo.TbOrderPayCountByDayVo(" +
"info.tradeDay," +
"SUM( CASE WHEN info.payType = 'scanCode' THEN info.orderAmount ELSE 0 END )," +
"SUM( CASE WHEN info.payType = 'deposit' THEN info.orderAmount ELSE 0 END )," +
"SUM( CASE WHEN info.payType = 'wx_lite' THEN info.orderAmount ELSE 0 END )," +
"SUM( CASE WHEN info.payType = 'cash' THEN info.orderAmount ELSE 0 END )," +
"SUM( info.orderAmount)) " +

View File

@ -386,6 +386,7 @@ public class SummaryServiceImpl implements SummaryService {
Map<String, Object> map = new LinkedHashMap<>();
map.put("总金额", all.getTotal());
map.put("现金", all.getCash());
map.put("储值卡支付", all.getDeposit());
map.put("扫码支付", all.getScanCode());
map.put("微信小程序支付", all.getWxLite());
map.put("日期", all.getTradeDay());
@ -427,12 +428,13 @@ public class SummaryServiceImpl implements SummaryService {
endTime = new Date();
}
TbOrderPayCountVo payCount = tbOrderInfoRepository.queryOrderPayCount(shopId, start, end);
TbOrderPayCountVo refCount = tbOrderInfoRepository.queryTbOrderRefund(shopId, start, end);
payCount.setPayAmount(new BigDecimal(payCount.getPayAmount().toString()).subtract(new BigDecimal(refCount.getPayAmount().toString())));
payCount.setIcon("el-icon-coin");
list.add(payCount);
TbOrderPayCountVo cashCount = tbOrderInfoRepository.queryOrderPayCash(shopId, start, end);
cashCount.setIcon("el-icon-circle-check");
list.add(cashCount);
TbOrderPayCountVo refCount = tbOrderInfoRepository.queryTbOrderRefund(shopId, start, end);
refCount.setPayType("退款金额");
refCount.setIcon("el-icon-money");
list.add(refCount);

View File

@ -1,15 +1,14 @@
package cn.ysk.cashier.vo;
import java.math.BigDecimal;
public class TbOrderPayCountByDayVo {
private String tradeDay;
private Object scanCode;
private Object deposit;
private Object wxLite;
private Object cash;
private BigDecimal total;
private Object total;
public String getTradeDay() {
return tradeDay;
@ -19,6 +18,14 @@ public class TbOrderPayCountByDayVo {
this.tradeDay = tradeDay;
}
public Object getDeposit() {
return deposit;
}
public void setDeposit(Object deposit) {
this.deposit = deposit;
}
public Object getScanCode() {
return scanCode;
}
@ -43,17 +50,18 @@ public class TbOrderPayCountByDayVo {
this.cash = cash;
}
public BigDecimal getTotal() {
public Object getTotal() {
return total;
}
public void setTotal(BigDecimal total) {
public void setTotal(Object total) {
this.total = total;
}
public TbOrderPayCountByDayVo(String tradeDay, Object scanCode, Object wxLite, Object cash, BigDecimal total) {
public TbOrderPayCountByDayVo(String tradeDay, Object scanCode,Object deposit, Object wxLite, Object cash, Object total) {
this.tradeDay = tradeDay;
this.scanCode = scanCode;
this.deposit = deposit;
this.wxLite = wxLite;
this.cash = cash;
this.total = total;