@@ -32,7 +32,7 @@ public class DspServiceImpl implements IDspService { | |||
@Override | |||
public JSONObject serviceStopApplication(JSONObject jsonObject) { | |||
String url = dspDomainUrl + "api/web/serviceInst/92cee2e917366746e5d2b0ac28799d02/stop"; | |||
String url = dspDomainUrl + "api/web/serviceInst/"+jsonObject.getString("requestId")+"/stop"; | |||
String result = doSend(url, jsonObject, null,"PUT"); | |||
return JSONObject.parseObject(result); | |||
} |
@@ -103,7 +103,7 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi | |||
if(AirPortTaskStatusEnum.FLIGHT.getCode()==missionStatusRequest.getStatus()){ | |||
ThMission thMission = getRecentlyRecord(missionStatusRequest,TaskStatusEnum.WAIT.getCode()); | |||
Assert.notNull(thMission, "飞行任务不能为空!"); | |||
ThMission thMissionUpdate = setStatus(missionStatusRequest, thMission); | |||
ThMission thMissionUpdate = setStatus(missionStatusRequest, thMission,AirPortTaskStatusEnum.FLIGHT); | |||
//开始分析 | |||
JSONObject jsonObject = startAI(missionStatusRequest); | |||
thMissionUpdate.setRequestId(jsonObject.getJSONObject("data").getString("requestId")); | |||
@@ -164,11 +164,13 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi | |||
private void stopAI(MissionStatusRequest missionStatusRequest) { | |||
ThMission thMission = getRecentlyRecord(missionStatusRequest,TaskStatusEnum.FLIGHT.getCode()); | |||
Assert.notNull(thMission, "飞行任务不能为空!"); | |||
ThMission thMissionUpdate = setStatus(missionStatusRequest, thMission); | |||
ThMission thMissionUpdate = setStatus(missionStatusRequest, thMission,AirPortTaskStatusEnum.WAIT); | |||
if(thMissionMapper.updateById(thMissionUpdate) > 0){ | |||
//任务调用完成之后,调用发送通道,请求DSP关闭请求 | |||
//调用DSP接口 | |||
JSONObject responseJson = dspService.serviceStopApplication(new JSONObject()); | |||
JSONObject jsonObject = new JSONObject(); | |||
jsonObject.put("requestId",thMission.getRequestId()); | |||
JSONObject responseJson = dspService.serviceStopApplication(jsonObject); | |||
if(responseJson.getIntValue("code") == 0){ | |||
String requestId = responseJson.getJSONObject("data").getString("requestId"); | |||
log.info("dsp实时调用响应requestId:{}",requestId); | |||
@@ -179,13 +181,15 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi | |||
} | |||
} | |||
private ThMission setStatus(MissionStatusRequest missionStatusRequest, ThMission thMission) { | |||
private ThMission setStatus(MissionStatusRequest missionStatusRequest, ThMission thMission,AirPortTaskStatusEnum airPortTaskStatusEnum) { | |||
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode()); | |||
thMissionUpdate.setId(thMission.getId()); | |||
thMissionUpdate.setPushUrl(missionStatusRequest.getPushUrl()); | |||
thMissionUpdate.setPullUrl(missionStatusRequest.getPullUrl()); | |||
if(missionStatusRequest.getStatus()==AirPortTaskStatusEnum.FLIGHT.getCode()){ | |||
if(missionStatusRequest.getStatus()==AirPortTaskStatusEnum.FLIGHT.getCode() && airPortTaskStatusEnum.getCode()==AirPortTaskStatusEnum.FLIGHT.getCode()){ | |||
thMissionUpdate.setPushUrl(missionStatusRequest.getPushUrl()); | |||
thMissionUpdate.setPullUrl(missionStatusRequest.getPullUrl()); | |||
thMissionUpdate.setStatus(TaskStatusEnum.FLIGHT.getCode()); | |||
}else{ | |||
thMissionUpdate.setStatus(TaskStatusEnum.COMPLETE.getCode()); | |||
} | |||
return thMissionUpdate; | |||
} | |||
@@ -196,7 +200,7 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi | |||
lambdaQueryWrapper.orderByAsc(ThMission::getExecutionStartTime); | |||
lambdaQueryWrapper.eq(ThMission::getInspectionLine, missionStatusRequest.getId()); | |||
lambdaQueryWrapper.eq(ThMission::getStatus,status); | |||
lambdaQueryWrapper.eq(ThMission::getTenantId,ShiroUtils.getTenantId()); | |||
//lambdaQueryWrapper.eq(ThMission::getTenantId,ShiroUtils.getTenantId()); | |||
List<ThMission> thMissions = thMissionMapper.selectList(lambdaQueryWrapper); | |||
return thMissions.size()>0? thMissions.get(0) : null; | |||
} |
@@ -63,12 +63,13 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio | |||
public List<Question> distributed(QuestionQuery query) { | |||
List<ThMission> thMissions = missionMapper.selectList(new LambdaQueryWrapper<ThMission>() | |||
.eq(ThMission::getMark, MarkTypeEnum.VALID.getCode()) | |||
.eq(ThMission::getStatus, QuestionStatusEnum.CONFIRM.getCode()) | |||
.orderByDesc(ThMission::getUpdateTime)); | |||
return getQuestions(query, thMissions); | |||
} | |||
private List<Question> getQuestions(QuestionQuery query, List<ThMission> thMissions) { | |||
List<Question> questionList = questionMapper.selectList(new LambdaQueryWrapper<Question>() | |||
return questionMapper.selectList(new LambdaQueryWrapper<Question>() | |||
//只需要取最上面的那一条 | |||
.eq(ObjectUtil.isNotEmpty(query.getMissionId()), Question::getMissionId, thMissions.get(0).getId()) | |||
.like(ObjectUtil.isNotEmpty(query.getMissionName()), Question::getMissionName, query.getMissionName()) | |||
@@ -77,7 +78,6 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio | |||
.eq(ObjectUtil.isNotEmpty(query.getStatus()), Question::getStatus, query.getStatus()) | |||
.eq(Question::getTenantId, ShiroUtils.getTenantId()) | |||
.eq(Question::getMark, MarkTypeEnum.VALID.getCode()).orderByDesc(Question::getCreateTime)); | |||
return questionList; | |||
} | |||
@Override | |||
@@ -179,6 +179,10 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio | |||
private Boolean saveQuestion(CallbackRequest callbackRequest, ThMission mission) { | |||
List<CallbackRequest.QuestionFilesDTO> questionFiles = callbackRequest.getQuestionFiles(); | |||
//获取当前飞行坐标,存问题的经纬度 | |||
List<Question> questionList=new ArrayList<>(); | |||
for (CallbackRequest.QuestionFilesDTO questionFile : questionFiles) { | |||
Question question=new Question(UpdateOrCreateEnum.CREATE.getCode()); |
@@ -23,7 +23,7 @@ tuoheng: | |||
# DSP服务域名 | |||
dsp-domain-url: http://192.168.11.241:1011/ | |||
# DSP回调地址 | |||
dsp-callback-url: http://192.168.11.11:9099/api/question/{requestId}/callback | |||
dsp-callback-url: http://192.168.13.142:9099/api/question/{requestId}/callback | |||
#阿里云 | |||
aliyuncsVod: | |||
accessKeyId: LTAI5tE7KWN9fsuGU7DyfYF4 |
@@ -23,7 +23,7 @@ tuoheng: | |||
# DSP服务域名 | |||
dsp-domain-url: http://192.168.11.241:1011/ | |||
# DSP回调地址 | |||
dsp-callback-url: http://192.168.11.11:9099/api/question/{requestId}/callback | |||
dsp-callback-url: http://192.168.13.142:9099/api/question/{requestId}/callback | |||
#阿里云 | |||
aliyuncsVod: | |||
accessKeyId: LTAI5tE7KWN9fsuGU7DyfYF4 |
@@ -23,7 +23,7 @@ tuoheng: | |||
# DSP服务域名 | |||
dsp-domain-url: http://192.168.11.241:1011/ | |||
# DSP回调地址 | |||
dsp-callback-url: http://192.168.11.11:9099/api/question/{requestId}/callback | |||
dsp-callback-url: http://192.168.13.142:9099/api/question/{requestId}/callback | |||
#阿里云 | |||
aliyuncsVod: | |||
accessKeyId: LTAI5tE7KWN9fsuGU7DyfYF4 |
@@ -23,7 +23,7 @@ tuoheng: | |||
# DSP服务域名 | |||
dsp-domain-url: http://192.168.11.241:1011/ | |||
# DSP回调地址 | |||
dsp-callback-url: http://192.168.11.11:9099/api/question/{requestId}/callback | |||
dsp-callback-url: http://192.168.13.142:9099/api/question/{requestId}/callback | |||
#阿里云 | |||
aliyuncsVod: | |||
accessKeyId: LTAI5tE7KWN9fsuGU7DyfYF4 |
@@ -23,7 +23,7 @@ tuoheng: | |||
# DSP服务域名 | |||
dsp-domain-url: http://192.168.11.241:1011/ | |||
# DSP回调地址 | |||
dsp-callback-url: http://192.168.11.11:9099/api/question/{requestId}/callback | |||
dsp-callback-url: http://192.168.13.142:9099/api/question/{requestId}/callback | |||
#阿里云 | |||
aliyuncsVod: | |||
accessKeyId: LTAI5tE7KWN9fsuGU7DyfYF4 |