Просмотр исходного кода

修改核实完成代码

tags/v1.2.0^2
wanjing 1 год назад
Родитель
Сommit
1b372ac4c6
1 измененных файлов: 5 добавлений и 8 удалений
  1. +5
    -8
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/verify/AccidentVerifyCompletedService.java

+ 5
- 8
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/verify/AccidentVerifyCompletedService.java Просмотреть файл

@@ -66,7 +66,6 @@ public class AccidentVerifyCompletedService {
User user = CurrentUserUtil.getUserInfo();
String userId = user.getId();
String tenantId = user.getTenantId();

JsonResult result = this.check(tenantId, request);
if (0 != result.getCode()) {
log.info("事故核实完成业务:校验失败:{}", result.getMsg());
@@ -74,11 +73,11 @@ public class AccidentVerifyCompletedService {
}
Accident accident = (Accident) result.getData();

this.updateAccident(accident.getId(), userId);

// 无人机回仓
this.droneReturn(accident.getInspectionId());

this.updateAccident(accident.getId(), userId);

return JsonResult.success();
}

@@ -100,8 +99,8 @@ public class AccidentVerifyCompletedService {
if (ObjectUtil.isNull(accident)) {
throw new ServiceException("事故不存在");
}
if (AccidentStatusEnum.UNTREATED.getCode() == accident.getStatus()) {
throw new ServiceException("该事故已处理,不能在核实");
if (AccidentStatusEnum.PROCESSED.getCode() == accident.getStatus()) {
throw new ServiceException("该事故未处理,不能核实完成");
}
return JsonResult.success(accident);
}
@@ -121,10 +120,9 @@ public class AccidentVerifyCompletedService {
jsonObject.put("taskId", inspection.getId());
jsonObject.put("airportId", inspection.getAirportId());
jsonObject.put("msg", "回仓");

JsonResult jsonResult = droneControlService.execute(jsonObject);
if (0 != jsonResult.getCode()) {
throw new ServiceException("机场平台返回,返回无人机回仓失败");
log.info("事故核实完成,调用机场平台,返回无人机回仓失败");
}
}

@@ -137,7 +135,6 @@ public class AccidentVerifyCompletedService {
private void updateAccident(String id, String userId) {
Accident accidentUpdate = new Accident();
accidentUpdate.setId(id);
accidentUpdate.setStatus(AccidentStatusEnum.PROCESSED.getCode());
accidentUpdate.setUpdateUser(userId);
accidentUpdate.setUpdateTime(DateUtils.now());
accidentUpdate.setEndTime(DateUtils.now());

Загрузка…
Отмена
Сохранить