| | |
| | | // 取水口ID换阀控器地址及通讯协议 |
| | | JSONObject job_rtu = getRtu(intakeId, null); |
| | | if(job_rtu == null) { |
| | | return BaseResponseUtils.buildError(WechatResultCode.RTU_NOT_EXIST.getMessage()); |
| | | return BaseResponseUtils.buildErrorMsg(WechatResultCode.RTU_NOT_EXIST.getMessage()); |
| | | } |
| | | String rtuAddr = job_rtu.getString("rtuAddr"); |
| | | String protocol = job_rtu.getString("protocol"); |
| | |
| | | public BaseResponse<Boolean> close(@RequestBody @Valid ValveClose valve, BindingResult bindingResult) { |
| | | DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyMMddHHmmss"); |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | String rtuAddr = valve.getRtuAddr(); |
| | |
| | | // 阀控器地址换取水口ID和通讯协议 |
| | | JSONObject job_rtu = getRtu(null, rtuAddr); |
| | | if(job_rtu == null) { |
| | | return BaseResponseUtils.buildError(WechatResultCode.RTU_NOT_EXIST.getMessage()); |
| | | return BaseResponseUtils.buildErrorMsg(WechatResultCode.RTU_NOT_EXIST.getMessage()); |
| | | } |
| | | Long intakeId = job_rtu.getLong("intakeId"); |
| | | String protocol = job_rtu.getString("protocol"); |
| | |
| | | // 回调失败 |
| | | if(!response_CallBack.getCode().equals("0001")) { |
| | | return BaseResponseUtils.buildFail(response_CallBack.getMsg()); |
| | | //return BaseResponseUtils.buildError(WechatResultCode.GET_RESULT_ERROR.getMessage()); |
| | | //return BaseResponseUtils.buildErrorMsg(WechatResultCode.GET_RESULT_ERROR.getMessage()); |
| | | } |
| | | |
| | | // 回调成功,再判断执行是否成功 |