Browse Source

feat: [试验管理] 计划表单选人

master
memorylkf 3 months ago
parent
commit
3d6ca7b2e2
5 changed files with 20 additions and 6 deletions
  1. +11
    -2
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysUserController.java
  2. +1
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/mapper/SysUserMapper.java
  3. +1
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java
  4. +2
    -2
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java
  5. +5
    -0
      hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysUserMapper.xml

+ 11
- 2
hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysUserController.java View File

@ -8,8 +8,11 @@ import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.hxhq.business.domain.Study;
import com.hxhq.business.dto.select.DeptUserTreeDto; import com.hxhq.business.dto.select.DeptUserTreeDto;
import com.hxhq.business.enums.dept.DeptTypeEnum; 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.dto.UserExportDto;
import com.hxhq.system.service.ISysConfigService; import com.hxhq.system.service.ISysConfigService;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
@ -77,6 +80,8 @@ public class SysUserController extends BaseController
@Autowired @Autowired
private TokenService tokenService; private TokenService tokenService;
@Autowired
private IStudyService studyService;
/** /**
* 获取用户列表 * 获取用户列表
@ -450,10 +455,14 @@ public class SysUserController extends BaseController
@GetMapping("/studyUser") @GetMapping("/studyUser")
public AjaxResult studyUser(Long studyId,Long studySubjectId,String permit) 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<>()); return AjaxResult.success(new ArrayList<>());
} }
List<DeptUserTreeDto> depts = userService.selectStudyUser(studyId,studySubjectId,permit);
Study study = studyService.getById(studyId);
if(study==null){
return AjaxResult.error("信息不存在");
}
List<DeptUserTreeDto> 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); return success(depts);
} }
} }

+ 1
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/mapper/SysUserMapper.java View File

@ -170,5 +170,5 @@ public interface SysUserMapper
* @param permit * @param permit
* @return * @return
*/ */
List<DeptUserTreeDto> selectStudyUser(@Param("studyId") Long studyId, @Param("studySubjectId") Long studySubjectId, @Param("permit") String permit);
List<DeptUserTreeDto> selectStudyUser(@Param("studyId") Long studyId, @Param("studySubjectId") Long studySubjectId,@Param("deptId") Long deptId, @Param("permit") String permit);
} }

+ 1
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java View File

@ -241,7 +241,7 @@ public interface ISysUserService
* @param permit * @param permit
* @return * @return
*/ */
List<DeptUserTreeDto> selectStudyUser(Long studyId,Long studySubjectId,String permit);
List<DeptUserTreeDto> selectStudyUser(Long studyId,Long studySubjectId,Long deptId, String permit);
/** /**
* 检查密码是否正确 * 检查密码是否正确

+ 2
- 2
hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java View File

@ -581,8 +581,8 @@ public class SysUserServiceImpl implements ISysUserService
} }
@Override @Override
public List<DeptUserTreeDto> selectStudyUser(Long studyId, Long studySubjectId, String permit) {
return userMapper.selectStudyUser(studyId,studySubjectId,permit);
public List<DeptUserTreeDto> selectStudyUser(Long studyId, Long studySubjectId, Long deptId, String permit) {
return userMapper.selectStudyUser(studyId,studySubjectId,deptId,permit);
} }
@Override @Override

+ 5
- 0
hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysUserMapper.xml View File

@ -283,6 +283,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) )
</if> </if>
-- 部门
<if test="deptId != null and deptId != 0">
AND u.dept_id=#{deptId}
</if>
-- 权限 -- 权限
<if test="permit != null and permit != ''"> <if test="permit != null and permit != ''">
AND u.`user_id` IN ( AND u.`user_id` IN (

Loading…
Cancel
Save