26-03-14-20:46 通过平台id获取平台下所有组件

This commit is contained in:
MHW
2026-03-14 20:46:49 +08:00
parent c1c67e826b
commit f72105134f
6 changed files with 44 additions and 0 deletions

View File

@@ -52,4 +52,15 @@ public class FireRuleController extends BaseController {
public AjaxResult getCommPlatformComponentNames(Integer scenarioId){ public AjaxResult getCommPlatformComponentNames(Integer scenarioId){
return success(ruleService.getCommPlatformComponentNames(scenarioId)); return success(ruleService.getCommPlatformComponentNames(scenarioId));
} }
/**
* 根据平台id获取平台下所有组件
* @param platformId
* @return
*/
@GetMapping("/component/{platformId}")
@ApiOperation("根据平台id获取平台下所有组件")
public AjaxResult getComponents(@PathVariable Integer platformId){
return success(ruleService.getComponents(platformId));
}
} }

View File

@@ -4,6 +4,7 @@ import java.util.List;
import com.solution.system.domain.AfsimScenario; import com.solution.system.domain.AfsimScenario;
import com.solution.system.domain.Behaviortree; import com.solution.system.domain.Behaviortree;
import sun.management.spi.PlatformMBeanProvider;
/** /**
* 行为树主Service接口 * 行为树主Service接口

View File

@@ -1,5 +1,6 @@
package com.solution.rule.mapper; package com.solution.rule.mapper;
import com.solution.rule.domain.PlatformComponent;
import com.solution.rule.domain.vo.ComponentCountVO; import com.solution.rule.domain.vo.ComponentCountVO;
import com.solution.rule.domain.vo.PlatformComponentNamesVO; import com.solution.rule.domain.vo.PlatformComponentNamesVO;
import com.solution.rule.domain.vo.WeaponModelVO; import com.solution.rule.domain.vo.WeaponModelVO;
@@ -32,4 +33,10 @@ public interface FireRuleMapper {
List<PlatformComponentNamesVO> getCommPlatformComponentNames(Integer scenarioId); List<PlatformComponentNamesVO> getCommPlatformComponentNames(Integer scenarioId);
/**
* 根据平台id获取平台下所有组件
* @param platformId
* @return
*/
List<PlatformComponent> getComponents(Integer platformId);
} }

View File

@@ -1,6 +1,7 @@
package com.solution.rule.service; package com.solution.rule.service;
import com.solution.rule.domain.FireRuleExecuteDTO; import com.solution.rule.domain.FireRuleExecuteDTO;
import com.solution.rule.domain.PlatformComponent;
import com.solution.rule.domain.vo.PlatformComponentNamesVO; import com.solution.rule.domain.vo.PlatformComponentNamesVO;
import com.solution.rule.domain.vo.PlatformWeaponAggregateVO; import com.solution.rule.domain.vo.PlatformWeaponAggregateVO;
@@ -29,4 +30,11 @@ public interface FireRuleService {
* @return * @return
*/ */
List<PlatformComponentNamesVO> getCommPlatformComponentNames(Integer scenarioId); List<PlatformComponentNamesVO> getCommPlatformComponentNames(Integer scenarioId);
/**
* 根据平台id获取平台下所有组件
* @param platformId
* @return
*/
List<PlatformComponent> getComponents(Integer platformId);
} }

View File

@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.solution.common.constant.ExceptionConstants; import com.solution.common.constant.ExceptionConstants;
import com.solution.rule.domain.FireRuleExecuteDTO; import com.solution.rule.domain.FireRuleExecuteDTO;
import com.solution.rule.domain.PlatformComponent;
import com.solution.rule.domain.RuleParam; import com.solution.rule.domain.RuleParam;
import com.solution.rule.domain.dto.WeaponModelDTO; import com.solution.rule.domain.dto.WeaponModelDTO;
import com.solution.rule.domain.vo.ComponentCountVO; import com.solution.rule.domain.vo.ComponentCountVO;
@@ -142,6 +143,16 @@ public class FireRuleServiceImpl implements FireRuleService {
return ruleMapper.getCommPlatformComponentNames(scenarioId); return ruleMapper.getCommPlatformComponentNames(scenarioId);
} }
/**
* 根据平台id获取平台下所有组件
* @param platformId
* @return
*/
@Override
public List<PlatformComponent> getComponents(Integer platformId) {
return ruleMapper.getComponents(platformId);
}
/** /**
* 获取所有组件以及数量 * 获取所有组件以及数量
* @return * @return

View File

@@ -61,6 +61,12 @@
WHERE pc.type = "comm" WHERE pc.type = "comm"
AND p.scenario_id = #{scenarioId} AND p.scenario_id = #{scenarioId}
</select> </select>
<select id="getComponents" resultType="com.solution.rule.domain.PlatformComponent"
parameterType="java.lang.Integer">
SELECT id,name,type,description,platform_id
FROM platform_component
WHERE platform_id = #{platformId}
</select>
</mapper> </mapper>