From ba1c0ad6cffaa8a6288a4e66d0598d16f1cccc10 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期三, 13 十月 2021 11:00:35 +0800
Subject: [PATCH] 优化代码

---
 service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java b/service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java
index bb79343..c9d28e5 100755
--- a/service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java
+++ b/service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java
@@ -208,7 +208,7 @@
             try {
                 doDealCarFee(tmpReportCarDto, tmpReportFeeDto);
             } catch (Exception e) {
-                logger.error("澶勭悊鎴垮眿璐圭敤澶辫触" + JSONObject.toJSONString(tmpReportFeeDto), e);
+                logger.error("澶勭悊杞﹁締璐圭敤澶辫触" + JSONObject.toJSONString(tmpReportFeeDto), e);
             }
         }
     }
@@ -224,7 +224,7 @@
         reportFeeMonthStatisticsDto.setCommunityId(tmpReportCarDto.getCommunityId());
         reportFeeMonthStatisticsDto.setConfigId(tmpReportFeeDto.getConfigId());
         reportFeeMonthStatisticsDto.setObjId(tmpReportFeeDto.getPayerObjId());
-        reportFeeMonthStatisticsDto.setFeeId(tmpReportFeeDto.getFeeId());
+        //reportFeeMonthStatisticsDto.setFeeId(tmpReportFeeDto.getFeeId());
         reportFeeMonthStatisticsDto.setObjType(tmpReportFeeDto.getPayerObjType());
         reportFeeMonthStatisticsDto.setFeeYear(DateUtil.getYear() + "");
         reportFeeMonthStatisticsDto.setFeeMonth(DateUtil.getMonth() + "");
@@ -267,6 +267,7 @@
             reportFeeMonthStatisticsPo.setFeeId(tmpReportFeeDto.getFeeId());
             reportFeeMonthStatisticsPo.setFeeMonth(DateUtil.getMonth() + "");
             reportFeeMonthStatisticsPo.setFeeYear(DateUtil.getYear() + "");
+            reportFeeMonthStatisticsPo.setCurMaxTime(DateUtil.getNextMonthFirstDay(DateUtil.DATE_FORMATE_STRING_A));
             reportFeeMonthStatisticsPo.setObjId(tmpReportCarDto.getCarId());
             reportFeeMonthStatisticsPo.setObjType(FeeDto.PAYER_OBJ_TYPE_CAR);
             reportFeeMonthStatisticsPo.setFeeName(tmpReportFeeDto.getFeeName());
@@ -285,8 +286,7 @@
 
         ReportFeeMonthStatisticsPo tmpReportFeeMonthStatisticsPo = new ReportFeeMonthStatisticsPo();
         tmpReportFeeMonthStatisticsPo.setFeeId(tmpReportFeeDto.getFeeId());
-        tmpReportFeeMonthStatisticsPo.setFeeYear(year + "");
-        tmpReportFeeMonthStatisticsPo.setFeeMonth(month + "");
+        tmpReportFeeMonthStatisticsPo.setCurMaxTime(DateUtil.getFormatTimeString(endTime,DateUtil.DATE_FORMATE_STRING_A));
         tmpReportFeeMonthStatisticsPo.setOweAmount("0");
         reportFeeMonthStatisticsServiceDaoImpl.updateReportFeeMonthStatisticsOwe(BeanConvertUtil.beanCovertMap(tmpReportFeeMonthStatisticsPo));
     }
@@ -357,6 +357,7 @@
         reportFeeMonthStatisticsPo.setFeeId(tmpReportFeeDto.getFeeId());
         reportFeeMonthStatisticsPo.setFeeMonth((preMonthDate.get(Calendar.MONTH) + 1) + "");
         reportFeeMonthStatisticsPo.setFeeYear(preMonthDate.get(Calendar.YEAR) + "");
+        reportFeeMonthStatisticsPo.setCurMaxTime(DateUtil.getFormatTimeString(DateUtil.getFirstDate(),DateUtil.DATE_FORMATE_STRING_A));
         reportFeeMonthStatisticsPo.setObjId(tmpReportCarDto.getCarId());
         reportFeeMonthStatisticsPo.setObjType(FeeDto.PAYER_OBJ_TYPE_CAR);
         reportFeeMonthStatisticsPo.setFeeName(tmpReportFeeDto.getFeeName());
@@ -387,6 +388,7 @@
             try {
                 doDealRoomFee(reportRoomDto, tmpReportFeeDto);
             } catch (Exception e) {
+                e.printStackTrace();
                 logger.error("澶勭悊鎴垮眿璐圭敤澶辫触" + JSONObject.toJSONString(tmpReportFeeDto), e);
             }
         }
@@ -406,7 +408,7 @@
         reportFeeMonthStatisticsDto.setCommunityId(reportRoomDto.getCommunityId());
         reportFeeMonthStatisticsDto.setConfigId(tmpReportFeeDto.getConfigId());
         reportFeeMonthStatisticsDto.setObjId(tmpReportFeeDto.getPayerObjId());
-        reportFeeMonthStatisticsDto.setFeeId(tmpReportFeeDto.getFeeId());
+        //reportFeeMonthStatisticsDto.setFeeId(tmpReportFeeDto.getFeeId());
         reportFeeMonthStatisticsDto.setObjType(tmpReportFeeDto.getPayerObjType());
         reportFeeMonthStatisticsDto.setFeeYear(DateUtil.getYear() + "");
         reportFeeMonthStatisticsDto.setFeeMonth(DateUtil.getMonth() + "");
@@ -453,6 +455,7 @@
             reportFeeMonthStatisticsPo.setFeeId(tmpReportFeeDto.getFeeId());
             reportFeeMonthStatisticsPo.setFeeMonth(DateUtil.getMonth() + "");
             reportFeeMonthStatisticsPo.setFeeYear(DateUtil.getYear() + "");
+            reportFeeMonthStatisticsPo.setCurMaxTime(DateUtil.getNextMonthFirstDay(DateUtil.DATE_FORMATE_STRING_A));
             reportFeeMonthStatisticsPo.setObjId(reportRoomDto.getRoomId());
             reportFeeMonthStatisticsPo.setObjType(FeeDto.PAYER_OBJ_TYPE_ROOM);
             reportFeeMonthStatisticsPo.setFeeName(StringUtil.isEmpty(tmpReportFeeDto.getImportFeeName()) ? tmpReportFeeDto.getFeeName() : tmpReportFeeDto.getImportFeeName());
@@ -469,15 +472,9 @@
         //灏嗙即璐� 鍒版湡鏃堕棿涔嬪墠寰楁瑺璐瑰埛涓�0
         Date endTime = tmpReportFeeDto.getEndTime();
 
-        Calendar calender = Calendar.getInstance();
-        calender.setTime(endTime);
-        int year = calender.get(Calendar.YEAR);
-        int month = calender.get(Calendar.MONTH);
-
         ReportFeeMonthStatisticsPo tmpReportFeeMonthStatisticsPo = new ReportFeeMonthStatisticsPo();
         tmpReportFeeMonthStatisticsPo.setFeeId(tmpReportFeeDto.getFeeId());
-        tmpReportFeeMonthStatisticsPo.setFeeYear(year + "");
-        tmpReportFeeMonthStatisticsPo.setFeeMonth(month + "");
+        tmpReportFeeMonthStatisticsPo.setCurMaxTime(DateUtil.getFormatTimeString(endTime,DateUtil.DATE_FORMATE_STRING_A));
         tmpReportFeeMonthStatisticsPo.setOweAmount("0");
         reportFeeMonthStatisticsServiceDaoImpl.updateReportFeeMonthStatisticsOwe(BeanConvertUtil.beanCovertMap(tmpReportFeeMonthStatisticsPo));
     }
@@ -554,6 +551,8 @@
         reportFeeMonthStatisticsPo.setFeeId(tmpReportFeeDto.getFeeId());
         reportFeeMonthStatisticsPo.setFeeMonth((preMonthDate.get(Calendar.MONTH) + 1) + "");
         reportFeeMonthStatisticsPo.setFeeYear(preMonthDate.get(Calendar.YEAR) + "");
+        reportFeeMonthStatisticsPo.setCurMaxTime(DateUtil.getFormatTimeString(DateUtil.getFirstDate(),DateUtil.DATE_FORMATE_STRING_A));
+
         reportFeeMonthStatisticsPo.setObjId(reportRoomDto.getRoomId());
         reportFeeMonthStatisticsPo.setObjType(FeeDto.PAYER_OBJ_TYPE_ROOM);
         reportFeeMonthStatisticsPo.setFeeName(StringUtil.isEmpty(tmpReportFeeDto.getImportFeeName()) ? tmpReportFeeDto.getFeeName() : tmpReportFeeDto.getImportFeeName());

--
Gitblit v1.8.0