From 3d6ca7b2e225b7c45aa197af734f2ba9e8a69529 Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Thu, 15 Jan 2026 16:16:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20[=E8=AF=95=E9=AA=8C=E7=AE=A1=E7=90=86]?= =?UTF-8?q?=20=E8=AE=A1=E5=88=92=E8=A1=A8=E5=8D=95=E9=80=89=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hxhq/system/controller/SysUserController.java | 13 +++++++++++-- .../src/main/java/com/hxhq/system/mapper/SysUserMapper.java | 2 +- .../main/java/com/hxhq/system/service/ISysUserService.java | 2 +- .../com/hxhq/system/service/impl/SysUserServiceImpl.java | 4 ++-- .../src/main/resources/mapper/system/SysUserMapper.xml | 5 +++++ 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysUserController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysUserController.java index 828a1fe..a359583 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysUserController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysUserController.java @@ -8,8 +8,11 @@ import java.util.Set; import java.util.stream.Collectors; import javax.servlet.http.HttpServletResponse; +import com.hxhq.business.domain.Study; import com.hxhq.business.dto.select.DeptUserTreeDto; import com.hxhq.business.enums.dept.DeptTypeEnum; +import com.hxhq.business.enums.study.StudyTypeEnum; +import com.hxhq.business.service.IStudyService; import com.hxhq.system.dto.UserExportDto; import com.hxhq.system.service.ISysConfigService; import org.apache.commons.lang3.ArrayUtils; @@ -77,6 +80,8 @@ public class SysUserController extends BaseController @Autowired private TokenService tokenService; + @Autowired + private IStudyService studyService; /** * 获取用户列表 @@ -450,10 +455,14 @@ public class SysUserController extends BaseController @GetMapping("/studyUser") public AjaxResult studyUser(Long studyId,Long studySubjectId,String permit) { - if((studyId==null || studyId.longValue()<=0) && StringUtils.isBlank(permit)){ + if(studyId==null || studyId.longValue()<=0){ return AjaxResult.success(new ArrayList<>()); } - List depts = userService.selectStudyUser(studyId,studySubjectId,permit); + Study study = studyService.getById(studyId); + if(study==null){ + return AjaxResult.error("信息不存在"); + } + List depts = userService.selectStudyUser(study.getType().equals(StudyTypeEnum.sy.getValue())?studyId:null,study.getType().equals(StudyTypeEnum.sy.getValue())?studySubjectId:null,study.getDeptId(),permit); return success(depts); } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/mapper/SysUserMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/mapper/SysUserMapper.java index b85716f..5106301 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/mapper/SysUserMapper.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/mapper/SysUserMapper.java @@ -170,5 +170,5 @@ public interface SysUserMapper * @param permit * @return */ - List selectStudyUser(@Param("studyId") Long studyId, @Param("studySubjectId") Long studySubjectId, @Param("permit") String permit); + List selectStudyUser(@Param("studyId") Long studyId, @Param("studySubjectId") Long studySubjectId,@Param("deptId") Long deptId, @Param("permit") String permit); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java index 5528d22..da1651b 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java @@ -241,7 +241,7 @@ public interface ISysUserService * @param permit * @return */ - List selectStudyUser(Long studyId,Long studySubjectId,String permit); + List selectStudyUser(Long studyId,Long studySubjectId,Long deptId, String permit); /** * 检查密码是否正确 diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java index c602fb1..47f985e 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java @@ -581,8 +581,8 @@ public class SysUserServiceImpl implements ISysUserService } @Override - public List selectStudyUser(Long studyId, Long studySubjectId, String permit) { - return userMapper.selectStudyUser(studyId,studySubjectId,permit); + public List selectStudyUser(Long studyId, Long studySubjectId, Long deptId, String permit) { + return userMapper.selectStudyUser(studyId,studySubjectId,deptId,permit); } @Override diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysUserMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysUserMapper.xml index d15df5e..52ae269 100644 --- a/hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -283,6 +283,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) + -- 部门 + + AND u.dept_id=#{deptId} + + -- 权限 AND u.`user_id` IN (