| | |
| | | //取出覆盖操作的关系信息 |
| | | //记录这些灯杆原先的任务 |
| | | List<LightTaskPoleRelation> oldRelation = new ArrayList<>(); |
| | | if ("FFFF".equals(param.getLightAddress())) { //todo |
| | | if ("FFFF".equals(param.getLightAddress())) { |
| | | // 灯杆中存在其他任务的灯头 |
| | | if (CollectionUtil.isNotEmpty(oldPoleIdList)) { |
| | | oldRelation = lightTaskPoleRelationService.list(Wrappers.lambdaQuery(LightTaskPoleRelation.class).in(LightTaskPoleRelation::getPoleId, oldPoleIdList) |
| | |
| | | List<LightTaskPoleRelation> all = new ArrayList<>(); |
| | | all.addAll(newPoleSuccess); |
| | | all.addAll(oldPoleFail); |
| | | // all.addAll(closePoleFail); |
| | | all.addAll(oldPoleSuccess); |
| | | all.addAll(oldPoleFail); |
| | | all.addAll(closePoleFail); |
| | | |
| | | |
| | | List<Long> allPoleId = new ArrayList<>(); |
| | |
| | | * 下发路灯任务日志记录结束 |
| | | */ |
| | | |
| | | if (newPoleFail.isEmpty() && closePoleFail.isEmpty()) { |
| | | if (newPoleFail.isEmpty() && closePoleFail.isEmpty() && oldPoleFail.isEmpty()) { |
| | | return "编辑成功"; |
| | | } else if (newPoleSuccess.isEmpty() && closePoleSuccess.isEmpty()) { |
| | | } else if (newPoleSuccess.isEmpty() && closePoleSuccess.isEmpty() && oldPoleSuccess.isEmpty()) { |
| | | throw new BusinessException("编辑失败,请检查原有设备和编辑后的设备是否在线!"); |
| | | } else if (!closePoleFail.isEmpty() && !newPoleSuccess.isEmpty()) { |
| | | } else if (!closePoleFail.isEmpty() && !newPoleSuccess.isEmpty() && !oldPoleFail.isEmpty()) { |
| | | return "原任务中存在下发异常,原任务保留,创建新任务进行保存"; |
| | | } else if (!newPoleFail.isEmpty() && !newPoleSuccess.isEmpty()) { |
| | | return "新任务中存在下发异常,忽略异常操作的灯杆"; |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | public boolean clearLightTask(List<Long> poleIds) { |
| | | Map<String, List<LightTaskPoleRelation>> ffff = sendControllerFrame(poleIds, "", "FFFF"); |
| | | ffff.get("success").forEach(lightTaskPoleRelation -> { |
| | | lightTaskPoleRelationService.remove(Wrappers.lambdaUpdate(LightTaskPoleRelation.class).eq(LightTaskPoleRelation::getPoleId, lightTaskPoleRelation.getPoleId()).eq(LightTaskPoleRelation::getTaskId, lightTaskPoleRelation.getTaskId())); |
| | | }); |
| | | return true; |
| | | } |
| | | } |