| | |
| | | List<LightTaskPoleRelation> newPoleFail = new ArrayList<>(); |
| | | if (CollectionUtil.isNotEmpty(newPoleIdList)) { |
| | | //新灯杆下发新任务 |
| | | Map<String, List<LightTaskPoleRelation>> newPoleMap = sendControllerFrame(newPoleIdList, lightTask.getFramePayload(), param.getLightAddress()); |
| | | Map<String, List<LightTaskPoleRelation>> newPoleMap = sendControllerFrame(newPoleIdList, newLightTask.getFramePayload(), param.getLightAddress()); |
| | | |
| | | //newPoleAll集合后面用于存储关系表 |
| | | newPoleAll = newPoleMap.getOrDefault("all", new ArrayList<>()); |
| | |
| | | List<LightTaskPoleRelation> oldPoleSuccess = new ArrayList<>(); |
| | | if (CollectionUtil.isNotEmpty(oldPoleIdList)) { |
| | | //覆盖操作灯杆 |
| | | Map<String, List<LightTaskPoleRelation>> oldPoleMap = sendControllerFrame(oldPoleIdList, lightTask.getFramePayload(), param.getLightAddress()); |
| | | Map<String, List<LightTaskPoleRelation>> oldPoleMap = sendControllerFrame(oldPoleIdList, newLightTask.getFramePayload(), param.getLightAddress()); |
| | | oldPoleFail = oldPoleMap.getOrDefault("fail", new ArrayList<>()); |
| | | oldPoleSuccess = oldPoleMap.getOrDefault("success", new ArrayList<>()); |
| | | } |
| | |
| | | System.out.println(closeLight + "closeLight"); |
| | | if (CollectionUtil.isNotEmpty(closeLight) && closeLight != null && closeLight.get(0) != null) { |
| | | //关灯内帧 |
| | | String framePayloadClose = "7f0000007f173b00"; |
| | | String framePayloadClose = "7F0000007F173B00"; |
| | | //关灯操作灯杆 |
| | | Map<String, List<LightTaskPoleRelation>> closePoleMap = sendControllerFrame(closeLight, framePayloadClose, param.getLightAddress()); |
| | | closePoleFail = closePoleMap.getOrDefault("fail", new ArrayList<>()); |
| | |
| | | WrapResponseCommonFrame<A5LightTimerRespInnerFrame> responseCommonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(deviceCode, requestFrame, A5LightTimerRespInnerFrame.class); |
| | | System.out.println(responseCommonFrame + " -----------responseCommonFrame"); |
| | | StoreOperationRecordsUtils.storeInnerFrameData(deviceCode, "单灯帧-控灯", requestFrame, responseCommonFrame); |
| | | |
| | | return Optional.ofNullable(responseCommonFrame).map(WrapResponseCommonFrame::getResponseInnerFrame).orElse(null); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | private Map<String, List<LightTaskPoleRelation>> sendControllerFrame(List<Long> poleIdList, String framePayload, String lightAddress) { |
| | | |
| | | System.out.println("framePayload:" + framePayload); |
| | | List<LightTaskPoleRelation> lightTaskPoleRelationList = new ArrayList<>(); |
| | | //成功 |
| | | List<LightTaskPoleRelation> success = new ArrayList<>(); |
| | |
| | | |
| | | |
| | | // rrpc 发生定时命令 |
| | | /* if ("FFFF".equals(lightAddress)) { |
| | | if ("FFFF".equals(lightAddress)) { |
| | | LightTaskPoleRelation lightTaskPoleRelation01 = new LightTaskPoleRelation(); |
| | | lightTaskPoleRelation01.setPoleId(pole.getId()); |
| | | lightTaskPoleRelation01.setLightAddress("0001"); |
| | |
| | | |
| | | lightTaskPoleRelationList.add(lightTaskPoleRelation01); |
| | | lightTaskPoleRelationList.add(lightTaskPoleRelation02); |
| | | } else */ |
| | | { |
| | | } else { |
| | | lightTaskPoleRelation.setLightAddress(lightAddress); |
| | | // rrpc 发生定时命令 |
| | | try { |