Răsfoiți Sursa

feat: MASC评估搞定

WANGKANG 8 luni în urmă
părinte
comite
bf44ae2c85
26 a modificat fișierele cu 308 adăugiri și 182 ștergeri
  1. 4 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/controller/AlgorithmConfigTrackController.java
  2. 4 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/controller/AlgorithmModelTrackController.java
  3. 4 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/controller/DataSeqController.java
  4. 4 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/controller/TargetDetectionController.java
  5. 4 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/controller/ToInfraredController.java
  6. 10 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/controller/TrackSequenceController.java
  7. 4 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/controller/Video2imageController.java
  8. 4 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/controller/VideoStableController.java
  9. 24 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/domain/AddEvaluate.java
  10. 4 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/service/IAlgorithmConfigTrackService.java
  11. 4 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/service/IAlgorithmModelTrackService.java
  12. 4 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/service/IDataSeqService.java
  13. 4 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/service/ITargetDetectionService.java
  14. 4 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/service/IToInfraredService.java
  15. 7 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/service/ITrackSequenceService.java
  16. 4 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/service/IVideo2imageService.java
  17. 4 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/service/IVideoStableService.java
  18. 23 25
      taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/AlgorithmConfigTrackServiceImpl.java
  19. 14 21
      taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/AlgorithmModelTrackServiceImpl.java
  20. 19 31
      taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/DataSeqServiceImpl.java
  21. 29 42
      taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/TargetDetectionServiceImpl.java
  22. 4 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/ToInfraredServiceImpl.java
  23. 89 36
      taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/TrackSequenceServiceImpl.java
  24. 4 0
      taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/Video2imageServiceImpl.java
  25. 15 19
      taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/VideoStableServiceImpl.java
  26. 14 8
      taais-modules/taais-biz/src/main/java/com/taais/biz/utils/ZipUtils.java

+ 4 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/controller/AlgorithmConfigTrackController.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.controller;
 
 import java.util.List;

+ 4 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/controller/AlgorithmModelTrackController.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.controller;
 
 import java.util.List;

+ 4 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/controller/DataSeqController.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.controller;
 
 import java.util.List;

+ 4 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/controller/TargetDetectionController.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.controller;
 
 import java.io.IOException;

+ 4 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/controller/ToInfraredController.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.controller;
 
 import com.taais.biz.domain.bo.ToInfraredBo;

+ 10 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/controller/TrackSequenceController.java

@@ -1,8 +1,13 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.controller;
 
 import java.io.IOException;
 import java.util.List;
 
+import com.taais.biz.domain.AddEvaluate;
 import lombok.RequiredArgsConstructor;
 import jakarta.servlet.http.HttpServletResponse;
 import cn.dev33.satoken.annotation.SaCheckPermission;
@@ -132,4 +137,9 @@ public class TrackSequenceController extends BaseController {
     public CommonResult getDetail(@PathVariable("id") Long id) {
         return trackSequenceService.getDetail(id);
     }
+
+    @PostMapping("/add_evaluate")
+    public CommonResult addEvaluate(@RequestBody AddEvaluate addEvaluate) {
+        return trackSequenceService.addEvaluate(addEvaluate);
+    }
 }

+ 4 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/controller/Video2imageController.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.controller;
 
 import java.io.File;

+ 4 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/controller/VideoStableController.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.controller;
 
 import java.io.File;

+ 24 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/domain/AddEvaluate.java

@@ -0,0 +1,24 @@
+/**
+ * @Date: 20241029
+ * @Author: WANGKANG
+ * @Blog: https://wangkang1717/github.io
+ * @Email: 1686617586@qq.com
+ * @Description: None
+ * Copyright 2024 WANGKANG, All Rights Reserved.
+ */
+
+package com.taais.biz.domain;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class AddEvaluate {
+    private Long id;
+    private String name;
+    private Long algorithmId;
+    private String remarks;
+}

+ 4 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/service/IAlgorithmConfigTrackService.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.service;
 
 import java.util.List;

+ 4 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/service/IAlgorithmModelTrackService.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.service;
 
 import java.util.List;

+ 4 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/service/IDataSeqService.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.service;
 
 import java.util.List;

+ 4 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/service/ITargetDetectionService.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.service;
 
 import java.util.List;

+ 4 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/service/IToInfraredService.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.service;
 
 

+ 7 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/service/ITrackSequenceService.java

@@ -1,7 +1,12 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.service;
 
 import java.util.List;
 
+import com.taais.biz.domain.AddEvaluate;
 import com.taais.biz.domain.TaskTrackResultBo;
 import com.taais.biz.domain.TrackSequence;
 import com.taais.biz.domain.vo.TrackSequenceVo;
@@ -78,4 +83,6 @@ public interface ITrackSequenceService extends IBaseService<TrackSequence> {
     CommonResult getLog(Long id);
 
     CommonResult getDetail(Long id);
+
+    CommonResult addEvaluate(AddEvaluate addEvaluate);
 }

+ 4 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/service/IVideo2imageService.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.service;
 
 import com.taais.biz.domain.Video2image;

+ 4 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/service/IVideoStableService.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.service;
 
 import java.util.List;

+ 23 - 25
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/AlgorithmConfigTrackServiceImpl.java

@@ -1,3 +1,8 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
+
 package com.taais.biz.service.impl;
 
 import java.util.ArrayList;
@@ -21,6 +26,7 @@ import com.taais.biz.domain.AlgorithmConfigTrack;
 import com.taais.biz.domain.bo.AlgorithmConfigTrackBo;
 import com.taais.biz.domain.vo.AlgorithmConfigTrackVo;
 import com.taais.biz.service.IAlgorithmConfigTrackService;
+
 import static com.taais.biz.domain.table.AlgorithmConfigTrackTableDef.ALGORITHM_CONFIG_TRACK;
 
 /**
@@ -41,22 +47,14 @@ public class AlgorithmConfigTrackServiceImpl extends BaseServiceImpl<AlgorithmCo
 
     private QueryWrapper buildQueryWrapper(AlgorithmConfigTrackBo algorithmConfigTrackBo) {
         QueryWrapper queryWrapper = super.buildBaseQueryWrapper();
-        queryWrapper.and(ALGORITHM_CONFIG_TRACK.TYPE.eq
-        (algorithmConfigTrackBo.getType()));
-        queryWrapper.and(ALGORITHM_CONFIG_TRACK.PARENT_ID.eq
-        (algorithmConfigTrackBo.getParentId()));
-        queryWrapper.and(ALGORITHM_CONFIG_TRACK.SUBSYSTEM.eq
-        (algorithmConfigTrackBo.getSubsystem()));
-        queryWrapper.and(ALGORITHM_CONFIG_TRACK.ALGORITHM_NAME.like
-        (algorithmConfigTrackBo.getAlgorithmName()));
-        queryWrapper.and(ALGORITHM_CONFIG_TRACK.ALGORITHM_ADDRESS.eq
-        (algorithmConfigTrackBo.getAlgorithmAddress()));
-        queryWrapper.and(ALGORITHM_CONFIG_TRACK.PARAMETER_CONFIG.eq
-        (algorithmConfigTrackBo.getParameterConfig()));
-        queryWrapper.and(ALGORITHM_CONFIG_TRACK.REMARKS.eq
-        (algorithmConfigTrackBo.getRemarks()));
-        queryWrapper.and(ALGORITHM_CONFIG_TRACK.SYSTEM.eq
-        (algorithmConfigTrackBo.getSystem()));
+        queryWrapper.and(ALGORITHM_CONFIG_TRACK.TYPE.eq(algorithmConfigTrackBo.getType()));
+        queryWrapper.and(ALGORITHM_CONFIG_TRACK.PARENT_ID.eq(algorithmConfigTrackBo.getParentId()));
+        queryWrapper.and(ALGORITHM_CONFIG_TRACK.SUBSYSTEM.eq(algorithmConfigTrackBo.getSubsystem()));
+        queryWrapper.and(ALGORITHM_CONFIG_TRACK.ALGORITHM_NAME.like(algorithmConfigTrackBo.getAlgorithmName()));
+        queryWrapper.and(ALGORITHM_CONFIG_TRACK.ALGORITHM_ADDRESS.eq(algorithmConfigTrackBo.getAlgorithmAddress()));
+        queryWrapper.and(ALGORITHM_CONFIG_TRACK.PARAMETER_CONFIG.eq(algorithmConfigTrackBo.getParameterConfig()));
+        queryWrapper.and(ALGORITHM_CONFIG_TRACK.REMARKS.eq(algorithmConfigTrackBo.getRemarks()));
+        queryWrapper.and(ALGORITHM_CONFIG_TRACK.SYSTEM.eq(algorithmConfigTrackBo.getSystem()));
 
         return queryWrapper;
     }
@@ -69,7 +67,7 @@ public class AlgorithmConfigTrackServiceImpl extends BaseServiceImpl<AlgorithmCo
      */
     @Override
     public AlgorithmConfigTrackVo selectById(Long id) {
-            return this.getOneAs(query().where(ALGORITHM_CONFIG_TRACK.ID.eq(id)), AlgorithmConfigTrackVo.class);
+        return this.getOneAs(query().where(ALGORITHM_CONFIG_TRACK.ID.eq(id)), AlgorithmConfigTrackVo.class);
 
     }
 
@@ -82,7 +80,7 @@ public class AlgorithmConfigTrackServiceImpl extends BaseServiceImpl<AlgorithmCo
     @Override
     public List<AlgorithmConfigTrackVo> selectList(AlgorithmConfigTrackBo algorithmConfigTrackBo) {
         QueryWrapper queryWrapper = buildQueryWrapper(algorithmConfigTrackBo);
-            return this.listAs(queryWrapper, AlgorithmConfigTrackVo.class);
+        return this.listAs(queryWrapper, AlgorithmConfigTrackVo.class);
     }
 
     /**
@@ -94,7 +92,7 @@ public class AlgorithmConfigTrackServiceImpl extends BaseServiceImpl<AlgorithmCo
     @Override
     public PageResult<AlgorithmConfigTrackVo> selectPage(AlgorithmConfigTrackBo algorithmConfigTrackBo) {
         QueryWrapper queryWrapper = buildQueryWrapper(algorithmConfigTrackBo);
-            Page<AlgorithmConfigTrackVo> page = this.pageAs(PageQuery.build(), queryWrapper, AlgorithmConfigTrackVo.class);
+        Page<AlgorithmConfigTrackVo> page = this.pageAs(PageQuery.build(), queryWrapper, AlgorithmConfigTrackVo.class);
         return PageResult.build(page);
     }
 
@@ -106,7 +104,7 @@ public class AlgorithmConfigTrackServiceImpl extends BaseServiceImpl<AlgorithmCo
      */
     @Override
     public boolean insert(AlgorithmConfigTrackBo algorithmConfigTrackBo) {
-    AlgorithmConfigTrack algorithmConfigTrack =MapstructUtils.convert(algorithmConfigTrackBo, AlgorithmConfigTrack. class);
+        AlgorithmConfigTrack algorithmConfigTrack = MapstructUtils.convert(algorithmConfigTrackBo, AlgorithmConfigTrack.class);
 
         return this.save(algorithmConfigTrack);//使用全局配置的雪花算法主键生成器生成ID值
     }
@@ -119,10 +117,10 @@ public class AlgorithmConfigTrackServiceImpl extends BaseServiceImpl<AlgorithmCo
      */
     @Override
     public boolean update(AlgorithmConfigTrackBo algorithmConfigTrackBo) {
-        AlgorithmConfigTrack algorithmConfigTrack =MapstructUtils.convert(algorithmConfigTrackBo, AlgorithmConfigTrack. class);
-        if (ObjectUtil.isNotNull(algorithmConfigTrack) && ObjectUtil.isNotNull(algorithmConfigTrack.getId())){
+        AlgorithmConfigTrack algorithmConfigTrack = MapstructUtils.convert(algorithmConfigTrackBo, AlgorithmConfigTrack.class);
+        if (ObjectUtil.isNotNull(algorithmConfigTrack) && ObjectUtil.isNotNull(algorithmConfigTrack.getId())) {
             boolean updated = this.updateById(algorithmConfigTrack);
-                return updated;
+            return updated;
         }
         return false;
     }
@@ -147,8 +145,8 @@ public class AlgorithmConfigTrackServiceImpl extends BaseServiceImpl<AlgorithmCo
 
         for (AlgorithmConfigTrack algorithmConfigTrack : algorithmConfigTrackMapper.selectAll()) {
             HashMap<String, Object> map = new HashMap<>();
-            map.put("label",algorithmConfigTrack.getAlgorithmName());
-            map.put("value",algorithmConfigTrack.getId());
+            map.put("label", algorithmConfigTrack.getAlgorithmName());
+            map.put("value", algorithmConfigTrack.getId());
             map.put("type", algorithmConfigTrack.getType());
             map.put("subsystem", algorithmConfigTrack.getSubsystem());
 

+ 14 - 21
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/AlgorithmModelTrackServiceImpl.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.service.impl;
 
 import java.io.File;
@@ -64,22 +68,14 @@ public class AlgorithmModelTrackServiceImpl extends BaseServiceImpl<AlgorithmMod
 
     private QueryWrapper buildQueryWrapper(AlgorithmModelTrackBo algorithmModelTrackBo) {
         QueryWrapper queryWrapper = super.buildBaseQueryWrapper();
-        queryWrapper.and(ALGORITHM_MODEL_TRACK.ALGORITHM_ID.eq
-            (algorithmModelTrackBo.getAlgorithmId()));
-        queryWrapper.and(ALGORITHM_MODEL_TRACK.MODEL_NAME.like
-            (algorithmModelTrackBo.getModelName()));
-        queryWrapper.and(ALGORITHM_MODEL_TRACK.MODEL_ADDRESS.eq
-            (algorithmModelTrackBo.getModelAddress()));
-        queryWrapper.and(ALGORITHM_MODEL_TRACK.SAMPLE_NUMBER.eq
-            (algorithmModelTrackBo.getSampleNumber()));
-        queryWrapper.and(ALGORITHM_MODEL_TRACK.CYCLE_EPOCH.eq
-            (algorithmModelTrackBo.getCycleEpoch()));
-        queryWrapper.and(ALGORITHM_MODEL_TRACK.REMARKS.eq
-            (algorithmModelTrackBo.getRemarks()));
-        queryWrapper.and(ALGORITHM_MODEL_TRACK.SYSTEM.eq
-            (algorithmModelTrackBo.getSystem()));
-        queryWrapper.and(ALGORITHM_MODEL_TRACK.ALGORITHM_TYPE.eq
-            (algorithmModelTrackBo.getAlgorithmType()));
+        queryWrapper.and(ALGORITHM_MODEL_TRACK.ALGORITHM_ID.eq(algorithmModelTrackBo.getAlgorithmId()));
+        queryWrapper.and(ALGORITHM_MODEL_TRACK.MODEL_NAME.like(algorithmModelTrackBo.getModelName()));
+        queryWrapper.and(ALGORITHM_MODEL_TRACK.MODEL_ADDRESS.eq(algorithmModelTrackBo.getModelAddress()));
+        queryWrapper.and(ALGORITHM_MODEL_TRACK.SAMPLE_NUMBER.eq(algorithmModelTrackBo.getSampleNumber()));
+        queryWrapper.and(ALGORITHM_MODEL_TRACK.CYCLE_EPOCH.eq(algorithmModelTrackBo.getCycleEpoch()));
+        queryWrapper.and(ALGORITHM_MODEL_TRACK.REMARKS.eq(algorithmModelTrackBo.getRemarks()));
+        queryWrapper.and(ALGORITHM_MODEL_TRACK.SYSTEM.eq(algorithmModelTrackBo.getSystem()));
+        queryWrapper.and(ALGORITHM_MODEL_TRACK.ALGORITHM_TYPE.eq(algorithmModelTrackBo.getAlgorithmType()));
 
         return queryWrapper;
     }
@@ -150,10 +146,7 @@ public class AlgorithmModelTrackServiceImpl extends BaseServiceImpl<AlgorithmMod
     @Override
     public CommonResult<String> insert(AlgorithmModelTrackBo algorithmModelTrackBo) {
         AlgorithmConfigTrackVo algorithmConfigTrackVo = algorithmConfigTrackService.selectById(algorithmModelTrackBo.getAlgorithmId());
-        if (algorithmConfigTrackVo.getType().equals(AlgorithmType.REASONING) &&
-            ObjectUtil.isEmpty(algorithmModelTrackBo.getModelInputOssId()) &&
-            ObjectUtil.isEmpty(algorithmModelTrackBo.getModelPath())
-        ) {
+        if (algorithmConfigTrackVo.getType().equals(AlgorithmType.REASONING) && ObjectUtil.isEmpty(algorithmModelTrackBo.getModelInputOssId()) && ObjectUtil.isEmpty(algorithmModelTrackBo.getModelPath())) {
             return CommonResult.fail("预测算法必须上传模型文件或指定模型路径!");
         }
 
@@ -181,7 +174,7 @@ public class AlgorithmModelTrackServiceImpl extends BaseServiceImpl<AlgorithmMod
                 return CommonResult.fail("模型格式不正确,请上传.zip或.pt文件");
             }
         } // 这是使用ossid上传
-        else if(ObjectUtil.isNotEmpty(algorithmModelTrackBo.getModelPath())) { // 这是使用路径上传
+        else if (ObjectUtil.isNotEmpty(algorithmModelTrackBo.getModelPath())) { // 这是使用路径上传
             File modelFile = new File(algorithmModelTrackBo.getModelPath());
             if (!modelFile.exists()) {
                 return CommonResult.fail("模型路径不存在!");

+ 19 - 31
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/DataSeqServiceImpl.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.service.impl;
 
 import java.io.File;
@@ -51,34 +55,20 @@ public class DataSeqServiceImpl extends BaseServiceImpl<DataSeqMapper, DataSeq>
 
     private QueryWrapper buildQueryWrapper(DataSeqBo dataSeqBo) {
         QueryWrapper queryWrapper = super.buildBaseQueryWrapper();
-        queryWrapper.and(DATA_SEQ.NAME.like
-            (dataSeqBo.getName()));
-        queryWrapper.and(DATA_SEQ.DATA_TYPE.eq
-            (dataSeqBo.getDataType()));
-        queryWrapper.and(DATA_SEQ.FILE_TYPE.eq
-            (dataSeqBo.getFileType()));
-        queryWrapper.and(DATA_SEQ.OBJECT_TYPE.eq
-            (dataSeqBo.getObjectType()));
-        queryWrapper.and(DATA_SEQ.OBJECT_SUBTYPE.eq
-            (dataSeqBo.getObjectSubtype()));
-        queryWrapper.and(DATA_SEQ.BATCH_NUM.eq
-            (dataSeqBo.getBatchNum()));
-        queryWrapper.and(DATA_SEQ.SCENE.eq
-            (dataSeqBo.getScene()));
-        queryWrapper.and(DATA_SEQ.DATA_SOURCE.eq
-            (dataSeqBo.getDataSource()));
-        queryWrapper.and(DATA_SEQ.GATHER_TIME.eq
-            (dataSeqBo.getGatherTime()));
-        queryWrapper.and(DATA_SEQ.GATHER_SPOT.eq
-            (dataSeqBo.getGatherSpot()));
-        queryWrapper.and(DATA_SEQ.URL.eq
-            (dataSeqBo.getUrl()));
-        queryWrapper.and(DATA_SEQ.LOG.eq
-            (dataSeqBo.getLog()));
-        queryWrapper.and(DATA_SEQ.REMARKS.eq
-            (dataSeqBo.getRemarks()));
-        queryWrapper.and(DATA_SEQ.SUBSYSTEM.eq
-            (dataSeqBo.getSubsystem()));
+        queryWrapper.and(DATA_SEQ.NAME.like(dataSeqBo.getName()));
+        queryWrapper.and(DATA_SEQ.DATA_TYPE.eq(dataSeqBo.getDataType()));
+        queryWrapper.and(DATA_SEQ.FILE_TYPE.eq(dataSeqBo.getFileType()));
+        queryWrapper.and(DATA_SEQ.OBJECT_TYPE.eq(dataSeqBo.getObjectType()));
+        queryWrapper.and(DATA_SEQ.OBJECT_SUBTYPE.eq(dataSeqBo.getObjectSubtype()));
+        queryWrapper.and(DATA_SEQ.BATCH_NUM.eq(dataSeqBo.getBatchNum()));
+        queryWrapper.and(DATA_SEQ.SCENE.eq(dataSeqBo.getScene()));
+        queryWrapper.and(DATA_SEQ.DATA_SOURCE.eq(dataSeqBo.getDataSource()));
+        queryWrapper.and(DATA_SEQ.GATHER_TIME.eq(dataSeqBo.getGatherTime()));
+        queryWrapper.and(DATA_SEQ.GATHER_SPOT.eq(dataSeqBo.getGatherSpot()));
+        queryWrapper.and(DATA_SEQ.URL.eq(dataSeqBo.getUrl()));
+        queryWrapper.and(DATA_SEQ.LOG.eq(dataSeqBo.getLog()));
+        queryWrapper.and(DATA_SEQ.REMARKS.eq(dataSeqBo.getRemarks()));
+        queryWrapper.and(DATA_SEQ.SUBSYSTEM.eq(dataSeqBo.getSubsystem()));
 
         return queryWrapper;
     }
@@ -280,9 +270,7 @@ public class DataSeqServiceImpl extends BaseServiceImpl<DataSeqMapper, DataSeq>
     }
 
     // 常见图片格式的后缀
-    private static final String[] IMAGE_EXTENSIONS = {
-        ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tiff", ".tif", ".webp"
-    };
+    private static final String[] IMAGE_EXTENSIONS = {".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tiff", ".tif", ".webp"};
 
     // 判断文件是否为常见图片格式
     public static boolean isImageFile(File file) {

+ 29 - 42
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/TargetDetectionServiceImpl.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.service.impl;
 
 import java.io.BufferedReader;
@@ -82,32 +86,19 @@ public class TargetDetectionServiceImpl extends BaseServiceImpl<TargetDetectionM
 
     private QueryWrapper buildQueryWrapper(TargetDetectionBo targetDetectionBo) {
         QueryWrapper queryWrapper = super.buildBaseQueryWrapper();
-        queryWrapper.and(TARGET_DETECTION.NAME.like
-            (targetDetectionBo.getName()));
-        queryWrapper.and(TARGET_DETECTION.STATUS.eq
-            (targetDetectionBo.getStatus()));
-        queryWrapper.and(TARGET_DETECTION.START_TIME.eq
-            (targetDetectionBo.getStartTime()));
-        queryWrapper.and(TARGET_DETECTION.END_TIME.eq
-            (targetDetectionBo.getEndTime()));
-        queryWrapper.and(TARGET_DETECTION.COST_SECOND.eq
-            (targetDetectionBo.getCostSecond()));
-        queryWrapper.and(TARGET_DETECTION.LOG.eq
-            (targetDetectionBo.getLog()));
-        queryWrapper.and(TARGET_DETECTION.REMARKS.eq
-            (targetDetectionBo.getRemarks()));
-        queryWrapper.and(TARGET_DETECTION.URL.eq
-            (targetDetectionBo.getUrl()));
-        queryWrapper.and(TARGET_DETECTION.INPUT_OSS_ID.eq
-            (targetDetectionBo.getInputOssId()));
-        queryWrapper.and(TARGET_DETECTION.INPUT_PATH.eq
-            (targetDetectionBo.getInputPath()));
-        queryWrapper.and(TARGET_DETECTION.OUTPUT_PATH.eq
-            (targetDetectionBo.getOutputPath()));
-        queryWrapper.and(TARGET_DETECTION.ZIP_FILE_PATH.eq
-            (targetDetectionBo.getZipFilePath()));
-        queryWrapper.and(TARGET_DETECTION.ALGORITHM_MODEL_ID.eq
-            (targetDetectionBo.getAlgorithmModelId()));
+        queryWrapper.and(TARGET_DETECTION.NAME.like(targetDetectionBo.getName()));
+        queryWrapper.and(TARGET_DETECTION.STATUS.eq(targetDetectionBo.getStatus()));
+        queryWrapper.and(TARGET_DETECTION.START_TIME.eq(targetDetectionBo.getStartTime()));
+        queryWrapper.and(TARGET_DETECTION.END_TIME.eq(targetDetectionBo.getEndTime()));
+        queryWrapper.and(TARGET_DETECTION.COST_SECOND.eq(targetDetectionBo.getCostSecond()));
+        queryWrapper.and(TARGET_DETECTION.LOG.eq(targetDetectionBo.getLog()));
+        queryWrapper.and(TARGET_DETECTION.REMARKS.eq(targetDetectionBo.getRemarks()));
+        queryWrapper.and(TARGET_DETECTION.URL.eq(targetDetectionBo.getUrl()));
+        queryWrapper.and(TARGET_DETECTION.INPUT_OSS_ID.eq(targetDetectionBo.getInputOssId()));
+        queryWrapper.and(TARGET_DETECTION.INPUT_PATH.eq(targetDetectionBo.getInputPath()));
+        queryWrapper.and(TARGET_DETECTION.OUTPUT_PATH.eq(targetDetectionBo.getOutputPath()));
+        queryWrapper.and(TARGET_DETECTION.ZIP_FILE_PATH.eq(targetDetectionBo.getZipFilePath()));
+        queryWrapper.and(TARGET_DETECTION.ALGORITHM_MODEL_ID.eq(targetDetectionBo.getAlgorithmModelId()));
 
         return queryWrapper;
     }
@@ -280,17 +271,16 @@ public class TargetDetectionServiceImpl extends BaseServiceImpl<TargetDetectionM
         if (BizConstant.AlgorithmType.REASONING.equals(algorithmConfigTrack.getType())) {
             String modelPath = algorithmModelTrack.getModelAddress() + File.separator + algorithmModelTrack.getModelName();
             startTaskConfig.setModel_path(modelPath);
-        }
-        else if (BizConstant.AlgorithmType.TRAIN.equals(algorithmConfigTrack.getType())) {
+        } else if (BizConstant.AlgorithmType.TRAIN.equals(algorithmConfigTrack.getType())) {
             // 这时候需要在之前的基础上,添加类别的路径
-            File dir = new File( startTaskConfig.getSource_dir());
+            File dir = new File(startTaskConfig.getSource_dir());
             File[] files = dir.listFiles();
             // 暂时只传第一个文件夹用作训练
-            if(files == null || files.length == 0) {
+            if (files == null || files.length == 0) {
                 return CommonResult.fail("输入数据集为空!");
             }
-            for(File file__ : files) {
-                if(file__.isDirectory()){
+            for (File file__ : files) {
+                if (file__.isDirectory()) {
                     startTaskConfig.setSource_dir(file__.getAbsolutePath()); // 设置路径
                     break;
                 }
@@ -406,10 +396,7 @@ public class TargetDetectionServiceImpl extends BaseServiceImpl<TargetDetectionM
         }
 
         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);
+        return ResponseEntity.ok().header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + file.getName() + "\"").header(HttpHeaders.CONTENT_TYPE, "application/octet-stream").body(resource);
     }
 
     private String getLogFileName(TargetDetection entity) {
@@ -442,7 +429,7 @@ public class TargetDetectionServiceImpl extends BaseServiceImpl<TargetDetectionM
         Integer idx = 0;
         ArrayList<Map<String, String>> res = new ArrayList<>();
         for (File file : files) {
-            if(!file.getName().endsWith(BizConstant.TD_TRAIN_MODEL_SUFFIX)){
+            if (!file.getName().endsWith(BizConstant.TD_TRAIN_MODEL_SUFFIX)) {
                 continue;
             }
             idx += 1;
@@ -465,15 +452,15 @@ public class TargetDetectionServiceImpl extends BaseServiceImpl<TargetDetectionM
         }
         return CommonResult.success(res, "success");
     }
+
     public static long getFileSize(File file) {
         // 返回单位B
-        if(file.isFile()) {
+        if (file.isFile()) {
             return file.length();
-        }
-        else {
+        } else {
             long totalSize = 0;
-            if(file.listFiles() != null && file.listFiles().length > 0) {
-                for(File file__ : Objects.requireNonNull(file.listFiles())) {
+            if (file.listFiles() != null && file.listFiles().length > 0) {
+                for (File file__ : Objects.requireNonNull(file.listFiles())) {
                     totalSize += getFileSize(file__);
                 }
             }

+ 4 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/ToInfraredServiceImpl.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.service.impl;
 
 import java.io.BufferedReader;

+ 89 - 36
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/TrackSequenceServiceImpl.java

@@ -1,10 +1,11 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.service.impl;
 
-import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileReader;
 import java.io.IOException;
-import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Arrays;
@@ -48,7 +49,6 @@ import com.taais.biz.domain.vo.TrackSequenceVo;
 import com.taais.biz.service.ITrackSequenceService;
 
 import static com.taais.biz.constant.BizConstant.VideoStatus.NOT_START;
-import static com.taais.biz.domain.table.AlgorithmModelTrackTableDef.ALGORITHM_MODEL_TRACK;
 import static com.taais.biz.domain.table.TrackSequenceTableDef.TRACK_SEQUENCE;
 import static com.taais.biz.service.impl.ToInfraredServiceImpl.readLogContent;
 import static com.taais.biz.service.impl.VideoStableServiceImpl.*;
@@ -248,49 +248,58 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
     @Override
     public CommonResult start(Long id) {
         TrackSequence entity = getById(id);
+        AlgorithmModelTrack algorithmModelTrack = algorithmModelTrackService.getById(entity.getAlgorithmModelId());
+        AlgorithmConfigTrack algorithmConfigTrack = algorithmConfigTrackService.getById(entity.getAlgorithmId());
+        StartTaskConfig startTaskConfig = new StartTaskConfig();
 
-        SysOssVo inputOssEntity = ossService.getById(entity.getInputOssId());
+        if (algorithmConfigTrack.getType().equals(BizConstant.AlgorithmType.TEST) && entity.getName().startsWith("MASC")) {
+            startTaskConfig.setBizType(BizConstant.BizType.TRACK_SEQUENCE);
+            startTaskConfig.setBizId(entity.getId());
 
-        String filePath = inputOssEntity.getFileName();
-        String localPath = TaaisConfig.getProfile();
-        String resourcePath = localPath + StringUtils.substringAfter(filePath, Constants.RESOURCE_PREFIX);
+            startTaskConfig.setOtherParams(algorithmConfigTrack.getParameterConfig());
 
-        String fileName = StringUtils.substringAfterLast(filePath, "/");
-        String fileName_without_suffix = removeFileExtension(fileName);
+            startTaskConfig.setSource_dir(entity.getInputPath());
+            startTaskConfig.setResult_dir(entity.getOutputPath());
+            startTaskConfig.setLog_path(entity.getOutputPath() + File.separator + getLogFileName(entity));
+        } else {
+            SysOssVo inputOssEntity = ossService.getById(entity.getInputOssId());
 
-        Path path = Paths.get(resourcePath);
-        Path inputPath = path.resolveSibling(fileName_without_suffix + BizConstant.UNZIP_SUFFIX);
-        Path outputPath = path.resolveSibling(entity.getId().toString() + BizConstant.TRACK_SEQUENCE_SUFFIX);
+            String filePath = inputOssEntity.getFileName();
+            String localPath = TaaisConfig.getProfile();
+            String resourcePath = localPath + StringUtils.substringAfter(filePath, Constants.RESOURCE_PREFIX);
 
-//        makeDir(inputPath.toString());
-        makeDir(outputPath.toString());
+            String fileName = StringUtils.substringAfterLast(filePath, "/");
+            String fileName_without_suffix = removeFileExtension(fileName);
 
-        File file = new File(inputPath.toString());
-        if (!file.exists()) {
-            ZipUtils.unzip(resourcePath, inputPath.toString());
-        }
+            Path path = Paths.get(resourcePath);
+            Path inputPath = path.resolveSibling(fileName_without_suffix + BizConstant.UNZIP_SUFFIX);
+            Path outputPath = path.resolveSibling(entity.getId().toString() + BizConstant.TRACK_SEQUENCE_SUFFIX);
 
-        entity.setInputPath(inputPath.toString());
-        entity.setOutputPath(outputPath.toString());
+//        makeDir(inputPath.toString());
+            makeDir(outputPath.toString());
 
-        entity.setStartTime(new Date());
+            File file = new File(inputPath.toString());
+            if (!file.exists()) {
+                ZipUtils.unzip(resourcePath, inputPath.toString());
+            }
 
-        AlgorithmModelTrack algorithmModelTrack = algorithmModelTrackService.getById(entity.getAlgorithmModelId());
-        AlgorithmConfigTrack algorithmConfigTrack = algorithmConfigTrackService.getById(entity.getAlgorithmId());
+            entity.setInputPath(inputPath.toString());
+            entity.setOutputPath(outputPath.toString());
 
-        StartTaskConfig startTaskConfig = new StartTaskConfig();
-        startTaskConfig.setBizType(BizConstant.BizType.TRACK_SEQUENCE);
-        startTaskConfig.setBizId(entity.getId());
+            entity.setStartTime(new Date());
 
-        startTaskConfig.setOtherParams(algorithmConfigTrack.getParameterConfig());
+            startTaskConfig.setBizType(BizConstant.BizType.TRACK_SEQUENCE);
+            startTaskConfig.setBizId(entity.getId());
 
-        startTaskConfig.setSource_dir(entity.getInputPath());
-        startTaskConfig.setResult_dir(entity.getOutputPath());
-        startTaskConfig.setLog_path(entity.getOutputPath() + File.separator + getLogFileName(entity));
+            startTaskConfig.setOtherParams(algorithmConfigTrack.getParameterConfig());
 
-        if (BizConstant.AlgorithmType.REASONING.equals(algorithmConfigTrack.getType())) {
-            String modelPath = algorithmModelTrack.getModelAddress();
-            startTaskConfig.setModel_path(modelPath);
+            startTaskConfig.setSource_dir(entity.getInputPath());
+            startTaskConfig.setResult_dir(entity.getOutputPath());
+            startTaskConfig.setLog_path(entity.getOutputPath() + File.separator + getLogFileName(entity));
+
+            if (BizConstant.AlgorithmType.REASONING.equals(algorithmConfigTrack.getType())) {
+                String modelPath = algorithmModelTrack.getModelAddress();
+                startTaskConfig.setModel_path(modelPath);
 //            if (algorithmModelTrack.getModelName().startsWith("masc") || algorithmModelTrack.getModelName().startsWith("MASC")) {
 //                String modelPath = algorithmModelTrack.getModelAddress() + File.separator + algorithmModelTrack.getModelName().substring(5);
 //                startTaskConfig.setModel_path(modelPath);
@@ -300,9 +309,8 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
 //            } else {
 //                return CommonResult.fail("模型命名失败,请以MASC或CAT开头命名模型");
 //            }
+            }
         }
-
-
         HttpResponseEntity responseEntity = sendPostMsg(algorithmConfigTrack.getAlgorithmAddress(), startTaskConfig);
         if (ObjectUtil.isNotNull(responseEntity) && responseEntity.getStatus() == 200) {
             entity.setStatus(BizConstant.VideoStatus.RUNNING);
@@ -451,4 +459,49 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
 
         return CommonResult.success(res, "success");
     }
+
+    @Override
+    public CommonResult addEvaluate(AddEvaluate addEvaluate) {
+        // 检查任务名称
+        if (ObjectUtil.isEmpty(addEvaluate.getName()) || (!addEvaluate.getName().startsWith("MASC") && !addEvaluate.getName().startsWith("CAT"))) {
+            return CommonResult.fail("任务命名错误,需以MASC或CAT开头!");
+        }
+
+        if (ObjectUtil.isEmpty(addEvaluate.getAlgorithmId())) {
+            return CommonResult.fail("请指定算法!");
+        }
+
+        AlgorithmConfigTrackVo config = algorithmConfigTrackService.selectById(addEvaluate.getAlgorithmId());
+        if (ObjectUtil.isNull(config)) {
+            return CommonResult.fail("找不到指定的算法!");
+        }
+
+        TrackSequence entity = this.getById(addEvaluate.getId());
+        TrackSequence evaluate_entity = new TrackSequence();
+        evaluate_entity.setStatus(NOT_START);
+        evaluate_entity.setUrl(entity.getUrl());
+        evaluate_entity.setInputPath(entity.getInputPath() + ";" + entity.getOutputPath() + File.separator + "gaze" + File.separator + "txt");
+        evaluate_entity.setZipFilePath(entity.getZipFilePath());
+        evaluate_entity.setAlgorithmModelId(entity.getAlgorithmModelId());
+        evaluate_entity.setInputOssId(entity.getInputOssId());
+
+        evaluate_entity.setName(addEvaluate.getName());
+        evaluate_entity.setAlgorithmId(addEvaluate.getAlgorithmId());
+        evaluate_entity.setRemarks(addEvaluate.getRemarks());
+
+        boolean flag__ = save(evaluate_entity);
+
+        if (flag__) {
+            Path path = Paths.get(entity.getOutputPath());
+            evaluate_entity.setOutputPath(path.resolveSibling(evaluate_entity.getId().toString() + BizConstant.TRACK_SEQUENCE_SUFFIX).toString());
+            boolean flag___ = updateById(evaluate_entity);
+            if (flag___) {
+                return CommonResult.success("新增评估任务成功!");
+            } else {
+                return CommonResult.success("新增评估任务成功! 更新输出路径失败");
+            }
+        } else {
+            return CommonResult.success("新增评估任务失败!");
+        }
+    }
 }

+ 4 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/Video2imageServiceImpl.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.service.impl;
 
 import java.io.File;

+ 15 - 19
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/VideoStableServiceImpl.java

@@ -1,3 +1,7 @@
+/**
+ * 20241029 ©WANGKANG 1686617586@qq.com
+ */
+
 package com.taais.biz.service.impl;
 
 import java.io.File;
@@ -72,22 +76,14 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
 
     private QueryWrapper buildQueryWrapper(VideoStableBo videoStableBo) {
         QueryWrapper queryWrapper = super.buildBaseQueryWrapper();
-        queryWrapper.and(VIDEO_STABLE.NAME.like
-            (videoStableBo.getName()));
-        queryWrapper.and(VIDEO_STABLE.STATUS.like
-            (videoStableBo.getStatus()));
-        queryWrapper.and(VIDEO_STABLE.INPUT_OSS_ID.eq
-            (videoStableBo.getInputOssId()));
-        queryWrapper.and(VIDEO_STABLE.START_TIME.eq
-            (videoStableBo.getStartTime()));
-        queryWrapper.and(VIDEO_STABLE.END_TIME.eq
-            (videoStableBo.getEndTime()));
-        queryWrapper.and(VIDEO_STABLE.COST_SECOND.eq
-            (videoStableBo.getCostSecond()));
-        queryWrapper.and(VIDEO_STABLE.LOG.like
-            (videoStableBo.getLog()));
-        queryWrapper.and(VIDEO_STABLE.REMARKS.like
-            (videoStableBo.getRemarks()));
+        queryWrapper.and(VIDEO_STABLE.NAME.like(videoStableBo.getName()));
+        queryWrapper.and(VIDEO_STABLE.STATUS.like(videoStableBo.getStatus()));
+        queryWrapper.and(VIDEO_STABLE.INPUT_OSS_ID.eq(videoStableBo.getInputOssId()));
+        queryWrapper.and(VIDEO_STABLE.START_TIME.eq(videoStableBo.getStartTime()));
+        queryWrapper.and(VIDEO_STABLE.END_TIME.eq(videoStableBo.getEndTime()));
+        queryWrapper.and(VIDEO_STABLE.COST_SECOND.eq(videoStableBo.getCostSecond()));
+        queryWrapper.and(VIDEO_STABLE.LOG.like(videoStableBo.getLog()));
+        queryWrapper.and(VIDEO_STABLE.REMARKS.like(videoStableBo.getRemarks()));
 
         return queryWrapper;
     }
@@ -356,12 +352,12 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
             List<String> inputImageList = getImageUrls(ossEntity, unzipPath, BizConstant.UNZIP_SUFFIX);
             List<String> outputImageList = getImageUrls(ossEntity, resultPath, BizConstant.STABLE_SUFFIX);
 
-            HashMap<String,String> nameToUrl1 = new HashMap<>();
+            HashMap<String, String> nameToUrl1 = new HashMap<>();
             for (String imageUrl : inputImageList) {
                 String name = imageUrl.substring(imageUrl.lastIndexOf("/") + 1);
                 nameToUrl1.put(name, imageUrl);
             }
-            HashMap<String,String> nameToUrl2 = new HashMap<>();
+            HashMap<String, String> nameToUrl2 = new HashMap<>();
             for (String imageUrl : outputImageList) {
                 String name = imageUrl.substring(imageUrl.lastIndexOf("/") + 1);
                 nameToUrl2.put(name, imageUrl);
@@ -385,7 +381,7 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
         }
     }
 
-    public List<String> getImageUrls(SysOssVo ossEntity, String path,  String suffix) {
+    public List<String> getImageUrls(SysOssVo ossEntity, String path, String suffix) {
         String urlPrefix = ossEntity.getUrl().substring(0, ossEntity.getUrl().lastIndexOf(".")) + suffix;
         // 列出unzipPath下所有图片文件
         File directory = new File(path);

+ 14 - 8
taais-modules/taais-biz/src/main/java/com/taais/biz/utils/ZipUtils.java

@@ -1,3 +1,13 @@
+/**
+ * @Date: 20241029
+ * @Author: WANGKANG
+ * @Blog: https://wangkang1717/github.io
+ * @Email: 1686617586@qq.com
+ * @Description: None
+ * Copyright 2024 WANGKANG, All Rights Reserved.
+ */
+
+
 package com.taais.biz.utils;
 
 import java.io.*;
@@ -18,12 +28,10 @@ public class ZipUtils {
     public static void zipFolderFiles(String sourceFolderPath, String zipFilePath) throws IOException {
         File sourceFolder = new File(sourceFolderPath);
         if (!sourceFolder.exists() || !sourceFolder.isDirectory()) {
-            throw new IllegalArgumentException(
-                "Source folder does not exist or is not a directory: " + sourceFolderPath);
+            throw new IllegalArgumentException("Source folder does not exist or is not a directory: " + sourceFolderPath);
         }
 
-        try (FileOutputStream fos = new FileOutputStream(zipFilePath);
-             ZipOutputStream zos = new ZipOutputStream(fos)) {
+        try (FileOutputStream fos = new FileOutputStream(zipFilePath); ZipOutputStream zos = new ZipOutputStream(fos)) {
             zipDirectory(sourceFolder, "", zos);
         }
     }
@@ -87,8 +95,7 @@ public class ZipUtils {
                             parentDir.mkdirs();
                         }
                         // 解压文件
-                        try (InputStream inputStream = zipFile.getInputStream(entry);
-                             FileOutputStream outputStream = new FileOutputStream(entryFile)) {
+                        try (InputStream inputStream = zipFile.getInputStream(entry); FileOutputStream outputStream = new FileOutputStream(entryFile)) {
                             byte[] buffer = new byte[1024];
                             int len;
                             while ((len = inputStream.read(buffer)) > 0) {
@@ -112,8 +119,7 @@ public class ZipUtils {
 
     public static void main(String[] args) {
         try {
-            zipFolderFiles("C:\\home\\ObjectDetection_Web\\upload\\2024\\10\\12\\dataset_20241012115340A001_to_infrared",
-                "C:\\home\\ObjectDetection_Web\\upload\\2024\\10\\12\\dataset_20241012115340A001_to_infrared.zip");
+            zipFolderFiles("C:\\home\\ObjectDetection_Web\\upload\\2024\\10\\12\\dataset_20241012115340A001_to_infrared", "C:\\home\\ObjectDetection_Web\\upload\\2024\\10\\12\\dataset_20241012115340A001_to_infrared.zip");
         } catch (IOException e) {
             e.printStackTrace();
         }