Browse Source

修改DSP回调错误

tags/v1.1.0
qiujinyang 2 years ago
parent
commit
5997da6366
1 changed files with 11 additions and 6 deletions
  1. +11
    -6
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/QuestionServiceImpl.java

+ 11
- 6
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/QuestionServiceImpl.java View File

@@ -165,13 +165,11 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio
Boolean aBoolean = saveQuestion(callbackRequest, mission);
//如果任务已经完成就修改任务状态
ThMission thMissionUpdate=new ThMission(UpdateOrCreateEnum.UPDATE.getCode());

thMissionUpdate.setProgressbar(callbackRequest.getProgress());
if(aBoolean){
//添加进度
thMissionUpdate.setProgressbar(callbackRequest.getProgress());
setComplate(callbackRequest, mission, thMissionUpdate);
}else{
//添加进度
thMissionUpdate.setProgressbar(callbackRequest.getProgress());
setTaskStatusEnum(thMissionUpdate, TaskStatusEnum.FAIL, mission);
}
return JsonResult.success();
@@ -188,10 +186,11 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio
//这边存回放的视频地址
thMissionUpdate.setVideoUrl(callbackRequest.getVideoUrl());
thMissionUpdate.setAiVideoUrl(callbackRequest.getAiVideoUrl());
setTaskStatusEnum(thMissionUpdate, TaskStatusEnum.COMPLETE, mission);
}else if(callbackRequest.getAnalyseStatus()== AiAnalyseStatusEnum.FAILED.getCode()){
thMissionUpdate.setStatus(TaskStatusEnum.FAIL.getCode());
setTaskStatusEnum(thMissionUpdate, TaskStatusEnum.FAIL, mission);
}
setTaskStatusEnum(thMissionUpdate, TaskStatusEnum.COMPLETE, mission);
}

private Boolean saveQuestion(CallbackRequest callbackRequest, ThMission mission) {
@@ -199,6 +198,9 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio
//获取当前飞行坐标,存问题的经纬度
List<ThInspection> flightDataList = getThInspections(mission);
List<Question> questionList = getQuestionList(mission, questionFiles, flightDataList);
if(questionList.size()==0){
return true;
}
return saveBatch(questionList);
}

@@ -211,6 +213,9 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio

private List<Question> getQuestionList(ThMission mission, List<CallbackRequest.QuestionFilesDTO> questionFiles, List<ThInspection> flightDataList) {
List<Question> questionList=new ArrayList<>();
if(ObjectUtil.isEmpty(questionFiles)){
return questionList;
}
for (CallbackRequest.QuestionFilesDTO questionFile : questionFiles) {
Question question=new Question(UpdateOrCreateEnum.CREATE.getCode());
ThInspection flightDataByTime = getFlightDataByTime(flightDataList, questionFile.getAnalyseTime().getTime());

Loading…
Cancel
Save