From aab1ad64e309fa904cc9cbeba4d76b533a5b6c71 Mon Sep 17 00:00:00 2001
From: chengf <cgf12138@163.com>
Date: 星期三, 20 八月 2025 16:46:28 +0800
Subject: [PATCH] 暂存0820

---
 service-fee/src/main/java/com/java110/fee/cmd/fee/ReportFeeCmd.java |   89 ++++++++++++++++++++++++++++++++------------
 1 files changed, 64 insertions(+), 25 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 7deda69..bd845be 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
@@ -8,12 +8,14 @@
 import com.java110.dto.community.CommunityDto;
 import com.java110.dto.dict.DictDto;
 import com.java110.dto.fee.FeeDto;
+import com.java110.dto.report.ReportQueryRecord;
 import com.java110.intf.community.ICommunityInnerServiceSMO;
 import com.java110.intf.dev.IDictV1InnerServiceSMO;
 import com.java110.intf.fee.IReportFeeInnerServiceSMO;
 import com.java110.po.fee.PayFeePo;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
 import com.java110.vo.FeeQueryParams;
 import com.java110.vo.ResultVo;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -53,25 +55,72 @@
         int currentYear = java.time.Year.now().getValue();
         feeQueryParams.setEndYear(currentYear + 2);
         int endYear = feeQueryParams.getEndYear();
-
-        List<Map> result = reportFeeInnerServiceSMOImpl.repostPaidInFee(feeQueryParams);
-        DictDto dictDto = new DictDto();
-        dictDto.setTableName("pay_fee_config");
-        dictDto.setTableColumns("fee_type_cd");
-        List<DictDto> dictDtos = dictV1InnerServiceSMOImpl.queryDicts(dictDto);
         int doYear = endYear - startYear;
+
+
+        ReportQueryRecord reportQueryRecord = new ReportQueryRecord();
+        reportQueryRecord.setCommunityId(reqJson.getString("communityId"));
+        reportQueryRecord.setQueryStatus("0");
+        reportQueryRecord.setEndYear(currentYear+"");
+        List<ReportQueryRecord> reportQueryRecords = reportFeeInnerServiceSMOImpl.queryReport(BeanConvertUtil.beanCovertMap(reportQueryRecord));
+
+        if(reportQueryRecords.size()>0){
+
+        }
+
         List<List<FeeDto>> reportFeeDtoLists = new LinkedList<>();
-        reportFeeDtoLists.add(new LinkedList<FeeDto>());
-        reportFeeDtoLists.add(new LinkedList<FeeDto>());
-        reportFeeDtoLists.add(new LinkedList<FeeDto>());
-        reportFeeDtoLists.add(new LinkedList<FeeDto>());
-        int ind = 1;
+        queryFee(reportFeeDtoLists ,reqJson);
 
         int[] arr = new int[endYear - startYear + 1];
         for (int i = startYear; i <= endYear; i++) {
             arr[i-startYear] = i;
         }
 
+        FeeDto feeDto = new FeeDto();
+        feeDto.setRepostList(reportFeeDtoLists);
+        feeDto.setYearArr(arr);
+        feeDto.setLength(doYear - 1 + 20);
+
+        reportQueryRecord.setCommunityId(reqJson.getString("communityId"));
+        reportQueryRecord.setQueryStatus("0");
+        reportQueryRecord.setEndYear(currentYear+"");
+        reportQueryRecord.setReportContent(JSONObject.toJSONString(feeDto));
+
+        int i = reportFeeInnerServiceSMOImpl.saveReport(BeanConvertUtil.beanCovertMap(reportQueryRecord));
+
+        ResultVo resultVo = new ResultVo(feeDto);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        context.setResponseEntity(responseEntity);
+    }
+    public void queryFee(List<List<FeeDto>> reportFeeDtoLists, JSONObject reqJson) {
+        int startYear = 2020;
+        CommunityDto communityDto = new CommunityDto();
+        communityDto.setCommunityId(reqJson.getString("communityId"));
+        List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
+        FeeQueryParams feeQueryParams = new FeeQueryParams();
+        feeQueryParams.setCommunityId(reqJson.getString("communityId"));
+        feeQueryParams.setStartYear(startYear);
+        int currentYear = java.time.Year.now().getValue();
+        feeQueryParams.setEndYear(currentYear + 2);
+        int endYear = feeQueryParams.getEndYear();
+        reportFeeDtoLists.add(new LinkedList<FeeDto>());
+        reportFeeDtoLists.add(new LinkedList<FeeDto>());
+        reportFeeDtoLists.add(new LinkedList<FeeDto>());
+        reportFeeDtoLists.add(new LinkedList<FeeDto>());
+        int ind = 1;
+        int doYear = endYear - startYear;
+
+        int[] arr = new int[endYear - startYear + 1];
+        for (int i = startYear; i <= endYear; i++) {
+            arr[i-startYear] = i;
+        }
+        List<Map> result = reportFeeInnerServiceSMOImpl.repostPaidInFee(feeQueryParams);
+        DictDto dictDto = new DictDto();
+        dictDto.setTableName("pay_fee_config");
+        dictDto.setTableColumns("fee_type_cd");
+        List<DictDto> dictDtos = dictV1InnerServiceSMOImpl.queryDicts(dictDto);
         for (DictDto dictDto1 : dictDtos) {//绫诲瀷
             List<FeeDto> reportFeeDtos = new LinkedList<>();//璇ョ被鍨嬬殑鏁扮粍
             FeeDto feeDto = new FeeDto();
@@ -83,7 +132,7 @@
                     doubles[0] = ((BigDecimal) map.get("璇ュ勾搴旂即鎬婚")).doubleValue();
                     doubles[1] = ((BigDecimal) map.get("姣忔湀璐圭敤")).doubleValue();
                     doubles[2] = ((Long) map.get("搴旀敹鏈堜唤鏁�")).doubleValue();
-                    doubles[3] = ((BigDecimal) map.get("褰撳勾鏀剁即鐜�(%)")).doubleValue();
+                    doubles[3] = ((BigDecimal) map.get("褰撳勾鏀剁即鐜�")).doubleValue();
                     doubles[4] = ((BigDecimal) map.get("鎶樻墸閲戦")).doubleValue();
                     int inde = 0;
                     for (int i : arr){
@@ -98,7 +147,7 @@
                     doubles[inde + 8] =((BigDecimal) map.get("褰撳勾娆犳")).doubleValue();
 
                     for (int i = 1 ; i <= 12 ; i++){
-                        doubles[inde + 8 + i] =((BigDecimal) map.get("褰撳勾"+i+"鏈堝疄缂�")).doubleValue();
+                        doubles[inde + 8 + i] =((BigDecimal) map.get("褰撳勾"+(i < 10 ? "0"+i : i) +"鏈堝疄缂�")).doubleValue();
                     }
                     feeDto.setCurYear(dictDto1.getName()+"鎬昏");
                     feeDto.setReport(doubles);
@@ -129,7 +178,7 @@
                         doubles[0] = ((BigDecimal) map.get("璇ュ勾搴旂即鎬婚")).doubleValue();
                         doubles[1] = ((BigDecimal) map.get("姣忔湀璐圭敤")).doubleValue();
                         doubles[2] = ((Long) map.get("搴旀敹鏈堜唤鏁�")).doubleValue();
-                        doubles[3] = ((BigDecimal) map.get("褰撳勾鏀剁即鐜�(%)")).doubleValue();
+                        doubles[3] = ((BigDecimal) map.get("褰撳勾鏀剁即鐜�")).doubleValue();
                         doubles[4] = ((BigDecimal) map.get("鎶樻墸閲戦")).doubleValue();
                         int inde = 0;
                         for (int in : arr){
@@ -144,7 +193,7 @@
                         doubles[inde + 8] =((BigDecimal) map.get("褰撳勾娆犳")).doubleValue();
 
                         for (int in = 1 ; in <= 12 ; in++){
-                            doubles[inde + 8 + in] =((BigDecimal) map.get("褰撳勾"+in+"鏈堝疄缂�")).doubleValue();
+                            doubles[inde + 8 + in] =((BigDecimal) map.get("褰撳勾"+(in < 10 ? "0"+in : in) +"鏈堝疄缂�")).doubleValue();
                         }
                         feeDto = new FeeDto();
                         feeDto.setFeeTypeCdName(dictDto1.getName());
@@ -195,15 +244,5 @@
             }
             ind ++;
         }
-        FeeDto feeDto = new FeeDto();
-        feeDto.setRepostList(reportFeeDtoLists);
-        feeDto.setYearArr(arr);
-        feeDto.setLength(String.valueOf(doYear+12+1+5+4));
-
-        ResultVo resultVo = new ResultVo(feeDto);
-
-        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
-
-        context.setResponseEntity(responseEntity);
     }
 }

--
Gitblit v1.8.0