diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/AllOrderInfoMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/AllOrderInfoMapper.java index dc8e25523..ba6f63894 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/AllOrderInfoMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/AllOrderInfoMapper.java @@ -103,4 +103,6 @@ public interface AllOrderInfoMapper extends BaseMapper { // IPage getBlanceANdOrder(Page page, @Param("order") CardValueOrdersDTO allOrderInfo); IPage queryAllByLimit(Page page, @Param("allOrderInfo") AllOrderInfoUniVo allOrderInfo); + + Double getCountMemberBalance(@Param("storeId") Integer storeId,@Param("endTime") String endTime); } \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml index 758524e34..16e3159ef 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml @@ -841,6 +841,16 @@ and date_format(create_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d') + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java index e8c4c2c9f..d3312a1e0 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java @@ -2057,12 +2057,16 @@ public class AllOrderInfoServiceImpl extends ServiceImpl oilNames = new ArrayList<>(); List> oilData = new ArrayList<>(); oilNames.add("油品交易额"); - oilNames.add("会员充值金额"); oilNames.add("非油品交易额"); + oilNames.add("会员充值金额"); oilNames.add("会员消费金额"); + oilNames.add("会员余额"); + + //查询会员余额 for (String time : allDatesBetween) { DateTime dateTime = DateUtil.beginOfDay(DateUtil.parse(time)); DateTime dateTime1 = DateUtil.endOfDay(dateTime); + Double memberBalance = allOrderInfoMapper.getCountMemberBalance(nowAccountInfo.getStoreId(), dateTime1.toString()); Map params = new HashMap<>(); params.put("time", time); List money = new ArrayList<>(); @@ -2070,18 +2074,20 @@ public class AllOrderInfoServiceImpl extends ServiceImpl oilOrder = filterOrders(allOrderInfos, dateTime, dateTime1, "1", null, null); double sum = oilOrder.stream().mapToDouble(AllOrderInfo::getPayMoney).sum(); money.add(sum); - //会员充值金额 - List mtTopUp = filterOrders(allOrderInfos, dateTime, dateTime1, null, "充值", null); - double mtSum = mtTopUp.stream().mapToDouble(AllOrderInfo::getPayMoney).sum(); - money.add(mtSum); //非油品交易额 List otherOrder = filterOrders(allOrderInfos, dateTime, dateTime1, null, null, "2"); double otherSum = otherOrder.stream().mapToDouble(AllOrderInfo::getPayMoney).sum(); money.add(otherSum); + //会员充值金额 + List mtTopUp = filterOrders(allOrderInfos, dateTime, dateTime1, null, "充值", null); + double mtSum = mtTopUp.stream().mapToDouble(AllOrderInfo::getPayMoney).sum(); + money.add(mtSum); //会员消费金额 List userOrder = filterOrders(allOrderInfos, dateTime, dateTime1, null, "订单", null); double userSum = userOrder.stream().mapToDouble(AllOrderInfo::getPayMoney).sum(); money.add(userSum); + //会员余额 + money.add(memberBalance); params.put("money", money); oilData.add(params);