“djh”
2 天以前 8c91afa9c1bbe5fae9d88cfd1e7243c376af69fe
multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysUserServiceImpl.java
@@ -14,9 +14,11 @@
import com.gkhy.exam.common.utils.RedisUtils;
import com.gkhy.exam.common.utils.SecurityUtils;
import com.gkhy.exam.common.utils.StringUtils;
import com.gkhy.exam.system.domain.ExStudent;
import com.gkhy.exam.system.domain.SysUserRole;
import com.gkhy.exam.system.mapper.SysUserMapper;
import com.gkhy.exam.system.mapper.SysUserRoleMapper;
import com.gkhy.exam.system.service.ExStudentService;
import com.gkhy.exam.system.service.SysConfigService;
import com.gkhy.exam.system.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -49,6 +51,9 @@
    private Validator validator;
    @Autowired
    private SysUserRoleMapper userRoleMapper;
    @Autowired
    private ExStudentService exStudentService;
    @Override
    public CommonPage<SysUser> selectUserList(SysUser user) {
@@ -133,6 +138,14 @@
    @Override
    public int addUser(SysUser user) {
        ExStudent exStudent = new ExStudent();
        exStudent.setCompanyId(user.getCompanyId());
        exStudent.setName(user.getName());
        exStudent.setPassword(user.getPassword());
        exStudent.setDeptId(user.getDeptId());
        exStudent.setDuty(user.getDuty());
        exStudent.setSex(user.getSex());
        exStudent.setPhone(user.getPhone());
        checkRequestData(user);
        checkUserAllowed(user);
        user.setCreateBy(SecurityUtils.getUsername());
@@ -145,6 +158,8 @@
        userRoleList.add(sysUserRole);
        userRoleMapper.batchUserRole(userRoleList);
        exStudentService.insertStudent(exStudent);
        if(row<1){
            throw new ApiException("新增用户失败");
        }