“djh”
2024-11-11 8458e64aab474c0fc2f49ae4ff22fb11ce5cf6e2
exam-system/src/main/java/com/gkhy/exam/system/service/impl/ExStudentServiceImpl.java
@@ -290,6 +290,31 @@
        return trainRecordVOList;
    }
    @Override
    public List<ExStudent> selectStudentCheckAll(ExStudent student) {
        SysUser currentUser= SecurityUtils.getLoginUser().getUser();
        if(!currentUser.getUserType().equals(UserTypeEnum.SYSTEM_USER.getCode())){
            student.setCompanyId(currentUser.getCompanyId());
            Map<String,Object> paramsMap=new HashMap<>();
            if(currentUser.getUserType().equals(UserTypeEnum.DEPART_USER.getCode())) {//部门级用户
                List<Long> workshopUserIds=userMapper.selectWorkshopUserIds(currentUser.getId());
                if(workshopUserIds==null){
                    workshopUserIds=new ArrayList<>();
                }
                workshopUserIds.add(currentUser.getId());
                paramsMap.put("createIds",workshopUserIds);
                student.setParams(paramsMap);
            }else if(currentUser.getUserType().equals(UserTypeEnum.WORKSHOP_USER.getCode())){//车间级用户
                List<Long> workshopUserIds=new ArrayList<>();
                workshopUserIds.add(currentUser.getId());
                workshopUserIds.add(currentUser.getParentId());
                paramsMap.put("createIds",workshopUserIds);
                student.setParams(paramsMap);
            }
        }
        return baseMapper.selectStudentList(student);
    }
    public ExStudent checkUserDataScope(Long studentId) {
        if(studentId==null){
            throw new ApiException("学员id为空!");