|
@@ -4,6 +4,14 @@
|
|
|
|
|
|
package com.taais.biz.service.impl;
|
|
|
|
|
|
+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 cn.hutool.core.lang.Dict;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.mybatisflex.core.paginate.Page;
|
|
@@ -26,6 +34,7 @@ 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.orm.core.page.PageQuery;
|
|
|
+import com.taais.common.core.core.page.PageResult;
|
|
|
import com.taais.common.orm.core.service.impl.BaseServiceImpl;
|
|
|
import com.taais.common.websocket.utils.WebSocketUtils;
|
|
|
import com.taais.system.domain.vo.SysOssVo;
|
|
@@ -41,20 +50,13 @@ import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-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.getFileSize;
|
|
|
import static com.taais.biz.service.impl.TargetDetectionServiceImpl.port;
|
|
|
-import static com.taais.biz.service.impl.ToInfraredServiceImpl.getCompareImage;
|
|
|
-import static com.taais.biz.service.impl.ToInfraredServiceImpl.readLogContent;
|
|
|
+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;
|
|
|
|
|
|
/**
|
|
|
* 注视轨迹序列Service业务层处理
|
|
@@ -126,7 +128,7 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
|
|
|
@Override
|
|
|
public List<TrackSequenceVo> selectList(TrackSequenceBo trackSequenceBo) {
|
|
|
QueryWrapper queryWrapper = buildQueryWrapper(trackSequenceBo);
|
|
|
- queryWrapper.orderBy(TRACK_SEQUENCE.CREATE_TIME,Boolean.FALSE);
|
|
|
+ queryWrapper.orderBy(TRACK_SEQUENCE.CREATE_TIME, Boolean.FALSE);
|
|
|
return this.listAs(queryWrapper, TrackSequenceVo.class);
|
|
|
}
|
|
|
|
|
@@ -139,7 +141,7 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
|
|
|
@Override
|
|
|
public PageResult<TrackSequenceVo> selectPage(TrackSequenceBo trackSequenceBo) {
|
|
|
QueryWrapper queryWrapper = buildQueryWrapper(trackSequenceBo);
|
|
|
- queryWrapper.orderBy(TRACK_SEQUENCE.CREATE_TIME,Boolean.FALSE);
|
|
|
+ queryWrapper.orderBy(TRACK_SEQUENCE.CREATE_TIME, Boolean.FALSE);
|
|
|
Page<TrackSequenceVo> page = this.pageAs(PageQuery.build(), queryWrapper, TrackSequenceVo.class);
|
|
|
page.getRecords().forEach(entity -> {
|
|
|
Long modelId = entity.getAlgorithmModelId();
|
|
@@ -726,4 +728,27 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
|
|
|
return CommonResult.success(map);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public CommonResult getStatisticsResult(Long id) {
|
|
|
+ TrackSequence entity = getById(id);
|
|
|
+ SysOssVo inputOssEntity = ossService.getById(entity.getInputOssId());
|
|
|
+
|
|
|
+ String filePath = inputOssEntity.getFileName();
|
|
|
+ String localPath = TaaisConfig.getProfile();
|
|
|
+ String resourcePath = localPath + StringUtils.substringAfter(filePath, Constants.RESOURCE_PREFIX);
|
|
|
+
|
|
|
+ Path path = Paths.get(resourcePath);
|
|
|
+ Path outputPath = path.resolveSibling(entity.getId().toString() + BizConstant.TRACK_SEQUENCE_SUFFIX);
|
|
|
+
|
|
|
+ Path statisticsResultPath = outputPath.resolve(BizConstant.RESULT_JSON_NAME);
|
|
|
+
|
|
|
+ List<Dict> resultMap = parseJsonMapList(statisticsResultPath);
|
|
|
+ if (ObjectUtil.isEmpty(resultMap)) {
|
|
|
+ return CommonResult.fail("获取结果文件失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ return CommonResult.success(resultMap);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|