From 398c4502681523631793ba0b5d02a9b0ca572ee5 Mon Sep 17 00:00:00 2001 From: syruan <321359594@qq.com> Date: Tue, 15 Oct 2024 16:23:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=B5=84=E7=B1=BB=E5=9E=8B=E7=AE=A1?= =?UTF-8?q?=E7=90=86--=E6=96=B0=E5=A2=9E=E7=88=B6=E7=BA=A7=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=AD=90=E7=BA=A7tree=E6=A0=91=E5=BD=A2=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/material/ma/controller/TypeController.java | 11 +++++++++++ .../com/bonus/material/ma/mapper/TypeMapper.java | 6 +++++- .../com/bonus/material/ma/service/ITypeService.java | 6 ++++++ .../material/ma/service/impl/TypeServiceImpl.java | 5 +++++ .../main/resources/mapper/material/ma/TypeMapper.xml | 12 ++++++++++++ 5 files changed, 39 insertions(+), 1 deletion(-) 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