根据平台id获取该行为树的下属
This commit is contained in:
@@ -136,16 +136,16 @@ public class BehaviortreeController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据行为树id获取该行为树的下属
|
* 根据平台id获取该行为树的下属
|
||||||
* @param treeId
|
* @param platformId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation("根据行为树id获取该行为树的下属")
|
@ApiOperation("根据平台id获取该行为树的下属")
|
||||||
@PreAuthorize("@ss.hasPermi('system:behaviortree:query')")
|
@PreAuthorize("@ss.hasPermi('system:behaviortree:query')")
|
||||||
@GetMapping("/underling/{treeId}")
|
@GetMapping("/underling/{platformId}")
|
||||||
public AjaxResult getUnderling(@PathVariable Integer treeId)
|
public AjaxResult getUnderling(@PathVariable Integer platformId)
|
||||||
{
|
{
|
||||||
return success(behaviortreeService.getUnderling(treeId));
|
return success(behaviortreeService.getUnderling(platformId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.solution.system.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台视图对象 platform
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PlatformVO
|
||||||
|
{
|
||||||
|
/** 主键 */
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/** 名称 */
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 描述 */
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/** 平台出现在想定上的想定id */
|
||||||
|
private Integer scenarioId;
|
||||||
|
|
||||||
|
/** 经度 */
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
/** 纬度 */
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
/** 平台类型 */
|
||||||
|
private String platformType;
|
||||||
|
|
||||||
|
/** 海拔 */
|
||||||
|
private Float altitude;
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.solution.system.mapper;
|
package com.solution.system.mapper;
|
||||||
|
|
||||||
import com.solution.system.domain.PlatformTree;
|
import com.solution.system.domain.PlatformTree;
|
||||||
|
import com.solution.system.domain.PlatformVO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@@ -9,12 +10,7 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface PlatformMapper {
|
public interface PlatformMapper {
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据行为树id获取行为树所属平台
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
PlatformTree getPlatformByTreeId(Integer id);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据下属平台英文名获取中文名返回
|
* 根据下属平台英文名获取中文名返回
|
||||||
@@ -22,4 +18,18 @@ public interface PlatformMapper {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<String> selectPlatformChineseName(@Param("underlingEnglishName") List<String> underlingEnglishName);
|
List<String> selectPlatformChineseName(@Param("underlingEnglishName") List<String> underlingEnglishName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据平台id获取平台实体
|
||||||
|
* @param platformId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PlatformTree getPlatformById(Integer platformId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据平台英文名查询该平台实体
|
||||||
|
* @param underlingEnglishName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PlatformVO> getPlatformByEnglishName(@Param("underlingEnglishName") List<String> underlingEnglishName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.solution.system.domain.Behaviortree;
|
import com.solution.system.domain.Behaviortree;
|
||||||
import com.solution.system.domain.PlatformChiefCommander;
|
import com.solution.system.domain.PlatformChiefCommander;
|
||||||
|
import com.solution.system.domain.PlatformVO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 行为树主Service接口
|
* 行为树主Service接口
|
||||||
@@ -65,11 +66,11 @@ public interface IBehaviortreeService
|
|||||||
public int deleteBehaviortreeById(Long id);
|
public int deleteBehaviortreeById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据行为树id获取该行为树的下属
|
* 根据平台id获取该行为树的下属
|
||||||
* @param treeId
|
* @param platformId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<String> getUnderling(Integer treeId);
|
List<PlatformVO> getUnderling(Integer platformId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据场景id获取总指挥的行为树的原数据
|
* 根据场景id获取总指挥的行为树的原数据
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import com.solution.common.constant.ExceptionConstants;
|
import com.solution.common.constant.ExceptionConstants;
|
||||||
import com.solution.system.domain.PlatformChiefCommander;
|
import com.solution.system.domain.PlatformChiefCommander;
|
||||||
import com.solution.system.domain.PlatformTree;
|
import com.solution.system.domain.PlatformTree;
|
||||||
|
import com.solution.system.domain.PlatformVO;
|
||||||
import com.solution.system.mapper.PlatformCommunicationMapper;
|
import com.solution.system.mapper.PlatformCommunicationMapper;
|
||||||
import com.solution.system.mapper.PlatformMapper;
|
import com.solution.system.mapper.PlatformMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -112,29 +113,28 @@ public class BehaviortreeServiceImpl implements IBehaviortreeService
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据行为树id获取该行为树的下属
|
* 根据平台id获取该行为树的下属
|
||||||
* @param treeId
|
* @param platformId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> getUnderling(Integer treeId) {
|
public List<PlatformVO> getUnderling(Integer platformId) {
|
||||||
if(null == treeId){
|
if(null == platformId){
|
||||||
throw new RuntimeException(ExceptionConstants.PARAMETER_EXCEPTION);
|
throw new RuntimeException(ExceptionConstants.PARAMETER_EXCEPTION);
|
||||||
}
|
}
|
||||||
Behaviortree behaviortree = behaviortreeMapper.selectBehaviortreeById(Long.valueOf(treeId));
|
//根据平台id获取平台实体
|
||||||
if(ObjectUtil.isEmpty(behaviortree) || null == behaviortree.getId()){
|
PlatformTree platform = platformMapper.getPlatformById(platformId);
|
||||||
throw new RuntimeException(ExceptionConstants.PARAMETER_EXCEPTION);
|
|
||||||
}
|
|
||||||
//根据行为树id获取行为树所属平台
|
|
||||||
PlatformTree platform = platformMapper.getPlatformByTreeId(behaviortree.getPlatformId());
|
|
||||||
//根据平台name获取平台下属英文名
|
//根据平台name获取平台下属英文名
|
||||||
List<String> underlingEnglishName = platformCommunicationMapper.getUnderlingBytreeId(platform.getName());
|
List<String> underlingEnglishName = platformCommunicationMapper.getUnderlingBytreeId(platform.getName());
|
||||||
//根据下属平台英文名获取中文名返回
|
if(CollUtil.isEmpty(underlingEnglishName)){
|
||||||
List<String> underlingChineseName = platformMapper.selectPlatformChineseName(underlingEnglishName);
|
|
||||||
if(CollUtil.isEmpty(underlingChineseName)){
|
|
||||||
throw new RuntimeException("该平台暂无下属");
|
throw new RuntimeException("该平台暂无下属");
|
||||||
}
|
}
|
||||||
return underlingChineseName;
|
//根据平台英文名查询该平台实体
|
||||||
|
List<PlatformVO> resultList = platformMapper.getPlatformByEnglishName(underlingEnglishName);
|
||||||
|
if(CollUtil.isEmpty(resultList)){
|
||||||
|
throw new RuntimeException("无法根据平台英文名获取平台实体");
|
||||||
|
}
|
||||||
|
return resultList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,12 +5,7 @@
|
|||||||
<mapper namespace="com.solution.system.mapper.PlatformMapper">
|
<mapper namespace="com.solution.system.mapper.PlatformMapper">
|
||||||
|
|
||||||
|
|
||||||
<select id="getPlatformByTreeId" resultType="com.solution.system.domain.PlatformTree"
|
|
||||||
parameterType="java.lang.Integer">
|
|
||||||
SELECT id , name , description, scenario_id
|
|
||||||
FROM platform
|
|
||||||
WHERE id = #{id}
|
|
||||||
</select>
|
|
||||||
<select id="selectPlatformChineseName" resultType="java.lang.String"
|
<select id="selectPlatformChineseName" resultType="java.lang.String"
|
||||||
parameterType="java.util.List">
|
parameterType="java.util.List">
|
||||||
SELECT description
|
SELECT description
|
||||||
@@ -20,4 +15,23 @@
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getPlatformById" resultType="com.solution.system.domain.PlatformTree"
|
||||||
|
parameterType="java.lang.Integer">
|
||||||
|
SELECT id, name, description, scenario_id AS scenarioId
|
||||||
|
FROM platform
|
||||||
|
WHERE id = #{platformId}
|
||||||
|
</select>
|
||||||
|
<select id="getPlatformByEnglishName" resultType="com.solution.system.domain.PlatformVO"
|
||||||
|
parameterType="java.util.List<java.lang.String>">
|
||||||
|
SELECT id,name,description,
|
||||||
|
scenario_id AS scenarioId,
|
||||||
|
longitude,latitude,
|
||||||
|
platform_type AS platformType,
|
||||||
|
altitude
|
||||||
|
FROM platform
|
||||||
|
WHERE name IN
|
||||||
|
<foreach item="item" collection="underlingEnglishName" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
4
modeler/types/components.d.ts
vendored
4
modeler/types/components.d.ts
vendored
@@ -38,6 +38,7 @@ declare module 'vue' {
|
|||||||
AListItem: typeof import('ant-design-vue/es')['ListItem']
|
AListItem: typeof import('ant-design-vue/es')['ListItem']
|
||||||
AListItemMeta: typeof import('ant-design-vue/es')['ListItemMeta']
|
AListItemMeta: typeof import('ant-design-vue/es')['ListItemMeta']
|
||||||
AMenu: typeof import('ant-design-vue/es')['Menu']
|
AMenu: typeof import('ant-design-vue/es')['Menu']
|
||||||
|
AMenuDivider: typeof import('ant-design-vue/es')['MenuDivider']
|
||||||
AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
|
AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
|
||||||
APagination: typeof import('ant-design-vue/es')['Pagination']
|
APagination: typeof import('ant-design-vue/es')['Pagination']
|
||||||
APopconfirm: typeof import('ant-design-vue/es')['Popconfirm']
|
APopconfirm: typeof import('ant-design-vue/es')['Popconfirm']
|
||||||
@@ -47,6 +48,7 @@ declare module 'vue' {
|
|||||||
ASelect: typeof import('ant-design-vue/es')['Select']
|
ASelect: typeof import('ant-design-vue/es')['Select']
|
||||||
ASelectOption: typeof import('ant-design-vue/es')['SelectOption']
|
ASelectOption: typeof import('ant-design-vue/es')['SelectOption']
|
||||||
ASpace: typeof import('ant-design-vue/es')['Space']
|
ASpace: typeof import('ant-design-vue/es')['Space']
|
||||||
|
ASubMenu: typeof import('ant-design-vue/es')['SubMenu']
|
||||||
ASwitch: typeof import('ant-design-vue/es')['Switch']
|
ASwitch: typeof import('ant-design-vue/es')['Switch']
|
||||||
ATabPane: typeof import('ant-design-vue/es')['TabPane']
|
ATabPane: typeof import('ant-design-vue/es')['TabPane']
|
||||||
ATabs: typeof import('ant-design-vue/es')['Tabs']
|
ATabs: typeof import('ant-design-vue/es')['Tabs']
|
||||||
@@ -86,6 +88,7 @@ declare global {
|
|||||||
const AListItem: typeof import('ant-design-vue/es')['ListItem']
|
const AListItem: typeof import('ant-design-vue/es')['ListItem']
|
||||||
const AListItemMeta: typeof import('ant-design-vue/es')['ListItemMeta']
|
const AListItemMeta: typeof import('ant-design-vue/es')['ListItemMeta']
|
||||||
const AMenu: typeof import('ant-design-vue/es')['Menu']
|
const AMenu: typeof import('ant-design-vue/es')['Menu']
|
||||||
|
const AMenuDivider: typeof import('ant-design-vue/es')['MenuDivider']
|
||||||
const AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
|
const AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
|
||||||
const APagination: typeof import('ant-design-vue/es')['Pagination']
|
const APagination: typeof import('ant-design-vue/es')['Pagination']
|
||||||
const APopconfirm: typeof import('ant-design-vue/es')['Popconfirm']
|
const APopconfirm: typeof import('ant-design-vue/es')['Popconfirm']
|
||||||
@@ -95,6 +98,7 @@ declare global {
|
|||||||
const ASelect: typeof import('ant-design-vue/es')['Select']
|
const ASelect: typeof import('ant-design-vue/es')['Select']
|
||||||
const ASelectOption: typeof import('ant-design-vue/es')['SelectOption']
|
const ASelectOption: typeof import('ant-design-vue/es')['SelectOption']
|
||||||
const ASpace: typeof import('ant-design-vue/es')['Space']
|
const ASpace: typeof import('ant-design-vue/es')['Space']
|
||||||
|
const ASubMenu: typeof import('ant-design-vue/es')['SubMenu']
|
||||||
const ASwitch: typeof import('ant-design-vue/es')['Switch']
|
const ASwitch: typeof import('ant-design-vue/es')['Switch']
|
||||||
const ATabPane: typeof import('ant-design-vue/es')['TabPane']
|
const ATabPane: typeof import('ant-design-vue/es')['TabPane']
|
||||||
const ATabs: typeof import('ant-design-vue/es')['Tabs']
|
const ATabs: typeof import('ant-design-vue/es')['Tabs']
|
||||||
|
|||||||
Reference in New Issue
Block a user