Kaynağa Gözat

BugId-971:中台商户金额信息修改

zc 1 ay önce
ebeveyn
işleme
7dc86ca36d

+ 1 - 1
alien-entity/src/main/resources/mapper/ManagementInfoMapper.xml

@@ -152,7 +152,7 @@
                 END AS type_name,
             coupon.`name`,
             "1" AS buy_count,
-            ROUND(userOrder.price / 100,2) AS buy_amount,
+            ROUND(userOrder.price ,2) AS buy_amount,
             userOrder.buy_time AS buy_time,
             userOrder.used_time AS used_time,
             userOrder.refund_time AS refund_time,

+ 28 - 6
alien-store/src/main/java/shop/alien/store/service/impl/ManagementInfoServiceImpl.java

@@ -215,10 +215,21 @@ public class ManagementInfoServiceImpl implements ManagementInfoService {
 
     @Override
     public HashMap<String, Object> storeDetailBillingStatistics(String storeId) {
+        int freeze = 0;
+        //查询冻结配置
+        SystemConfigVo systemConfigVo = storeDictService.getConfig("freeze");
+        if(systemConfigVo != null){
+            String freezeFlag = systemConfigVo.getConfigValue1();
+            String freezeDay =  systemConfigVo.getConfigValue2();
+            if(StringUtils.isNotBlank(freezeFlag) && freezeFlag.equals("1") && StringUtils.isNotBlank(freezeDay)){
+                freeze = Integer.parseInt(freezeDay);
+            }
+        }
+
         // 获取当前日期
         LocalDate currentDate = LocalDate.now();
         // 计算三天前的日期
-        LocalDate threeDaysAgo = currentDate.minusDays(3);
+        LocalDate threeDaysAgo = currentDate.minusDays(freeze);
         // 设置时间为当天的 0 点
         LocalDateTime threeDaysAgoMidnight = threeDaysAgo.atStartOfDay();
 
@@ -243,11 +254,15 @@ public class ManagementInfoServiceImpl implements ManagementInfoService {
                                 .eq(StoreIncomeDetailsRecord::getStoreId, storeId)
                 );
         Double storeIncomeDetailsCount = 0d;
+        Double storeIncomeDetailsNoCashCount = 0d;
+
         for (StoreIncomeDetailsRecord storeIncomeDetailsRecord : storeIncomeDetailsRecords) {
+            if(storeIncomeDetailsRecord.getCashOutId() == null || storeIncomeDetailsRecord.getCashOutId() == 0){
+                storeIncomeDetailsNoCashCount += storeIncomeDetailsRecord.getMoney();
+            }
             storeIncomeDetailsCount += storeIncomeDetailsRecord.getMoney();
         }
 
-
         //存入已付款金额
         result.put("allOrderAmount", allOrderAmount.getAllOrderAmount());
         //存入总交易金额
@@ -256,15 +271,22 @@ public class ManagementInfoServiceImpl implements ManagementInfoService {
         result.put("orderTransactionNumber", orderTransactionNumber.getOrderTransactionNumber());
         //存入核验金额
         result.put("verificationAmount", verificationAmount.getVerificationAmount());
-
         //已提现金额
         result.put("totalWithdrawalAmount", totalWithdrawalAmount.getTotalWithdrawalAmount());
 
         //冻结金额
-        result.put("freezeAmounts", storeIncomeDetailsCount);
+        if(freeze == 0){
+            //冻结金额
+            result.put("freezeAmounts", 0);
+            //冻结待提现金额
+            result.put("unwithdrawnAmountsFrozen", 0);
+        } else {
+            //冻结金额
+            result.put("freezeAmounts", storeIncomeDetailsCount);
+            //冻结待提现金额
+            result.put("unwithdrawnAmountsFrozen", storeIncomeDetailsNoCashCount);
 
-        //冻结待提现金额
-        result.put("unwithdrawnAmountsFrozen", storeIncomeDetailsCount);
+        }
         return result;
     }