From cb9caeaf939dbc10522f395647ca7fefb3a8634b Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期一, 01 九月 2025 14:28:09 +0800 Subject: [PATCH] 为前端提供蒸腾量测试计算逻辑功能 --- pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/vapor/VaporCtrl.java | 80 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 80 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/vapor/VaporCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/vapor/VaporCtrl.java new file mode 100644 index 0000000..69ebb79 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/vapor/VaporCtrl.java @@ -0,0 +1,80 @@ +package com.dy.pipIrrWechat.vapor; + +import com.dy.common.util.DateTime; +import com.dy.common.webUtil.BaseResponse; +import com.dy.common.webUtil.BaseResponseUtils; +import com.dy.pipIrrGlobal.pojoMd.MdEt0; +import io.swagger.v3.oas.annotations.tags.Tag; +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.ArrayList; +import java.util.List; + +/** + * @Author: liurunyu + * @Date: 2025/8/19 16:21 + * @Description + */ +@Slf4j +@Tag(name = "浣滅墿鏃ヨ捀鑵鹃噺", description = "浣滅墿鏃ヨ捀鑵鹃噺鏌ヨ绛夋搷浣�") +@RestController +@RequestMapping(path = "mdVapor") +public class VaporCtrl { + + private VaporSv sv; + + @Autowired + private void setSv(VaporSv sv) { this.sv = sv; } + + + /** + * 瀹㈡埛绔姹傚緱鍒版墍鏈変綔鐗╃殑鏄ㄦ棩钂歌吘閲� + * @return 鎵�鏈夋墍鏈変綔鐗╃殑鏄ㄦ棩钂歌吘閲� + */ + @GetMapping(path = "allCropsWithYesterday") + public BaseResponse<List<MdEt0>> allYesterday(){ + try { + String ymd = DateTime.yesterday_yyyy_MM_dd( + Integer.parseInt(DateTime.yyyy()), + Integer.parseInt(DateTime.MM()), + Integer.parseInt(DateTime.dd())) ; + List<MdEt0> res = this.sv.selectEt0(ymd) ; + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鏌ヨ鎵�鏈変綔鐗╃殑鏄ㄦ棩钂歌吘閲忓紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } + + /** + * 鏍规嵁鎸囧畾鏉′欢浣滅墿鏌ヨ涓�娈垫椂闂村唴鐨勮捀鑵鹃噺 + * @param qo + * @return + */ + @GetMapping(path = "oneCropsSomeEt0") + public BaseResponse<List<MdEt0>> oneCropsSomeEt0(VaporQo qo){ + try { + if(qo.cropId == null){ + return BaseResponseUtils.buildFail("浣滅墿id涓嶈兘涓虹┖") ; + } + if(qo.timeStop == null || qo.timeStop.trim().equals("")){ + qo.timeStop = DateTime.yyyy_MM_dd() ; + } + if(qo.timeStart == null || qo.timeStart.trim().equals("")){ + qo.timeStart = DateTime.lastXDay_yyyy_MM_dd(qo.timeStop, 10); + } + List<MdEt0> list = sv.oneCropsSomeEt0(qo) ; + if(list == null){ + list = new ArrayList<>() ; + } + return BaseResponseUtils.buildSuccess(list); + } catch (Exception e) { + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } + +} -- Gitblit v1.8.0