From 76088a1a46cbbc05fc92ad8d982b0dcb0da87cb2 Mon Sep 17 00:00:00 2001
From: cgf <2156125618@qq.com>
Date: 星期三, 10 九月 2025 09:58:24 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 service-fee/src/main/java/com/java110/fee/cmd/fee/ReportFeeCmd.java |   91 +++++++++++++++++++++++++++++++++------------
 1 files changed, 67 insertions(+), 24 deletions(-)

diff --git a/service-fee/src/main/java/com/java110/fee/cmd/fee/ReportFeeCmd.java b/service-fee/src/main/java/com/java110/fee/cmd/fee/ReportFeeCmd.java
index 89f8a6f..b146ee4 100644
--- a/service-fee/src/main/java/com/java110/fee/cmd/fee/ReportFeeCmd.java
+++ b/service-fee/src/main/java/com/java110/fee/cmd/fee/ReportFeeCmd.java
@@ -157,6 +157,22 @@
         double[] col4Fee = new double[doYear - 1 + 20];
         double[] colByCar = new double[doYear - 1 + 20];
         double[] colByOther = new double[doYear - 1 + 20];
+
+        LinkedList carFeeList = new LinkedList();
+        FeeDto fee = new FeeDto();
+        fee.setCurYear("鍋滆溅璐瑰悎璁★紙3+...+7锛�");
+        fee.setReport(colByCar);
+        fee.setRow(0);
+        carFeeList.add(fee);
+
+
+        LinkedList otherFeeList = new LinkedList();
+        FeeDto fee2 = new FeeDto();
+        fee2.setCurYear("鍏朵粬绫诲悎璁★紙8+...+22锛�");
+        fee2.setReport(colByOther);
+        fee2.setRow(0);
+        otherFeeList.add(fee2);
+
         reportFeeDtoLists.add(col1);
         reportFeeDtoLists.add(col2);
         reportFeeDtoLists.add(col2);
@@ -168,6 +184,37 @@
             arr[i-startYear] = i;
         }
         List<Map> result = reportFeeInnerServiceSMOImpl.repostPaidInFee(feeQueryParams);
+        List<Map> resultLT = reportFeeInnerServiceSMOImpl.repostPaidInFeeTwo(feeQueryParams);
+        for (Map map : result) {
+            if (map.containsKey("fee_type_cd") && map.get("fee_type_cd").equals("630000007")){
+                for (Map map2 : resultLT) {
+                    if (!map.get("璐圭敤鎵�灞炲勾浠�").equals("绫诲瀷鎬昏") && map2.containsKey("骞翠唤")&&((Long)map2.get("骞翠唤")) == Integer.parseInt((String)map.get("璐圭敤鎵�灞炲勾浠�"))){
+                        map.put("璇ュ勾搴旂即鎬婚",((BigDecimal)map.get("璇ュ勾搴旂即鎬婚")).add((BigDecimal)map2.get("搴旂即閲戦")));
+                        map.put(map2.get("骞翠唤")+"骞村疄缂�", ((BigDecimal)map.get(map2.get("骞翠唤")+"骞村疄缂�")).add((BigDecimal)map2.get("瀹炵即閲戦")));
+                    }
+                    if (!map.get("璐圭敤鎵�灞炲勾浠�").equals("绫诲瀷鎬昏") && (Long)map2.get("骞翠唤") == currentYear && map2.containsKey("鏈堜唤") && Integer.parseInt((String) map.get("璐圭敤鎵�灞炲勾浠�")) == currentYear){
+                        Long month = (Long)map2.get("鏈堜唤");
+                        map.put("褰撳勾"+(month > 9 ? month : "0" + month)+"鏈堝疄缂�",((BigDecimal)map.get("褰撳勾"+(month > 9 ? month : "0" + month)+"鏈堝疄缂�")).add((BigDecimal) map2.get("瀹炵即閲戦")));
+                    }
+
+                    if (map.get("璐圭敤鎵�灞炲勾浠�").equals("绫诲瀷鎬昏") && map2.containsKey("骞翠唤")){
+                        map.put("璇ュ勾搴旂即鎬婚",((BigDecimal)map.get("璇ュ勾搴旂即鎬婚")).add((BigDecimal)map2.get("搴旂即閲戦")));
+                        map.put(map2.get("骞翠唤")+"骞村疄缂�", ((BigDecimal)map.get(map2.get("骞翠唤")+"骞村疄缂�")).add((BigDecimal)map2.get("瀹炵即閲戦")));
+                    }
+                    if (map.get("璐圭敤鎵�灞炲勾浠�").equals("绫诲瀷鎬昏") && (Long)map2.get("骞翠唤") == currentYear && map2.containsKey("鏈堜唤")){
+                        Long month = (Long)map2.get("鏈堜唤");
+                        map.put("褰撳勾"+(month > 9 ? month : "0" + month)+"鏈堝疄缂�",((BigDecimal)map.get("褰撳勾"+(month > 9 ? month : "0" + month)+"鏈堝疄缂�")).add((BigDecimal) map2.get("瀹炵即閲戦")));
+                    }
+                }
+                BigDecimal allPayable = new BigDecimal(0);
+                for (int a : arr){
+                    BigDecimal bigDecimal = (BigDecimal) map.get(a+"骞村疄缂�");
+                    allPayable=allPayable.add(bigDecimal);
+                }
+                map.put("姣忔湀璐圭敤", new BigDecimal(((BigDecimal) map.get("璇ュ勾搴旂即鎬婚")).doubleValue() / ((Long) map.get("搴旀敹鏈堜唤鏁�"))));
+                map.put("褰撳勾鏀剁即鐜�", new BigDecimal(allPayable.doubleValue() / ((BigDecimal) map.get("璇ュ勾搴旂即鎬婚")).doubleValue() * 100));
+            }
+        }
         DictDto dictDto = new DictDto();
         dictDto.setTableName("pay_fee_config");
         dictDto.setTableColumns("fee_type_cd");
@@ -205,12 +252,12 @@
                         for(int i = 0 ; i < doubles.length ; i++){
                             if(i == 3){
                                 if (doubles[i] != 0){
-                                    col1Fee[i] = (doubles[i]+col1Fee[i])/2;
-                                    col2Fee[i] = (doubles[i]+col2Fee[i])/2;
+                                    col1Fee[i] = doubleUse((doubles[i]+col1Fee[i])/2);
+                                    col2Fee[i] = doubleUse((doubles[i]+col2Fee[i])/2);
                                 }
                             }else{
                                 col1Fee[i] = doubleUse(doubles[i]+col1Fee[i]);
-                                col2Fee[i] = doubleUse(doubles[i]+col1Fee[i]);
+                                col2Fee[i] = doubleUse(doubles[i]+col2Fee[i]);
                             }
                         }
                     }
@@ -218,24 +265,24 @@
                         for(int i = 0 ; i < doubles.length ; i++){
                             if(i == 3){
                                 if (doubles[i] != 0){
-                                    col1Fee[i] = (doubles[i]+col1Fee[i])/2;
-//                                    col2Fee[i] = (doubles[i]+col2Fee[i])/2;
+                                    col1Fee[i] = doubleUse((doubles[i]+col1Fee[i])/2);
+                                    colByCar[i] = doubleUse((doubles[i]+colByCar[i])/2);
                                 }
                             }else{
                                 col1Fee[i] = doubleUse(doubles[i]+col1Fee[i]);
-//                                col2Fee[i] += doubleUse(doubles[i]);
+                                colByCar[i] = doubleUse(colByCar[i] + doubles[i]);
                             }
                         }
                     }else{
                         for(int i = 0 ; i < doubles.length ; i++){
                             if(i == 3){
                                 if (doubles[i] != 0){
-                                    col1Fee[i] = (doubles[i]+col1Fee[i])/2;
-//                                    col2Fee[i] = (doubles[i]+col2Fee[i])/2;
+                                    col1Fee[i] = doubleUse((doubles[i]+col1Fee[i])/2);
+                                    colByOther[i] = doubleUse((doubles[i]+colByOther[i])/2);
                                 }
                             }else{
                                 col1Fee[i] = doubleUse(doubles[i]+col1Fee[i]);
-//                                col2Fee[i] += doubleUse(doubles[i]);
+                                colByOther[i] = doubleUse(colByOther[i] + doubles[i]);
                             }
                         }
                     }
@@ -265,15 +312,15 @@
                     if(map.get("璐圭敤鎵�灞炲勾浠�").equals(i+"") && map.get("fee_type_cd").equals(dictDto1.getStatusCd())){
                         double[] doubles = new double[doYear - 1 + 20];
                         doubles[0] = doubleUse(((BigDecimal) map.get("璇ュ勾搴旂即鎬婚")).doubleValue());
-                        doubles[1] = doubleUse(((BigDecimal) map.get("姣忔湀璐圭敤")).doubleValue());
+                        doubles[1] = map.get("姣忔湀璐圭敤") == null ? 0 : doubleUse(((BigDecimal) map.get("姣忔湀璐圭敤")).doubleValue());
                         doubles[2] = doubleUse(((Long) map.get("搴旀敹鏈堜唤鏁�")).doubleValue());
                         doubles[3] = doubleUse(((BigDecimal) map.get("褰撳勾鏀剁即鐜�")).doubleValue());
                         doubles[4] = doubleUse(((BigDecimal) map.get("鎶樻墸閲戦")).doubleValue());
                         int inde = 0;
                         for (int in : arr){
-                            if(in < currentYear && (in+"").equals(map.get("璐圭敤鎵�灞炲勾浠�"))){
+                            if(in < currentYear && !(map.get("璐圭敤鎵�灞炲勾浠�").equals("绫诲瀷鎬昏"))){
                                 inde++;
-                                doubles[in - startYear + 5] = doubleUse(((BigDecimal) map.get(i + "骞村疄缂�")).doubleValue());
+                                doubles[in - startYear + 5] = doubleUse(((BigDecimal) map.get(in + "骞村疄缂�")).doubleValue());
                             }
                         }
                         doubles[inde + 5] =doubleUse(((BigDecimal) map.get("褰撳勾棰勭畻")).doubleValue());
@@ -318,20 +365,16 @@
                 reportFeeDtoLists.add(linkedList);
             }
             if (ind == 3){
-                LinkedList linkedList = new LinkedList();
-                FeeDto feeDto1 = new FeeDto();
-                feeDto1.setCurYear("鍋滆溅璐瑰悎璁★紙3+...+7锛�");
-                feeDto1.setReport(colByCar);
-                linkedList.add(feeDto1);
-                reportFeeDtoLists.add(linkedList);
+//                fee.setCurYear("鍋滆溅璐瑰悎璁★紙3+...+7锛�");
+//                fee.setReport(colByCar);
+//                carFeeList.add(fee);
+                reportFeeDtoLists.add(carFeeList);
             }
             if (ind == 8){
-                LinkedList linkedList = new LinkedList();
-                FeeDto feeDto1 = new FeeDto();
-                feeDto1.setCurYear("鍏朵粬绫诲悎璁★紙8+...+22锛�");
-                feeDto1.setReport(colByOther);
-                linkedList.add(feeDto1);
-                reportFeeDtoLists.add(linkedList);
+//                fee2.setCurYear("鍏朵粬绫诲悎璁★紙8+...+22锛�");
+//                fee2.setReport(colByOther);
+//                otherFeeList.add(fee2);
+                reportFeeDtoLists.add(otherFeeList);
             }
             ind ++;
         }

--
Gitblit v1.8.0