diff --git a/auto-solution-admin/src/main/java/com/solution/web/controller/behaviour/BehaviortreeController.java b/auto-solution-admin/src/main/java/com/solution/web/controller/behaviour/BehaviortreeController.java index ba6cee5..5bbbd9d 100644 --- a/auto-solution-admin/src/main/java/com/solution/web/controller/behaviour/BehaviortreeController.java +++ b/auto-solution-admin/src/main/java/com/solution/web/controller/behaviour/BehaviortreeController.java @@ -9,14 +9,7 @@ import io.swagger.annotations.ApiOperation; import org.checkerframework.checker.units.qual.A; 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 org.springframework.web.bind.annotation.*; import com.solution.common.annotation.Log; import com.solution.common.core.controller.BaseController; import com.solution.common.core.domain.AjaxResult; @@ -158,4 +151,15 @@ public class BehaviortreeController extends BaseController return success(behaviortreeService.getCommander(scenarioId)); } + /** + * 修改平台关联的行为树id + * @param behaviortreeId + * @return + */ + @ApiOperation("修改平台关联的行为树id") + @PutMapping("/{behaviortreeId}") + public AjaxResult updateBehaviortreeId(@PathVariable Integer behaviortreeId, + @RequestParam(required = false) Integer id){ + return toAjax(behaviortreeService.updateBehaviortreeId(behaviortreeId,id)); + } } diff --git a/auto-solution-behaviour/src/main/java/com/solution/system/mapper/PlatformMapper.java b/auto-solution-behaviour/src/main/java/com/solution/system/mapper/PlatformMapper.java index aff86bc..b15486e 100644 --- a/auto-solution-behaviour/src/main/java/com/solution/system/mapper/PlatformMapper.java +++ b/auto-solution-behaviour/src/main/java/com/solution/system/mapper/PlatformMapper.java @@ -32,4 +32,11 @@ public interface PlatformMapper { * @return */ List getPlatformByEnglishName(@Param("underlingEnglishName") List underlingEnglishName); + + /** + * 修改平台关联的行为树id + * @param behaviortreeId + * @return + */ + Integer updateBehaviortreeId(@Param("behaviortreeId") Integer behaviortreeId,@Param("id") Integer id); } diff --git a/auto-solution-behaviour/src/main/java/com/solution/system/service/IBehaviortreeService.java b/auto-solution-behaviour/src/main/java/com/solution/system/service/IBehaviortreeService.java index bdd1ac5..19c45ed 100644 --- a/auto-solution-behaviour/src/main/java/com/solution/system/service/IBehaviortreeService.java +++ b/auto-solution-behaviour/src/main/java/com/solution/system/service/IBehaviortreeService.java @@ -84,4 +84,11 @@ public interface IBehaviortreeService * @return */ Integer getCountName(String newName); + + /** + * 修改平台关联的行为树id + * @param behaviortreeId + * @return + */ + Integer updateBehaviortreeId(Integer behaviortreeId,Integer id); } diff --git a/auto-solution-behaviour/src/main/java/com/solution/system/service/impl/BehaviortreeServiceImpl.java b/auto-solution-behaviour/src/main/java/com/solution/system/service/impl/BehaviortreeServiceImpl.java index e1803af..729b11f 100644 --- a/auto-solution-behaviour/src/main/java/com/solution/system/service/impl/BehaviortreeServiceImpl.java +++ b/auto-solution-behaviour/src/main/java/com/solution/system/service/impl/BehaviortreeServiceImpl.java @@ -156,4 +156,17 @@ public class BehaviortreeServiceImpl implements IBehaviortreeService public Integer getCountName(String newName) { return behaviortreeMapper.getCountName(newName); } + + /** + * 修改平台关联的行为树id + * @param behaviortreeId + * @return + */ + @Override + public Integer updateBehaviortreeId(Integer behaviortreeId,Integer id) { + if(ObjectUtil.isEmpty(behaviortreeId) || ObjectUtil.isEmpty(id)){ + throw new RuntimeException(ExceptionConstants.PARAMETER_EXCEPTION); + } + return platformMapper.updateBehaviortreeId(behaviortreeId,id); + } } diff --git a/auto-solution-behaviour/src/main/java/com/solution/system/service/impl/NodeparameterServiceImpl.java b/auto-solution-behaviour/src/main/java/com/solution/system/service/impl/NodeparameterServiceImpl.java index e1f0ec8..49ec78f 100644 --- a/auto-solution-behaviour/src/main/java/com/solution/system/service/impl/NodeparameterServiceImpl.java +++ b/auto-solution-behaviour/src/main/java/com/solution/system/service/impl/NodeparameterServiceImpl.java @@ -14,7 +14,7 @@ import com.solution.system.service.INodeparameterService; * @date 2026-02-05 */ @Service -public class NodeparameterServiceImpl implements INodeparameterService +public class NodeparameterServiceImpl implements INodeparameterService { @Autowired private NodeparameterMapper nodeparameterMapper; diff --git a/auto-solution-behaviour/src/main/resources/mapper/system/PlatformMapper.xml b/auto-solution-behaviour/src/main/resources/mapper/system/PlatformMapper.xml index 99c03d4..c7bbd21 100644 --- a/auto-solution-behaviour/src/main/resources/mapper/system/PlatformMapper.xml +++ b/auto-solution-behaviour/src/main/resources/mapper/system/PlatformMapper.xml @@ -3,8 +3,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - + + UPDATE platform + SET behaviortree_id = #{behaviortreeId} + WHERE id = #{id} +