Compare commits

...

3 Commits

Author SHA1 Message Date
577bc3e1c0 feat(behaviour): 添加行为树模块功能实现
- 添加节点参数的保存、更新和删除操作支持
2026-02-06 16:16:05 +08:00
7c5c5d89ee Merge branch 'master' of http://101.43.238.71:3000/zouju/auto-solution into dev 2026-02-05 17:22:35 +08:00
zouju
000f8d4bc5 新增规则模块 新增规则模块CRUD 2026-02-05 17:12:53 +08:00
22 changed files with 1193 additions and 39 deletions

View File

@@ -61,6 +61,15 @@
<artifactId>solution-generator</artifactId> <artifactId>solution-generator</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.solution</groupId>
<artifactId>solution-behaviour</artifactId>
</dependency>
<dependency>
<groupId>com.solution</groupId>
<artifactId>solution-algo</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@@ -0,0 +1,104 @@
package com.solution.web.controller.algo;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.solution.common.annotation.Log;
import com.solution.common.core.controller.BaseController;
import com.solution.common.core.domain.AjaxResult;
import com.solution.common.enums.BusinessType;
import com.solution.algo.domain.SysAlgoConfig;
import com.solution.algo.service.ISysAlgoConfigService;
import com.solution.common.utils.poi.ExcelUtil;
import com.solution.common.core.page.TableDataInfo;
/**
* 动态规则配置Controller
*
* @author zouju
* @date 2026-02-05
*/
@RestController
@RequestMapping("/algo/algo")
public class SysAlgoConfigController extends BaseController
{
@Autowired
private ISysAlgoConfigService sysAlgoConfigService;
/**
* 查询动态规则配置列表
*/
@PreAuthorize("@ss.hasPermi('algo:algo:list')")
@GetMapping("/list")
public TableDataInfo list(SysAlgoConfig sysAlgoConfig)
{
startPage();
List<SysAlgoConfig> list = sysAlgoConfigService.selectSysAlgoConfigList(sysAlgoConfig);
return getDataTable(list);
}
/**
* 导出动态规则配置列表
*/
@PreAuthorize("@ss.hasPermi('algo:algo:export')")
@Log(title = "动态规则配置", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SysAlgoConfig sysAlgoConfig)
{
List<SysAlgoConfig> list = sysAlgoConfigService.selectSysAlgoConfigList(sysAlgoConfig);
ExcelUtil<SysAlgoConfig> util = new ExcelUtil<SysAlgoConfig>(SysAlgoConfig.class);
util.exportExcel(response, list, "动态规则配置数据");
}
/**
* 获取动态规则配置详细信息
*/
@PreAuthorize("@ss.hasPermi('algo:algo:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sysAlgoConfigService.selectSysAlgoConfigById(id));
}
/**
* 新增动态规则配置
*/
@PreAuthorize("@ss.hasPermi('algo:algo:add')")
@Log(title = "动态规则配置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SysAlgoConfig sysAlgoConfig)
{
return toAjax(sysAlgoConfigService.insertSysAlgoConfig(sysAlgoConfig));
}
/**
* 修改动态规则配置
*/
@PreAuthorize("@ss.hasPermi('algo:algo:edit')")
@Log(title = "动态规则配置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SysAlgoConfig sysAlgoConfig)
{
return toAjax(sysAlgoConfigService.updateSysAlgoConfig(sysAlgoConfig));
}
/**
* 删除动态规则配置
*/
@PreAuthorize("@ss.hasPermi('algo:algo:remove')")
@Log(title = "动态规则配置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sysAlgoConfigService.deleteSysAlgoConfigByIds(ids));
}
}

View File

@@ -2,6 +2,9 @@ package com.solution.web.controller.behaviour;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@@ -27,6 +30,7 @@ import com.solution.common.core.page.TableDataInfo;
* @author ruoyi * @author ruoyi
* @date 2026-02-05 * @date 2026-02-05
*/ */
@Api("行为树管理")
@RestController @RestController
@RequestMapping("/system/behaviortree") @RequestMapping("/system/behaviortree")
public class BehaviortreeController extends BaseController public class BehaviortreeController extends BaseController
@@ -37,6 +41,7 @@ public class BehaviortreeController extends BaseController
/** /**
* 查询行为树主列表 * 查询行为树主列表
*/ */
@ApiOperation("获取行为树列表")
@PreAuthorize("@ss.hasPermi('system:behaviortree:list')") @PreAuthorize("@ss.hasPermi('system:behaviortree:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(Behaviortree behaviortree) public TableDataInfo list(Behaviortree behaviortree)
@@ -62,6 +67,7 @@ public class BehaviortreeController extends BaseController
/** /**
* 获取行为树主详细信息 * 获取行为树主详细信息
*/ */
@ApiOperation("获取行为树详情")
@PreAuthorize("@ss.hasPermi('system:behaviortree:query')") @PreAuthorize("@ss.hasPermi('system:behaviortree:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
@@ -72,6 +78,7 @@ public class BehaviortreeController extends BaseController
/** /**
* 新增行为树主 * 新增行为树主
*/ */
@ApiOperation("新增行为树主")
@PreAuthorize("@ss.hasPermi('system:behaviortree:add')") @PreAuthorize("@ss.hasPermi('system:behaviortree:add')")
@Log(title = "行为树主", businessType = BusinessType.INSERT) @Log(title = "行为树主", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
@@ -83,6 +90,7 @@ public class BehaviortreeController extends BaseController
/** /**
* 修改行为树主 * 修改行为树主
*/ */
@ApiOperation("修改行为树主")
@PreAuthorize("@ss.hasPermi('system:behaviortree:edit')") @PreAuthorize("@ss.hasPermi('system:behaviortree:edit')")
@Log(title = "行为树主", businessType = BusinessType.UPDATE) @Log(title = "行为树主", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
@@ -94,6 +102,7 @@ public class BehaviortreeController extends BaseController
/** /**
* 删除行为树主 * 删除行为树主
*/ */
@ApiOperation("删除行为树主")
@PreAuthorize("@ss.hasPermi('system:behaviortree:remove')") @PreAuthorize("@ss.hasPermi('system:behaviortree:remove')")
@Log(title = "行为树主", businessType = BusinessType.DELETE) @Log(title = "行为树主", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")

View File

@@ -5,6 +5,8 @@ import javax.servlet.http.HttpServletResponse;
import com.solution.system.domain.Nodeconnection; import com.solution.system.domain.Nodeconnection;
import com.solution.system.service.INodeconnectionService; import com.solution.system.service.INodeconnectionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@@ -28,6 +30,7 @@ import com.solution.common.core.page.TableDataInfo;
* @author ruoyi * @author ruoyi
* @date 2026-02-05 * @date 2026-02-05
*/ */
@Api("节点连接管理")
@RestController @RestController
@RequestMapping("/system/nodeconnection") @RequestMapping("/system/nodeconnection")
public class NodeconnectionController extends BaseController public class NodeconnectionController extends BaseController
@@ -63,6 +66,7 @@ public class NodeconnectionController extends BaseController
/** /**
* 获取节点连接详细信息 * 获取节点连接详细信息
*/ */
@ApiOperation("获取节点连接详细信息")
@PreAuthorize("@ss.hasPermi('system:nodeconnection:query')") @PreAuthorize("@ss.hasPermi('system:nodeconnection:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
@@ -73,6 +77,7 @@ public class NodeconnectionController extends BaseController
/** /**
* 新增节点连接 * 新增节点连接
*/ */
@ApiOperation("新增节点连接")
@PreAuthorize("@ss.hasPermi('system:nodeconnection:add')") @PreAuthorize("@ss.hasPermi('system:nodeconnection:add')")
@Log(title = "节点连接", businessType = BusinessType.INSERT) @Log(title = "节点连接", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
@@ -95,6 +100,7 @@ public class NodeconnectionController extends BaseController
/** /**
* 删除节点连接 * 删除节点连接
*/ */
@ApiOperation("删除节点连接")
@PreAuthorize("@ss.hasPermi('system:nodeconnection:remove')") @PreAuthorize("@ss.hasPermi('system:nodeconnection:remove')")
@Log(title = "节点连接", businessType = BusinessType.DELETE) @Log(title = "节点连接", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")

View File

@@ -2,6 +2,9 @@ package com.solution.web.controller.behaviour;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@@ -27,6 +30,7 @@ import com.solution.common.core.page.TableDataInfo;
* @author ruoyi * @author ruoyi
* @date 2026-02-05 * @date 2026-02-05
*/ */
@Api("节点参数管理")
@RestController @RestController
@RequestMapping("/system/nodeparameter") @RequestMapping("/system/nodeparameter")
public class NodeparameterController extends BaseController public class NodeparameterController extends BaseController
@@ -72,6 +76,7 @@ public class NodeparameterController extends BaseController
/** /**
* 新增节点参数 * 新增节点参数
*/ */
@ApiOperation("新增节点参数")
@PreAuthorize("@ss.hasPermi('system:nodeparameter:add')") @PreAuthorize("@ss.hasPermi('system:nodeparameter:add')")
@Log(title = "节点参数", businessType = BusinessType.INSERT) @Log(title = "节点参数", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
@@ -83,6 +88,7 @@ public class NodeparameterController extends BaseController
/** /**
* 修改节点参数 * 修改节点参数
*/ */
@ApiOperation("修改节点参数")
@PreAuthorize("@ss.hasPermi('system:nodeparameter:edit')") @PreAuthorize("@ss.hasPermi('system:nodeparameter:edit')")
@Log(title = "节点参数", businessType = BusinessType.UPDATE) @Log(title = "节点参数", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
@@ -94,6 +100,7 @@ public class NodeparameterController extends BaseController
/** /**
* 删除节点参数 * 删除节点参数
*/ */
@ApiOperation("删除节点参数")
@PreAuthorize("@ss.hasPermi('system:nodeparameter:remove')") @PreAuthorize("@ss.hasPermi('system:nodeparameter:remove')")
@Log(title = "节点参数", businessType = BusinessType.DELETE) @Log(title = "节点参数", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")

View File

@@ -1,9 +1,19 @@
package com.solution.web.controller.behaviour; package com.solution.web.controller.behaviour;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.solution.common.core.domain.R;
import com.solution.web.controller.behaviour.vo.NodetemplateDTO;
import com.solution.web.controller.behaviour.vo.NodetemplateVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
@@ -27,10 +37,10 @@ import com.solution.common.core.page.TableDataInfo;
* @author ruoyi * @author ruoyi
* @date 2026-02-05 * @date 2026-02-05
*/ */
@Api("节点模板管理")
@RestController @RestController
@RequestMapping("/system/nodetemplate") @RequestMapping("/system/nodetemplate")
public class NodetemplateController extends BaseController public class NodetemplateController extends BaseController {
{
@Autowired @Autowired
private INodetemplateService nodetemplateService; private INodetemplateService nodetemplateService;
@@ -39,21 +49,50 @@ public class NodetemplateController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('system:nodetemplate:list')") @PreAuthorize("@ss.hasPermi('system:nodetemplate:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(Nodetemplate nodetemplate) public TableDataInfo list(Nodetemplate nodetemplate) {
{
startPage(); startPage();
List<Nodetemplate> list = nodetemplateService.selectNodetemplateList(nodetemplate); List<Nodetemplate> list = nodetemplateService.selectNodetemplateList(nodetemplate);
return getDataTable(list); return getDataTable(list);
} }
@ApiOperation("节点模板列表")
@PreAuthorize("@ss.hasPermi('system:nodetemplate:list')")
@GetMapping("/listAll")
public R<List<NodetemplateVO>> listAll() {
Nodetemplate nodetemplate = new Nodetemplate();
List<Nodetemplate> list = nodetemplateService.selectNodetemplateList(nodetemplate);
if (CollectionUtils.isEmpty(list)) {
return R.ok(null);
}
Map<String, List<NodetemplateDTO>> groupedByTemplateType = list.stream()
.map(template -> {
NodetemplateDTO dto = new NodetemplateDTO();
dto.setId(template.getId());
dto.setName(template.getName());
dto.setDescription(template.getDescription());
dto.setEnglishName(template.getEnglishName());
dto.setLogicHandler(template.getLogicHandler());
return dto;
})
.collect(Collectors.groupingBy(NodetemplateDTO::getTempleteType));
List<NodetemplateVO> vos = new ArrayList<>();
groupedByTemplateType.forEach((key, value) -> {
// 处理逻辑
NodetemplateVO vo = new NodetemplateVO();
vo.setTempleteType(key);
vo.setDtoList(value);
vos.add(vo);
});
return R.ok(vos);
}
/** /**
* 导出节点模板列表 * 导出节点模板列表
*/ */
@PreAuthorize("@ss.hasPermi('system:nodetemplate:export')") @PreAuthorize("@ss.hasPermi('system:nodetemplate:export')")
@Log(title = "节点模板", businessType = BusinessType.EXPORT) @Log(title = "节点模板", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, Nodetemplate nodetemplate) public void export(HttpServletResponse response, Nodetemplate nodetemplate) {
{
List<Nodetemplate> list = nodetemplateService.selectNodetemplateList(nodetemplate); List<Nodetemplate> list = nodetemplateService.selectNodetemplateList(nodetemplate);
ExcelUtil<Nodetemplate> util = new ExcelUtil<Nodetemplate>(Nodetemplate.class); ExcelUtil<Nodetemplate> util = new ExcelUtil<Nodetemplate>(Nodetemplate.class);
util.exportExcel(response, list, "节点模板数据"); util.exportExcel(response, list, "节点模板数据");
@@ -64,8 +103,7 @@ public class NodetemplateController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('system:nodetemplate:query')") @PreAuthorize("@ss.hasPermi('system:nodetemplate:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id) {
{
return success(nodetemplateService.selectNodetemplateById(id)); return success(nodetemplateService.selectNodetemplateById(id));
} }
@@ -75,8 +113,7 @@ public class NodetemplateController extends BaseController
@PreAuthorize("@ss.hasPermi('system:nodetemplate:add')") @PreAuthorize("@ss.hasPermi('system:nodetemplate:add')")
@Log(title = "节点模板", businessType = BusinessType.INSERT) @Log(title = "节点模板", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody Nodetemplate nodetemplate) public AjaxResult add(@RequestBody Nodetemplate nodetemplate) {
{
return toAjax(nodetemplateService.insertNodetemplate(nodetemplate)); return toAjax(nodetemplateService.insertNodetemplate(nodetemplate));
} }
@@ -86,8 +123,7 @@ public class NodetemplateController extends BaseController
@PreAuthorize("@ss.hasPermi('system:nodetemplate:edit')") @PreAuthorize("@ss.hasPermi('system:nodetemplate:edit')")
@Log(title = "节点模板", businessType = BusinessType.UPDATE) @Log(title = "节点模板", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody Nodetemplate nodetemplate) public AjaxResult edit(@RequestBody Nodetemplate nodetemplate) {
{
return toAjax(nodetemplateService.updateNodetemplate(nodetemplate)); return toAjax(nodetemplateService.updateNodetemplate(nodetemplate));
} }
@@ -97,8 +133,7 @@ public class NodetemplateController extends BaseController
@PreAuthorize("@ss.hasPermi('system:nodetemplate:remove')") @PreAuthorize("@ss.hasPermi('system:nodetemplate:remove')")
@Log(title = "节点模板", businessType = BusinessType.DELETE) @Log(title = "节点模板", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids) {
{
return toAjax(nodetemplateService.deleteNodetemplateByIds(ids)); return toAjax(nodetemplateService.deleteNodetemplateByIds(ids));
} }
} }

View File

@@ -1,9 +1,28 @@
package com.solution.web.controller.behaviour; package com.solution.web.controller.behaviour;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.solution.common.core.domain.R;
import com.solution.system.domain.Nodeparameter;
import com.solution.system.domain.Templateparameterdef;
import com.solution.system.service.INodeparameterService;
import com.solution.system.service.ITemplateparameterdefService;
import com.solution.web.controller.behaviour.vo.NodeparameterVO;
import com.solution.web.controller.behaviour.vo.NodetemplateVO;
import com.solution.web.controller.behaviour.vo.TreenodeinstanceVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
@@ -27,20 +46,24 @@ import com.solution.common.core.page.TableDataInfo;
* @author ruoyi * @author ruoyi
* @date 2026-02-05 * @date 2026-02-05
*/ */
@Api("行为树实例节点管理")
@RestController @RestController
@RequestMapping("/system/treenodeinstance") @RequestMapping("/system/treenodeinstance")
public class TreenodeinstanceController extends BaseController public class TreenodeinstanceController extends BaseController {
{
@Autowired @Autowired
private ITreenodeinstanceService treenodeinstanceService; private ITreenodeinstanceService treenodeinstanceService;
@Autowired
private INodeparameterService nodeparameterService;
@Autowired
private ITemplateparameterdefService templateparameterdefService;
/** /**
* 查询行为树实例节点列表 * 查询行为树实例节点列表
*/ */
@PreAuthorize("@ss.hasPermi('system:treenodeinstance:list')") @PreAuthorize("@ss.hasPermi('system:treenodeinstance:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(Treenodeinstance treenodeinstance) public TableDataInfo list(Treenodeinstance treenodeinstance) {
{
startPage(); startPage();
List<Treenodeinstance> list = treenodeinstanceService.selectTreenodeinstanceList(treenodeinstance); List<Treenodeinstance> list = treenodeinstanceService.selectTreenodeinstanceList(treenodeinstance);
return getDataTable(list); return getDataTable(list);
@@ -52,8 +75,7 @@ public class TreenodeinstanceController extends BaseController
@PreAuthorize("@ss.hasPermi('system:treenodeinstance:export')") @PreAuthorize("@ss.hasPermi('system:treenodeinstance:export')")
@Log(title = "行为树实例节点", businessType = BusinessType.EXPORT) @Log(title = "行为树实例节点", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, Treenodeinstance treenodeinstance) public void export(HttpServletResponse response, Treenodeinstance treenodeinstance) {
{
List<Treenodeinstance> list = treenodeinstanceService.selectTreenodeinstanceList(treenodeinstance); List<Treenodeinstance> list = treenodeinstanceService.selectTreenodeinstanceList(treenodeinstance);
ExcelUtil<Treenodeinstance> util = new ExcelUtil<Treenodeinstance>(Treenodeinstance.class); ExcelUtil<Treenodeinstance> util = new ExcelUtil<Treenodeinstance>(Treenodeinstance.class);
util.exportExcel(response, list, "行为树实例节点数据"); util.exportExcel(response, list, "行为树实例节点数据");
@@ -64,19 +86,89 @@ public class TreenodeinstanceController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('system:treenodeinstance:query')") @PreAuthorize("@ss.hasPermi('system:treenodeinstance:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id) {
{
return success(treenodeinstanceService.selectTreenodeinstanceById(id)); return success(treenodeinstanceService.selectTreenodeinstanceById(id));
} }
@ApiOperation("行为树实例节点详情展示")
@PreAuthorize("@ss.hasPermi('system:treenodeinstance:query')")
@GetMapping(value = "/getInfo")
public R<TreenodeinstanceVO> getInfoParams(@PathVariable("id") Long id) {
TreenodeinstanceVO treenodeinstanceVO = new TreenodeinstanceVO();
Treenodeinstance treenodeinstance = treenodeinstanceService.selectTreenodeinstanceById(id);
BeanUtils.copyProperties(treenodeinstance, treenodeinstanceVO);
Templateparameterdef templateparameterdef = new Templateparameterdef();
templateparameterdef.setTemplateId(treenodeinstance.getTemplateId());
List<Templateparameterdef> templateparameterdefs = templateparameterdefService.selectTemplateparameterdefList(templateparameterdef);
if (CollectionUtils.isEmpty(templateparameterdefs)) {
return R.ok(treenodeinstanceVO);
}
List<NodeparameterVO> nodeparameterVOList = new ArrayList<>();
treenodeinstanceVO.setNodeparameterVOList(nodeparameterVOList);
Nodeparameter nodeparameter = new Nodeparameter();
nodeparameter.setNodeInstanceId(id);
List<Nodeparameter> nodeparameters = nodeparameterService.selectNodeparameterList(nodeparameter);
Map<Long, Nodeparameter> nodeParameterMap = new HashMap<>();
if (!CollectionUtils.isEmpty(nodeparameters)) {
nodeParameterMap.putAll(nodeparameters.stream()
.collect(Collectors.toMap(
Nodeparameter::getParamDefId,
Function.identity(), (existing, replacement) -> existing
)));
}
templateparameterdefs.forEach(t -> {
NodeparameterVO vo = new NodeparameterVO();
vo.setDescription(t.getDescription());
vo.setParamKey(t.getParamKey());
vo.setDataType(t.getDataType());
vo.setDefaultValue(t.getDefaultValue());
vo.setParamDefId(t.getId());
vo.setNodeInstanceId(id);
if (nodeParameterMap.containsKey(t.getId())) {
Nodeparameter nodeparameter1 = nodeParameterMap.get(t.getId());
vo.setId(nodeparameter1.getId());
vo.setValue(nodeparameter1.getValue());
}
nodeparameterVOList.add(vo);
});
return R.ok(treenodeinstanceVO);
}
@ApiOperation("行为树实例节点保存或者跟新")
@PreAuthorize("@ss.hasPermi('system:treenodeinstance:add')")
@Log(title = "行为树实例节点", businessType = BusinessType.INSERT)
@PostMapping("/saveOrUpdate")
public R<Integer> saveOrUpdate(@RequestBody Treenodeinstance treenodeinstance) {
if (null == treenodeinstance.getId()) {
//新增
Templateparameterdef templateparameterdef = new Templateparameterdef();
templateparameterdef.setTemplateId(treenodeinstance.getTemplateId());
List<Templateparameterdef> templateparameterdefs = templateparameterdefService.selectTemplateparameterdefList(templateparameterdef);
if (CollectionUtils.isEmpty(templateparameterdefs)) {
return R.ok(treenodeinstanceService.insertTreenodeinstance(treenodeinstance));
}
templateparameterdefs.forEach(t -> {
Nodeparameter nodeparameter = new Nodeparameter();
nodeparameter.setNodeInstanceId(treenodeinstance.getId());
nodeparameter.setParamDefId(t.getId());
nodeparameter.setValue(t.getDefaultValue());
nodeparameterService.insertNodeparameter(nodeparameter);
});
}
return R.ok(treenodeinstanceService.updateTreenodeinstance(treenodeinstance));
}
/** /**
* 新增行为树实例节点 * 新增行为树实例节点
*/ */
@PreAuthorize("@ss.hasPermi('system:treenodeinstance:add')") @PreAuthorize("@ss.hasPermi('system:treenodeinstance:add')")
@Log(title = "行为树实例节点", businessType = BusinessType.INSERT) @Log(title = "行为树实例节点", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody Treenodeinstance treenodeinstance) public AjaxResult add(@RequestBody Treenodeinstance treenodeinstance) {
{
return toAjax(treenodeinstanceService.insertTreenodeinstance(treenodeinstance)); return toAjax(treenodeinstanceService.insertTreenodeinstance(treenodeinstance));
} }
@@ -86,19 +178,28 @@ public class TreenodeinstanceController extends BaseController
@PreAuthorize("@ss.hasPermi('system:treenodeinstance:edit')") @PreAuthorize("@ss.hasPermi('system:treenodeinstance:edit')")
@Log(title = "行为树实例节点", businessType = BusinessType.UPDATE) @Log(title = "行为树实例节点", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody Treenodeinstance treenodeinstance) public AjaxResult edit(@RequestBody Treenodeinstance treenodeinstance) {
{
return toAjax(treenodeinstanceService.updateTreenodeinstance(treenodeinstance)); return toAjax(treenodeinstanceService.updateTreenodeinstance(treenodeinstance));
} }
/** /**
* 删除行为树实例节点 * 删除行为树实例节点
*/ */
@ApiOperation("删除行为树实例节点")
@PreAuthorize("@ss.hasPermi('system:treenodeinstance:remove')") @PreAuthorize("@ss.hasPermi('system:treenodeinstance:remove')")
@Log(title = "行为树实例节点", businessType = BusinessType.DELETE) @Log(title = "行为树实例节点", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable Long[] ids) public R<Integer> remove(@PathVariable Long id) {
{ Nodeparameter nodeparameter = new Nodeparameter();
return toAjax(treenodeinstanceService.deleteTreenodeinstanceByIds(ids)); nodeparameter.setNodeInstanceId(id);
List<Nodeparameter> nodeparameters = nodeparameterService.selectNodeparameterList(nodeparameter);
if (!CollectionUtils.isEmpty(nodeparameters)) {
List<Long> ids = nodeparameters.stream()
.map(Nodeparameter::getId)
.collect(Collectors.toList());
Long[] idsArray = ids.toArray(new Long[0]);
nodeparameterService.deleteNodeparameterByIds(idsArray);
}
return R.ok(treenodeinstanceService.deleteTreenodeinstanceById(id));
} }
} }

View File

@@ -0,0 +1,52 @@
package com.solution.web.controller.behaviour.vo;
import io.swagger.annotations.ApiModelProperty;
public class BehaviortreeVO {
private Long id;
/** 行为树名称 */
@ApiModelProperty(name = "行为树名称")
private String name;
/** 行为树描述 */
@ApiModelProperty(name = "行为树描述")
private String description;
@ApiModelProperty(name = "英文名称")
private String englishName;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getEnglishName() {
return englishName;
}
public void setEnglishName(String englishName) {
this.englishName = englishName;
}
}

View File

@@ -0,0 +1,100 @@
package com.solution.web.controller.behaviour.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel(value = "NodeparameterVO", description = "节点参数vo")
public class NodeparameterVO {
private Long id;
/** 关联到哪个节点实例 (外键: TreeInstanceNode.id) */
@ApiModelProperty("节点实例id")
private Long nodeInstanceId;
/** 关联到哪个参数定义 (外键: TemplateParameterDef.id) */
@ApiModelProperty("模板参数定义表id")
private Long paramDefId;
/** 节点实例设置的具体参数值 (覆盖模板默认值) */
@ApiModelProperty("节点实例设置的具体参数值 (覆盖模板默认值)")
private String value;
@ApiModelProperty("参数键名, 例如: target_name, speed")
private String paramKey;
/** 参数数据类型, 例如: "float", "int", "string", "bool" */
@ApiModelProperty("参数数据类型, 例如: float, int, string, bool")
private String dataType;
/** 默认值 */
@ApiModelProperty("默认值")
private String defaultValue;
@ApiModelProperty("参数名称描述")
private String description;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getNodeInstanceId() {
return nodeInstanceId;
}
public void setNodeInstanceId(Long nodeInstanceId) {
this.nodeInstanceId = nodeInstanceId;
}
public Long getParamDefId() {
return paramDefId;
}
public void setParamDefId(Long paramDefId) {
this.paramDefId = paramDefId;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getParamKey() {
return paramKey;
}
public void setParamKey(String paramKey) {
this.paramKey = paramKey;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public String getDefaultValue() {
return defaultValue;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}

View File

@@ -0,0 +1,75 @@
package com.solution.web.controller.behaviour.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel(value = "NodetemplateDTO", description = "节点模板dto")
public class NodetemplateDTO {
private Long id;
/** 模板名称, 例如: "MoveToTarget", "IsTargetVisible" */
@ApiModelProperty("模板名称, 例如: MoveToTarget, IsTargetVisible")
private String name;
/** 对应的逻辑执行代码/脚本/函数名 */
@ApiModelProperty("对应的逻辑执行代码/脚本/函数名")
private String logicHandler;
/** 模板描述 */
@ApiModelProperty("模板描述")
private String description;
/** afsim 中转换的节点名 */
@ApiModelProperty("afsim 中转换的节点名")
private String englishName;
private String templeteType;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getLogicHandler() {
return logicHandler;
}
public void setLogicHandler(String logicHandler) {
this.logicHandler = logicHandler;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getEnglishName() {
return englishName;
}
public void setEnglishName(String englishName) {
this.englishName = englishName;
}
public String getTempleteType() {
return templeteType;
}
public void setTempleteType(String templeteType) {
this.templeteType = templeteType;
}
}

View File

@@ -0,0 +1,32 @@
package com.solution.web.controller.behaviour.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
@ApiModel(value = "NodetemplateVO", description = "节点模板vo")
public class NodetemplateVO {
/** 模版类型节点模版或者条件判断例如“node”precondition“ */
@ApiModelProperty("模版类型节点模版或者条件判断例如“node”precondition“")
private String templeteType;
@ApiModelProperty("节点模板数据")
private List<NodetemplateDTO> dtoList;
public String getTempleteType() {
return templeteType;
}
public void setTempleteType(String templeteType) {
this.templeteType = templeteType;
}
public List<NodetemplateDTO> getDtoList() {
return dtoList;
}
public void setDtoList(List<NodetemplateDTO> dtoList) {
this.dtoList = dtoList;
}
}

View File

@@ -0,0 +1,87 @@
package com.solution.web.controller.behaviour.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
@ApiModel(value = "TreenodeinstanceVO", description = "节点vo")
public class TreenodeinstanceVO {
private Long id;
@ApiModelProperty("行为树id")
private Long treeId;
/** 引用哪个节点模板 (外键: NodeTemplate.id) */
@ApiModelProperty("节点模板id")
private Long templateId;
/** 节点的显示名称 (可能与模板名称不同, 用于区分实例) */
@ApiModelProperty("节点的显示名称")
private String instanceName;
/** 判断当前节点是否为根节点,默认情况下是非根节点 */
@ApiModelProperty("判断当前节点是否为根节点,默认情况下是非根节点")
private Long isRoot;
@ApiModelProperty("节点介绍")
private String desciption;
@ApiModelProperty("节点变量结合")
private List<NodeparameterVO> nodeparameterVOList;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getTreeId() {
return treeId;
}
public void setTreeId(Long treeId) {
this.treeId = treeId;
}
public Long getTemplateId() {
return templateId;
}
public void setTemplateId(Long templateId) {
this.templateId = templateId;
}
public String getInstanceName() {
return instanceName;
}
public void setInstanceName(String instanceName) {
this.instanceName = instanceName;
}
public Long getIsRoot() {
return isRoot;
}
public void setIsRoot(Long isRoot) {
this.isRoot = isRoot;
}
public String getDesciption() {
return desciption;
}
public void setDesciption(String desciption) {
this.desciption = desciption;
}
public List<NodeparameterVO> getNodeparameterVOList() {
return nodeparameterVOList;
}
public void setNodeparameterVOList(List<NodeparameterVO> nodeparameterVOList) {
this.nodeparameterVOList = nodeparameterVOList;
}
}

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>solution</artifactId>
<groupId>com.solution</groupId>
<version>3.9.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>solution-algo</artifactId>
<description>
algo模块
</description>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.solution</groupId>
<artifactId>solution-common</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,176 @@
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,61 @@
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.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,93 @@
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);
}
}

View File

@@ -0,0 +1,96 @@
<?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.solution.algo.mapper.SysAlgoConfigMapper">
<resultMap type="SysAlgoConfig" id="SysAlgoConfigResult">
<result property="id" column="id" />
<result property="algoType" column="algo_type" />
<result property="algoName" column="algo_name" />
<result property="engineType" column="engine_type" />
<result property="inputSchema" column="input_schema" />
<result property="scriptContent" column="script_content" />
<result property="description" column="description" />
<result property="status" column="status" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
</resultMap>
<sql id="selectSysAlgoConfigVo">
select id, algo_type, algo_name, engine_type, input_schema, script_content, description, status, created_at, updated_at from sys_algo_config
</sql>
<select id="selectSysAlgoConfigList" parameterType="SysAlgoConfig" resultMap="SysAlgoConfigResult">
<include refid="selectSysAlgoConfigVo"/>
<where>
<if test="algoType != null and algoType != ''"> and algo_type = #{algoType}</if>
<if test="algoName != null and algoName != ''"> and algo_name like concat('%', #{algoName}, '%')</if>
<if test="engineType != null and engineType != ''"> and engine_type = #{engineType}</if>
<if test="inputSchema != null and inputSchema != ''"> and input_schema = #{inputSchema}</if>
<if test="scriptContent != null and scriptContent != ''"> and script_content = #{scriptContent}</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="status != null "> and status = #{status}</if>
<if test="createdAt != null "> and created_at = #{createdAt}</if>
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
</where>
</select>
<select id="selectSysAlgoConfigById" parameterType="Long" resultMap="SysAlgoConfigResult">
<include refid="selectSysAlgoConfigVo"/>
where id = #{id}
</select>
<insert id="insertSysAlgoConfig" parameterType="SysAlgoConfig" useGeneratedKeys="true" keyProperty="id">
insert into sys_algo_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="algoType != null and algoType != ''">algo_type,</if>
<if test="algoName != null and algoName != ''">algo_name,</if>
<if test="engineType != null and engineType != ''">engine_type,</if>
<if test="inputSchema != null">input_schema,</if>
<if test="scriptContent != null">script_content,</if>
<if test="description != null">description,</if>
<if test="status != null">status,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="algoType != null and algoType != ''">#{algoType},</if>
<if test="algoName != null and algoName != ''">#{algoName},</if>
<if test="engineType != null and engineType != ''">#{engineType},</if>
<if test="inputSchema != null">#{inputSchema},</if>
<if test="scriptContent != null">#{scriptContent},</if>
<if test="description != null">#{description},</if>
<if test="status != null">#{status},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
</trim>
</insert>
<update id="updateSysAlgoConfig" parameterType="SysAlgoConfig">
update sys_algo_config
<trim prefix="SET" suffixOverrides=",">
<if test="algoType != null and algoType != ''">algo_type = #{algoType},</if>
<if test="algoName != null and algoName != ''">algo_name = #{algoName},</if>
<if test="engineType != null and engineType != ''">engine_type = #{engineType},</if>
<if test="inputSchema != null">input_schema = #{inputSchema},</if>
<if test="scriptContent != null">script_content = #{scriptContent},</if>
<if test="description != null">description = #{description},</if>
<if test="status != null">status = #{status},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysAlgoConfigById" parameterType="Long">
delete from sys_algo_config where id = #{id}
</delete>
<delete id="deleteSysAlgoConfigByIds" parameterType="String">
delete from sys_algo_config where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -38,6 +38,9 @@ public class Treenodeinstance extends BaseEntity
@Excel(name = "节点执行的判断条件对应的模版id") @Excel(name = "节点执行的判断条件对应的模版id")
private Long preconditionTempleteId; private Long preconditionTempleteId;
@Excel(name = "节点介绍")
private String desciption;
/** $column.columnComment */ /** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String uuid; private String uuid;
@@ -112,6 +115,15 @@ public class Treenodeinstance extends BaseEntity
return uuid; return uuid;
} }
public String getDesciption() {
return desciption;
}
public void setDesciption(String desciption) {
this.desciption = desciption;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -122,6 +134,7 @@ public class Treenodeinstance extends BaseEntity
.append("isRoot", getIsRoot()) .append("isRoot", getIsRoot())
.append("preconditionTempleteId", getPreconditionTempleteId()) .append("preconditionTempleteId", getPreconditionTempleteId())
.append("uuid", getUuid()) .append("uuid", getUuid())
.append("desciption", getDesciption())
.toString(); .toString();
} }
} }

View File

@@ -12,10 +12,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="isRoot" column="is_root" /> <result property="isRoot" column="is_root" />
<result property="preconditionTempleteId" column="precondition_templete_id" /> <result property="preconditionTempleteId" column="precondition_templete_id" />
<result property="uuid" column="uuid" /> <result property="uuid" column="uuid" />
<result property="desciption" column="desciption" />
</resultMap> </resultMap>
<sql id="selectTreenodeinstanceVo"> <sql id="selectTreenodeinstanceVo">
select id, tree_id, template_id, instance_name, is_root, precondition_templete_id, uuid from treenodeinstance select id, tree_id, template_id, instance_name, is_root, precondition_templete_id, uuid,desciption from treenodeinstance
</sql> </sql>
<select id="selectTreenodeinstanceList" parameterType="Treenodeinstance" resultMap="TreenodeinstanceResult"> <select id="selectTreenodeinstanceList" parameterType="Treenodeinstance" resultMap="TreenodeinstanceResult">
@@ -27,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isRoot != null "> and is_root = #{isRoot}</if> <if test="isRoot != null "> and is_root = #{isRoot}</if>
<if test="preconditionTempleteId != null "> and precondition_templete_id = #{preconditionTempleteId}</if> <if test="preconditionTempleteId != null "> and precondition_templete_id = #{preconditionTempleteId}</if>
<if test="uuid != null and uuid != ''"> and uuid = #{uuid}</if> <if test="uuid != null and uuid != ''"> and uuid = #{uuid}</if>
<if test="desciption != null and desciption != ''"> and desciption = #{desciption}</if>
</where> </where>
</select> </select>
@@ -44,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isRoot != null">is_root,</if> <if test="isRoot != null">is_root,</if>
<if test="preconditionTempleteId != null">precondition_templete_id,</if> <if test="preconditionTempleteId != null">precondition_templete_id,</if>
<if test="uuid != null">uuid,</if> <if test="uuid != null">uuid,</if>
<if test="desciption != null">desciption,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="treeId != null">#{treeId},</if> <if test="treeId != null">#{treeId},</if>
@@ -52,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isRoot != null">#{isRoot},</if> <if test="isRoot != null">#{isRoot},</if>
<if test="preconditionTempleteId != null">#{preconditionTempleteId},</if> <if test="preconditionTempleteId != null">#{preconditionTempleteId},</if>
<if test="uuid != null">#{uuid},</if> <if test="uuid != null">#{uuid},</if>
<if test="desciption != null">#{desciption},</if>
</trim> </trim>
</insert> </insert>
@@ -64,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isRoot != null">is_root = #{isRoot},</if> <if test="isRoot != null">is_root = #{isRoot},</if>
<if test="preconditionTempleteId != null">precondition_templete_id = #{preconditionTempleteId},</if> <if test="preconditionTempleteId != null">precondition_templete_id = #{preconditionTempleteId},</if>
<if test="uuid != null">uuid = #{uuid},</if> <if test="uuid != null">uuid = #{uuid},</if>
<if test="desciption != null">desciption = #{desciption},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

View File

@@ -59,11 +59,6 @@
<artifactId>solution-system</artifactId> <artifactId>solution-system</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.solution</groupId>
<artifactId>solution-behaviour</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -224,12 +224,21 @@
<version>${solution.version}</version> <version>${solution.version}</version>
</dependency> </dependency>
<!-- 规则模块-->
<dependency>
<groupId>com.solution</groupId>
<artifactId>solution-algo</artifactId>
<version>${solution.version}</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<modules> <modules>
<module>auto-solution-admin</module> <module>auto-solution-admin</module>
<module>auto-solution-behaviour</module> <module>auto-solution-behaviour</module>
<module>auto-solution-algo</module>
<module>auto-solution-framework</module> <module>auto-solution-framework</module>
<module>auto-solution-system</module> <module>auto-solution-system</module>
<module>auto-solution-quartz</module> <module>auto-solution-quartz</module>