From 203223860baa19deb6860eb2ba3181910d662980 Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期四, 17 四月 2025 14:22:59 +0800 Subject: [PATCH] 1. 轮灌组被终止时灌溉时长为实际数值。2. 计划历史表按照创建时间倒排序。3. 发布计划时判断是否同项目下未完成计划,是否其他项目下使用了本计划的轮灌组且计划未完成。4. 根据计划ID获取计划最新状态。 --- pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intaker/IntakerCtrl.java | 72 ++++++++++++++++++++++++++++++++++++ 1 files changed, 72 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intaker/IntakerCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intaker/IntakerCtrl.java new file mode 100644 index 0000000..291b0f5 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intaker/IntakerCtrl.java @@ -0,0 +1,72 @@ +package com.dy.pipIrrStatistics.intaker; + +import com.dy.common.aop.SsoAop; +import com.dy.common.util.DateTime; +import com.dy.common.webUtil.BaseResponse; +import com.dy.common.webUtil.BaseResponseUtils; +import com.dy.common.webUtil.QueryResultVo; +import com.dy.pipIrrGlobal.voSt.VoDayIntakeAmount; +import com.dy.pipIrrGlobal.voSt.VoMonthAmount; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Author: liurunyu + * @Date: 2024/12/12 16:24 + * @Description 鏈夊叧鍙栨按鍙g敤姘寸粺璁� + */ +@Slf4j +@RestController +@RequestMapping(path="intake") +@RequiredArgsConstructor +public class IntakerCtrl { + + private IntakerSv sv; + + @Autowired + public void setSv(IntakerSv sv){ + this.sv = sv ; + } + + /** + * 鏌ヨ鎸囧畾鏈堜唤鍚勬棩鐢ㄦ按閲� + * @param qo + * @return + */ + @GetMapping(path = "/amountOfDay") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoDayIntakeAmount>>> amountOfDay(IntakerQo qo) throws Exception { + String yearMonth = qo.getYearMonth(); + if(yearMonth == null || yearMonth.trim().equals("")) { + return BaseResponseUtils.buildErrorMsg("鏌ヨ鏉′欢骞存湀涓嶈兘涓虹┖"); + } + qo.startDt = DateTime.dateFrom_yyyy_MM_dd(yearMonth + "-01"); + qo.endDt = DateTime.dateFrom_yyyy_MM_dd(yearMonth + "-31"); + + int[] ymd = DateTime.yyyy_MM_ymdGroup(yearMonth) ; + qo.year = ymd[0] ; + qo.month = ymd[1] ; + + return BaseResponseUtils.buildSuccess(this.sv.amountOfDay(qo)); + } + + /** + * 鏌ヨ鎸囧畾鏈堜唤鍚勬棩鐢ㄦ按閲� + * @param qo + * @return + */ + @GetMapping(path = "/amountOfMonth") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoMonthAmount>>> amountOfMonth(IntakerQo qo) throws Exception { + if(qo.getYear() == null) { + return BaseResponseUtils.buildErrorMsg("鏌ヨ鏉′欢骞村害涓嶈兘涓虹┖"); + } + return BaseResponseUtils.buildSuccess(this.sv.amountOfMonth(qo)); + } +} -- Gitblit v1.8.0