From 4f99f59668c9160ca60958b7347944def26f2228 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期日, 27 四月 2025 10:58:53 +0800 Subject: [PATCH] 回退配置 --- pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigation/IrrigationCtrl.java | 51 ++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 36 insertions(+), 15 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigation/IrrigationCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigation/IrrigationCtrl.java index e2ffc0d..6ebf27c 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigation/IrrigationCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigation/IrrigationCtrl.java @@ -3,13 +3,16 @@ import com.dy.common.webUtil.BaseResponse; import com.dy.common.webUtil.BaseResponseUtils; import com.dy.common.webUtil.QueryResultVo; +import com.dy.pipIrrGlobal.voIr.VoGroupIntakes; import com.dy.pipIrrGlobal.voIr.VoGroupSimple; -import com.dy.pipIrrGlobal.voIr.VoUnitSimple; -import com.dy.pipIrrWechat.irrigation.qo.QoClient; +import com.dy.pipIrrGlobal.voIr.VoProjectSimple; +import com.dy.pipIrrWechat.irrigation.qo.QoGroup; +import com.dy.pipIrrWechat.irrigation.qo.QoProject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.List; @@ -28,16 +31,31 @@ public class IrrigationCtrl { private final IrrigationSv irrigationSv; + /** - * 鏍规嵁鍐滄埛缂栧彿鑾峰彇杞亴缁勫垪琛� - * @param vo + * 鏍规嵁鍐滄埛缂栧彿鑾峰彇鐏屾簤鍗曞厓鍒楄〃 + * @param qo * @return */ - @GetMapping(path = "/getGroups") - public BaseResponse<QueryResultVo<List<VoGroupSimple>>> getGroups(QoClient vo) { + @GetMapping(path = "/getSimpleProjects") + public BaseResponse<List<VoProjectSimple>> getSimpleProjects(QoProject qo) { try { - QueryResultVo<List<VoGroupSimple>> res = irrigationSv.getGroupsByClientId(vo); - return BaseResponseUtils.buildSuccess(res); + return BaseResponseUtils.buildSuccess(irrigationSv.getSimpleProjects(qo)); + } catch (Exception e) { + log.error("鑾峰彇椤圭洰璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } + + @GetMapping(path = "/getSimpleGroups") + public BaseResponse<List<VoGroupSimple>> getSimpleGroups(QoGroup qo) { + if(qo.getProjectId() == null) { + return BaseResponseUtils.buildErrorMsg("璇烽�夋嫨椤圭洰"); + } + + try { + //QueryResultVo<List<VoGroupSimple>> res = irrigationSv.getSimpleGroups(qo); + return BaseResponseUtils.buildSuccess(irrigationSv.getSimpleGroups(qo)); } catch (Exception e) { log.error("鑾峰彇杞亴缁勮褰曞紓甯�", e); return BaseResponseUtils.buildException(e.getMessage()); @@ -45,17 +63,20 @@ } /** - * 鏍规嵁鍐滄埛缂栧彿鑾峰彇鐏屾簤鍗曞厓鍒楄〃 - * @param vo + * 鏍规嵁杞亴缁処D鑾峰彇杞亴缁勮鎯� + * @param groupId * @return */ - @GetMapping(path = "/getUnits") - public BaseResponse<QueryResultVo<List<VoUnitSimple>>> getUnits(QoClient vo) { + @GetMapping(path = "/getGroupDetails") + public BaseResponse<VoGroupIntakes> getGroupDetails(@RequestParam Long groupId) { + if(groupId == null) { + return BaseResponseUtils.buildErrorMsg("杞亴缁処D涓嶈兘涓虹┖"); + } + try { - QueryResultVo<List<VoUnitSimple>> res = irrigationSv.getUnitsByClientId(vo); - return BaseResponseUtils.buildSuccess(res); + return BaseResponseUtils.buildSuccess(irrigationSv.getGroupDetails(groupId).get("content")); } catch (Exception e) { - log.error("鑾峰彇鐏屾簤鍗曞厓璁板綍寮傚父", e); + log.error("鑾峰彇杞亴缁勮鎯呭紓甯�", e); return BaseResponseUtils.buildException(e.getMessage()); } } -- Gitblit v1.8.0