diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java index 9f46131d..7960388e 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java @@ -64,6 +64,17 @@ public class TypeController extends BaseController { return success(list); } + /** + * 根据物资类型ID查询所属下拉列表 + */ + @ApiOperation(value = "根据物资类型ID查询所属下拉列表") + @RequiresPermissions("ma:type:list") + @GetMapping("/selectMaTypeListByTypeId") + public AjaxResult selectMaTypeListByTypeId(@NotNull(message = "物资类型ID不能为空") Long typeId) { + List list = typeService.getMaTypeSelectVoListByParentId(typeId); + return success(list); + } + /** * 根据左列表类型id查询右表格 --- 暂未启用,代码有问题!! * TODO: 待完善 diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java index 9496f448..30af360e 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java @@ -36,7 +36,11 @@ public interface TypeMapper { List getListByTypeName(@Param("typeId") Long typeId, @Param("typeName") String typeName); - List getMaTypeSelectVoListByParentId(@Param("typeId") Long typeId); + /** + * 查询物资类型下拉树结构--根据上级ID + * @param parentId 父级ID + */ + List getMaTypeSelectVoListByParentId(@Param("parentId") Long parentId); /** * 物资类型树形结构 diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java index 807139ec..6ea729cc 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java @@ -26,6 +26,12 @@ public interface ITypeService { List getListByParentId(Long typeId, String typeName); + /** + * 查询物资类型下拉树结构--根据上级ID + * @param parentId 父级id + */ + List getMaTypeSelectVoListByParentId(Long parentId); + /** * 查询物资类型列表 * diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java index 77f1ad92..875ee3a1 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java @@ -64,6 +64,11 @@ public class TypeServiceImpl implements ITypeService { return typeMapper.getListByTypeName(typeId, typeName); } + @Override + public List getMaTypeSelectVoListByParentId(Long parentId) { + return typeMapper.getMaTypeSelectVoListByParentId(parentId); + } + /** * 查询物资类型管理列表 * diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml index 8fdd780b..ea79b697 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml @@ -316,4 +316,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where wh_house_set.house_id = #{mouseId} and wh_house_set.del_flag = 0 + + \ No newline at end of file