主页板块报错问题

This commit is contained in:
wangw 2024-09-26 17:23:55 +08:00
parent 3302b8dd24
commit 90382c8f59
2 changed files with 14 additions and 8 deletions

View File

@ -46,7 +46,7 @@ public interface TbShopUserRepository extends JpaRepository<TbShopUser, Integer>
List<Integer> getUserIdByShopId(String shopId);
@Query("SELECT count(1) from TbShopUser user where user.shopId = :shopId and user.joinTime BETWEEN :startTime AND :endTime")
Integer newFlow(@Param("shopId") String shopId, @Param("startTime") String startTime, @Param("endTime") String endTime);
Integer newFlow(@Param("shopId") String shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
@Query(value = "select IFNULL(sum(amount),0) from tb_shop_user_flow where shop_user_id=:userId and biz_code in ('cashMemberIn','scanMemberIn')",nativeQuery = true)
BigDecimal sumAmount(Integer userId);

View File

@ -87,7 +87,7 @@ public class SummaryServiceImpl implements SummaryService {
//会员 充值金额 inAmount /退款金额 outAmount /会员消费金额 useAmount /会员消费笔数 useNum
Map<String, Object> flowMap = tbShopUserFlowMapper.tradeIndexFlow(param.getShopId(), DateUtil.getStrTime(param.getStartTime()), DateUtil.getStrTime(param.getEndTime()));
// 新增会员数
Integer newFlow = tbShopUserRepository.newFlow(param.getShopId().toString(), DateUtil.getStrTime(param.getStartTime()), DateUtil.getStrTime(param.getEndTime()));
Integer newFlow = tbShopUserRepository.newFlow(param.getShopId().toString(), param.getStartTime(), param.getEndTime());
// Integer newFlow = tbShopUserFlowMapper.tradeIndexNewFlow(param.getShopId(), DateUtil.getStrTime(param.getStartTime()), DateUtil.getStrTime(param.getEndTime()));
//台桌数
int tables = tbShopTableRepository.countAllByShopId(param.getShopId());
@ -121,22 +121,28 @@ public class SummaryServiceImpl implements SummaryService {
BigDecimal payAmount = new BigDecimal(payCountVo.getPayAmount().toString());
switch (payCountVo.getPayType()){
case "微信小程序":
payCountVo.setPayAmount(payAmount.add(payCountMap.get("wx_lite")));
payCountVo.setPayAmount(payCountMap.containsKey("wx_lite")?payAmount.add(payCountMap.get("wx_lite")):payAmount);
break;
case "支付宝小程序":
payCountVo.setPayAmount(payAmount.add(payCountMap.get("ali_lite")));
payCountVo.setPayAmount(payCountMap.containsKey("ali_lite")?payAmount.add(payCountMap.get("ali_lite")):payAmount);
break;
case "主扫收款":
payCountVo.setPayAmount(payAmount.add(payCountMap.get("scanCode")));
payCountVo.setPayAmount(payCountMap.containsKey("scanCode")?payAmount.add(payCountMap.get("scanCode")):payAmount);
break;
case "收款码收款":
payCountVo.setPayAmount(payAmount.add(payCountMap.get("ALIPAY")).add(payCountMap.get("WECHAT")));
if(payCountMap.containsKey("ALIPAY")){
payAmount = payAmount.add(payCountMap.get("ALIPAY"));
}
if(payCountMap.containsKey("WECHAT")){
payAmount = payAmount.add(payCountMap.get("WECHAT"));
}
payCountVo.setPayAmount(payAmount);
break;
case "现金":
payCountVo.setPayAmount(payAmount.add(payCountMap.get("cash")));
payCountVo.setPayAmount(payCountMap.containsKey("cash")?payAmount.add(payCountMap.get("cash")):payAmount);
break;
case "会员":
payCountVo.setPayAmount(payAmount.add(payCountMap.get("deposit")));
payCountVo.setPayAmount(payCountMap.containsKey("deposit")?payAmount.add(payCountMap.get("deposit")):payAmount);
break;
case "充值":
payCountVo.setPayAmount(payAmount.add(vipSaveAmount));