From e67870fff62635cd14beb0d5988f08aeef4b22fa Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期一, 07 四月 2025 21:27:06 +0800 Subject: [PATCH] 添加远程关阀式终止灌溉计划,未测试 --- pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanCtrl.java | 21 ++++++++++++++++++++- 1 files changed, 20 insertions(+), 1 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanCtrl.java index e052a51..4f02d79 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanCtrl.java @@ -6,11 +6,14 @@ import com.dy.pipIrrGlobal.pojoIr.IrIrrigateSchedule; import com.dy.pipIrrGlobal.pojoIr.IrPlanOperate; import com.dy.pipIrrGlobal.pojoIr.IrPlanSchedule; +import com.dy.pipIrrGlobal.pojoRm.RmCommandHistory; import com.dy.pipIrrGlobal.voIr.VoIrrigateSchedule; import com.dy.pipIrrGlobal.voIr.VoPlanSimple; import com.dy.pipIrrGlobal.voIr.VoPlans; +import com.dy.pipIrrGlobal.voRm.VoIntakeVc; import com.dy.pipIrrWechat.command.CommandSv; import com.dy.pipIrrWechat.command.dto.AutomaticClose; +import com.dy.pipIrrWechat.command.dto.ValveOpen; import com.dy.pipIrrWechat.irrigatePlan.dto.IrrigatePlan; import com.dy.pipIrrWechat.irrigatePlan.dto.IrrigateSchedule; import com.dy.pipIrrWechat.irrigatePlan.dto.PlanSimple; @@ -308,7 +311,7 @@ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); String terminateStartTimeStr = "2000-01-01 00:00:00"; Date terminateStartTime = Date.from(LocalDateTime.parse(terminateStartTimeStr, formatter).atZone(ZoneId.systemDefault()).toInstant()); - Integer terminateDuration = 100000; + Integer terminateDuration = 9999; // 鑾峰彇鍙粓姝㈡搷浣滆鍒掔殑鐏屾簤寮�濮嬫椂闂� Date planStartTime = irrigatePlanSv.getToTerminatePlan(planId); @@ -355,6 +358,22 @@ } } else { // 鎵ц杩滅▼鍏抽榾 + List<Long> commandIds = irrigatePlanSv.getTerminateCommandIds(planId); + for(Long commandId : commandIds) { + VoIntakeVc intakeVc = irrigatePlanSv.getIntakeVc(commandId); + Long intakeId = intakeVc.getIntakeId(); + Long vdId = intakeVc.getVcId(); + + ValveOpen valve = new ValveOpen(); + valve.setIntakeId(intakeId); + valve.setVcId(vdId); + valve.setForceOpen(true); + valve.setOperator(operatorId); + valve.setOpenType(Byte.valueOf("1")); + + commandSv.openWx(valve, planId, operateType); + } + } return BaseResponseUtils.buildSuccess(); -- Gitblit v1.8.0