| | |
| | | } |
| | | |
| | | |
| | | |
| | | List<LightTaskPoleRelation> newPoleMap = new ArrayList<>(); |
| | | if (!poleIdList.isEmpty()) { |
| | | //新灯杆下发新任务 |
| | | newPoleMap = sendControllerFrame(newLightTask, poleIdList, newLightTask.getFramePayload(), param.getLightAddress()); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | List<LightTaskPoleRelation> newPoleAll = new ArrayList<>(); |
| | | List<LightTaskPoleRelation> newPoleSuccess = new ArrayList<>(); |
| | | List<LightTaskPoleRelation> newPoleFail = new ArrayList<>(); |
| | |
| | | newPoleFail = newPoleMap.getOrDefault("fail", 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<>()); |
| | | oldPoleSuccess = oldPoleMap.getOrDefault("success", new ArrayList<>()); |
| | | } |
| | | |
| | | |
| | | List<LightTaskPoleRelation> closePoleFail = new ArrayList<>(); |
| | | List<LightTaskPoleRelation> closePoleSuccess = new ArrayList<>(); |
| | | if (CollectionUtil.isNotEmpty(closeLight)) { |
| | | System.out.println(closeLight + "closeLight"); |
| | | if (CollectionUtil.isNotEmpty(closeLight) && closeLight != null&& closeLight.get(0) != null) { |
| | | //关灯内帧 |
| | | 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<>()); |
| | |
| | | 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) { |
| | |
| | | |
| | | List<LightTaskPoleRelation> all = new ArrayList<>(); |
| | | all.addAll(newPoleSuccess); |
| | | all.addAll(oldPoleFail); |
| | | // all.addAll(closePoleFail); |
| | | |
| | | |
| | |
| | | allPoleId.add(bean.getPoleId()); |
| | | } |
| | | for (LightTaskPoleRelation bean : closePoleSuccess) { |
| | | allPoleId.add(bean.getPoleId()); |
| | | } |
| | | for (LightTaskPoleRelation bean : oldPoleSuccess) { |
| | | allPoleId.add(bean.getPoleId()); |
| | | } |
| | | |
| | |
| | | for (Pole pole : poles) { |
| | | if (pole.getDeviceCode() == null || pole.getDeviceCode().equals("")) { |
| | | removeById(lightTask.getTaskId()); |
| | | throw new BusinessException("灯杆不存在mac,不能下发任务 请检查灯杆是否存在单灯"); |
| | | throw new BusinessException("编辑的灯杆或原有任务的灯杆不存在mac,不能下发任务 请检查灯杆是否存在单灯"); |
| | | } |
| | | LightTaskPoleRelation lightTaskPoleRelation = new LightTaskPoleRelation(); |
| | | lightTaskPoleRelation.setPoleId(pole.getId()); |
| | |
| | | |
| | | for (Pole pole : poles) { |
| | | if (pole.getDeviceCode() == null || pole.getDeviceCode().equals("")) { |
| | | throw new BusinessException("灯杆不存在mac,不能下发任务 请检查灯杆是否存在单灯"); |
| | | throw new BusinessException("编辑的灯杆或原有任务的灯杆不存在mac,不能下发任务 请检查灯杆是否存在单灯"); |
| | | } |
| | | LightTaskPoleRelation lightTaskPoleRelation = new LightTaskPoleRelation(); |
| | | lightTaskPoleRelation.setPoleId(pole.getId()); |