From ce64e667815b39efdc2f8bd52be0d43d49db8d84 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期日, 17 七月 2022 00:06:29 +0800
Subject: [PATCH] 优化小区位置

---
 service-report/src/main/java/com/java110/report/smo/impl/GeneratorOweFeeInnerServiceSMOImpl.java |   42 +++++++++++++++++++++++++++++++++++-------
 1 files changed, 35 insertions(+), 7 deletions(-)

diff --git a/service-report/src/main/java/com/java110/report/smo/impl/GeneratorOweFeeInnerServiceSMOImpl.java b/service-report/src/main/java/com/java110/report/smo/impl/GeneratorOweFeeInnerServiceSMOImpl.java
index b925f6e..9ffd407 100644
--- a/service-report/src/main/java/com/java110/report/smo/impl/GeneratorOweFeeInnerServiceSMOImpl.java
+++ b/service-report/src/main/java/com/java110/report/smo/impl/GeneratorOweFeeInnerServiceSMOImpl.java
@@ -21,17 +21,16 @@
 import com.java110.report.dao.IReportFeeYearCollectionServiceDao;
 import com.java110.report.dao.IReportOweFeeServiceDao;
 import com.java110.service.smo.ISaveSystemErrorSMO;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.BeanConvertUtil;
-import com.java110.utils.util.DateUtil;
-import com.java110.utils.util.ExceptionUtil;
+import com.java110.utils.util.*;
 import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import com.java110.core.log.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -89,7 +88,7 @@
 //        List<CommunityDto> communityDtos = BeanConvertUtil.covertBeanList(
 //                reportCommunityServiceDaoImpl.getCommunitys(BeanConvertUtil.beanCovertMap(communityDto)), CommunityDto.class);
 
-        List<CommunityDto> communityDtos =communityInnerServiceSMOImpl.queryCommunitys(communityDto);
+        List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
 
         for (CommunityDto tmpCommunityDto : communityDtos) {
             reportFeeMonthStatisticsPo.setCommunityId(tmpCommunityDto.getCommunityId());
@@ -103,6 +102,9 @@
         String communityId = reportFeeMonthStatisticsPo.getCommunityId();
 
         Assert.hasLength(communityId, "鏈寘鍚皬鍖轰俊鎭�");
+
+        //
+        feeDataFiltering(communityId);
 
         //鏌ヨ璐圭敤椤�
         FeeConfigDto feeConfigDto = new FeeConfigDto();
@@ -125,6 +127,32 @@
         }
 
     }
+    private void feeDataFiltering(String communityId) {
+
+        Map reportFeeDto = new HashMap();
+        reportFeeDto.put("communityId", communityId);
+        List<Map> feeDtos = reportOweFeeServiceDaoImpl.queryInvalidOweFee(reportFeeDto);
+
+        List<String> feeIds = new ArrayList<>();
+        for (Map feeDto : feeDtos) {
+            if (!feeDto.containsKey("feeId") || StringUtil.isNullOrNone(feeDto.get("feeId"))) {
+                continue;
+            }
+
+            feeIds.add(feeDto.get("feeId").toString());
+
+            if (feeIds.size() >= 50) {
+                reportFeeDto.put("feeIds", feeIds);
+                reportOweFeeServiceDaoImpl.deleteInvalidFee(reportFeeDto);
+                feeIds = new ArrayList<>();
+            }
+        }
+        reportFeeDto.put("feeIds", feeIds);
+        if (feeIds.size() > 0) {
+            reportOweFeeServiceDaoImpl.deleteInvalidFee(reportFeeDto);
+        }
+    }
+
 
     /**
      * 鎸夎垂鐢ㄩ」鏉ュ嚭璐�
@@ -141,7 +169,7 @@
         List<ReportFeeDto> feeDtos = reportFeeServiceDaoImpl.getFees(feeDto);
 
         //娌℃湁鍏宠仈璐圭敤
-        if (feeDto == null || feeDtos.size() < 1) {
+        if (feeDtos == null || feeDtos.size() < 1) {
             return;
         }
         for (ReportFeeDto tmpFeeDto : feeDtos) {

--
Gitblit v1.8.0