|
@@ -6,7 +6,6 @@ package com.taais.biz.service.impl;
|
|
|
|
|
|
import cn.hutool.core.lang.Dict;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
-import com.alibaba.fastjson2.JSON;
|
|
|
import com.mybatisflex.core.paginate.Page;
|
|
|
import com.mybatisflex.core.query.QueryWrapper;
|
|
|
import com.taais.biz.constant.BizConstant;
|
|
@@ -24,19 +23,13 @@ import com.taais.common.core.constant.Constants;
|
|
|
import com.taais.common.core.core.domain.CommonResult;
|
|
|
import com.taais.common.core.core.page.PageResult;
|
|
|
import com.taais.common.core.utils.MapstructUtils;
|
|
|
-import com.taais.common.core.utils.StringUtils;
|
|
|
import com.taais.common.json.utils.JsonUtils;
|
|
|
import com.taais.common.orm.core.page.PageQuery;
|
|
|
import com.taais.common.orm.core.service.impl.BaseServiceImpl;
|
|
|
import com.taais.common.websocket.utils.WebSocketUtils;
|
|
|
-import com.taais.system.domain.SysOss;
|
|
|
import com.taais.system.domain.vo.SysOssVo;
|
|
|
import com.taais.system.service.ISysOssService;
|
|
|
-import com.taais.system.service.impl.SysOssServiceImpl;
|
|
|
-
|
|
|
import jakarta.annotation.Resource;
|
|
|
-
|
|
|
-import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.core.io.FileSystemResource;
|
|
@@ -50,24 +43,24 @@ import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.nio.file.Path;
|
|
|
import java.nio.file.Paths;
|
|
|
-import java.text.DecimalFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
import static com.taais.biz.constant.BizConstant.VideoStatus.NOT_START;
|
|
|
import static com.taais.biz.domain.table.TrackSequenceTableDef.TRACK_SEQUENCE;
|
|
|
-import static com.taais.biz.service.impl.TargetDetectionServiceImpl.*;
|
|
|
+import static com.taais.biz.service.impl.TargetDetectionServiceImpl.getTrainInputPath;
|
|
|
import static com.taais.biz.service.impl.ToInfraredServiceImpl.*;
|
|
|
-import static com.taais.biz.service.impl.VideoStableServiceImpl.*;
|
|
|
+import static com.taais.biz.service.impl.VideoStableServiceImpl.makeDir;
|
|
|
+import static com.taais.biz.service.impl.VideoStableServiceImpl.sendPostMsg;
|
|
|
|
|
|
/**
|
|
|
* 注视轨迹序列Service业务层处理
|
|
|
*
|
|
|
* @author wangkang
|
|
|
- * 2024-09-22
|
|
|
+ * 2024-09-22
|
|
|
*/
|
|
|
@Service
|
|
|
public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMapper, TrackSequence>
|
|
|
- implements ITrackSequenceService {
|
|
|
+ implements ITrackSequenceService {
|
|
|
|
|
|
private static final String MASC = "MASC";
|
|
|
private static final String CAT = "CAT";
|
|
@@ -195,16 +188,19 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
|
|
|
Long modelId = entity.getAlgorithmModelId();
|
|
|
if (ObjectUtil.isNotNull(modelId)) {
|
|
|
AlgorithmModelTrack model = algorithmModelTrackService.getById(modelId);
|
|
|
- entity.setModelName(model.getModelName());
|
|
|
-
|
|
|
+ if (ObjectUtil.isNotNull(model)) {
|
|
|
+ entity.setModelName(model.getModelName());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Long algorithmId = entity.getAlgorithmId();
|
|
|
if (ObjectUtil.isNotNull(algorithmId)) {
|
|
|
AlgorithmConfigTrackVo config = algorithmConfigTrackService.selectById(algorithmId);
|
|
|
- entity.setType(config.getType());
|
|
|
- entity.setSubsystem(config.getSubsystem());
|
|
|
- entity.setAlgorithmName(config.getAlgorithmName());
|
|
|
+ if (ObjectUtil.isNotNull(config)) {
|
|
|
+ entity.setType(config.getType());
|
|
|
+ entity.setSubsystem(config.getSubsystem());
|
|
|
+ entity.setAlgorithmName(config.getAlgorithmName());
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
page.getRecords().sort(Comparator.comparing(TrackSequenceVo::getCreateTime).reversed());
|
|
@@ -278,7 +274,7 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
|
|
|
}
|
|
|
|
|
|
Map<String, Object> algorithmParameters = getAlgorithmParameters(algorithmConfig.getParameters(),
|
|
|
- entityBo.getOtherParams());
|
|
|
+ entityBo.getOtherParams());
|
|
|
|
|
|
// 步骤4. 构造可以直接传给前端的map数据结构
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
@@ -467,8 +463,8 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
|
|
|
|
|
|
org.springframework.core.io.Resource resource = new FileSystemResource(file);
|
|
|
return ResponseEntity.ok()
|
|
|
- .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + file.getName() + "\"")
|
|
|
- .header(HttpHeaders.CONTENT_TYPE, "application/octet-stream").body(resource);
|
|
|
+ .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + file.getName() + "\"")
|
|
|
+ .header(HttpHeaders.CONTENT_TYPE, "application/octet-stream").body(resource);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -520,7 +516,7 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
|
|
|
} else if (entity.getName().startsWith(CAT)) {
|
|
|
AlgorithmModelTrack modelTrack = algorithmModelTrackService.getById(entity.getAlgorithmModelId());
|
|
|
AlgorithmConfigTrack algorithmConfigTrack = algorithmConfigTrackService
|
|
|
- .getById(modelTrack.getAlgorithmId());
|
|
|
+ .getById(modelTrack.getAlgorithmId());
|
|
|
|
|
|
AlgorithmModelTrackVo res = new AlgorithmModelTrackVo();
|
|
|
|