| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | } |
| | | } 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(); |