| | |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean updateLightTask(Long taskId, LightTaskParam param) { |
| | | if (StrUtil.length(param.getControlOrder()) % LightTaskParam.REQUEST_ORDER_LENGTH != 0) { |
| | | throw new BusinessException("灯控命令格式不正确"); |
| | | } |
| | | LightTask lightTask = getById(taskId); |
| | | if (lightTask == null) { |
| | | throw new BusinessException("找不到路灯任务"); |
| | | } |
| | | |
| | | |
| | | //记录任务编辑器前灯杆ID |
| | | List<LightTaskStatusAndPole> oldLightTaskStatusAndPoles = lightTaskPoleRelationService.listPoleAndStatusIdByTaskId(taskId); |
| | | |
| | | |
| | | int week = 0; |
| | | for (Integer w : param.getWeekList()) { |
| | | week |= w; |
| | | } |
| | | |
| | | LightTask newLightTask = new LightTask(); |
| | | newLightTask.setTaskName(param.getTaskName()); |
| | | if (SecurityUtils.getClientId() != null) { |
| | | lightTask.setClientId(clientService.getClientId()); |
| | | lightTask.setUserId(SecurityUtils.getUserId()); |
| | | } |
| | | newLightTask.setWeek(week); |
| | | newLightTask.setCreateUser(SecurityUtils.getUsername()); |
| | | newLightTask.setControlOrder(param.getControlOrder()); |
| | | newLightTask.setOpenOrder(param.getOpenOrder()); |
| | | newLightTask.setCloseOrder(param.getCloseOrder()); |
| | | newLightTask.setLightAdress(param.getLightAddress()); |
| | | newLightTask.setUpdateTime(LocalDateTime.now()); |
| | | newLightTask.setFramePayload(buildControlFramePayload(param.getOpenOrder(), param.getCloseOrder(), param.getControlOrder(), week)); |
| | | |
| | | if (!save(newLightTask)) { |
| | | throw new BusinessException("编辑任务失败"); |
| | | } |
| | | |
| | | /** |
| | | * 编辑路灯任务日志记录开始 |
| | | */ |
| | | // List<String> poleCodeList = new ArrayList<>(); |
| | | // if (CollectionUtil.isNotEmpty(param.getPoleIdList())) { |
| | | // List<Pole> poleList = SpringContextHolder.getBean(PoleService.class).listByIds(param.getPoleIdList()); |
| | | // if (CollectionUtil.isNotEmpty(poleList)) { |
| | | // poleCodeList = poleList.stream().map(Pole::getDeviceCode).collect(Collectors.toList()); |
| | | // } |
| | | // } |
| | | // String content = "{任务ID:" + newLightTask.getTaskId() |
| | | // + ", 任务名:" + newLightTask.getTaskName() |
| | | // + "},{内帧指令" + newLightTask.getFramePayload() |
| | | // + ", 灯杆ID:" + param.getPoleIdList().toString() |
| | | // + ", 控制的灯头地址:" + param.getLightAddress() |
| | | // + " }"; |
| | | // StoreOperationRecordsUtils.storeOperationData(poleCodeList, null, "编辑路灯任务", content); |
| | | /** |
| | | * 编辑路灯任务日志记录结束 |
| | | */ |
| | | |
| | | List<Long> poleIdList = param.getPoleIdList(); |
| | | if (CollectionUtil.isNotEmpty(poleIdList)) { |
| | | List<LightTaskPoleRelation> lightTaskPoleRelationList = sendControllerFrame(newLightTask, poleIdList, lightTask.getFramePayload(), param.getLightAddress()); |
| | | //状态不为0 新建任务 |
| | | lightTaskPoleRelationList.forEach(taskResult -> { |
| | | //保存下发失败的任务关联关系,状态为O成功,其他状态都为失败 |
| | | if (taskResult.getIssueStatus() == 0) { |
| | | for (LightTaskStatusAndPole bean : oldLightTaskStatusAndPoles) { |
| | | if (bean.getId().equals(taskResult.getPoleId())) { |
| | | oldLightTaskStatusAndPoles.remove(bean); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | //修改灯杆任务绑定关系表 |
| | | for (LightTaskPoleRelation bean : lightTaskPoleRelationList) { |
| | | LightTaskPoleRelation one = lightTaskPoleRelationService.getOne(Wrappers.lambdaQuery(LightTaskPoleRelation.class).eq(LightTaskPoleRelation::getPoleId, bean.getPoleId())); |
| | | |
| | | //成功才修改,失败不变 |
| | | if (bean.getIssueStatus() == 0) { |
| | | if (one != null) { |
| | | one.setTaskId(newLightTask.getTaskId()); |
| | | lightTaskPoleRelationService.updateById(one); |
| | | } else { |
| | | lightTaskPoleRelationService.save(bean); |
| | | } |
| | | } else { |
| | | if (one == null) { |
| | | lightTaskPoleRelationService.save(bean); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | List<Long> failPoleId = new ArrayList<>(); |
| | | for (LightTaskStatusAndPole bean1 : oldLightTaskStatusAndPoles) { |
| | | failPoleId.add(bean1.getId()); |
| | | } |
| | | //执行关灯 |
| | | String framePayloadClose = "7f0000007f173b00"; |
| | | |
| | | List<LightTaskPoleRelation> lightTaskPoleRelations = new ArrayList<>(); |
| | | if (!failPoleId.isEmpty()) { |
| | | lightTaskPoleRelations = sendControllerFrame(lightTask, failPoleId, framePayloadClose, lightTask.getLightAdress()); |
| | | } |
| | | |
| | | //状态不为0 新建任务 |
| | | lightTaskPoleRelations.forEach(taskResult -> { |
| | | //保存下发失败的任务关联关系,状态为O成功,其他状态都为失败 |
| | | if (taskResult.getIssueStatus() == 0) { |
| | | for (LightTaskStatusAndPole bean : oldLightTaskStatusAndPoles) { |
| | | if (bean.getId().equals(taskResult.getPoleId())) { |
| | | oldLightTaskStatusAndPoles.remove(bean); |
| | | lightTaskPoleRelationService.remove(Wrappers.lambdaQuery(LightTaskPoleRelation.class).eq(LightTaskPoleRelation::getTaskId, lightTask.getTaskId()).eq(LightTaskPoleRelation::getPoleId, bean.getId())); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | //任务顺利完成 |
| | | if (oldLightTaskStatusAndPoles.size() == 0) { |
| | | removeById(lightTask); |
| | | } |
| | | |
| | | |
| | | // // 添加绑定灯杆 |
| | | // if (!lightTaskPoleRelationService.saveBatch(lightTaskPoleRelationList)) { |
| | | // throw new BusinessException("绑定灯杆失败"); |
| | | // } |
| | | // |
| | | // // 一个灯杆只能使用一个任务,新任务要覆盖旧任务 |
| | | // lightTaskPoleRelationService.remove(Wrappers.lambdaQuery(LightTaskPoleRelation.class).in(LightTaskPoleRelation::getPoleId, poleIdList).ne(LightTaskPoleRelation::getTaskId, lightTask.getTaskId())); |
| | | |
| | | /** |
| | | * 下发路灯任务日志记录开始 |
| | | */ |
| | | |
| | | // String content1 = "{任务ID:" + lightTask.getTaskId() |
| | | // + ", 任务名:" + lightTask.getTaskName() |
| | | // + "}," + " 灯杆ID:" + param.getPoleIdList().toString() |
| | | // + " }"; |
| | | // StoreOperationRecordsUtils.storeOperationData(poleCodeList, null, "下发路灯任务", content1); |
| | | /** |
| | | * 下发路灯任务日志记录结束 |
| | | */ |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean newUpdateLightTask(Long taskId, LightTaskParam param) { |
| | | public String updateLightTask(Long taskId, LightTaskParam param) { |
| | | if (StrUtil.length(param.getControlOrder()) % LightTaskParam.REQUEST_ORDER_LENGTH != 0) { |
| | | throw new BusinessException("灯控命令格式不正确"); |
| | | } |
| | |
| | | newLightTask.setUpdateTime(LocalDateTime.now()); |
| | | newLightTask.setFramePayload(buildControlFramePayload(param.getOpenOrder(), param.getCloseOrder(), param.getControlOrder(), week)); |
| | | |
| | | // if (!save(newLightTask)) { |
| | | // throw new BusinessException("编辑任务失败"); |
| | | // } |
| | | |
| | | /** |
| | | * 编辑路灯任务日志记录开始 |
| | | */ |
| | | // List<String> poleCodeList = new ArrayList<>(); |
| | | // if (CollectionUtil.isNotEmpty(param.getPoleIdList())) { |
| | | // List<Pole> poleList = SpringContextHolder.getBean(PoleService.class).listByIds(param.getPoleIdList()); |
| | | // if (CollectionUtil.isNotEmpty(poleList)) { |
| | | // poleCodeList = poleList.stream().map(Pole::getDeviceCode).collect(Collectors.toList()); |
| | | // } |
| | | // } |
| | | // String content = "{任务ID:" + newLightTask.getTaskId() |
| | | // + ", 任务名:" + newLightTask.getTaskName() |
| | | // + "},{内帧指令" + newLightTask.getFramePayload() |
| | | // + ", 灯杆ID:" + param.getPoleIdList().toString() |
| | | // + ", 控制的灯头地址:" + param.getLightAddress() |
| | | // + " }"; |
| | | // StoreOperationRecordsUtils.storeOperationData(poleCodeList, null, "编辑路灯任务", content); |
| | | /** |
| | | * 编辑路灯任务日志记录结束 |
| | | */ |
| | | |
| | | //编辑后灯杆ID集合 |
| | | List<Long> poleIdList = param.getPoleIdList(); |
| | |
| | | List<Long> closeLight = oldList.stream().filter(poleId -> !param.getPoleIdList().contains(poleId)).collect(Collectors.toList()); |
| | | |
| | | |
| | | if (CollectionUtil.isNotEmpty(poleIdList)) { |
| | | List<LightTaskPoleRelation> newPoleAll = new ArrayList<>(); |
| | | if (CollectionUtil.isNotEmpty(newPoleIdList)) { |
| | | //新灯杆下发新任务 |
| | | Map<String, List<LightTaskPoleRelation>> newPoleMap = sendControllerFrame(newPoleIdList, lightTask.getFramePayload(), param.getLightAddress()); |
| | | List<LightTaskPoleRelation> newPoleAll = new ArrayList<>(); |
| | | List<LightTaskPoleRelation> newPoleSuccess = new ArrayList<>(); |
| | | List<LightTaskPoleRelation> newPoleFail = new ArrayList<>(); |
| | | if (CollectionUtil.isNotEmpty(newPoleIdList)) { |
| | | //新灯杆下发新任务 |
| | | Map<String, List<LightTaskPoleRelation>> newPoleMap = sendControllerFrame(newPoleIdList, lightTask.getFramePayload(), param.getLightAddress()); |
| | | |
| | | //newPoleAll集合后面用于存储关系表 |
| | | newPoleAll = newPoleMap.getOrDefault("all", new ArrayList<>()); |
| | | } |
| | | |
| | | List<LightTaskPoleRelation> oldPoleFail = new ArrayList<>(); |
| | | List<LightTaskPoleRelation> oldPoleSuccess = new ArrayList<>(); |
| | | if (CollectionUtil.isNotEmpty(oldPoleIdList)) { |
| | | //覆盖操作灯杆 |
| | | Map<String, List<LightTaskPoleRelation>> oldPoleMap = sendControllerFrame(oldPoleIdList, lightTask.getFramePayload(), param.getLightAddress()); |
| | | oldPoleFail = oldPoleMap.getOrDefault("fail", new ArrayList<>()); |
| | | } |
| | | |
| | | List<LightTaskPoleRelation> closePoleFail = new ArrayList<>(); |
| | | if (CollectionUtil.isNotEmpty(closeLight)) { |
| | | //执行关灯内帧 |
| | | String framePayloadClose = "7f0000007f173b00"; |
| | | //覆盖操作灯杆 |
| | | Map<String, List<LightTaskPoleRelation>> closePoleMap = sendControllerFrame(closeLight, framePayloadClose, param.getLightAddress()); |
| | | closePoleFail = closePoleMap.getOrDefault("fail", new ArrayList<>()); |
| | | } |
| | | |
| | | //有失敗的需要保存旧的任務 |
| | | if (closePoleFail.size() == 0 && oldPoleFail.size() == 0) { |
| | | newLightTask.setTaskId(lightTask.getTaskId()); |
| | | updateById(newLightTask); |
| | | } else { |
| | | save(newLightTask); |
| | | } |
| | | |
| | | for (LightTaskPoleRelation bean : newPoleAll) { |
| | | bean.setTaskId(newLightTask.getTaskId()); |
| | | } |
| | | //成功用新的任务ID |
| | | for (LightTaskPoleRelation bean : oldPoleSuccess) { |
| | | bean.setTaskId(newLightTask.getTaskId()); |
| | | } |
| | | //失败用旧的任务ID |
| | | for (LightTaskPoleRelation bean : oldPoleFail) { |
| | | bean.setTaskId(lightTask.getTaskId()); |
| | | } |
| | | |
| | | //失败用旧的任务ID |
| | | for (LightTaskPoleRelation bean : closePoleFail) { |
| | | bean.setTaskId(lightTask.getTaskId()); |
| | | } |
| | | |
| | | List<LightTaskPoleRelation> all = new ArrayList<>(); |
| | | all.addAll(newPoleAll); |
| | | all.addAll(oldPoleSuccess); |
| | | all.addAll(oldPoleFail); |
| | | all.addAll(closePoleFail); |
| | | |
| | | |
| | | List<Long> allPoleId = new ArrayList<>(); |
| | | allPoleId.addAll(poleIdList); |
| | | allPoleId.addAll(oldList); |
| | | lightTaskPoleRelationService.remove(Wrappers.lambdaQuery(LightTaskPoleRelation.class).in(LightTaskPoleRelation::getPoleId, allPoleId)); |
| | | lightTaskPoleRelationService.saveBatch(all); |
| | | |
| | | |
| | | /** |
| | | * 下发路灯任务日志记录开始 |
| | | */ |
| | | |
| | | // String content1 = "{任务ID:" + lightTask.getTaskId() |
| | | // + ", 任务名:" + lightTask.getTaskName() |
| | | // + "}," + " 灯杆ID:" + param.getPoleIdList().toString() |
| | | // + " }"; |
| | | // StoreOperationRecordsUtils.storeOperationData(poleCodeList, null, "下发路灯任务", content1); |
| | | /** |
| | | * 下发路灯任务日志记录结束 |
| | | */ |
| | | //newPoleAll集合后面用于存储关系表 |
| | | newPoleAll = newPoleMap.getOrDefault("all", new ArrayList<>()); |
| | | newPoleSuccess = newPoleMap.getOrDefault("success", new ArrayList<>()); |
| | | newPoleFail = newPoleMap.getOrDefault("fail", new ArrayList<>()); |
| | | } |
| | | |
| | | return true; |
| | | List<LightTaskPoleRelation> oldPoleFail = new ArrayList<>(); |
| | | List<LightTaskPoleRelation> oldPoleSuccess = new ArrayList<>(); |
| | | if (CollectionUtil.isNotEmpty(oldPoleIdList)) { |
| | | //覆盖操作灯杆 |
| | | Map<String, List<LightTaskPoleRelation>> oldPoleMap = sendControllerFrame(oldPoleIdList, lightTask.getFramePayload(), param.getLightAddress()); |
| | | oldPoleFail = oldPoleMap.getOrDefault("fail", new ArrayList<>()); |
| | | oldPoleSuccess = oldPoleMap.getOrDefault("success", new ArrayList<>()); |
| | | } |
| | | |
| | | List<LightTaskPoleRelation> closePoleFail = new ArrayList<>(); |
| | | List<LightTaskPoleRelation> closePoleSuccess = new ArrayList<>(); |
| | | if (CollectionUtil.isNotEmpty(closeLight)) { |
| | | //执行关灯内帧 |
| | | String framePayloadClose = "7f0000007f173b00"; |
| | | //覆盖操作灯杆 |
| | | Map<String, List<LightTaskPoleRelation>> closePoleMap = sendControllerFrame(closeLight, framePayloadClose, param.getLightAddress()); |
| | | closePoleFail = closePoleMap.getOrDefault("fail", new ArrayList<>()); |
| | | closePoleSuccess = closePoleMap.getOrDefault("success", new ArrayList<>()); |
| | | } |
| | | |
| | | |
| | | if (closePoleFail.size() == 0 && oldPoleFail.size() == 0) { |
| | | //旧任务中全部发送指令成功,更新原本任务中的数据 |
| | | newLightTask.setTaskId(lightTask.getTaskId()); |
| | | updateById(newLightTask); |
| | | } else { |
| | | if (!newPoleSuccess.isEmpty() || !oldPoleSuccess.isEmpty()) { |
| | | //有失敗的需要保存旧的任務,新增新的任务数据进行保存 |
| | | save(newLightTask); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 编辑路灯任务日志记录开始 |
| | | */ |
| | | List<String> poleCodeList = new ArrayList<>(); |
| | | if (CollectionUtil.isNotEmpty(param.getPoleIdList())) { |
| | | List<Pole> poleList = SpringContextHolder.getBean(PoleService.class).listByIds(param.getPoleIdList()); |
| | | if (CollectionUtil.isNotEmpty(poleList)) { |
| | | poleCodeList = poleList.stream().map(Pole::getDeviceCode).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | String content = "{任务ID:" + newLightTask.getTaskId() + ", 任务名:" + newLightTask.getTaskName() + "},{内帧指令" + newLightTask.getFramePayload() + ", 灯杆ID:" + param.getPoleIdList().toString() + ", 控制的灯头地址:" + param.getLightAddress() + " }"; |
| | | StoreOperationRecordsUtils.storeOperationData(poleCodeList, null, "编辑路灯任务", content); |
| | | /** |
| | | * 编辑路灯任务日志记录结束 |
| | | */ |
| | | |
| | | for (LightTaskPoleRelation bean : newPoleSuccess) { |
| | | bean.setTaskId(newLightTask.getTaskId()); |
| | | } |
| | | //成功用新的任务ID |
| | | for (LightTaskPoleRelation bean : oldPoleSuccess) { |
| | | bean.setTaskId(newLightTask.getTaskId()); |
| | | } |
| | | //失败用旧的任务ID |
| | | for (LightTaskPoleRelation bean : oldPoleFail) { |
| | | bean.setTaskId(lightTask.getTaskId()); |
| | | } |
| | | |
| | | //失败用旧的任务ID |
| | | for (LightTaskPoleRelation bean : closePoleFail) { |
| | | bean.setTaskId(lightTask.getTaskId()); |
| | | } |
| | | |
| | | List<LightTaskPoleRelation> all = new ArrayList<>(); |
| | | all.addAll(newPoleSuccess); |
| | | all.addAll(oldPoleSuccess); |
| | | all.addAll(oldPoleFail); |
| | | all.addAll(closePoleFail); |
| | | |
| | | |
| | | List<Long> allPoleId = new ArrayList<>(); |
| | | for (LightTaskPoleRelation bean : newPoleSuccess) { |
| | | allPoleId.add(bean.getPoleId()); |
| | | } |
| | | for (LightTaskPoleRelation bean : oldPoleSuccess) { |
| | | allPoleId.add(bean.getPoleId()); |
| | | } |
| | | for (LightTaskPoleRelation bean : oldPoleFail) { |
| | | allPoleId.add(bean.getPoleId()); |
| | | } |
| | | for (LightTaskPoleRelation bean : closePoleSuccess) { |
| | | allPoleId.add(bean.getPoleId()); |
| | | } |
| | | |
| | | if (!allPoleId.isEmpty()) { |
| | | lightTaskPoleRelationService.remove(Wrappers.lambdaQuery(LightTaskPoleRelation.class).in(LightTaskPoleRelation::getPoleId, allPoleId)); |
| | | |
| | | } |
| | | if (!all.isEmpty()) { |
| | | lightTaskPoleRelationService.saveBatch(all); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 下发路灯任务日志记录开始 |
| | | */ |
| | | String content1 = "{任务ID:" + newLightTask.getTaskId() + ", 任务名:" + newLightTask.getTaskName() + "}," + " 灯杆ID:" + param.getPoleIdList().toString() + " }"; |
| | | StoreOperationRecordsUtils.storeOperationData(poleCodeList, null, "下发路灯任务", content1); |
| | | /** |
| | | * 下发路灯任务日志记录结束 |
| | | */ |
| | | |
| | | // if (oldPoleFail.isEmpty() && closePoleFail.isEmpty()) { |
| | | // //全部成功 |
| | | // return 0; |
| | | // } else if (!closeLight.isEmpty() || !oldPoleFail.isEmpty()) { |
| | | // //关灯失败 或者覆盖任务失败 |
| | | // return 1; |
| | | // } else if (newPoleSuccess.isEmpty() && oldPoleSuccess.isEmpty() && closeSuccess.isEmpty()) { |
| | | // //编辑全部失败 |
| | | // return 2; |
| | | // } else { |
| | | // //其他情况 |
| | | // return -1; |
| | | // } |
| | | |
| | | // if (newPoleFail.isEmpty() && oldPoleFail.isEmpty() && closePoleFail.isEmpty()) { |
| | | // //编辑成功 |
| | | // return 0; |
| | | // } else if (newPoleSuccess.isEmpty() && oldPoleSuccess.isEmpty() && closePoleSuccess.isEmpty()) { |
| | | // //编辑失败 |
| | | // return 1; |
| | | // } else { |
| | | // //在旧任务基础上编辑 |
| | | // if (lightTask.getTaskId().equals(newLightTask.getTaskId())) { |
| | | // //只有旧任务 |
| | | // return 2; |
| | | // } else { |
| | | // //有新任务,有旧任务 |
| | | // return 3; |
| | | // } |
| | | // } |
| | | |
| | | if (newPoleFail.isEmpty() && oldPoleFail.isEmpty() && closePoleFail.isEmpty()) { |
| | | return "编辑成功"; |
| | | } else if (newPoleSuccess.isEmpty() && oldPoleSuccess.isEmpty() && closePoleSuccess.isEmpty()) { |
| | | throw new BusinessException("编辑失败"); |
| | | } else if (!closePoleFail.isEmpty() || !oldPoleFail.isEmpty()) { |
| | | return "原任务中存在下发异常,原任务保留,创建新任务进行保存"; |
| | | } else if (!newPoleFail.isEmpty()) { |
| | | return "新任务中存在下发异常,忽略异常操作的灯杆"; |
| | | }else { |
| | | return "操作异常"; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | public A5LightTimerRespInnerFrame sendTimeRRpc(String framePayload, String deviceCode, String lightAddress) { |
| | | IRequestFrame requestFrame = FrameBuilder.builderA5().innerFrame(new A5LightTimerReqInnerFrame(framePayload, lightAddress)).orderType(A5OrderEnum.REQUEST_LIGHT_DATA.getCode()).build(); |
| | | WrapResponseCommonFrame<A5LightTimerRespInnerFrame> responseCommonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(deviceCode, requestFrame, A5LightTimerRespInnerFrame.class); |
| | | |
| | | StoreOperationRecordsUtils.storeInnerFrameData(deviceCode, "单灯帧-控灯", requestFrame, responseCommonFrame); |
| | | |
| | | return Optional.ofNullable(responseCommonFrame).map(WrapResponseCommonFrame::getResponseInnerFrame).orElse(null); |
| | | } |
| | | |
| | |
| | | return page; |
| | | } |
| | | |
| | | |
| | | // 每个路灯发送控制帧 返回关联列表 |
| | | /** |
| | | * 用于任务新增,下发 |
| | | * |
| | | * @param lightTask |
| | | * @param poleIdList |
| | | * @param framePayload |
| | | * @param lightAddress |
| | | * @return |
| | | */ |
| | | private List<LightTaskPoleRelation> sendControllerFrame(LightTask lightTask, List<Long> poleIdList, String framePayload, String lightAddress) { |
| | | List<LightTaskPoleRelation> lightTaskPoleRelationList = new ArrayList<>(); |
| | | //成功 |
| | |
| | | for (Pole pole : poles) { |
| | | LightTaskPoleRelation lightTaskPoleRelation = new LightTaskPoleRelation(); |
| | | lightTaskPoleRelation.setPoleId(pole.getId()); |
| | | // lightTaskPoleRelation.setTaskId(lightTask.getTaskId()); |
| | | lightTaskPoleRelation.setTaskId(lightTask.getTaskId()); |
| | | // rrpc 发生定时命令 |
| | | try { |
| | | A5LightTimerRespInnerFrame a5LightTimerRespInnerFrame = sendTimeRRpc(framePayload, pole.getDeviceCode(), lightAddress); |
| | |
| | | return lightTaskPoleRelationList; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 用于任务编辑 |
| | | * |
| | | * @param poleIdList |
| | | * @param framePayload |
| | | * @param lightAddress |
| | | * @return |
| | | */ |
| | | private Map<String, List<LightTaskPoleRelation>> sendControllerFrame(List<Long> poleIdList, String framePayload, String lightAddress) { |
| | | List<LightTaskPoleRelation> lightTaskPoleRelationList = new ArrayList<>(); |
| | | //成功 |