diff --git a/src/main/java/com/glxp/api/controller/auth/DeptUserController.java b/src/main/java/com/glxp/api/controller/auth/DeptUserController.java index f0b99793f..6d89e8ccd 100644 --- a/src/main/java/com/glxp/api/controller/auth/DeptUserController.java +++ b/src/main/java/com/glxp/api/controller/auth/DeptUserController.java @@ -2,10 +2,13 @@ package com.glxp.api.controller.auth; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.AuthRuleAnnotation; +import com.glxp.api.entity.auth.DeptEntity; import com.glxp.api.entity.auth.DeptUserEntity; import com.glxp.api.req.auth.FilterDeptUserReqeust; +import com.glxp.api.req.auth.FilterInvWarehouseRequest; import com.glxp.api.res.PageSimpleResponse; import com.glxp.api.res.auth.DeptUserResponse; +import com.glxp.api.service.auth.DeptService; import com.glxp.api.service.auth.DeptUserService; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; @@ -23,10 +26,16 @@ public class DeptUserController { @Resource DeptUserService deptUserService; + @Resource + DeptService deptService; + @AuthRuleAnnotation("") @GetMapping("udi/auth/dept/user/filter") public BaseResponse filterList(FilterDeptUserReqeust filterDeptUserReqeust) { + //获取部门id + Long idByCode = deptService.getIdByCode(filterDeptUserReqeust.getDeptId()); + filterDeptUserReqeust.setDeptId(idByCode); List deptEntityList = deptUserService.selectJoinDeptUser(filterDeptUserReqeust); PageInfo pageInfo = new PageInfo<>(deptEntityList); PageSimpleResponse deptEntityPageSimpleResponse = new PageSimpleResponse<>(); diff --git a/src/main/java/com/glxp/api/dao/auth/DeptDao.java b/src/main/java/com/glxp/api/dao/auth/DeptDao.java index 3122d66e6..1750556ed 100644 --- a/src/main/java/com/glxp/api/dao/auth/DeptDao.java +++ b/src/main/java/com/glxp/api/dao/auth/DeptDao.java @@ -27,6 +27,9 @@ public interface DeptDao { String getNameByCode(@Param("fromCorpId") String fromCorpId); + Long getIdByCode(@Param("fromCorpId") Long fromCorpId); + + /** * 批量导入仓库信息 * diff --git a/src/main/java/com/glxp/api/service/auth/DeptService.java b/src/main/java/com/glxp/api/service/auth/DeptService.java index 27c76f3f5..70e50dcce 100644 --- a/src/main/java/com/glxp/api/service/auth/DeptService.java +++ b/src/main/java/com/glxp/api/service/auth/DeptService.java @@ -31,6 +31,8 @@ public interface DeptService { DeptEntity selectByName(String name); + Long getIdByCode( Long fromCorpId); + boolean deleteById(String id); List selectByNameList(String name); diff --git a/src/main/java/com/glxp/api/service/auth/impl/DeptServiceImpl.java b/src/main/java/com/glxp/api/service/auth/impl/DeptServiceImpl.java index 21bb2c41a..1104f1d05 100644 --- a/src/main/java/com/glxp/api/service/auth/impl/DeptServiceImpl.java +++ b/src/main/java/com/glxp/api/service/auth/impl/DeptServiceImpl.java @@ -110,6 +110,11 @@ public class DeptServiceImpl implements DeptService { return null; } + @Override + public Long getIdByCode(Long fromCorpId) { + return deptDao.getIdByCode(fromCorpId); + } + @Override public List selectByNameList(String name) { FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest(); diff --git a/src/main/resources/mybatis/mapper/auth/DeptDao.xml b/src/main/resources/mybatis/mapper/auth/DeptDao.xml index 28cdfbea1..2a9f04314 100644 --- a/src/main/resources/mybatis/mapper/auth/DeptDao.xml +++ b/src/main/resources/mybatis/mapper/auth/DeptDao.xml @@ -172,6 +172,11 @@ from auth_dept where code = #{fromCorpId} + replace