修改部分规则模块删除无用前端 新增前端界面

This commit is contained in:
zouju
2026-02-06 17:22:22 +08:00
parent 000f8d4bc5
commit a440094138
583 changed files with 26241 additions and 26046 deletions

View File

@@ -0,0 +1,111 @@
package com.solution.algo.domain;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.solution.common.annotation.Excel;
import com.solution.common.core.domain.BaseEntity;
/**
* 规则对象 algorithm
*
* @author ruoyi
* @date 2026-02-06
*/
public class Algorithm
{
/** */
private Long id;
/** 算法名称 */
@Excel(name = "算法名称")
private String name;
/** 业务类型 */
@Excel(name = "业务类型")
private String type;
/** 算法文件路径 */
@Excel(name = "算法文件路径")
private String codePath;
/** 算法描述 */
@Excel(name = "算法描述")
private String description;
/** 算法参数定义信息 */
private List<AlgorithmParam> algorithmParamList;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
public void setCodePath(String codePath)
{
this.codePath = codePath;
}
public String getCodePath()
{
return codePath;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public List<AlgorithmParam> getAlgorithmParamList()
{
return algorithmParamList;
}
public void setAlgorithmParamList(List<AlgorithmParam> algorithmParamList)
{
this.algorithmParamList = algorithmParamList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("type", getType())
.append("codePath", getCodePath())
.append("description", getDescription())
.append("algorithmParamList", getAlgorithmParamList())
.toString();
}
}

View File

@@ -0,0 +1,92 @@
package com.solution.algo.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.solution.common.annotation.Excel;
import com.solution.common.core.domain.BaseEntity;
/**
* 算法参数定义对象 algorithm_param
*
* @author ruoyi
* @date 2026-02-06
*/
public class AlgorithmParam
{
/** $column.columnComment */
private Long id;
/** 算法ID */
@Excel(name = "算法ID")
private Long algorithmId;
/** 参数名 */
@Excel(name = "参数名")
private String paramName;
/** 默认值 */
@Excel(name = "默认值")
private String defaultValue;
/** 描述 */
@Excel(name = "描述")
private String description;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setAlgorithmId(Long algorithmId)
{
this.algorithmId = algorithmId;
}
public Long getAlgorithmId()
{
return algorithmId;
}
public void setParamName(String paramName)
{
this.paramName = paramName;
}
public String getParamName()
{
return paramName;
}
public void setDefaultValue(String defaultValue)
{
this.defaultValue = defaultValue;
}
public String getDefaultValue()
{
return defaultValue;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("algorithmId", getAlgorithmId())
.append("paramName", getParamName())
.append("defaultValue", getDefaultValue())
.append("description", getDescription())
.toString();
}
}

View File

@@ -1,176 +0,0 @@
package com.solution.algo.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.solution.common.annotation.Excel;
import com.solution.common.core.domain.BaseEntity;
/**
* 动态规则配置对象 sys_algo_config
*
* @author zouju
* @date 2026-02-05
*/
public class SysAlgoConfig extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 算法唯一标识(Type),用于接口路由 */
@Excel(name = "算法唯一标识(Type),用于接口路由")
private String algoType;
/** 算法名称,后台展示用 */
@Excel(name = "算法名称,后台展示用")
private String algoName;
/** 执行引擎类型: GROOVY, PYTHON, JS, LUA等 */
@Excel(name = "执行引擎类型: GROOVY, PYTHON, JS, LUA等")
private String engineType;
/** 参数定义模型(JSON Schema),用于自动校验入参 */
@Excel(name = "参数定义模型(JSON Schema),用于自动校验入参")
private String inputSchema;
/** 算法脚本代码或规则表达式 */
@Excel(name = "算法脚本代码或规则表达式")
private String scriptContent;
/** 算法描述 */
@Excel(name = "算法描述")
private String description;
/** 状态: 1-启用, 0-禁用 */
@Excel(name = "状态: 1-启用, 0-禁用")
private Long status;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdAt;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updatedAt;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setAlgoType(String algoType)
{
this.algoType = algoType;
}
public String getAlgoType()
{
return algoType;
}
public void setAlgoName(String algoName)
{
this.algoName = algoName;
}
public String getAlgoName()
{
return algoName;
}
public void setEngineType(String engineType)
{
this.engineType = engineType;
}
public String getEngineType()
{
return engineType;
}
public void setInputSchema(String inputSchema)
{
this.inputSchema = inputSchema;
}
public String getInputSchema()
{
return inputSchema;
}
public void setScriptContent(String scriptContent)
{
this.scriptContent = scriptContent;
}
public String getScriptContent()
{
return scriptContent;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setStatus(Long status)
{
this.status = status;
}
public Long getStatus()
{
return status;
}
public void setCreatedAt(Date createdAt)
{
this.createdAt = createdAt;
}
public Date getCreatedAt()
{
return createdAt;
}
public void setUpdatedAt(Date updatedAt)
{
this.updatedAt = updatedAt;
}
public Date getUpdatedAt()
{
return updatedAt;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("algoType", getAlgoType())
.append("algoName", getAlgoName())
.append("engineType", getEngineType())
.append("inputSchema", getInputSchema())
.append("scriptContent", getScriptContent())
.append("description", getDescription())
.append("status", getStatus())
.append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt())
.toString();
}
}

View File

@@ -0,0 +1,87 @@
package com.solution.algo.mapper;
import java.util.List;
import com.solution.algo.domain.Algorithm;
import com.solution.algo.domain.AlgorithmParam;
/**
* 规则Mapper接口
*
* @author ruoyi
* @date 2026-02-06
*/
public interface AlgorithmMapper
{
/**
* 查询规则
*
* @param id 规则主键
* @return 规则
*/
public Algorithm selectAlgorithmById(Long id);
/**
* 查询规则列表
*
* @param algorithm 规则
* @return 规则集合
*/
public List<Algorithm> selectAlgorithmList(Algorithm algorithm);
/**
* 新增规则
*
* @param algorithm 规则
* @return 结果
*/
public int insertAlgorithm(Algorithm algorithm);
/**
* 修改规则
*
* @param algorithm 规则
* @return 结果
*/
public int updateAlgorithm(Algorithm algorithm);
/**
* 删除规则
*
* @param id 规则主键
* @return 结果
*/
public int deleteAlgorithmById(Long id);
/**
* 批量删除规则
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteAlgorithmByIds(Long[] ids);
/**
* 批量删除算法参数定义
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteAlgorithmParamByAlgorithmIds(Long[] ids);
/**
* 批量新增算法参数定义
*
* @param algorithmParamList 算法参数定义列表
* @return 结果
*/
public int batchAlgorithmParam(List<AlgorithmParam> algorithmParamList);
/**
* 通过规则主键删除算法参数定义信息
*
* @param id 规则ID
* @return 结果
*/
public int deleteAlgorithmParamByAlgorithmId(Long id);
}

View File

@@ -1,61 +0,0 @@
package com.solution.algo.mapper;
import java.util.List;
import com.solution.algo.domain.SysAlgoConfig;
/**
* 动态规则配置Mapper接口
*
* @author zouju
* @date 2026-02-05
*/
public interface SysAlgoConfigMapper
{
/**
* 查询动态规则配置
*
* @param id 动态规则配置主键
* @return 动态规则配置
*/
public SysAlgoConfig selectSysAlgoConfigById(Long id);
/**
* 查询动态规则配置列表
*
* @param sysAlgoConfig 动态规则配置
* @return 动态规则配置集合
*/
public List<SysAlgoConfig> selectSysAlgoConfigList(SysAlgoConfig sysAlgoConfig);
/**
* 新增动态规则配置
*
* @param sysAlgoConfig 动态规则配置
* @return 结果
*/
public int insertSysAlgoConfig(SysAlgoConfig sysAlgoConfig);
/**
* 修改动态规则配置
*
* @param sysAlgoConfig 动态规则配置
* @return 结果
*/
public int updateSysAlgoConfig(SysAlgoConfig sysAlgoConfig);
/**
* 删除动态规则配置
*
* @param id 动态规则配置主键
* @return 结果
*/
public int deleteSysAlgoConfigById(Long id);
/**
* 批量删除动态规则配置
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSysAlgoConfigByIds(Long[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.solution.algo.service;
import java.util.List;
import com.solution.algo.domain.Algorithm;
/**
* 规则Service接口
*
* @author ruoyi
* @date 2026-02-06
*/
public interface IAlgorithmService
{
/**
* 查询规则
*
* @param id 规则主键
* @return 规则
*/
public Algorithm selectAlgorithmById(Long id);
/**
* 查询规则列表
*
* @param algorithm 规则
* @return 规则集合
*/
public List<Algorithm> selectAlgorithmList(Algorithm algorithm);
/**
* 新增规则
*
* @param algorithm 规则
* @return 结果
*/
public int insertAlgorithm(Algorithm algorithm);
/**
* 修改规则
*
* @param algorithm 规则
* @return 结果
*/
public int updateAlgorithm(Algorithm algorithm);
/**
* 批量删除规则
*
* @param ids 需要删除的规则主键集合
* @return 结果
*/
public int deleteAlgorithmByIds(Long[] ids);
/**
* 删除规则信息
*
* @param id 规则主键
* @return 结果
*/
public int deleteAlgorithmById(Long id);
}

View File

@@ -1,61 +0,0 @@
package com.solution.algo.service;
import java.util.List;
import com.solution.algo.domain.SysAlgoConfig;
/**
* 动态规则配置Service接口
*
* @author zouju
* @date 2026-02-05
*/
public interface ISysAlgoConfigService
{
/**
* 查询动态规则配置
*
* @param id 动态规则配置主键
* @return 动态规则配置
*/
public SysAlgoConfig selectSysAlgoConfigById(Long id);
/**
* 查询动态规则配置列表
*
* @param sysAlgoConfig 动态规则配置
* @return 动态规则配置集合
*/
public List<SysAlgoConfig> selectSysAlgoConfigList(SysAlgoConfig sysAlgoConfig);
/**
* 新增动态规则配置
*
* @param sysAlgoConfig 动态规则配置
* @return 结果
*/
public int insertSysAlgoConfig(SysAlgoConfig sysAlgoConfig);
/**
* 修改动态规则配置
*
* @param sysAlgoConfig 动态规则配置
* @return 结果
*/
public int updateSysAlgoConfig(SysAlgoConfig sysAlgoConfig);
/**
* 批量删除动态规则配置
*
* @param ids 需要删除的动态规则配置主键集合
* @return 结果
*/
public int deleteSysAlgoConfigByIds(Long[] ids);
/**
* 删除动态规则配置信息
*
* @param id 动态规则配置主键
* @return 结果
*/
public int deleteSysAlgoConfigById(Long id);
}

View File

@@ -0,0 +1,131 @@
package com.solution.algo.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import com.solution.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.solution.algo.domain.AlgorithmParam;
import com.solution.algo.mapper.AlgorithmMapper;
import com.solution.algo.domain.Algorithm;
import com.solution.algo.service.IAlgorithmService;
/**
* 规则Service业务层处理
*
* @author ruoyi
* @date 2026-02-06
*/
@Service
public class AlgorithmServiceImpl implements IAlgorithmService
{
@Autowired
private AlgorithmMapper algorithmMapper;
/**
* 查询规则
*
* @param id 规则主键
* @return 规则
*/
@Override
public Algorithm selectAlgorithmById(Long id)
{
return algorithmMapper.selectAlgorithmById(id);
}
/**
* 查询规则列表
*
* @param algorithm 规则
* @return 规则
*/
@Override
public List<Algorithm> selectAlgorithmList(Algorithm algorithm)
{
return algorithmMapper.selectAlgorithmList(algorithm);
}
/**
* 新增规则
*
* @param algorithm 规则
* @return 结果
*/
@Transactional
@Override
public int insertAlgorithm(Algorithm algorithm)
{
int rows = algorithmMapper.insertAlgorithm(algorithm);
insertAlgorithmParam(algorithm);
return rows;
}
/**
* 修改规则
*
* @param algorithm 规则
* @return 结果
*/
@Transactional
@Override
public int updateAlgorithm(Algorithm algorithm)
{
algorithmMapper.deleteAlgorithmParamByAlgorithmId(algorithm.getId());
insertAlgorithmParam(algorithm);
return algorithmMapper.updateAlgorithm(algorithm);
}
/**
* 批量删除规则
*
* @param ids 需要删除的规则主键
* @return 结果
*/
@Transactional
@Override
public int deleteAlgorithmByIds(Long[] ids)
{
algorithmMapper.deleteAlgorithmParamByAlgorithmIds(ids);
return algorithmMapper.deleteAlgorithmByIds(ids);
}
/**
* 删除规则信息
*
* @param id 规则主键
* @return 结果
*/
@Transactional
@Override
public int deleteAlgorithmById(Long id)
{
algorithmMapper.deleteAlgorithmParamByAlgorithmId(id);
return algorithmMapper.deleteAlgorithmById(id);
}
/**
* 新增算法参数定义信息
*
* @param algorithm 规则对象
*/
public void insertAlgorithmParam(Algorithm algorithm)
{
List<AlgorithmParam> algorithmParamList = algorithm.getAlgorithmParamList();
Long id = algorithm.getId();
if (StringUtils.isNotNull(algorithmParamList))
{
List<AlgorithmParam> list = new ArrayList<AlgorithmParam>();
for (AlgorithmParam algorithmParam : algorithmParamList)
{
algorithmParam.setAlgorithmId(id);
list.add(algorithmParam);
}
if (list.size() > 0)
{
algorithmMapper.batchAlgorithmParam(list);
}
}
}
}

View File

@@ -1,93 +0,0 @@
package com.solution.algo.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.solution.algo.mapper.SysAlgoConfigMapper;
import com.solution.algo.domain.SysAlgoConfig;
import com.solution.algo.service.ISysAlgoConfigService;
/**
* 动态规则配置Service业务层处理
*
* @author zouju
* @date 2026-02-05
*/
@Service
public class SysAlgoConfigServiceImpl implements ISysAlgoConfigService
{
@Autowired
private SysAlgoConfigMapper sysAlgoConfigMapper;
/**
* 查询动态规则配置
*
* @param id 动态规则配置主键
* @return 动态规则配置
*/
@Override
public SysAlgoConfig selectSysAlgoConfigById(Long id)
{
return sysAlgoConfigMapper.selectSysAlgoConfigById(id);
}
/**
* 查询动态规则配置列表
*
* @param sysAlgoConfig 动态规则配置
* @return 动态规则配置
*/
@Override
public List<SysAlgoConfig> selectSysAlgoConfigList(SysAlgoConfig sysAlgoConfig)
{
return sysAlgoConfigMapper.selectSysAlgoConfigList(sysAlgoConfig);
}
/**
* 新增动态规则配置
*
* @param sysAlgoConfig 动态规则配置
* @return 结果
*/
@Override
public int insertSysAlgoConfig(SysAlgoConfig sysAlgoConfig)
{
return sysAlgoConfigMapper.insertSysAlgoConfig(sysAlgoConfig);
}
/**
* 修改动态规则配置
*
* @param sysAlgoConfig 动态规则配置
* @return 结果
*/
@Override
public int updateSysAlgoConfig(SysAlgoConfig sysAlgoConfig)
{
return sysAlgoConfigMapper.updateSysAlgoConfig(sysAlgoConfig);
}
/**
* 批量删除动态规则配置
*
* @param ids 需要删除的动态规则配置主键
* @return 结果
*/
@Override
public int deleteSysAlgoConfigByIds(Long[] ids)
{
return sysAlgoConfigMapper.deleteSysAlgoConfigByIds(ids);
}
/**
* 删除动态规则配置信息
*
* @param id 动态规则配置主键
* @return 结果
*/
@Override
public int deleteSysAlgoConfigById(Long id)
{
return sysAlgoConfigMapper.deleteSysAlgoConfigById(id);
}
}