Sfoglia il codice sorgente

问题分布只查询已经确认的数据

tags/v1.1.0
qiujinyang 2 anni fa
parent
commit
0f41706222
8 ha cambiato i file con 24 aggiunte e 16 eliminazioni
  1. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/DspServiceImpl.java
  2. +12
    -8
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/MissionServiceImpl.java
  3. +6
    -2
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/QuestionServiceImpl.java
  4. +1
    -1
      tuoheng-admin/src/main/resources/application-airport.yml
  5. +1
    -1
      tuoheng-admin/src/main/resources/application-dev.yml
  6. +1
    -1
      tuoheng-admin/src/main/resources/application-local.yml
  7. +1
    -1
      tuoheng-admin/src/main/resources/application-prod.yml
  8. +1
    -1
      tuoheng-admin/src/main/resources/application-test.yml

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/DspServiceImpl.java Vedi File

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

+ 12
- 8
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/MissionServiceImpl.java Vedi File

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

+ 6
- 2
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/QuestionServiceImpl.java Vedi File

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

+ 1
- 1
tuoheng-admin/src/main/resources/application-airport.yml Vedi File

@@ -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

+ 1
- 1
tuoheng-admin/src/main/resources/application-dev.yml Vedi File

@@ -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

+ 1
- 1
tuoheng-admin/src/main/resources/application-local.yml Vedi File

@@ -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

+ 1
- 1
tuoheng-admin/src/main/resources/application-prod.yml Vedi File

@@ -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

+ 1
- 1
tuoheng-admin/src/main/resources/application-test.yml Vedi File

@@ -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

Loading…
Annulla
Salva