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 0ebe3011..03790bd0 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 @@ -180,7 +180,8 @@ public class TypeController extends BaseController { @ApiOperation(value = "获取物资类型连动式下拉框") @GetMapping("/equipmentType") public AjaxResult equipmentType(@RequestParam(required = false) Long typeId, @RequestParam(required = false) String typeName) { - List listByMaType = typeService.getEquipmentType(typeId, typeName); + Long deptId = typeService.getUserDeptId(); + List listByMaType = typeService.getEquipmentType(typeId, typeName, deptId); return success(listByMaType); } 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 c3811833..706c234e 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 @@ -25,7 +25,7 @@ public interface TypeMapper { // 查询物资类型的内部租赁价 BigDecimal selectLeasePriceByTypeId(Long typeId); - List selectMaTypeList(@Param("typeId") Long typeId,@Param("typeName") String typeName); + List selectMaTypeList(@Param("typeId") Long typeId, @Param("typeName") String typeName, @Param("companyId") Long companyId); /** * 查询物资类型3级--前端联动式下拉框 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 23c39c48..f0772d63 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 @@ -27,7 +27,7 @@ public interface ITypeService { List selectParentId(MaTypeVo type); - List getEquipmentType(Long typeId, String typeName); + List getEquipmentType(Long typeId, String typeName, Long deptId); /** * 查询物资类型3级--前端联动式下拉框 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 2706020d..b90af28e 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 @@ -93,8 +93,8 @@ public class TypeServiceImpl implements ITypeService { * @param typeName 类型名称 */ @Override - public List getEquipmentType(Long typeId, String typeName) { - List maTypes = typeMapper.selectMaTypeList(typeId, typeName); + public List getEquipmentType(Long typeId, String typeName, Long deptId) { + List maTypes = typeMapper.selectMaTypeList(typeId, typeName, deptId); List roots = maTypes.stream() .filter(t -> t.getParentId() == 0) .collect(Collectors.toList()); 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 15abaaf9..981e5278 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 @@ -599,6 +599,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND m.type_id = #{typeId} + + AND m.company_id = #{companyId} +