Ver Fonte

feat: data augmentation

unknown há 6 meses atrás
pai
commit
a5a0ef05bd

+ 6 - 0
taais-admin/pom.xml

@@ -80,6 +80,12 @@
             <groupId>com.taais</groupId>
             <artifactId>taais-biz</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot</artifactId>
+            <version>3.2.1</version>
+            <scope>compile</scope>
+        </dependency>
 
     </dependencies>
 

+ 192 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/controller/DataAugmentationController.java

@@ -0,0 +1,192 @@
+package com.taais.biz.controller;
+
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.mybatisflex.core.query.QueryWrapper;
+import com.taais.biz.domain.DataAugmentation;
+import com.taais.biz.domain.bo.DataAugmentationBo;
+import com.taais.biz.domain.vo.DataAugmentationVo;
+import com.taais.common.core.service.OssService;
+import com.taais.system.domain.SysOss;
+import com.taais.system.service.ISysOssService;
+import lombok.RequiredArgsConstructor;
+import jakarta.servlet.http.HttpServletResponse;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.validation.annotation.Validated;
+import com.taais.common.core.core.domain.CommonResult;
+import com.taais.common.excel.utils.ExcelUtil;
+import com.taais.common.log.annotation.Log;
+import com.taais.common.log.enums.BusinessType;
+import com.taais.common.web.annotation.RepeatSubmit;
+import com.taais.common.web.core.BaseController;
+import jakarta.annotation.Resource;
+import com.taais.biz.service.IDataAugmentationService;
+
+import com.taais.common.core.core.page.PageResult;
+
+/**
+ * 数据增强Controller
+ *
+ * @author 0
+ * 2024-08-30
+ */
+@Validated
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/demo/dataAugmentation")
+public class DataAugmentationController extends BaseController {
+    @Resource
+    private IDataAugmentationService dataAugmentationService;
+    @Autowired
+    private ISysOssService ossService;
+    @GetMapping("/compare/num/{task_id}")
+
+    public CommonResult getCompareNum(@PathVariable("task_id") Long taskId) {
+        return CommonResult.success(dataAugmentationService.getCompareNum(taskId));
+    }
+
+
+
+    @GetMapping("/compare/{task_id}/{idx}")
+    public ResponseEntity<Map<String, String>> getCompareImages(@PathVariable("task_id") Long taskId, @PathVariable("idx") int idx) {
+        try {
+            DataAugmentation dataAugmentation = dataAugmentationService.getById(taskId);
+
+            Path inputPath = null;
+            Path outputPath = null;
+            String osName = System.getProperty("os.name");
+            // 判断是否是Windows环境
+            if (osName.toLowerCase().contains("windows")) {
+                inputPath = Paths.get("C:", dataAugmentation.getInputPath());
+                outputPath = Paths.get("C:", dataAugmentation.getOutputPath());
+            } else {
+                inputPath = Paths.get(dataAugmentation.getInputPath());
+                outputPath = Paths.get(dataAugmentation.getOutputPath());
+            }
+            System.out.println("inputPath: " + inputPath.toString());
+            System.out.println("outputPath: " + outputPath.toString());
+
+
+            byte[] image1 = Files.readAllBytes(inputPath.resolve(String.format("%05d", idx) + ".jpg"));
+            byte[] image2 = Files.readAllBytes(outputPath.resolve(String.format("%05d", idx) + ".jpg"));
+
+            // 将图片编码成Base64字符串
+            String base64Image1 = Base64.getEncoder().encodeToString(image1);
+            String base64Image2 = Base64.getEncoder().encodeToString(image2);
+
+            // 创建一个Map来存储Base64编码的图片
+            Map<String, String> images = new HashMap<>();
+            images.put("origin", base64Image1);
+            images.put("stable", base64Image2);
+
+            // 返回Map
+            return ResponseEntity.ok(images);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return ResponseEntity.status(500).build();
+        }
+    }
+
+    // @PostMapping("/get_result")
+    // public CommonResult getResult(@Valid @RequestBody dataAugmentationStartResultBo dataAugmentationStartResultBo) {
+    //     return dataAugmentationService.getResult(dataAugmentationStartResultBo);
+    // }
+
+    @GetMapping("/start/{id}")
+    public CommonResult start(@PathVariable("id") Long id) {
+        return dataAugmentationService.start(id);
+    }
+
+    @GetMapping("/stop/{id}")
+    public CommonResult stop(@PathVariable("id") Long id) {
+        return dataAugmentationService.stop(id);
+    }
+
+    /**
+     * 查询数据增强列表
+     */
+    @SaCheckPermission("demo:dataAugmentation:list")
+    @GetMapping("/list")
+    public CommonResult<PageResult<DataAugmentationVo>> list(DataAugmentationBo dataAugmentationBo) {
+        return CommonResult.success(dataAugmentationService.selectPage(dataAugmentationBo));
+    }
+
+    /**
+     * 导出数据增强列表
+     */
+    @SaCheckPermission("demo:dataAugmentation:export")
+    @Log(title = "数据增强", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, DataAugmentationBo dataAugmentationBo) {
+        List<DataAugmentationVo> list = dataAugmentationService.selectList(dataAugmentationBo);
+        ExcelUtil.exportExcel(list, "数据增强", DataAugmentationVo.class, response);
+    }
+
+    /**
+     * 获取数据增强详细信息
+     */
+    @SaCheckPermission("demo:dataAugmentation:query")
+    @GetMapping(value = "/{id}")
+    public CommonResult<DataAugmentationVo> getInfo(@PathVariable Long id) {
+        return CommonResult.success(dataAugmentationService.selectById(id));
+    }
+
+    /**
+     * 新增数据增强
+     */
+    @SaCheckPermission("demo:dataAugmentation:add")
+    @Log(title = "数据增强", businessType = BusinessType.INSERT)
+    @RepeatSubmit()
+    @PostMapping
+    public CommonResult<Void> add(@Validated @RequestBody DataAugmentationBo dataAugmentationBo) {
+        QueryWrapper queryWrapper = new QueryWrapper();
+        queryWrapper.eq("file_name", dataAugmentationBo.getUploadPath());
+        List<SysOss> list = ossService.list(queryWrapper);
+        SysOss oneByEntityId = list.get(0);
+        dataAugmentationBo.setInputOssId(oneByEntityId.getOssId());
+        boolean inserted = dataAugmentationService.insert(dataAugmentationBo);
+        if (!inserted) {
+            return CommonResult.fail("新增数据增强记录失败!");
+        }
+        return CommonResult.success();
+    }
+
+    /**
+     * 修改数据增强
+     */
+    @SaCheckPermission("demo:dataAugmentation:edit")
+    @Log(title = "数据增强", businessType = BusinessType.UPDATE)
+    @RepeatSubmit()
+    @PutMapping
+    public CommonResult<Void> edit(@Validated @RequestBody DataAugmentationBo dataAugmentationBo) {
+        Boolean updated = dataAugmentationService.update(dataAugmentationBo);
+        if (!updated) {
+            return CommonResult.fail("修改数据增强记录失败!");
+        }
+        return CommonResult.success();
+    }
+
+    /**
+     * 删除数据增强
+     */
+    @SaCheckPermission("demo:dataAugmentation:remove")
+    @Log(title = "数据增强", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public CommonResult<Void> remove(@PathVariable Long[] ids) {
+        boolean deleted = dataAugmentationService.deleteByIds(ids);
+        if (!deleted) {
+            return CommonResult.fail("删除数据增强记录失败!");
+        }
+        return CommonResult.success();
+    }
+}

+ 97 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/domain/DataAugmentation.java

@@ -0,0 +1,97 @@
+package com.taais.biz.domain;
+
+
+import java.util.Date;
+
+import com.mybatisflex.annotation.Column;
+import com.mybatisflex.annotation.Id;
+import com.mybatisflex.annotation.Table;
+import jakarta.validation.constraints.NotNull;
+import lombok.*;
+
+import java.io.Serial;
+
+import com.taais.common.orm.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 数据增强对象 data_augmentation
+ *
+ * @author tanlun
+ * 2024-10-11
+ */
+@Builder
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Table(value = "video_stable")
+@AllArgsConstructor
+@NoArgsConstructor
+public class DataAugmentation extends BaseEntity {
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @Id
+    private Long id;
+
+    /**
+     * 视频名称
+     */
+    private String name;
+
+    /**
+     * 任务状态 0未开始 1进行中 2已结束
+     */
+    private String status;
+
+    /**
+     * 输入oss_ID
+     */
+    private Long inputOssId;
+    private String inputPath;
+    private String outputPath;
+
+    /**
+     * 开始时间
+     */
+    private Date startTime;
+
+    /**
+     * 结束时间
+     */
+    private Date endTime;
+
+    /**
+     * 耗时
+     */
+    private Long costSecond;
+
+    /**
+     * 日志
+     */
+    private String log;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 逻辑删除标志(0代表存在 1代表删除)
+     */
+    @Column(isLogicDelete = true)
+    private Integer delFlag;
+
+    /**
+     * 算法路径
+     */
+    private String algorithmPath;
+
+    /**
+     * 超参配置
+     */
+    private String hyperparameterConfiguration;
+
+}

+ 87 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/domain/bo/DataAugmentationBo.java

@@ -0,0 +1,87 @@
+package com.taais.biz.domain.bo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.taais.biz.domain.VideoStable;
+import io.github.linpeilie.annotations.AutoMapper;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import lombok.*;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.taais.common.orm.core.domain.BaseEntity;
+
+/**
+ * 数据增强对象 data_augmentation
+ *
+ * @author tanlun
+ * 2024-10-11
+ */
+@Builder
+@Data
+@EqualsAndHashCode(callSuper = true)
+@AutoMapper(target = VideoStable.class, reverseConvertGenerate = false)
+@AllArgsConstructor
+@NoArgsConstructor
+public class DataAugmentationBo extends BaseEntity{
+    /**
+     * 主键ID
+     */
+    private Long id;
+
+    /**
+     * 视频名称
+     */
+    @NotBlank(message = "任务名称不能为空")
+    private String name;
+
+    /**
+     * 任务状态 0未开始 1进行中 2已结束
+     */
+    private String status;
+
+    /**
+     * 输入图片集ossId
+     */
+
+    private Long inputOssId;
+    @NotNull(message = "输入图片集路径不能为空")
+    private String uploadPath;
+
+    private String inputPath;
+    private String outputPath;
+
+    /**
+     * 开始时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+
+    /**
+     * 结束时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date endTime;
+
+    /**
+     * 耗时
+     */
+    private Long costSecond;
+
+    /**
+     * 日志
+     */
+    private String log;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+    /**
+     * 算法路径
+     */
+    private String algorithmPath;
+    /**
+     * 超参配置
+     */
+    private String hyperparameterConfiguration;
+}

+ 26 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/domain/bo/DataAugmentationStartResultBo.java

@@ -0,0 +1,26 @@
+package com.taais.biz.domain.bo;
+
+import jakarta.validation.constraints.NotNull;
+import lombok.*;
+import net.bytebuddy.implementation.bind.annotation.Empty;
+
+/**
+ * @Datetime : 2024/10/11 12:13
+ * @Author : tanlun
+ * @Email : 2896808975@qq.com
+ * @File : DataAugmentationStartResult.java
+ * @Brief :
+ */
+
+@Builder
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode()
+public class DataAugmentationStartResultBo {
+    @NotNull(message = "status不能为空")
+    private String status;
+    private String msg;
+    @NotNull(message = "id不能为空")
+    private Long id;
+}

+ 85 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/domain/vo/DataAugmentationVo.java

@@ -0,0 +1,85 @@
+package com.taais.biz.domain.vo;
+
+import java.util.Date;
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.taais.biz.domain.VideoStable;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import java.io.Serial;
+import java.io.Serializable;
+import com.taais.common.orm.core.domain.BaseEntity;
+
+/**
+ * 数据增强对象 data_augmentation
+ *
+ * @author tanlun
+ * 2024-10-11
+ */
+@Data
+@ExcelIgnoreUnannotated
+@EqualsAndHashCode(callSuper = true)
+@AutoMapper(target = VideoStable.class)
+public class DataAugmentationVo extends BaseEntity implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /** 主键ID */
+    @ExcelProperty(value = "主键ID")
+    private Long id;
+
+    /** 视频名称 */
+    @ExcelProperty(value = "视频名称")
+    private String name;
+
+    /** 任务状态 0未开始 1进行中 2已结束 */
+    @ExcelProperty(value = "任务状态 0未开始 1进行中 2已结束")
+    private String status;
+
+    /** 输入图片集路径 */
+    @ExcelProperty(value = "输入图片集ossID")
+    private Long inputOssId;
+
+    /** 去抖动的图片集路径 */
+    @ExcelProperty(value = "去抖动的图片集ossId")
+    private Long outputOssId;
+
+    /** 开始时间 */
+    @ExcelProperty(value = "开始时间")
+    private Date startTime;
+
+    /** 结束时间 */
+    @ExcelProperty(value = "结束时间")
+    private Date endTime;
+
+    /** 耗时 */
+    @ExcelProperty(value = "耗时")
+    private Long costSecond;
+
+    /** 日志 */
+    @ExcelProperty(value = "日志")
+    private String log;
+
+    /** 备注 */
+    @ExcelProperty(value = "备注")
+    private String remarks;
+
+    /** 逻辑删除标志(0代表存在 1代表删除) */
+    @ExcelProperty(value = "逻辑删除标志(0代表存在 1代表删除)")
+    private Integer delFlag;
+
+    @ExcelProperty(value = "输入路径")
+    private String inputPath;
+    @ExcelProperty(value = "输出路径")
+    private String outputPath;
+    @ExcelProperty(value = "算法路径")
+    private String algorithmPath;
+    @ExcelProperty(value = "超参配置")
+    private String hyperparameterConfiguration;
+
+
+
+}

+ 17 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/mapper/DataAugmentationMapper.java

@@ -0,0 +1,17 @@
+package com.taais.biz.mapper;
+
+import com.mybatisflex.core.BaseMapper;
+import com.taais.biz.domain.DataAugmentation;
+import com.taais.biz.domain.VideoStable;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 数据增强Mapper接口
+ *
+ * @author tanlun
+ * 2024-10-11
+ */
+@Mapper
+public interface DataAugmentationMapper extends BaseMapper<DataAugmentation> {
+
+}

+ 75 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/service/IDataAugmentationService.java

@@ -0,0 +1,75 @@
+package com.taais.biz.service;
+
+import com.taais.biz.domain.DataAugmentation;
+import com.taais.biz.domain.bo.DataAugmentationBo;
+import com.taais.biz.domain.bo.DataAugmentationStartResultBo;
+import com.taais.biz.domain.vo.DataAugmentationVo;
+import com.taais.common.core.core.domain.CommonResult;
+import com.taais.common.core.core.page.PageResult;
+import com.taais.common.orm.core.service.IBaseService;
+
+import java.util.List;
+
+/**
+ * 数据增强Service接口
+ *
+ * @author tanlun
+ * 2024-08-30
+ */
+public interface IDataAugmentationService extends IBaseService<DataAugmentation> {
+    /**
+     * 查询数据增强
+     *
+     * @param id 数据增强主键
+     * @return 数据增强
+     */
+        DataAugmentationVo selectById(Long id);
+
+    /**
+     * 查询数据增强列表
+     *
+     * @param dataAugmentationBo 数据增强Bo
+     * @return 数据增强集合
+     */
+    List<DataAugmentationVo> selectList(DataAugmentationBo dataAugmentationBo);
+
+    /**
+     * 分页查询数据增强列表
+     *
+     * @param dataAugmentationBo 数据增强Bo
+     * @return 分页数据增强集合
+     */
+    PageResult<DataAugmentationVo> selectPage(DataAugmentationBo dataAugmentationBo);
+
+    /**
+     * 新增数据增强
+     *
+     * @param dataAugmentationBo 数据增强Bo
+     * @return 结果:true 操作成功,false 操作失败
+     */
+    boolean insert(DataAugmentationBo dataAugmentationBo);
+
+    /**
+     * 修改数据增强
+     *
+     * @param dataAugmentationBo 数据增强Bo
+     * @return 结果:true 更新成功,false 更新失败
+     */
+    boolean update(DataAugmentationBo dataAugmentationBo);
+
+    /**
+     * 批量删除数据增强
+     *
+     * @param ids 需要删除的数据增强主键集合
+     * @return 结果:true 删除成功,false 删除失败
+     */
+    boolean deleteByIds(Long[] ids);
+
+    CommonResult start(Long id);
+
+    CommonResult getResult(DataAugmentationStartResultBo dataAugmentationStartResultBo);
+
+    Object getCompareNum(Long taskId);
+
+    CommonResult stop(Long id);
+}

+ 386 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/DataAugmentationServiceImpl.java

@@ -0,0 +1,386 @@
+package com.taais.biz.service.impl;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.mybatisflex.core.paginate.Page;
+import com.mybatisflex.core.query.QueryWrapper;
+import com.taais.biz.constant.BizConstant;
+import com.taais.biz.domain.HttpResponseEntity;
+import com.taais.biz.domain.DataAugmentation;
+import com.taais.biz.domain.bo.DataAugmentationBo;
+import com.taais.biz.domain.bo.DataAugmentationStartResultBo;
+import com.taais.biz.domain.vo.DataAugmentationVo;
+import com.taais.biz.mapper.DataAugmentationMapper;
+import com.taais.biz.service.IDataAugmentationService;
+import com.taais.biz.utils.ZipUtils;
+import com.taais.common.core.config.TaaisConfig;
+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.system.domain.vo.SysOssVo;
+import com.taais.system.service.ISysOssService;
+import jakarta.annotation.Resource;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.io.FileUtils;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+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.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+import static com.taais.biz.domain.table.VideoStableTableDef.VIDEO_STABLE;
+
+/**
+ * 数据增强Service业务层处理
+ *
+ * @author tanlun
+ * 2024-10-11
+ */
+@Service
+@Slf4j
+public class DataAugmentationServiceImpl extends BaseServiceImpl<DataAugmentationMapper, DataAugmentation> implements IDataAugmentationService {
+    @Value("${server.video_stable_start_url}")
+    private String video_stable_start_url;
+
+    @Value("${server.video_stable_stop_url}")
+    private String video_stable_stop_url;
+
+    @Autowired
+    private ISysOssService ossService;
+
+    @Resource
+    private DataAugmentationMapper dataAugmentationMapper;
+
+    @Override
+    public QueryWrapper query() {
+        return super.query().from(VIDEO_STABLE);
+    }
+
+    private QueryWrapper buildQueryWrapper(DataAugmentationBo dataAugmentationBo) {
+        QueryWrapper queryWrapper = super.buildBaseQueryWrapper();
+        queryWrapper.and(VIDEO_STABLE.NAME.like
+            (dataAugmentationBo.getName()));
+        queryWrapper.and(VIDEO_STABLE.STATUS.like
+            (dataAugmentationBo.getStatus()));
+        queryWrapper.and(VIDEO_STABLE.INPUT_OSS_ID.eq
+            (dataAugmentationBo.getInputOssId()));
+        queryWrapper.and(VIDEO_STABLE.START_TIME.eq
+            (dataAugmentationBo.getStartTime()));
+        queryWrapper.and(VIDEO_STABLE.END_TIME.eq
+            (dataAugmentationBo.getEndTime()));
+        queryWrapper.and(VIDEO_STABLE.COST_SECOND.eq
+            (dataAugmentationBo.getCostSecond()));
+        queryWrapper.and(VIDEO_STABLE.LOG.like
+            (dataAugmentationBo.getLog()));
+        queryWrapper.and(VIDEO_STABLE.REMARKS.like
+            (dataAugmentationBo.getRemarks()));
+
+        return queryWrapper;
+    }
+
+    /**
+     * 查询数据增强
+     *
+     * @param id 数据增强主键
+     * @return 数据增强
+     */
+    @Override
+    public DataAugmentationVo selectById(Long id) {
+        return this.getOneAs(query().where(VIDEO_STABLE.ID.eq(id)), DataAugmentationVo.class);
+
+    }
+
+    /**
+     * 查询数据增强列表
+     *
+     * @param dataAugmentationBo 数据增强Bo
+     * @return 数据增强集合
+     */
+    @Override
+    public List<DataAugmentationVo> selectList(DataAugmentationBo dataAugmentationBo) {
+        QueryWrapper queryWrapper = buildQueryWrapper(dataAugmentationBo);
+        return this.listAs(queryWrapper, DataAugmentationVo.class);
+    }
+
+    /**
+     * 分页查询数据增强列表
+     *
+     * @param dataAugmentationBo 数据增强Bo
+     * @return 分页数据增强集合
+     */
+    @Override
+    public PageResult<DataAugmentationVo> selectPage(DataAugmentationBo dataAugmentationBo) {
+        QueryWrapper queryWrapper = buildQueryWrapper(dataAugmentationBo);
+        Page<DataAugmentationVo> page = this.pageAs(PageQuery.build(), queryWrapper, DataAugmentationVo.class);
+        return PageResult.build(page);
+    }
+
+    /**
+     * 新增数据增强
+     *
+     * @param dataAugmentationBo 数据增强Bo
+     * @return 结果:true 操作成功,false 操作失败
+     */
+    @Override
+    public boolean insert(DataAugmentationBo dataAugmentationBo) {
+        // 检查input_oss_id是否存在
+        if (ObjectUtil.isNull(dataAugmentationBo.getInputOssId())) {
+            return false;
+        }
+
+        SysOssVo ossEntity = ossService.getById(dataAugmentationBo.getInputOssId());
+        if (ObjectUtil.isNull(ossEntity)) {
+            return false;
+        }
+
+        //DataAugmentation dataAugmentation = MapstructUtils.convert(dataAugmentationBo, DataAugmentation.class);
+        DataAugmentation dataAugmentation = new DataAugmentation();
+        dataAugmentation.setId(dataAugmentationBo.getId());
+        dataAugmentation.setOutputPath(dataAugmentationBo.getOutputPath());
+        dataAugmentation.setLog(dataAugmentationBo.getLog());
+        dataAugmentation.setCostSecond(dataAugmentationBo.getCostSecond());
+        dataAugmentation.setInputPath(dataAugmentationBo.getInputPath());
+        dataAugmentation.setEndTime(dataAugmentationBo.getEndTime());
+        dataAugmentation.setAlgorithmPath(dataAugmentationBo.getAlgorithmPath());
+        dataAugmentation.setHyperparameterConfiguration(dataAugmentationBo.getHyperparameterConfiguration());
+        dataAugmentation.setInputOssId(dataAugmentationBo.getInputOssId());
+        dataAugmentation.setRemarks(dataAugmentationBo.getRemarks());
+        dataAugmentation.setStartTime(dataAugmentationBo.getStartTime());
+        dataAugmentation.setStatus(BizConstant.VideoStatus.NOT_START);
+
+        return this.save(dataAugmentation);// 使用全局配置的雪花算法主键生成器生成ID值
+    }
+
+    public static String removeFileExtension(String fileName) {
+        int lastDotIndex = fileName.lastIndexOf('.');
+        if (lastDotIndex == -1) {
+            return fileName; // 如果没有找到'.',则返回原文件名
+        }
+        return fileName.substring(0, lastDotIndex);
+    }
+
+    public static void makeDir(String path) {
+        File folder = new File(path);
+        if (!folder.exists()) {
+            folder.mkdirs();
+        } else {
+            try {
+                FileUtils.cleanDirectory(folder);
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        }
+    }
+
+    /**
+     * 修改数据增强
+     *
+     * @param dataAugmentationBo 数据增强Bo
+     * @return 结果:true 更新成功,false 更新失败
+     */
+    @Override
+    public boolean update(DataAugmentationBo dataAugmentationBo) {
+        DataAugmentation dataAugmentation = MapstructUtils.convert(dataAugmentationBo, DataAugmentation.class);
+        if (ObjectUtil.isNotNull(dataAugmentation) && ObjectUtil.isNotNull(dataAugmentation.getId())) {
+            boolean updated = this.updateById(dataAugmentation);
+            return updated;
+        }
+        return false;
+    }
+
+    /**
+     * 批量删除数据增强
+     *
+     * @param ids 需要删除的数据增强主键集合
+     * @return 结果:true 删除成功,false 删除失败
+     */
+    @Transactional
+    @Override
+    public boolean deleteByIds(Long[] ids) {
+        return this.removeByIds(Arrays.asList(ids));
+    }
+
+    @Override
+    public CommonResult start(Long id) {
+        DataAugmentation dataAugmentation = getById(id);
+
+        SysOssVo inputOssEntity = ossService.getById(dataAugmentation.getInputOssId());
+
+        String filePath = inputOssEntity.getFileName();
+        String localPath = TaaisConfig.getProfile();
+        String resourcePath = localPath + StringUtils.substringAfter(filePath, Constants.RESOURCE_PREFIX);
+
+        String fileName = StringUtils.substringAfterLast(filePath, "/");
+        String fileName_without_suffix = removeFileExtension(fileName);
+
+        Path path = Paths.get(resourcePath);
+        Path inputPath = path.resolveSibling(fileName_without_suffix + "_images");
+        Path outputPath = path.resolveSibling(fileName_without_suffix + "_stable");
+
+        makeDir(inputPath.toString());
+        makeDir(outputPath.toString());
+
+        ZipUtils.unzip(resourcePath, inputPath.toString());
+
+        dataAugmentation.setInputPath(inputPath.toString());
+        dataAugmentation.setOutputPath(outputPath.toString());
+
+        dataAugmentation.setStartTime(new Date());
+
+        dataAugmentation.setStatus(BizConstant.VideoStatus.RUNNING);
+        updateById(dataAugmentation);
+
+        HttpResponseEntity responseEntity = sendPostMsg(video_stable_start_url, dataAugmentation);
+        if (responseEntity.getStatus() == 200) {
+            dataAugmentation.setStatus(BizConstant.VideoStatus.FAILED);
+            updateById(dataAugmentation);
+            return CommonResult.success("任务开始成功,请等待完成");
+        }
+        else {
+            return CommonResult.fail("任务开始失败,请检查!");
+        }
+    }
+
+    public HttpResponseEntity sendPostMsg(String url, Object obj) {
+        log.info("sendMsg: {} - {}", url, JsonUtils.toJsonString(obj));
+
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        HttpPost request = new HttpPost(url);
+        // 设置请求体
+        StringEntity entity = new StringEntity(JsonUtils.toJsonString(obj), "UTF-8");
+        entity.setContentType("application/json");
+        request.setEntity(entity);
+
+        try {
+            CloseableHttpResponse response = httpClient.execute(request);
+            if (response.getStatusLine().getStatusCode() != 200) {
+                log.error("sendMsg failed, status code -> " + response.getStatusLine().getStatusCode());
+                return null;
+            }
+            String responseBody = EntityUtils.toString(response.getEntity());
+            log.info("responseBody -> " + responseBody);
+            // 使用 JsonUtils 将响应体转换为指定的实体类
+            return JsonUtils.parseObject(responseBody, HttpResponseEntity.class);
+        } catch (Exception e) {
+            log.error("sendMsg error", e);
+            return null;
+        }
+    }
+
+    @Override
+    public CommonResult getResult(DataAugmentationStartResultBo dataAugmentationStartResultBo) {
+        Long id = dataAugmentationStartResultBo.getId();
+        String status = dataAugmentationStartResultBo.getStatus();
+        String msg = dataAugmentationStartResultBo.getMsg();
+        DataAugmentation dataAugmentation = getById(id);
+        dataAugmentation.setLog(msg);
+        dataAugmentation.setStatus("200".equals(status) ? BizConstant.VideoStatus.END : BizConstant.VideoStatus.FAILED);
+        dataAugmentation.setEndTime(new Date());
+        try {
+            dataAugmentation.setCostSecond((dataAugmentation.getEndTime().getTime() - dataAugmentation.getStartTime().getTime()) / 1000);
+        } catch (Exception e) {
+            dataAugmentation.setCostSecond(null);
+        }
+        updateById(dataAugmentation);
+        return CommonResult.success();
+    }
+
+    @Override
+    public HashMap<String, Object> getCompareNum(Long taskId) {
+        DataAugmentation dataAugmentation = getById(taskId);
+
+        Path inputPath = null;
+        Path outputPath = null;
+        String osName = System.getProperty("os.name");
+        // 判断是否是Windows环境
+        if (osName.toLowerCase().contains("windows")) {
+            inputPath = Paths.get("C:", dataAugmentation.getInputPath());
+            outputPath = Paths.get("C:", dataAugmentation.getOutputPath());
+        } else {
+            inputPath = Paths.get(dataAugmentation.getInputPath());
+            outputPath = Paths.get(dataAugmentation.getOutputPath());
+        }
+
+        // 创建File对象
+        File in_directory = new File(inputPath.toString());
+        File out_directory = new File(outputPath.toString());
+
+        // 调用方法获取文件数量
+        int in_fileCount = countFiles(in_directory);
+        int out_fileCount = countFiles(out_directory);
+
+        // 输出文件数量
+        log.info("inFileCount -> " + in_fileCount);
+        log.info("outFileCount -> " + out_fileCount);
+
+        HashMap<String, Object> map = new HashMap<>();
+        map.put("inFileCount", in_fileCount);
+        map.put("outFileCount", out_fileCount);
+        return map;
+    }
+
+    @Override
+    public CommonResult stop(Long id) {
+        DataAugmentation dataAugmentation = getById(id);
+
+        HttpResponseEntity responseEntity = sendPostMsg(video_stable_stop_url, dataAugmentation);
+        if (ObjectUtil.isNotNull(responseEntity) && responseEntity.getStatus() == 200) {
+            dataAugmentation.setStatus(BizConstant.VideoStatus.INTERRUPTED);
+            updateById(dataAugmentation);
+            return CommonResult.fail("终止任务成功");
+        } else {
+            return CommonResult.fail("终止任务失败");
+        }
+    }
+
+    /**
+     * 递归统计文件夹中的文件数量
+     *
+     * @param directory 文件夹对象
+     * @return 文件数量
+     */
+    public static int countFiles(File directory) {
+        // 检查文件夹是否存在且是一个目录
+        if (!directory.exists() || !directory.isDirectory()) {
+            System.out.println("指定的路径不是一个有效的文件夹");
+            return 0;
+        }
+
+        // 获取文件夹中的所有文件和子文件夹
+        File[] files = directory.listFiles();
+
+        // 初始化文件计数器
+        int count = 0;
+
+        // 遍历文件和子文件夹
+        for (File file : files) {
+            if (file.isFile()) {
+                // 如果是文件,计数器加1
+                count++;
+            } else if (file.isDirectory()) {
+                // 如果是子文件夹,递归调用countFiles方法
+                count += countFiles(file);
+            }
+        }
+
+        return count;
+    }
+}

+ 7 - 0
taais-modules/taais-biz/src/main/resources/mapper/demo/DataAugmentationMapper.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.taais.demo.mapper.DataAugmentationMapper">
+
+</mapper>

+ 1 - 1
taais-modules/taais-generator/src/main/java/com/taais/generator/controller/GenController.java

@@ -36,7 +36,7 @@ import java.util.Map;
 @Validated
 @RestController
 @RequestMapping("/tool/gen")
-public class GenController extends BaseController {
+public class    GenController extends BaseController {
     @Resource
     private IGenTableService genTableService;
 

+ 5 - 0
taais-modules/taais-system/src/main/java/com/taais/system/service/impl/SysMenuServiceImpl.java

@@ -480,6 +480,7 @@ public class SysMenuServiceImpl extends BaseServiceImpl<SysMenuMapper, SysMenu>
     public String getRouterPath(SysMenu menu) {
         String routerPath = menu.getPath();
         // 内链打开外网方式
+
         if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) {
             routerPath = innerLinkReplaceEach(routerPath);
         }
@@ -531,6 +532,10 @@ public class SysMenuServiceImpl extends BaseServiceImpl<SysMenuMapper, SysMenu>
      * @return 结果
      */
     public boolean isInnerLink(SysMenu menu) {
+        if (menu.getIsFrame() == null) {
+            menu.setIsFrame("0");
+            updateById(menu);
+        }
         return menu.getIsFrame().equals(UserConstants.NO_FRAME) && StringUtils.ishttp(menu.getPath());
     }