Browse Source

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

tags/v1.2.0^2
chengwang 1 year ago
parent
commit
55952b3bac
2 changed files with 13 additions and 6 deletions
  1. +12
    -5
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/PointFlightService.java
  2. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallbackServiceImpl.java

+ 12
- 5
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/PointFlightService.java View File

@@ -42,18 +42,23 @@ public class PointFlightService {

@Transactional(propagation = Propagation.REQUIRED)
public JsonResult pointFlight(AccidentFlightRequest request) {
log.info("执行应急飞行起飞,request={}",request);
//先创建应急任务--->执行定点飞行任务
//校验
if(StringUtils.isEmpty(request.getLongitude())){
log.info("经度,lon={}",request.getLongitude());
return JsonResult.error(AccidentEnum.LONGITUDE_IS_NULL.getCode(),AccidentEnum.LONGITUDE_IS_NULL.getMsg());
}
if(StringUtils.isEmpty(request.getLatitude())){
log.info("经度,lat={}",request.getLatitude());
return JsonResult.error(AccidentEnum.LATITUDE_IS_NULL.getCode(),AccidentEnum.LATITUDE_IS_NULL.getMsg());
}
if(null == request.getAirportId()){
log.info("机场id,id={}",request.getAirportId());
return JsonResult.error(AccidentEnum.AIRPORT_ID_IS_NULL.getCode(),AccidentEnum.AIRPORT_ID_IS_NULL.getMsg());
}
if(StringUtils.isEmpty(request.getAirportName())){
log.info("机场名称,airportName={}",request.getAirportName());
return JsonResult.error(AccidentEnum.AIRPORT_NAME_IS_NULL.getCode(),AccidentEnum.AIRPORT_NAME_IS_NULL.getMsg());
}
//获取当前用户及租户信息
@@ -61,15 +66,15 @@ public class PointFlightService {
String tenantId = CurrentUserUtil.getTenantId();
//获取租户信息
Tenant tenant = this.getTenant(tenantId);
log.info("当前登录用户租户id,tenantId={}",tenant);
//创建应急任务
Inspection inspection = this.createInspection(user, request);
log.info("生成的应急任务,inspection={}",inspection);

//调用机场平台进行飞行
//因任务为原来新的应急任务不用关心其他正在巡检飞行的任务
if(inspection.getAirportId() != request.getAirportId()){
throw new ServiceException("新的应急任务机场id和选择的机场id不对应");
}
this.callNewAirport(tenant,request,inspection.getId());
boolean flag = this.callNewAirport(tenant, request, inspection.getId());
log.info("调用机场进行飞行,flag={}",flag);

log.info("调用机场平台方法:执行定点飞行结束");

@@ -82,7 +87,7 @@ public class PointFlightService {
* @param request
* @param inspectionId
*/
private void callNewAirport(Tenant tenant,AccidentFlightRequest request,String inspectionId){
private boolean callNewAirport(Tenant tenant,AccidentFlightRequest request,String inspectionId){
String url = CommonConfig.airportURL + SystemConstant.API_AIRPORT_POINT_FLIGH;
//高度设置为60
request.setAlt("60");
@@ -104,6 +109,8 @@ public class PointFlightService {
throw new ServiceException("机场接口返回数据为空,飞行失败");
}

return true;

}

/**

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallbackServiceImpl.java View File

@@ -301,7 +301,7 @@ public class DspCallbackServiceImpl implements IDspCallbackService {
Accident accident = new Accident();
//问题类型为应急类型时添加数据
if(inspectionFile.getQuestionCode().equals(QuestionCodeEnum.PONDING.getCode())
|| inspectionFile.getQuestionCode().equals(QuestionCodeEnum.BIOCKY_CRACK.getCode())){
|| inspectionFile.getQuestionCode().equals(QuestionCodeEnum.PIT_GROOVE.getCode())){
accident.setTenantId(inspectionFile.getTenantId());
accident.setDeptId(deptId);
accident.setInspectionId(inspectionFile.getInspectionId());

Loading…
Cancel
Save