Parcourir la source

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

tags/v1.0.0^2
wanjing il y a 1 an
Parent
révision
59cbd78de0
2 fichiers modifiés avec 23 ajouts et 1 suppressions
  1. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/Report.java
  2. +22
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/flyer/UpdateFlyerService.java

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/Report.java Voir le fichier

@@ -206,7 +206,7 @@ public class Report extends BaseEntity {
/**
* 任务状态 5任务待飞行 7飞行失败 10任务飞行中 15任务飞行完成
*/
private String status;
private Integer status;
/**
* 算法处理状态:0默认 1待上传 2待分析 3分析中 4成功 5超时 6失败

+ 22
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/flyer/UpdateFlyerService.java Voir le fichier

@@ -2,9 +2,12 @@ package com.tuoheng.admin.service.inspection.update.flyer;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.Report;
import com.tuoheng.admin.enums.TaskStatusEnum;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.mapper.ReportMapper;
import com.tuoheng.admin.request.inspection.UpdateTaskByCodeRequest;
import com.tuoheng.common.core.exception.ServiceException;
import com.tuoheng.common.core.utils.JacksonUtil;
@@ -29,6 +32,9 @@ public class UpdateFlyerService {
@Autowired
private InspectionMapper inspectionMapper;

@Autowired
private ReportMapper reportMapper;

@Autowired
private OnlineIdentifService onlineIdentifService;

@@ -138,5 +144,21 @@ public class UpdateFlyerService {
inspection.setStatus(request.getStatus());
inspection.setExecutionEndTime(request.getFlightEndTime());
inspectionMapper.updateById(inspection);

this.updateReport(inspection);
}

private void updateReport(Inspection inspection) {
Report report = reportMapper.selectOne(Wrappers.<Report>lambdaQuery()
.eq(Report::getInspectionId, inspection.getId())
.eq(Report::getMark, 1));
if (ObjectUtil.isNull(report)) {
log.info("该任务还没有生成报告,不需要修改报告的完成时间和状态");
return;
}
report.setStatus(inspection.getStatus());
report.setExecutionEndTime(inspection.getExecutionEndTime());
reportMapper.updateById(report);
}

}

Chargement…
Annuler
Enregistrer