zhubaomin
2025-04-07 e67870fff62635cd14beb0d5988f08aeef4b22fa
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();