From 43ac672840ab4a099e9243fd4b10188a2fce6f61 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期二, 17 十二月 2024 08:57:56 +0800 Subject: [PATCH] 临时任务功能,增加测试接口 --- pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/changeSome/ChSomeIntakeAmountSv.java | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 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 fcebfd9..a23eb3d 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 @@ -130,7 +130,7 @@ } @Transactional - int doUpdateOneIntakeAmountDay(Long id, Double amount){ + protected int doUpdateOneIntakeAmountDay(Long id, Double amount){ return dao.updateOneIntakeAmountDay(id, amount); } @@ -164,6 +164,7 @@ * 鍒犻櫎鎵�鏈夊彇姘村彛鏈堝彇姘撮噺缁熻 * @throws Exception */ + @Transactional public void deleteAllIntakeAmountMonth(){ dao.deleteAllIntakeAmountMonth(); } @@ -182,22 +183,23 @@ list = null ; if(year < nowYear){ for(int month = 1 ; month <= 12 ; month ++){ - startDt = DateTime.dateFrom_MM_dd(year + "-" + month + "-01") ; - endDt = DateTime.dateFrom_MM_dd(year + "-" + month + endDayOfMonth(year, month)) ; + startDt = DateTime.dateFrom_yyyy_MM_dd(year + "-" + month + "-01") ; + endDt = DateTime.dateFrom_yyyy_MM_dd(year + "-" + month + "-" + endDayOfMonth(year, month)) ; list = dao.statisticAllIntakeAmountMonthFromAmountDay(startDt, endDt) ; this.doStatisticsIntakeAmountMonth(year, month, list) ; } }else{ for(int month = 1 ; month <= nowMonth ; month ++){ - startDt = DateTime.dateFrom_MM_dd(year + "-" + month + "-01") ; - endDt = DateTime.dateFrom_MM_dd(year + "-" + month + endDayOfMonth(year, month)) ; + startDt = DateTime.dateFrom_yyyy_MM_dd(year + "-" + month + "-01") ; + endDt = DateTime.dateFrom_yyyy_MM_dd(year + "-" + month + "-" + endDayOfMonth(year, month)) ; list = dao.statisticAllIntakeAmountMonthFromAmountDay(startDt, endDt) ; this.doStatisticsIntakeAmountMonth(year, month, list) ; } } } } - private void doStatisticsIntakeAmountMonth(int year, int month, List<StIntakeAmountMonth> list) throws Exception{ + @Transactional + protected void doStatisticsIntakeAmountMonth(int year, int month, List<StIntakeAmountMonth> list) throws Exception{ if(list != null && list.size() > 0){ for(StIntakeAmountMonth po : list){ po.year = year ; @@ -217,6 +219,7 @@ * 鍒犻櫎鎵�鏈夊彇姘村彛骞村彇姘撮噺缁熻 * @throws Exception */ + @Transactional public void deleteAllIntakeAmountYear(){ dao.deleteAllIntakeAmountYear(); } @@ -232,13 +235,14 @@ 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) ; } } - private void doStatisticsIntakeAmountYear(int year, List<StIntakeAmountYear> list) throws Exception{ + @Transactional + protected void doStatisticsIntakeAmountYear(int year, List<StIntakeAmountYear> list) throws Exception{ if(list != null && list.size() > 0){ for(StIntakeAmountYear po : list){ po.year = year ; -- Gitblit v1.8.0