From c06c38ce579264ef82430b9e2f353afa97e6cafa Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期六, 28 十二月 2024 09:51:57 +0800 Subject: [PATCH] 通信中间件统计农户日用水量数据中增加次数属性,数据库中也相应增加此字段。 --- pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/changeSome/ChSomeIntakeAmountSv.java | 23 ++++------------------- 1 files changed, 4 insertions(+), 19 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/changeSome/ChSomeIntakeAmountSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/changeSome/ChSomeIntakeAmountSv.java index 47c63cf..d1e6f82 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/changeSome/ChSomeIntakeAmountSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/changeSome/ChSomeIntakeAmountSv.java @@ -145,21 +145,6 @@ private static final int DealStartYear = 2024 ; private static final int DealStartMonth = 8 ; - private static final String endDayOfMonth(int year, int month){ - if(month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12){ - return "31" ; - }else{ - if(month == 2){ - if(DateTime.isLeapYear(year)){ - return "29" ; - }else{ - return "28" ; - } - }else{ - return "30" ; - } - } - } /** * 鍒犻櫎鎵�鏈夊彇姘村彛鏈堝彇姘撮噺缁熻 * @throws Exception @@ -184,14 +169,14 @@ if(year < nowYear){ for(int month = 1 ; month <= 12 ; month ++){ startDt = DateTime.dateFrom_yyyy_MM_dd(year + "-" + month + "-01") ; - endDt = DateTime.dateFrom_yyyy_MM_dd(year + "-" + month + "-" + endDayOfMonth(year, month)) ; + endDt = DateTime.dateFrom_yyyy_MM_dd(year + "-" + month + "-" + DateTime.endDayOfMonth(year, month)) ; list = dao.statisticAllIntakeAmountMonthFromAmountDay(startDt, endDt) ; this.doStatisticsIntakeAmountMonth(year, month, list) ; } }else{ for(int month = 1 ; month <= nowMonth ; month ++){ startDt = DateTime.dateFrom_yyyy_MM_dd(year + "-" + month + "-01") ; - endDt = DateTime.dateFrom_yyyy_MM_dd(year + "-" + month + "-" + endDayOfMonth(year, month)) ; + endDt = DateTime.dateFrom_yyyy_MM_dd(year + "-" + month + "-" + DateTime.endDayOfMonth(year, month)) ; list = dao.statisticAllIntakeAmountMonthFromAmountDay(startDt, endDt) ; this.doStatisticsIntakeAmountMonth(year, month, list) ; } @@ -235,8 +220,8 @@ List<StIntakeAmountYear> list ; for(int year = DealStartYear; year <= nowYear; year ++){ list = null ; - startDt = DateTime.dateFrom_MM_dd(year + "-01-01") ; - endDt = DateTime.dateFrom_MM_dd(year + "-12-31") ; + startDt = DateTime.dateFrom_yyyy_MM_dd(year + "-01-01") ; + endDt = DateTime.dateFrom_yyyy_MM_dd(year + "-12-31") ; list = dao.statisticAllIntakeAmountYearFromAmountDay(startDt, endDt) ; this.doStatisticsIntakeAmountYear(year, list) ; } -- Gitblit v1.8.0