Ver Fonte

feature:营养餐对账

wuyongyi há 2 anos atrás
pai
commit
d43919145f
1 ficheiros alterados com 3 adições e 101 exclusões
  1. 3 101
      src/main/java/com/ywt/mg/services/MealOrderService.java

+ 3 - 101
src/main/java/com/ywt/mg/services/MealOrderService.java

@@ -879,19 +879,19 @@ public class MealOrderService {
         customExcelItemList.add(new CustomExcelItem(startColumn + 1, startRows, "支付总额", null));
         customExcelItemList.add(new CustomExcelItem(startColumn + 2, startRows,
                 FormatUtil.intShrink100ToStr(orders.stream()
-                        .mapToInt(v -> Checker.getIntegerValue(v.getOrderAmount()))
+                        .mapToInt(v -> Checker.getIntegerValue(v.getWechatPayAmount()))
                         .sum()), null));
         customExcelItemList.add(new CustomExcelItem(startColumn + 3, startRows, "退款总额", null));
         customExcelItemList.add(new CustomExcelItem(startColumn + 4, startRows,
                 FormatUtil.intShrink100ToStr(orders.stream()
                         .filter(v -> RefundStatusEnum.SUCCESS.getValue() == Checker.getIntegerValue(v.getRefundStatus()))
-                        .mapToInt(v -> Checker.getIntegerValue(v.getOrderAmount()))
+                        .mapToInt(v -> Checker.getIntegerValue(v.getWechatPayAmount()))
                         .sum()), null));
         customExcelItemList.add(new CustomExcelItem(startColumn + 5, startRows, "实际支付总额", null));
         customExcelItemList.add(new CustomExcelItem(startColumn + 6, startRows,
                 FormatUtil.intShrink100ToStr(orders.stream()
                         .filter(v -> RefundStatusEnum.SUCCESS.getValue() != Checker.getIntegerValue(v.getRefundStatus()))
-                        .mapToInt(v -> Checker.getIntegerValue(v.getOrderAmount()))
+                        .mapToInt(v -> Checker.getIntegerValue(v.getWechatPayAmount()))
                         .sum()), null));
 //        customExcelItemList.add(new CustomExcelItem(startColumn + 7, startRows, "总成本", null));
 //        customExcelItemList.add(new CustomExcelItem(startColumn + 8, startRows, allCost, null));
@@ -918,104 +918,6 @@ public class MealOrderService {
 //        customExcelItemList.add(new CustomExcelItem(startColumn + 8, startRows, wechatSinglePointCost, null));
         startRows += 1;
         // 金币支付
-        customExcelItemList.add(new CustomExcelItem(startColumn + 1, startRows, "金币支付总额", null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 2, startRows,
-                FormatUtil.intShrink100ToStr(orders.stream()
-                        .mapToInt(v -> Checker.getIntegerValue(v.getCoinPayAmount()))
-                        .sum()), null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 3, startRows, "金币退款总额", null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 4, startRows,
-                FormatUtil.intShrink100ToStr(orders.stream()
-                        .filter(v -> RefundStatusEnum.SUCCESS.getValue() == Checker.getIntegerValue(v.getRefundStatus()))
-                        .mapToInt(v -> Checker.getIntegerValue(v.getCoinPayAmount()))
-                        .sum()), null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 5, startRows, "金币实际支付总额", null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 6, startRows,
-                FormatUtil.intShrink100ToStr(orders.stream()
-                        .filter(v -> RefundStatusEnum.SUCCESS.getValue() != Checker.getIntegerValue(v.getRefundStatus()))
-                        .mapToInt(v -> Checker.getIntegerValue(v.getCoinPayAmount()))
-                        .sum()), null));
-//        customExcelItemList.add(new CustomExcelItem(startColumn + 7, startRows, "金币点单成本", null));
-//        customExcelItemList.add(new CustomExcelItem(startColumn + 8, startRows, coinSinglePointCost, null));
-        startRows += 1;
-        // 现场支付
-        customExcelItemList.add(new CustomExcelItem(startColumn + 1, startRows, "现场支付总额", null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 2, startRows,
-                FormatUtil.intShrink100ToStr(orders.stream()
-                        .mapToInt(v -> Checker.getIntegerValue(v.getF2fPayAmount()))
-                        .sum()), null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 3, startRows, "现场退款总额", null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 4, startRows,
-                FormatUtil.intShrink100ToStr(orders.stream()
-                        .filter(v -> RefundStatusEnum.SUCCESS.getValue() == Checker.getIntegerValue(v.getRefundStatus()))
-                        .mapToInt(v -> Checker.getIntegerValue(v.getF2fPayAmount()))
-                        .sum()), null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 5, startRows, "现场实际支付总额", null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 6, startRows,
-                FormatUtil.intShrink100ToStr(orders.stream()
-                        .filter(v -> RefundStatusEnum.SUCCESS.getValue() != Checker.getIntegerValue(v.getRefundStatus()))
-                        .mapToInt(v -> Checker.getIntegerValue(v.getF2fPayAmount()))
-                        .sum()), null));
-//        customExcelItemList.add(new CustomExcelItem(startColumn + 7, startRows, "现场点单成本", null));
-//        customExcelItemList.add(new CustomExcelItem(startColumn + 8, startRows, p2fSinglePointCost, null));
-        startRows += 1;
-        // 洗碗费
-        // 目前只计算有金币支付的订单,不包括纯微信支付及现场支付订单。计算的规则是符合条件的订单的微信支付金额总和。
-        // 等同这个 SQL 语句:
-        // select sum(wechat_pay_amount) from nutrimeal.meal_order where deleted = 0 and pay_type = 4 and (refund_status is null or refund_status != 1) and wechat_pay_amount is not null ;
-        customExcelItemList.add(new CustomExcelItem(startColumn + 1, startRows, "2元洗碗费总额", null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 2, startRows,
-                FormatUtil.intShrink100ToStr(orders.stream()
-                        .filter(v -> OrderPayTypeEnum.COIN.getValue() == Checker.getIntegerValue(v.getPayType()) &&
-                                RefundStatusEnum.SUCCESS.getValue() != Checker.getIntegerValue(v.getRefundStatus()))
-                        .mapToInt(v -> Checker.getIntegerValue(v.getWechatPayAmount()))
-                        .sum()), null));
-        startRows += 2;
-        // v1.3.1_nfyybyfy 新增职工统计
-        // 职工支付
-        customExcelItemList.add(new CustomExcelItem(startColumn + 1, startRows, "职工支付总额", null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 2, startRows,
-                FormatUtil.intShrink100ToStr(orders.stream()
-                        .filter(v -> Checker.getIntegerValue(v.getStaffId()) > 0)
-                        .mapToInt(v -> Checker.getIntegerValue(v.getOrderAmount()))
-                        .sum()), null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 3, startRows, "退款总额", null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 4, startRows,
-                FormatUtil.intShrink100ToStr(orders.stream()
-                        .filter(v -> Checker.getIntegerValue(v.getStaffId()) > 0)
-                        .filter(v -> RefundStatusEnum.SUCCESS.getValue() == Checker.getIntegerValue(v.getRefundStatus()))
-                        .mapToInt(v -> Checker.getIntegerValue(v.getOrderAmount()))
-                        .sum()), null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 5, startRows, "实际支付总额", null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 6, startRows,
-                FormatUtil.intShrink100ToStr(orders.stream()
-                        .filter(v -> Checker.getIntegerValue(v.getStaffId()) > 0)
-                        .filter(v -> RefundStatusEnum.SUCCESS.getValue() != Checker.getIntegerValue(v.getRefundStatus()))
-                        .mapToInt(v -> Checker.getIntegerValue(v.getOrderAmount()))
-                        .sum()), null));
-        startRows += 1;
-        // 非职工支付
-        customExcelItemList.add(new CustomExcelItem(startColumn + 1, startRows, "非职工支付总额", null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 2, startRows,
-                FormatUtil.intShrink100ToStr(orders.stream()
-                        .filter(v -> Checker.getIntegerValue(v.getStaffId()) <= 0)
-                        .mapToInt(v -> Checker.getIntegerValue(v.getOrderAmount()))
-                        .sum()), null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 3, startRows, "退款总额", null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 4, startRows,
-                FormatUtil.intShrink100ToStr(orders.stream()
-                        .filter(v -> Checker.getIntegerValue(v.getStaffId()) <= 0)
-                        .filter(v -> RefundStatusEnum.SUCCESS.getValue() == Checker.getIntegerValue(v.getRefundStatus()))
-                        .mapToInt(v -> Checker.getIntegerValue(v.getOrderAmount()))
-                        .sum()), null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 5, startRows, "实际支付总额", null));
-        customExcelItemList.add(new CustomExcelItem(startColumn + 6, startRows,
-                FormatUtil.intShrink100ToStr(orders.stream()
-                        .filter(v -> Checker.getIntegerValue(v.getStaffId()) <= 0)
-                        .filter(v -> RefundStatusEnum.SUCCESS.getValue() != Checker.getIntegerValue(v.getRefundStatus()))
-                        .mapToInt(v -> Checker.getIntegerValue(v.getOrderAmount()))
-                        .sum()), null));
-        startRows += 2;
 
 
         return customExcelItemList;