From cd7fd2ea35de966cfd1c6f3038e593097d7a6dec Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期四, 03 七月 2025 11:26:46 +0800 Subject: [PATCH] 轮灌组PC端接口 --- pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigatePlan/IrrigatePlanCtrl.java | 103 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 99 insertions(+), 4 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigatePlan/IrrigatePlanCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigatePlan/IrrigatePlanCtrl.java index 40fbe97..f6425a2 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigatePlan/IrrigatePlanCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigatePlan/IrrigatePlanCtrl.java @@ -3,6 +3,10 @@ import com.dy.common.aop.SsoAop; import com.dy.common.webUtil.BaseResponse; import com.dy.common.webUtil.BaseResponseUtils; +import com.dy.common.webUtil.QueryConditionVo; +import com.dy.common.webUtil.QueryResultVo; +import com.dy.pipIrrGlobal.voIr.VoPlanDetails; +import com.dy.pipIrrGlobal.voIr.VoPlans; import com.dy.pipIrrIrrigate.irrigatePlan.dto.IrrigatePlan; import com.dy.pipIrrIrrigate.irrigatePlan.dto.PlanSimple; import jakarta.validation.Valid; @@ -10,11 +14,9 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.http.MediaType; import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import java.util.List; import java.util.Map; import java.util.Objects; @@ -114,4 +116,97 @@ } return BaseResponseUtils.buildSuccess() ; } + + /** + * 鑾峰彇鏈畬鎴愮殑璁″垝鍒楄〃锛岀亴婧夋ā鍧楄鍒掑垪琛ㄩ〉浣跨敤 + * @return + */ + @GetMapping(path = "/getNotCompletePlans") + @SsoAop() + public BaseResponse<List<VoPlans>> getNotCompletePlans() { + try { + List<VoPlans> res = irrigatePlanSv.getNotCompletePlans(); + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鑾峰彇鏈畬鐨勮鍒掑紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } + + /** + * 鑾峰彇宸插畬鎴愮殑璁″垝鍒楄〃锛岀亴婧夋ā鍧楄鍒掑垪琛ㄩ〉浣跨敤 + * @return + */ + @GetMapping(path = "/getCompletedPlans") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoPlans>>> getCompletedPlans(QueryConditionVo qo) { + try { + return BaseResponseUtils.buildSuccess(irrigatePlanSv.getCompletedPlans(qo)); + } catch (Exception e) { + log.error("鑾峰彇椤圭洰璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } + + /** + * 鏍规嵁璁″垝ID鑾峰彇璁″垝鍙戝竷缁撴灉 + * @param planId + * @return + */ + @GetMapping(path = "/getPublishResults") + @SsoAop() + public BaseResponse<VoPlanDetails> getPublishResults(@RequestParam Long planId) { + if(planId == null) { + return BaseResponseUtils.buildErrorMsg("璁″垝ID涓嶈兘涓虹┖"); + } + + try { + VoPlanDetails res = irrigatePlanSv.getPublishResults(planId); + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鑾峰彇璁″垝鍙戝竷缁撴灉寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } + + /** + * 鏍规嵁璁″垝ID鑾峰彇璁″垝缁堟鎿嶄綔缁撴灉 + * @param planId + * @return + */ + @GetMapping(path = "/getTerminateResults") + @SsoAop() + public BaseResponse<VoPlanDetails> getTerminateResults(@RequestParam Long planId) { + if(planId == null) { + return BaseResponseUtils.buildErrorMsg("璁″垝ID涓嶈兘涓虹┖"); + } + + try { + VoPlanDetails res = irrigatePlanSv.getTerminateResults(planId); + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鑾峰彇璁″垝鍙戝竷缁撴灉寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } + + /** + * 鏍规嵁璁″垝ID鑾峰彇璁″垝鏈�鏂扮姸鎬� + * @param planId + * @return + */ + @GetMapping(path = "/getPlanLatestState") + @SsoAop() + public BaseResponse<Integer> getPlanLatestState(@RequestParam Long planId) { + if(planId == null) { + return BaseResponseUtils.buildErrorMsg("璁″垝ID涓嶈兘涓虹┖"); + } + + try { + return BaseResponseUtils.buildSuccess(irrigatePlanSv.getPlanLatestState(planId)); + } catch (Exception e) { + log.error("鑾峰彇鏈畬鐨勮鍒掑紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } } -- Gitblit v1.8.0