From 900829daab40ea7e29440c9de75592cd58a7562a Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期二, 30 五月 2023 15:52:03 +0800
Subject: [PATCH] optimize

---
 service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeDetailRoomCmd.java |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeDetailRoomCmd.java b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeDetailRoomCmd.java
index b857d29..ea7e77a 100644
--- a/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeDetailRoomCmd.java
+++ b/service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeDetailRoomCmd.java
@@ -19,6 +19,7 @@
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 
+import java.math.BigDecimal;
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.List;
@@ -38,8 +39,6 @@
     @Autowired
     private IBaseDataStatistics baseDataStatisticsImpl;
 
-    @Autowired
-    private IReportFeeMonthStatisticsInnerServiceSMO reportFeeMonthStatisticsInnerServiceSMOImpl;
 
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
@@ -115,15 +114,22 @@
             return datas;
         }
 
+        BigDecimal oweFee = new BigDecimal(0.00);
+        BigDecimal receivedFee = new BigDecimal(0.00);
         for(int dataIndex = 0; dataIndex < datas.size();dataIndex ++){
             data = datas.getJSONObject(dataIndex);
             for(Map info : infos){
                 if(!data.get("roomId").toString().equals(info.get("objId"))){
                     continue;
                 }
+
+                oweFee = oweFee.add(new BigDecimal(info.get("oweFee").toString()));
+                receivedFee = oweFee.add(new BigDecimal(info.get("receivedFee").toString()));
                 data.put("oweFee"+info.get("feeTypeCd").toString(),info.get("oweFee"));
                 data.put("receivedFee"+info.get("feeTypeCd").toString(),info.get("receivedFee"));
             }
+            data.put("oweFee",oweFee.doubleValue());
+            data.put("receivedFee",receivedFee.doubleValue());
         }
 
         return datas;

--
Gitblit v1.8.0