|
|
@@ -2,6 +2,7 @@ package com.tuoheng.admin.service.third.airport.execute; |
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.tuoheng.admin.dto.GetAirportListDto; |
|
|
|
import com.tuoheng.admin.entity.Inspection; |
|
|
|
import com.tuoheng.admin.entity.InspectionHistory; |
|
|
|
import com.tuoheng.admin.enums.InspectionStatusEnum; |
|
|
@@ -15,6 +16,7 @@ import com.tuoheng.admin.tzhl.constant.TZHLConstant; |
|
|
|
import com.tuoheng.admin.tzhl.response.TZHLAirportLineResponse; |
|
|
|
import com.tuoheng.admin.tzhl.response.TZHLOnlineUavResponse; |
|
|
|
import com.tuoheng.admin.tzhl.response.TZHLShelterTaskResponse; |
|
|
|
import com.tuoheng.admin.tzhl.service.airport.TZHLGetAirportListService; |
|
|
|
import com.tuoheng.admin.tzhl.service.airportline.TZHLGetAirportLineListService; |
|
|
|
import com.tuoheng.admin.tzhl.service.fly.onlineuav.OnlineUavService; |
|
|
|
import com.tuoheng.admin.tzhl.service.task.ShelterTaskService; |
|
|
@@ -41,6 +43,9 @@ public class ExecuteTaskService { |
|
|
|
@Autowired |
|
|
|
private InspectionHistoryMapper inspectionHistoryMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private TZHLGetAirportListService tzhlGetAirportListService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private TZHLGetAirportLineListService tzhlGetAirportLineListService; |
|
|
|
|
|
|
@@ -50,10 +55,11 @@ public class ExecuteTaskService { |
|
|
|
public JsonResult executeTask(String userId, Inspection inspection) { |
|
|
|
log.info("进入泰州海陵区城管,执行任务,inspectionId={}", inspection.getId()); |
|
|
|
|
|
|
|
JsonResult result = this.check(inspection); |
|
|
|
TZHLAirportLineResponse tzhlAirportLineResponse = tzhlGetAirportLineListService.getAirportLineById(inspection.getInspectionLine()); |
|
|
|
if (ObjectUtil.isEmpty(tzhlAirportLineResponse)) { |
|
|
|
log.info("泰州海陵区城管,执行任务,航线不存在,airportLineId:{}", tzhlAirportLineResponse.getId()); |
|
|
|
return JsonResult.success("泰州海陵区城管,航线不存在"); |
|
|
|
if (0 != result.getCode()) { |
|
|
|
this.insertInspectionHistory(inspection, result.getMsg()); |
|
|
|
return JsonResult.error(result.getMsg()); |
|
|
|
} |
|
|
|
|
|
|
|
Long recordId = shelterTaskService.distributeTask(inspection, tzhlAirportLineResponse); |
|
|
@@ -76,6 +82,26 @@ public class ExecuteTaskService { |
|
|
|
return JsonResult.success(); |
|
|
|
} |
|
|
|
|
|
|
|
private JsonResult check(Inspection inspection) { |
|
|
|
GetAirportListDto airportListDto = tzhlGetAirportListService.getAirport(inspection.getAirportId()); |
|
|
|
if (ObjectUtil.isEmpty(airportListDto)) { |
|
|
|
log.info("泰州海陵区城管,执行任务,机场不存在,inspectionId:{}, airportId", inspection.getId(), inspection.getAirportId()); |
|
|
|
return JsonResult.error("泰州海陵区城管,执行任务,航线不存在"); |
|
|
|
} |
|
|
|
|
|
|
|
if (1 == airportListDto.getShelterStatus()) { |
|
|
|
log.info("泰州海陵区城管,执行任务,机场被禁用,inspectionId:{}, airportId", inspection.getId(), inspection.getAirportId()); |
|
|
|
return JsonResult.error("泰州海陵区城管,执行任务,机场被禁用"); |
|
|
|
} |
|
|
|
|
|
|
|
TZHLAirportLineResponse tzhlAirportLineResponse = tzhlGetAirportLineListService.getAirportLineById(inspection.getInspectionLine()); |
|
|
|
if (ObjectUtil.isEmpty(tzhlAirportLineResponse)) { |
|
|
|
log.info("泰州海陵区城管,执行任务,航线不存在,inspectionId:{}, airportLineId", inspection.getId(), tzhlAirportLineResponse.getId()); |
|
|
|
return JsonResult.error("泰州海陵区城管,航线不存在"); |
|
|
|
} |
|
|
|
return JsonResult.success(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 修改任务执行 |
|
|
|
* |