| | |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Long projectId = planAndSchedule.getProjectId(); |
| | | Long operatorId = planAndSchedule.getOperatorId(); |
| | | Byte startupMode = planAndSchedule.getStartupMode(); |
| | | Date planStartTime = planAndSchedule.getPlanStartTime();; |
| | |
| | | //planStopTime = Date.from(stopTime.atZone(ZoneId.systemDefault()).toInstant()); |
| | | |
| | | IrIrrigatePlan plan = new IrIrrigatePlan(); |
| | | plan.setProjectId(projectId); |
| | | plan.setPlanName(planAndSchedule.getPlanName()); |
| | | plan.setStartupMode(startupMode); |
| | | plan.setPlanStartTime(planStartTime); |
| | |
| | | automaticClose.setOperator(operatorId); |
| | | automaticClose.setOpenType(Byte.valueOf("1")); |
| | | |
| | | commandSv.planedOpenTimedClose(automaticClose, schedule.getStartTime(), schedule.getDuration()); |
| | | commandSv.planedOpenTimedClose(automaticClose, planId, schedule.getStartTime(), schedule.getDuration()); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取灌溉计划列表 |
| | | * @param vo |
| | | * 终止灌溉计划 |
| | | * @param planSimple |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | //@GetMapping(path = "/getIrrigatePlans") |
| | | //public BaseResponse<QueryResultVo<List<VoIrrigatePlan>>> getIrrigatePlans(QoIrrigatePlan vo) { |
| | | // try { |
| | | // QueryResultVo<List<VoIrrigatePlan>> res = irrigatePlanSv.getIrrigatePlans(vo); |
| | | // return BaseResponseUtils.buildSuccess(res); |
| | | // } catch (Exception e) { |
| | | // log.error("获取轮灌组记录异常", e); |
| | | // return BaseResponseUtils.buildException(e.getMessage()); |
| | | //@PostMapping(path = "terminatePlan", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | //@Transactional(rollbackFor = Exception.class) |
| | | //public BaseResponse<Boolean> terminatePlan(@RequestBody @Valid PlanSimple planSimple, BindingResult bindingResult){ |
| | | // if(bindingResult != null && bindingResult.hasErrors()){ |
| | | // return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | // } |
| | | // |
| | | // Long planId = planSimple.getPlanId(); |
| | | // Long operatorId = planSimple.getOperatorId(); |
| | | // |
| | | // IrIrrigatePlan iIrrigatePlan = new IrIrrigatePlan(); |
| | | // iIrrigatePlan.setId(planId); |
| | | // iIrrigatePlan.setExecutingState((byte)3); |
| | | // if(irrigatePlanSv.updatePlan(iIrrigatePlan) == 0){ |
| | | // return BaseResponseUtils.buildErrorMsg("终止计划状态失败"); |
| | | // } |
| | | // |
| | | // |
| | | // |
| | | //} |
| | | } |