Просмотр исходного кода

添加线下支付金额合计 线下单数 添加 订单 实收金额

xgb 2 недель назад
Родитель
Сommit
3f7f420d3c

+ 10 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -401,6 +401,11 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
     public List<FsStoreOrderVO> selectFsStoreOrderListVO(FsStoreOrderParam param) {
         List<FsStoreOrderVO> list = fsStoreOrderMapper.selectFsStoreOrderListVO(param);
         for (FsStoreOrderVO vo : list) {
+            // 实收金额 线下支付金额 加 线上支付金额
+            BigDecimal payPrice=vo.getPayPrice()==null?BigDecimal.ZERO:vo.getPayPrice();
+            BigDecimal offlinePayAmount=vo.getOfflinePayAmount()==null?BigDecimal.ZERO:vo.getOfflinePayAmount();
+            vo.setTotalPayMoney(payPrice.add(offlinePayAmount));
+
             String nickName = vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2");
             vo.setNickname(nickName);
             if (StringUtils.isNotEmpty(vo.getItemJson())) {
@@ -2543,6 +2548,11 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
                     }
                     vo.setProductNames(sb.toString());
                 }
+
+                // 实收金额 线下支付金额 加 线上支付金额
+                BigDecimal payPrice=vo.getPayPrice()==null?BigDecimal.ZERO:vo.getPayPrice();
+                BigDecimal offlinePayAmount=vo.getOfflinePayAmount()==null?BigDecimal.ZERO:vo.getOfflinePayAmount();
+                vo.setTotalPayMoney(payPrice.add(offlinePayAmount));
             }
         });
 

+ 5 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreOrderCountsVO.java

@@ -21,6 +21,11 @@ public class FsStoreOrderCountsVO {
     //成单金额
     @Excel(name = "成单金额")
     private BigDecimal validAmount;
+    @Excel(name = "线下单数")
+    private Long totalOfflineCalls;
+    // 线下支付总金额
+    @Excel(name = "线下支付金额")
+    private BigDecimal totalOfflineAmount;
     //待审核订单数
     @Excel(name = "待审核订单数")
     private Long waitingOrders;

+ 3 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreOrderExportVO.java

@@ -93,6 +93,9 @@ public class FsStoreOrderExportVO implements Serializable
     @Excel(name = "线下支付金额",cellType= Excel.ColumnType.NUMERIC)
     private BigDecimal offlinePayAmount;
 
+    @Excel(name = "实收金额",cellType= Excel.ColumnType.NUMERIC)
+    private BigDecimal totalPayMoney;
+
 
 //    /** 支付邮费 */
 //    private BigDecimal payPostage;

+ 2 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreOrderVO.java

@@ -252,6 +252,8 @@ public class FsStoreOrderVO implements Serializable
 
     // 线下支付金额
     private BigDecimal offlinePayAmount;
+    // 实收金额 线下加线上金额合计
+    private BigDecimal totalPayMoney;
 
 
 }

+ 4 - 0
fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml

@@ -1019,6 +1019,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <!-- 总金额totalAmount 不包括取消金额和 退款金额 待支付-->
     <!--  待支付-0 待发货-1 待收货-2 交易完成-3 ;退款中-(-1); 已退款-(-2) ;已取消- (-3);  -->
     <!-- 成单金额 = 总金额  审核通过的,没有审核就是支付成功的 -->
+    <!-- totalOfflineAmount 线下支付金额   -->
     <!-- 待审金额 (a.audit_status is null or a.audit_status = 4) null 审核未开启 4 审核成功-->
     <!--  waitingOrders 待审核  -->
     <!--  unPassedOrders 审核未过  -->
@@ -1033,6 +1034,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
         SUM(CASE WHEN o.status IN (1,2,3,-1) and (o.audit_status is null or o.audit_status = 4) THEN o.pay_price ELSE 0 END) AS validAmount,
 
+        sum(case when o.status in (1,2,3,-1) and (o.offline_pay_amount is not null and o.offline_pay_amount > 0 ) then 1 else 0 end) AS  totalOfflineCalls,
+        sum(case when o.status in (1,2,3,-1) and (o.offline_pay_amount is not null and o.offline_pay_amount > 0 ) then o.offline_pay_amount else 0 end) AS totalOfflineAmount,
+
         COUNT(CASE WHEN o.audit_status in (0,2) THEN 1 END) AS waitingOrders,
         SUM(CASE WHEN o.audit_status in (0,2) THEN o.pay_price ELSE 0 END) AS waitingAmount,