From 30d56423f862b506e6ea049ebcc095de2562bce9 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期三, 21 十月 2020 10:28:10 +0800
Subject: [PATCH] 优化代码

---
 service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java b/service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java
index a751412..68837c5 100644
--- a/service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java
+++ b/service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java
@@ -177,7 +177,7 @@
         if (count > 0) {
             reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryDeadlineFee(reportFeeMonthStatisticsDto);
 
-            freshReportOweDay(reportFeeMonthStatisticsDtos);
+            freshReportDeadlineDay(reportFeeMonthStatisticsDtos);
         } else {
             reportFeeMonthStatisticsDtos = new ArrayList<>();
         }
@@ -271,6 +271,22 @@
 
         for (ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto : reportFeeMonthStatisticsDtos) {
             try {
+                int day = DateUtil.daysBetween(DateUtil.getDateFromString(reportFeeMonthStatisticsDto.getFeeCreateTime(),
+                        DateUtil.DATE_FORMATE_STRING_A), nowDate);
+                reportFeeMonthStatisticsDto.setOweDay(day);
+            } catch (Exception e) {
+                logger.error("璁$畻娆犺垂澶╂暟澶辫触", e);
+            }
+
+        }
+    }
+
+    private void freshReportDeadlineDay(List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos) {
+
+        Date nowDate = DateUtil.getCurrentDate();
+
+        for (ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto : reportFeeMonthStatisticsDtos) {
+            try {
                 int day = DateUtil.daysBetween(DateUtil.getDateFromString(reportFeeMonthStatisticsDto.getDeadlineTime(),
                         DateUtil.DATE_FORMATE_STRING_A), nowDate);
                 reportFeeMonthStatisticsDto.setOweDay(day);

--
Gitblit v1.8.0