Ver código fonte

FIX 海康jna和oshi jar包冲突问题

tjf 1 dia atrás
pai
commit
5e329b3121

+ 91 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/manage/AlgorithmSetController.java

@@ -0,0 +1,91 @@
+package com.ruoyi.web.controller.manage;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.domain.entity.AlgorithmSet;
+import com.ruoyi.manage.service.IAlgorithmSetService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 算法Controller
+ *
+ * @author boman
+ * @date 2025-08-12
+ */
+@RestController
+@RequestMapping("/manage/algorithmSet")
+public class AlgorithmSetController extends BaseController {
+    @Autowired
+    private IAlgorithmSetService algorithmSetService;
+
+    /**
+     * 查询算法列表
+     */
+    @PreAuthorize("@ss.hasPermi('manage:algorithmSet:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(AlgorithmSet algorithmSet) {
+        startPage();
+        List<AlgorithmSet> list = algorithmSetService.selectAlgorithmSetList(algorithmSet);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出算法列表
+     */
+    @PreAuthorize("@ss.hasPermi('manage:algorithmSet:export')")
+    @Log(title = "算法", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, AlgorithmSet algorithmSet) {
+        List<AlgorithmSet> list = algorithmSetService.selectAlgorithmSetList(algorithmSet);
+        ExcelUtil<AlgorithmSet> util = new ExcelUtil<AlgorithmSet>(AlgorithmSet.class);
+        util.exportExcel(response, list, "算法数据");
+    }
+
+    /**
+     * 获取算法详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('manage:algorithmSet:query')")
+    @GetMapping(value = "/{algorithmId}")
+    public AjaxResult getInfo(@PathVariable("algorithmId") Long algorithmId) {
+        return success(algorithmSetService.selectAlgorithmSetByAlgorithmId(algorithmId));
+    }
+
+    /**
+     * 新增算法
+     */
+    @PreAuthorize("@ss.hasPermi('manage:algorithmSet:add')")
+    @Log(title = "算法", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AlgorithmSet algorithmSet) {
+        return toAjax(algorithmSetService.insertAlgorithmSet(algorithmSet));
+    }
+
+    /**
+     * 修改算法
+     */
+    @PreAuthorize("@ss.hasPermi('manage:algorithmSet:edit')")
+    @Log(title = "算法", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody AlgorithmSet algorithmSet) {
+        return toAjax(algorithmSetService.updateAlgorithmSet(algorithmSet));
+    }
+
+    /**
+     * 删除算法
+     */
+    @PreAuthorize("@ss.hasPermi('manage:algorithmSet:remove')")
+    @Log(title = "算法", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{algorithmIds}")
+    public AjaxResult remove(@PathVariable Long[] algorithmIds) {
+        return toAjax(algorithmSetService.deleteAlgorithmSetByAlgorithmIds(algorithmIds));
+    }
+}

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/manage/TaskManageController.java

@@ -19,7 +19,7 @@ import java.util.List;
  * 任务管理Controller
  *
  * @author boman
- * @date 2025-05-07
+ * @date 2025-08-12
  */
 @RestController
 @RequestMapping("/manage/taskManage")

+ 131 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/AlgorithmSet.java

@@ -0,0 +1,131 @@
+package com.ruoyi.common.core.domain.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 算法对象 algorithm_set
+ * 
+ * @author boman
+ * @date 2025-08-12
+ */
+public class AlgorithmSet extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 算法ID */
+    private Long algorithmId;
+
+    /** 算法编号 */
+    @Excel(name = "算法编号")
+    private String algorithmNum;
+
+    /** 算法名称 */
+    @Excel(name = "算法名称")
+    private String algorithmName;
+
+    /** 算法描述 */
+    @Excel(name = "算法描述")
+    private String algorithmDescription;
+
+    /** 算法阈值严格 */
+    @Excel(name = "算法阈值严格")
+    private String algorithmThresholdStrict;
+
+    /** 算法阈值 */
+    @Excel(name = "算法阈值")
+    private String algorithmThreshold;
+
+    /** 删除标志(0代表存在 1代表删除) */
+    private String delFlag;
+
+    public void setAlgorithmId(Long algorithmId) 
+    {
+        this.algorithmId = algorithmId;
+    }
+
+    public Long getAlgorithmId()
+    {
+        return algorithmId;
+    }
+
+    public void setAlgorithmNum(String algorithmNum)
+    {
+        this.algorithmNum = algorithmNum;
+    }
+
+    public String getAlgorithmNum()
+    {
+        return algorithmNum;
+    }
+
+    public void setAlgorithmName(String algorithmName)
+    {
+        this.algorithmName = algorithmName;
+    }
+
+    public String getAlgorithmName()
+    {
+        return algorithmName;
+    }
+
+    public void setAlgorithmDescription(String algorithmDescription)
+    {
+        this.algorithmDescription = algorithmDescription;
+    }
+
+    public String getAlgorithmDescription()
+    {
+        return algorithmDescription;
+    }
+
+    public void setAlgorithmThresholdStrict(String algorithmThresholdStrict)
+    {
+        this.algorithmThresholdStrict = algorithmThresholdStrict;
+    }
+
+    public String getAlgorithmThresholdStrict()
+    {
+        return algorithmThresholdStrict;
+    }
+
+    public void setAlgorithmThreshold(String algorithmThreshold)
+    {
+        this.algorithmThreshold = algorithmThreshold;
+    }
+
+    public String getAlgorithmThreshold()
+    {
+        return algorithmThreshold;
+    }
+
+    public void setDelFlag(String delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag()
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("algorithmId", getAlgorithmId())
+            .append("algorithmNum", getAlgorithmNum())
+            .append("algorithmName", getAlgorithmName())
+            .append("algorithmDescription", getAlgorithmDescription())
+            .append("algorithmThresholdStrict", getAlgorithmThresholdStrict())
+            .append("algorithmThreshold", getAlgorithmThreshold())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 26 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/ChannelNumber.java

@@ -97,6 +97,31 @@ public class ChannelNumber extends BaseEntity {
     /** 子菜单 */
     private List<ChannelNumber> children = new ArrayList<ChannelNumber>();
 
+    /**
+     * 算法集合
+     */
+    private List<AlgorithmSet> algorithmSetList = new ArrayList<>();
+
+    /**
+     * 算法集合id
+     */
+    private Long[] algorithmSetIds;
+
+    public Long[] getAlgorithmSetIds() {
+        return algorithmSetIds;
+    }
+
+    public void setAlgorithmSetIds(Long[] algorithmSetIds) {
+        this.algorithmSetIds = algorithmSetIds;
+    }
+
+    public List<AlgorithmSet> getAlgorithmSetList() {
+        return algorithmSetList;
+    }
+
+    public void setAlgorithmSetList(List<AlgorithmSet> algorithmSetList) {
+        this.algorithmSetList = algorithmSetList;
+    }
 
     public List<ChannelNumber> getChildren() {
         return children;
@@ -254,6 +279,7 @@ public class ChannelNumber extends BaseEntity {
                 ", isChannel='" + isChannel + '\'' +
                 ", parameterSet=" + parameterSet +
                 ", children=" + children +
+                ", algorithmSetList=" + algorithmSetList +
                 '}';
     }
 }

+ 50 - 0
ruoyi-system/src/main/java/com/ruoyi/manage/domain/AlgorithmChannel.java

@@ -0,0 +1,50 @@
+package com.ruoyi.manage.domain;
+
+import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 算法和通道关联对象 algorithm_channel
+ * 
+ * @author boman
+ * @date 2025-08-12
+ */
+public class AlgorithmChannel extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 算法ID */
+    private Long algorithmId;
+
+    /** 通道ID */
+    private Long channelId;
+
+    public void setAlgorithmId(Long algorithmId) 
+    {
+        this.algorithmId = algorithmId;
+    }
+
+    public Long getAlgorithmId() 
+    {
+        return algorithmId;
+    }
+
+    public void setChannelId(Long channelId) 
+    {
+        this.channelId = channelId;
+    }
+
+    public Long getChannelId() 
+    {
+        return channelId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("algorithmId", getAlgorithmId())
+            .append("channelId", getChannelId())
+            .toString();
+    }
+}

+ 65 - 17
ruoyi-system/src/main/java/com/ruoyi/manage/domain/TaskManage.java

@@ -1,15 +1,19 @@
 package com.ruoyi.manage.domain;
 
+import com.ruoyi.common.core.domain.entity.AlgorithmSet;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * 任务管理对象 task_manage
  * 
  * @author boman
- * @date 2025-05-07
+ * @date 2025-08-12
  */
 public class TaskManage extends BaseEntity
 {
@@ -18,6 +22,14 @@ public class TaskManage extends BaseEntity
     /** 任务ID */
     private Long taskId;
 
+    /** 工作计划id(打卡时间表) */
+    @Excel(name = "工作计划id(打卡时间表)")
+    private Long clockSetId;
+
+    /** 工作计划名称 */
+    @Excel(name = "工作计划名称")
+    private String clockName;
+
     /** 任务编号 */
     @Excel(name = "任务编号")
     private String taskNum;
@@ -26,6 +38,10 @@ public class TaskManage extends BaseEntity
     @Excel(name = "任务描述")
     private String taskDetails;
 
+    /** IO口信号输出1:是,2:否 */
+    @Excel(name = "IO口信号输出1:是,2:否")
+    private String ioOutput;
+
     /** 通道ID */
     @Excel(name = "通道ID")
     private Long channelId;
@@ -38,14 +54,23 @@ public class TaskManage extends BaseEntity
     @Excel(name = "上报地址")
     private String reportAddress;
 
-    /** 选择的算法编号 逗号分割 */
-    @Excel(name = "选择的算法编号 逗号分割")
-    private String algorithmSet;
-
     /** 删除标志(0代表存在 1代表删除) */
     private String delFlag;
 
-    public void setTaskId(Long taskId) 
+    /**
+     * 算法集合
+     */
+    private List<AlgorithmSet> algorithmSetList = new ArrayList<>();
+
+    public List<AlgorithmSet> getAlgorithmSetList() {
+        return algorithmSetList;
+    }
+
+    public void setAlgorithmSetList(List<AlgorithmSet> algorithmSetList) {
+        this.algorithmSetList = algorithmSetList;
+    }
+
+    public void setTaskId(Long taskId)
     {
         this.taskId = taskId;
     }
@@ -55,6 +80,26 @@ public class TaskManage extends BaseEntity
         return taskId;
     }
 
+    public void setClockSetId(Long clockSetId) 
+    {
+        this.clockSetId = clockSetId;
+    }
+
+    public Long getClockSetId() 
+    {
+        return clockSetId;
+    }
+
+    public void setClockName(String clockName) 
+    {
+        this.clockName = clockName;
+    }
+
+    public String getClockName() 
+    {
+        return clockName;
+    }
+
     public void setTaskNum(String taskNum) 
     {
         this.taskNum = taskNum;
@@ -75,6 +120,16 @@ public class TaskManage extends BaseEntity
         return taskDetails;
     }
 
+    public void setIoOutput(String ioOutput) 
+    {
+        this.ioOutput = ioOutput;
+    }
+
+    public String getIoOutput() 
+    {
+        return ioOutput;
+    }
+
     public void setChannelId(Long channelId) 
     {
         this.channelId = channelId;
@@ -105,16 +160,6 @@ public class TaskManage extends BaseEntity
         return reportAddress;
     }
 
-    public void setAlgorithmSet(String algorithmSet) 
-    {
-        this.algorithmSet = algorithmSet;
-    }
-
-    public String getAlgorithmSet() 
-    {
-        return algorithmSet;
-    }
-
     public void setDelFlag(String delFlag) 
     {
         this.delFlag = delFlag;
@@ -129,17 +174,20 @@ public class TaskManage extends BaseEntity
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("taskId", getTaskId())
+            .append("clockSetId", getClockSetId())
+            .append("clockName", getClockName())
             .append("taskNum", getTaskNum())
             .append("taskDetails", getTaskDetails())
+            .append("ioOutput", getIoOutput())
             .append("channelId", getChannelId())
             .append("videoAddress", getVideoAddress())
             .append("reportAddress", getReportAddress())
-            .append("algorithmSet", getAlgorithmSet())
             .append("delFlag", getDelFlag())
             .append("createBy", getCreateBy())
             .append("createTime", getCreateTime())
             .append("updateBy", getUpdateBy())
             .append("updateTime", getUpdateTime())
+            .append("algorithmSetList", getAlgorithmSetList())
             .append("remark", getRemark())
             .toString();
     }

+ 71 - 0
ruoyi-system/src/main/java/com/ruoyi/manage/mapper/AlgorithmChannelMapper.java

@@ -0,0 +1,71 @@
+package com.ruoyi.manage.mapper;
+
+import com.ruoyi.manage.domain.AlgorithmChannel;
+
+import java.util.List;
+
+/**
+ * 算法和通道关联Mapper接口
+ * 
+ * @author boman
+ * @date 2025-08-12
+ */
+public interface AlgorithmChannelMapper 
+{
+    /**
+     * 查询算法和通道关联
+     * 
+     * @param algorithmId 算法和通道关联主键
+     * @return 算法和通道关联
+     */
+    public AlgorithmChannel selectAlgorithmChannelByAlgorithmId(Long algorithmId);
+
+    /**
+     * 查询算法和通道关联列表
+     * 
+     * @param algorithmChannel 算法和通道关联
+     * @return 算法和通道关联集合
+     */
+    public List<AlgorithmChannel> selectAlgorithmChannelList(AlgorithmChannel algorithmChannel);
+
+    /**
+     * 新增算法和通道关联
+     * 
+     * @param algorithmChannel 算法和通道关联
+     * @return 结果
+     */
+    public int insertAlgorithmChannel(AlgorithmChannel algorithmChannel);
+
+    /**
+     * 修改算法和通道关联
+     * 
+     * @param algorithmChannel 算法和通道关联
+     * @return 结果
+     */
+    public int updateAlgorithmChannel(AlgorithmChannel algorithmChannel);
+
+    /**
+     * 删除算法和通道关联
+     * 
+     * @param algorithmId 算法和通道关联主键
+     * @return 结果
+     */
+    public int deleteAlgorithmChannelByAlgorithmId(Long algorithmId);
+
+    /**
+     * 批量删除算法和通道关联
+     * 
+     * @param algorithmIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAlgorithmChannelByAlgorithmIds(Long[] algorithmIds);
+    public int deleteAlgorithmChannelByChannelId(Long channelId);
+    public int deleteAlgorithmChannelByChannelIds(Long[] channelIds);
+
+    /**
+     * 批量新增
+     * @param algorithmChannelList
+     * @return
+     */
+     int batchAlgorithmChannel(List<AlgorithmChannel> algorithmChannelList);
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/manage/mapper/AlgorithmSetMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.manage.mapper;
+
+import com.ruoyi.common.core.domain.entity.AlgorithmSet;
+
+import java.util.List;
+
+/**
+ * 算法Mapper接口
+ * 
+ * @author boman
+ * @date 2025-08-12
+ */
+public interface AlgorithmSetMapper 
+{
+    /**
+     * 查询算法
+     * 
+     * @param algorithmId 算法主键
+     * @return 算法
+     */
+    public AlgorithmSet selectAlgorithmSetByAlgorithmId(Long algorithmId);
+
+    /**
+     * 查询算法列表
+     * 
+     * @param algorithmSet 算法
+     * @return 算法集合
+     */
+    public List<AlgorithmSet> selectAlgorithmSetList(AlgorithmSet algorithmSet);
+
+    /**
+     * 新增算法
+     * 
+     * @param algorithmSet 算法
+     * @return 结果
+     */
+    public int insertAlgorithmSet(AlgorithmSet algorithmSet);
+
+    /**
+     * 修改算法
+     * 
+     * @param algorithmSet 算法
+     * @return 结果
+     */
+    public int updateAlgorithmSet(AlgorithmSet algorithmSet);
+
+    /**
+     * 删除算法
+     * 
+     * @param algorithmId 算法主键
+     * @return 结果
+     */
+    public int deleteAlgorithmSetByAlgorithmId(Long algorithmId);
+
+    /**
+     * 批量删除算法
+     * 
+     * @param algorithmIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAlgorithmSetByAlgorithmIds(Long[] algorithmIds);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/manage/service/IAlgorithmChannelService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.manage.service;
+
+import java.util.List;
+import com.ruoyi.manage.domain.AlgorithmChannel;
+
+/**
+ * 算法和通道关联Service接口
+ * 
+ * @author boman
+ * @date 2025-08-12
+ */
+public interface IAlgorithmChannelService 
+{
+    /**
+     * 查询算法和通道关联
+     * 
+     * @param algorithmId 算法和通道关联主键
+     * @return 算法和通道关联
+     */
+    public AlgorithmChannel selectAlgorithmChannelByAlgorithmId(Long algorithmId);
+
+    /**
+     * 查询算法和通道关联列表
+     * 
+     * @param algorithmChannel 算法和通道关联
+     * @return 算法和通道关联集合
+     */
+    public List<AlgorithmChannel> selectAlgorithmChannelList(AlgorithmChannel algorithmChannel);
+
+    /**
+     * 新增算法和通道关联
+     * 
+     * @param algorithmChannel 算法和通道关联
+     * @return 结果
+     */
+    public int insertAlgorithmChannel(AlgorithmChannel algorithmChannel);
+
+    /**
+     * 修改算法和通道关联
+     * 
+     * @param algorithmChannel 算法和通道关联
+     * @return 结果
+     */
+    public int updateAlgorithmChannel(AlgorithmChannel algorithmChannel);
+
+    /**
+     * 批量删除算法和通道关联
+     * 
+     * @param algorithmIds 需要删除的算法和通道关联主键集合
+     * @return 结果
+     */
+    public int deleteAlgorithmChannelByAlgorithmIds(Long[] algorithmIds);
+
+    /**
+     * 删除算法和通道关联信息
+     * 
+     * @param algorithmId 算法和通道关联主键
+     * @return 结果
+     */
+    public int deleteAlgorithmChannelByAlgorithmId(Long algorithmId);
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/manage/service/IAlgorithmSetService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.manage.service;
+
+import com.ruoyi.common.core.domain.entity.AlgorithmSet;
+
+import java.util.List;
+
+/**
+ * 算法Service接口
+ * 
+ * @author boman
+ * @date 2025-08-12
+ */
+public interface IAlgorithmSetService 
+{
+    /**
+     * 查询算法
+     * 
+     * @param algorithmId 算法主键
+     * @return 算法
+     */
+    public AlgorithmSet selectAlgorithmSetByAlgorithmId(Long algorithmId);
+
+    /**
+     * 查询算法列表
+     * 
+     * @param algorithmSet 算法
+     * @return 算法集合
+     */
+    public List<AlgorithmSet> selectAlgorithmSetList(AlgorithmSet algorithmSet);
+
+    /**
+     * 新增算法
+     * 
+     * @param algorithmSet 算法
+     * @return 结果
+     */
+    public int insertAlgorithmSet(AlgorithmSet algorithmSet);
+
+    /**
+     * 修改算法
+     * 
+     * @param algorithmSet 算法
+     * @return 结果
+     */
+    public int updateAlgorithmSet(AlgorithmSet algorithmSet);
+
+    /**
+     * 批量删除算法
+     * 
+     * @param algorithmIds 需要删除的算法主键集合
+     * @return 结果
+     */
+    public int deleteAlgorithmSetByAlgorithmIds(Long[] algorithmIds);
+
+    /**
+     * 删除算法信息
+     * 
+     * @param algorithmId 算法主键
+     * @return 结果
+     */
+    public int deleteAlgorithmSetByAlgorithmId(Long algorithmId);
+}

+ 93 - 0
ruoyi-system/src/main/java/com/ruoyi/manage/service/impl/AlgorithmChannelServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.manage.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.manage.mapper.AlgorithmChannelMapper;
+import com.ruoyi.manage.domain.AlgorithmChannel;
+import com.ruoyi.manage.service.IAlgorithmChannelService;
+
+/**
+ * 算法和通道关联Service业务层处理
+ * 
+ * @author boman
+ * @date 2025-08-12
+ */
+@Service
+public class AlgorithmChannelServiceImpl implements IAlgorithmChannelService 
+{
+    @Autowired
+    private AlgorithmChannelMapper algorithmChannelMapper;
+
+    /**
+     * 查询算法和通道关联
+     * 
+     * @param algorithmId 算法和通道关联主键
+     * @return 算法和通道关联
+     */
+    @Override
+    public AlgorithmChannel selectAlgorithmChannelByAlgorithmId(Long algorithmId)
+    {
+        return algorithmChannelMapper.selectAlgorithmChannelByAlgorithmId(algorithmId);
+    }
+
+    /**
+     * 查询算法和通道关联列表
+     * 
+     * @param algorithmChannel 算法和通道关联
+     * @return 算法和通道关联
+     */
+    @Override
+    public List<AlgorithmChannel> selectAlgorithmChannelList(AlgorithmChannel algorithmChannel)
+    {
+        return algorithmChannelMapper.selectAlgorithmChannelList(algorithmChannel);
+    }
+
+    /**
+     * 新增算法和通道关联
+     * 
+     * @param algorithmChannel 算法和通道关联
+     * @return 结果
+     */
+    @Override
+    public int insertAlgorithmChannel(AlgorithmChannel algorithmChannel)
+    {
+        return algorithmChannelMapper.insertAlgorithmChannel(algorithmChannel);
+    }
+
+    /**
+     * 修改算法和通道关联
+     * 
+     * @param algorithmChannel 算法和通道关联
+     * @return 结果
+     */
+    @Override
+    public int updateAlgorithmChannel(AlgorithmChannel algorithmChannel)
+    {
+        return algorithmChannelMapper.updateAlgorithmChannel(algorithmChannel);
+    }
+
+    /**
+     * 批量删除算法和通道关联
+     * 
+     * @param algorithmIds 需要删除的算法和通道关联主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAlgorithmChannelByAlgorithmIds(Long[] algorithmIds)
+    {
+        return algorithmChannelMapper.deleteAlgorithmChannelByAlgorithmIds(algorithmIds);
+    }
+
+    /**
+     * 删除算法和通道关联信息
+     * 
+     * @param algorithmId 算法和通道关联主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAlgorithmChannelByAlgorithmId(Long algorithmId)
+    {
+        return algorithmChannelMapper.deleteAlgorithmChannelByAlgorithmId(algorithmId);
+    }
+}

+ 97 - 0
ruoyi-system/src/main/java/com/ruoyi/manage/service/impl/AlgorithmSetServiceImpl.java

@@ -0,0 +1,97 @@
+package com.ruoyi.manage.service.impl;
+
+import com.ruoyi.common.core.domain.entity.AlgorithmSet;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.manage.mapper.AlgorithmSetMapper;
+import com.ruoyi.manage.service.IAlgorithmSetService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 算法Service业务层处理
+ * 
+ * @author boman
+ * @date 2025-08-12
+ */
+@Service
+public class AlgorithmSetServiceImpl implements IAlgorithmSetService 
+{
+    @Autowired
+    private AlgorithmSetMapper algorithmSetMapper;
+
+    /**
+     * 查询算法
+     * 
+     * @param algorithmId 算法主键
+     * @return 算法
+     */
+    @Override
+    public AlgorithmSet selectAlgorithmSetByAlgorithmId(Long algorithmId)
+    {
+        return algorithmSetMapper.selectAlgorithmSetByAlgorithmId(algorithmId);
+    }
+
+    /**
+     * 查询算法列表
+     * 
+     * @param algorithmSet 算法
+     * @return 算法
+     */
+    @Override
+    public List<AlgorithmSet> selectAlgorithmSetList(AlgorithmSet algorithmSet)
+    {
+        return algorithmSetMapper.selectAlgorithmSetList(algorithmSet);
+    }
+
+    /**
+     * 新增算法
+     * 
+     * @param algorithmSet 算法
+     * @return 结果
+     */
+    @Override
+    public int insertAlgorithmSet(AlgorithmSet algorithmSet)
+    {
+        algorithmSet.setCreateTime(DateUtils.getNowDate());
+        return algorithmSetMapper.insertAlgorithmSet(algorithmSet);
+    }
+
+    /**
+     * 修改算法
+     * 
+     * @param algorithmSet 算法
+     * @return 结果
+     */
+    @Override
+    public int updateAlgorithmSet(AlgorithmSet algorithmSet)
+    {
+        algorithmSet.setUpdateTime(DateUtils.getNowDate());
+        return algorithmSetMapper.updateAlgorithmSet(algorithmSet);
+    }
+
+    /**
+     * 批量删除算法
+     * 
+     * @param algorithmIds 需要删除的算法主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAlgorithmSetByAlgorithmIds(Long[] algorithmIds)
+    {
+        return algorithmSetMapper.deleteAlgorithmSetByAlgorithmIds(algorithmIds);
+    }
+
+    /**
+     * 删除算法信息
+     * 
+     * @param algorithmId 算法主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAlgorithmSetByAlgorithmId(Long algorithmId)
+    {
+        return algorithmSetMapper.deleteAlgorithmSetByAlgorithmId(algorithmId);
+    }
+}

+ 34 - 2
ruoyi-system/src/main/java/com/ruoyi/manage/service/impl/ChannelNumberServiceImpl.java

@@ -5,8 +5,10 @@ import com.ruoyi.common.core.domain.entity.ChannelNumber;
 import com.ruoyi.common.core.domain.entity.ParameterSet;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.manage.domain.AlgorithmChannel;
 import com.ruoyi.manage.domain.ChannelNumberVo;
 import com.ruoyi.manage.domain.EquipmentManage;
+import com.ruoyi.manage.mapper.AlgorithmChannelMapper;
 import com.ruoyi.manage.mapper.ChannelNumberMapper;
 import com.ruoyi.manage.mapper.EquipmentManageMapper;
 import com.ruoyi.manage.mapper.ParameterSetMapper;
@@ -14,7 +16,9 @@ import com.ruoyi.manage.service.IChannelNumberService;
 import com.ruoyi.mqtt.service.MqttService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
@@ -35,14 +39,14 @@ import static com.ruoyi.common.constant.Constants.*;
 public class ChannelNumberServiceImpl implements IChannelNumberService {
     @Autowired
     private ChannelNumberMapper channelNumberMapper;
-
     @Autowired
     private ParameterSetMapper parameterSetMapper;
     @Autowired
     private EquipmentManageMapper equipmentManageMapper;
-
     @Autowired
     private MqttService mqttService;
+    @Autowired
+    private AlgorithmChannelMapper algorithmChannelMapper;
 
     /**
      * 查询通道管理
@@ -115,9 +119,30 @@ public class ChannelNumberServiceImpl implements IChannelNumberService {
                 return AjaxResult.error("发布消息失败:" + DETECTION_RTSP);
             }
         }
+        //新增算法和通道信息
+        insertAlgorithmChannel(channelNumber);
         return AjaxResult.success();
     }
 
+    /**
+     * 新增算法和通道信息
+     */
+    public void insertAlgorithmChannel(ChannelNumber channelNumber) {
+        Long channelId = channelNumber.getChannelId();
+        Long[] algorithmSetIds = channelNumber.getAlgorithmSetIds();
+        if (StringUtils.isNotEmpty(algorithmSetIds)) {
+            //新增算法和通道信息
+            List<AlgorithmChannel> list = new ArrayList<AlgorithmChannel>(algorithmSetIds.length);
+            for (Long algorithmSetId : algorithmSetIds) {
+                AlgorithmChannel algorithmChannel = new AlgorithmChannel();
+                algorithmChannel.setChannelId(channelId);
+                algorithmChannel.setAlgorithmId(algorithmSetId);
+                algorithmChannel.setCreateTime(DateUtils.getNowDate());
+                list.add(algorithmChannel);
+            }
+            algorithmChannelMapper.batchAlgorithmChannel(list);
+        }
+    }
 
     /**
      * 修改通道管理
@@ -137,6 +162,7 @@ public class ChannelNumberServiceImpl implements IChannelNumberService {
      * @return 结果
      */
     @Override
+    @Transactional
     public AjaxResult updateChannelNumber(ChannelNumber channelNumber) {
         Long channelId = channelNumber.getChannelId();
         ChannelNumber channelNumberOld = channelNumberMapper.selectChannelNumberByChannelNum(channelNumber);
@@ -152,6 +178,10 @@ public class ChannelNumberServiceImpl implements IChannelNumberService {
                 return AjaxResult.error("发布消息失败:" + DETECTION_RTSP);
             }
         }
+        //删除算法和通道信息
+        algorithmChannelMapper.deleteAlgorithmChannelByChannelId(channelNumber.getChannelId());
+        //新增算法和通道信息
+        insertAlgorithmChannel(channelNumber);
         channelNumber.setUpdateTime(DateUtils.getNowDate());
         channelNumberMapper.updateChannelNumber(channelNumber);
         return AjaxResult.success();
@@ -174,6 +204,8 @@ public class ChannelNumberServiceImpl implements IChannelNumberService {
                 return AjaxResult.error("发布消息失败:" + DETECTION_RTSP);
             }
         }
+        //删除算法和通道信息
+        algorithmChannelMapper.deleteAlgorithmChannelByChannelIds(channelIds);
         return row > 0 ? AjaxResult.success() : AjaxResult.error();
     }
 

+ 75 - 0
ruoyi-system/src/main/resources/mapper/manage/AlgorithmChannelMapper.xml

@@ -0,0 +1,75 @@
+<?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.ruoyi.manage.mapper.AlgorithmChannelMapper">
+
+    <resultMap type="AlgorithmChannel" id="AlgorithmChannelResult">
+        <result property="algorithmId" column="algorithm_id"/>
+        <result property="channelId" column="channel_id"/>
+    </resultMap>
+
+    <sql id="selectAlgorithmChannelVo">
+        select algorithm_id, channel_id
+        from algorithm_channel
+    </sql>
+
+    <select id="selectAlgorithmChannelList" parameterType="AlgorithmChannel" resultMap="AlgorithmChannelResult">
+        <include refid="selectAlgorithmChannelVo"/>
+        <where>
+        </where>
+    </select>
+
+    <select id="selectAlgorithmChannelByAlgorithmId" parameterType="Long" resultMap="AlgorithmChannelResult">
+        <include refid="selectAlgorithmChannelVo"/>
+        where algorithm_id = #{algorithmId}
+    </select>
+
+    <insert id="insertAlgorithmChannel" parameterType="AlgorithmChannel">
+        insert into algorithm_channel
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="algorithmId != null">algorithm_id,</if>
+            <if test="channelId != null">channel_id,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="algorithmId != null">#{algorithmId},</if>
+            <if test="channelId != null">#{channelId},</if>
+        </trim>
+    </insert>
+    <insert id="batchAlgorithmChannel">
+        insert into algorithm_channel(algorithm_id,channel_id) values
+        <foreach item="item" index="index" collection="list" separator=",">
+            (#{item.algorithmId},#{item.channelId})
+        </foreach>
+    </insert>
+
+    <update id="updateAlgorithmChannel" parameterType="AlgorithmChannel">
+        update algorithm_channel
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="channelId != null">channel_id = #{channelId},</if>
+        </trim>
+        where algorithm_id = #{algorithmId}
+    </update>
+
+    <delete id="deleteAlgorithmChannelByAlgorithmId" parameterType="Long">
+        delete
+        from algorithm_channel
+        where algorithm_id = #{algorithmId}
+    </delete>
+
+    <delete id="deleteAlgorithmChannelByAlgorithmIds" parameterType="String">
+        delete from algorithm_channel where algorithm_id in
+        <foreach item="algorithmId" collection="array" open="(" separator="," close=")">
+            #{algorithmId}
+        </foreach>
+    </delete>
+    <delete id="deleteAlgorithmChannelByChannelId" parameterType="Long">
+        delete from algorithm_channel where channel_id = #{channelId}
+    </delete>
+    <delete id="deleteAlgorithmChannelByChannelIds" parameterType="Long">
+        delete from algorithm_channel where channel_id in
+        <foreach collection="array" item="channelId" open="(" separator="," close=")">
+            #{channelId}
+        </foreach>
+    </delete>
+</mapper>

+ 122 - 0
ruoyi-system/src/main/resources/mapper/manage/AlgorithmSetMapper.xml

@@ -0,0 +1,122 @@
+<?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.ruoyi.manage.mapper.AlgorithmSetMapper">
+
+    <resultMap type="AlgorithmSet" id="AlgorithmSetResult">
+        <result property="algorithmId" column="algorithm_id"/>
+        <result property="algorithmNum" column="algorithm_num"/>
+        <result property="algorithmName" column="algorithm_name"/>
+        <result property="algorithmDescription" column="algorithm_description"/>
+        <result property="algorithmThresholdStrict" column="algorithm_threshold_strict"/>
+        <result property="algorithmThreshold" column="algorithm_threshold"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+    </resultMap>
+
+    <sql id="selectAlgorithmSetVo">
+        select algorithm_id,
+               algorithm_num,
+               algorithm_name,
+               algorithm_description,
+               algorithm_threshold_strict,
+               algorithm_threshold,
+               del_flag,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from algorithm_set
+    </sql>
+
+    <select id="selectAlgorithmSetList" parameterType="AlgorithmSet" resultMap="AlgorithmSetResult">
+        <include refid="selectAlgorithmSetVo"/>
+        <where>
+            <if test="algorithmNum != null  and algorithmNum != ''">and algorithm_num = #{algorithmNum}</if>
+            <if test="algorithmName != null  and algorithmName != ''">and algorithm_name like concat('%',
+                #{algorithmName}, '%')
+            </if>
+            <if test="algorithmDescription != null  and algorithmDescription != ''">and algorithm_description =
+                #{algorithmDescription}
+            </if>
+            <if test="algorithmThresholdStrict != null  and algorithmThresholdStrict != ''">and
+                algorithm_threshold_strict = #{algorithmThresholdStrict}
+            </if>
+            <if test="algorithmThreshold != null  and algorithmThreshold != ''">and algorithm_threshold =
+                #{algorithmThreshold}
+            </if>
+        </where>
+    </select>
+
+    <select id="selectAlgorithmSetByAlgorithmId" parameterType="Long" resultMap="AlgorithmSetResult">
+        <include refid="selectAlgorithmSetVo"/>
+        where algorithm_id = #{algorithmId}
+    </select>
+
+    <insert id="insertAlgorithmSet" parameterType="AlgorithmSet" useGeneratedKeys="true" keyProperty="algorithmId">
+        insert into algorithm_set
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="algorithmNum != null">algorithm_num,</if>
+            <if test="algorithmName != null">algorithm_name,</if>
+            <if test="algorithmDescription != null">algorithm_description,</if>
+            <if test="algorithmThresholdStrict != null">algorithm_threshold_strict,</if>
+            <if test="algorithmThreshold != null">algorithm_threshold,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="algorithmNum != null">#{algorithmNum},</if>
+            <if test="algorithmName != null">#{algorithmName},</if>
+            <if test="algorithmDescription != null">#{algorithmDescription},</if>
+            <if test="algorithmThresholdStrict != null">#{algorithmThresholdStrict},</if>
+            <if test="algorithmThreshold != null">#{algorithmThreshold},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+        </trim>
+    </insert>
+
+    <update id="updateAlgorithmSet" parameterType="AlgorithmSet">
+        update algorithm_set
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="algorithmNum != null">algorithm_num = #{algorithmNum},</if>
+            <if test="algorithmName != null">algorithm_name = #{algorithmName},</if>
+            <if test="algorithmDescription != null">algorithm_description = #{algorithmDescription},</if>
+            <if test="algorithmThresholdStrict != null">algorithm_threshold_strict = #{algorithmThresholdStrict},</if>
+            <if test="algorithmThreshold != null">algorithm_threshold = #{algorithmThreshold},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where algorithm_id = #{algorithmId}
+    </update>
+
+    <delete id="deleteAlgorithmSetByAlgorithmId" parameterType="Long">
+        delete
+        from algorithm_set
+        where algorithm_id = #{algorithmId}
+    </delete>
+
+    <delete id="deleteAlgorithmSetByAlgorithmIds" parameterType="String">
+        delete from algorithm_set where algorithm_id in
+        <foreach item="algorithmId" collection="array" open="(" separator="," close=")">
+            #{algorithmId}
+        </foreach>
+    </delete>
+</mapper>

+ 16 - 6
ruoyi-system/src/main/resources/mapper/manage/TaskManageMapper.xml

@@ -6,12 +6,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <resultMap type="TaskManage" id="TaskManageResult">
         <result property="taskId"    column="task_id"    />
+        <result property="clockSetId"    column="clock_set_id"    />
+        <result property="clockName"    column="clock_name"    />
         <result property="taskNum"    column="task_num"    />
         <result property="taskDetails"    column="task_details"    />
+        <result property="ioOutput"    column="io_output"    />
         <result property="channelId"    column="channel_id"    />
         <result property="videoAddress"    column="video_address"    />
         <result property="reportAddress"    column="report_address"    />
-        <result property="algorithmSet"    column="algorithm_set"    />
         <result property="delFlag"    column="del_flag"    />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
@@ -21,18 +23,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTaskManageVo">
-        select task_id, task_num, task_details, channel_id, video_address, report_address, algorithm_set, del_flag, create_by, create_time, update_by, update_time, remark from task_manage
+        select task_id, clock_set_id, clock_name, task_num, task_details, io_output, channel_id, video_address, report_address, del_flag, create_by, create_time, update_by, update_time, remark from task_manage
     </sql>
 
     <select id="selectTaskManageList" parameterType="TaskManage" resultMap="TaskManageResult">
         <include refid="selectTaskManageVo"/>
         <where>  
+            <if test="clockSetId != null "> and clock_set_id = #{clockSetId}</if>
+            <if test="clockName != null  and clockName != ''"> and clock_name like concat('%', #{clockName}, '%')</if>
             <if test="taskNum != null  and taskNum != ''"> and task_num = #{taskNum}</if>
             <if test="taskDetails != null  and taskDetails != ''"> and task_details = #{taskDetails}</if>
+            <if test="ioOutput != null  and ioOutput != ''"> and io_output = #{ioOutput}</if>
             <if test="channelId != null "> and channel_id = #{channelId}</if>
             <if test="videoAddress != null  and videoAddress != ''"> and video_address = #{videoAddress}</if>
             <if test="reportAddress != null  and reportAddress != ''"> and report_address = #{reportAddress}</if>
-            <if test="algorithmSet != null  and algorithmSet != ''"> and algorithm_set = #{algorithmSet}</if>
         </where>
     </select>
     
@@ -44,12 +48,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="insertTaskManage" parameterType="TaskManage" useGeneratedKeys="true" keyProperty="taskId">
         insert into task_manage
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="clockSetId != null">clock_set_id,</if>
+            <if test="clockName != null">clock_name,</if>
             <if test="taskNum != null">task_num,</if>
             <if test="taskDetails != null">task_details,</if>
+            <if test="ioOutput != null">io_output,</if>
             <if test="channelId != null">channel_id,</if>
             <if test="videoAddress != null">video_address,</if>
             <if test="reportAddress != null">report_address,</if>
-            <if test="algorithmSet != null">algorithm_set,</if>
             <if test="delFlag != null">del_flag,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
@@ -58,12 +64,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remark != null">remark,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="clockSetId != null">#{clockSetId},</if>
+            <if test="clockName != null">#{clockName},</if>
             <if test="taskNum != null">#{taskNum},</if>
             <if test="taskDetails != null">#{taskDetails},</if>
+            <if test="ioOutput != null">#{ioOutput},</if>
             <if test="channelId != null">#{channelId},</if>
             <if test="videoAddress != null">#{videoAddress},</if>
             <if test="reportAddress != null">#{reportAddress},</if>
-            <if test="algorithmSet != null">#{algorithmSet},</if>
             <if test="delFlag != null">#{delFlag},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
@@ -76,12 +84,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateTaskManage" parameterType="TaskManage">
         update task_manage
         <trim prefix="SET" suffixOverrides=",">
+            <if test="clockSetId != null">clock_set_id = #{clockSetId},</if>
+            <if test="clockName != null">clock_name = #{clockName},</if>
             <if test="taskNum != null">task_num = #{taskNum},</if>
             <if test="taskDetails != null">task_details = #{taskDetails},</if>
+            <if test="ioOutput != null">io_output = #{ioOutput},</if>
             <if test="channelId != null">channel_id = #{channelId},</if>
             <if test="videoAddress != null">video_address = #{videoAddress},</if>
             <if test="reportAddress != null">report_address = #{reportAddress},</if>
-            <if test="algorithmSet != null">algorithm_set = #{algorithmSet},</if>
             <if test="delFlag != null">del_flag = #{delFlag},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>