Explorar el Código

修改下发任务对机场的校验

tags/v1.3.1
wanjing hace 1 año
padre
commit
1b8788a626
Se han modificado 3 ficheros con 33 adiciones y 7 borrados
  1. +3
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/PermissionController.java
  2. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/dto/PermissionRoleIdListByApiUrlDto.java
  3. +29
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/execute/ExecuteTaskService.java

+ 3
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/PermissionController.java Ver fichero

@@ -1,6 +1,6 @@
package com.tuoheng.admin.controller;

import com.tuoheng.admin.dto.GetPermissionRoleIdListByApiUrlDto;
import com.tuoheng.admin.dto.PermissionRoleIdListByApiUrlDto;
import com.tuoheng.admin.entity.OpPermissions;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.query.RoleClientQuery;
@@ -39,8 +39,8 @@ public class PermissionController{
* @return
*/
@PostMapping("/getRoleIdList")
public JsonResult getRoleIdListByApiUrl(@RequestBody GetPermissionRoleIdListByApiUrlDto getPermissionRoleIdListByApiUrlDto) {
return permissionService.getRoleIdListByApiUrl(getPermissionRoleIdListByApiUrlDto.getApiUrl());
public JsonResult getRoleIdListByApiUrl(@RequestBody PermissionRoleIdListByApiUrlDto permissionRoleIdListByApiUrlDto) {
return permissionService.getRoleIdListByApiUrl(permissionRoleIdListByApiUrlDto.getApiUrl());
}

/**

tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/dto/GetPermissionRoleIdListByApiUrlDto.java → tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/dto/PermissionRoleIdListByApiUrlDto.java Ver fichero

@@ -8,7 +8,7 @@ import lombok.Data;
* @date 2022/11/17 13:21
*/
@Data
public class GetPermissionRoleIdListByApiUrlDto {
public class PermissionRoleIdListByApiUrlDto {

private String apiUrl;


+ 29
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/execute/ExecuteTaskService.java Ver fichero

@@ -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();
}

/**
* 修改任务执行
*

Cargando…
Cancelar
Guardar