|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.sztzjy.linkCommerce.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.convert.Convert;
|
|
|
|
|
import cn.hutool.core.lang.UUID;
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import com.sztzjy.linkCommerce.entity.*;
|
|
|
|
|
@ -82,6 +83,32 @@ public class UserInfoServiceImpl implements UserInfoService {
|
|
|
|
|
String password = zyUserInfo.getPassword();
|
|
|
|
|
Integer roleId = zyUserInfo.getRoleId();
|
|
|
|
|
|
|
|
|
|
if (roleId == 3)
|
|
|
|
|
{
|
|
|
|
|
//查询班级名和班级ID
|
|
|
|
|
UserinfoExample userInfoExample = new UserinfoExample();
|
|
|
|
|
userInfoExample.createCriteria().andSchoolIdEqualTo(String.valueOf(zyUserInfo.getSchoolId())).andRoleEqualTo(4);
|
|
|
|
|
List<Userinfo> userInfos = userInfoMapper.selectByExample(userInfoExample);
|
|
|
|
|
if (userInfos.isEmpty() || userInfos==null){
|
|
|
|
|
//该学校暂未开通考试账号
|
|
|
|
|
zyUserInfo.setClassName(zyUserInfo.getSchoolName()+"-默认班级");
|
|
|
|
|
String schoolId = zyUserInfo.getSchoolId().toString() + "00";
|
|
|
|
|
zyUserInfo.setClassId(Convert.toInt(schoolId));
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
Userinfo userinfo = userInfos.get(0);
|
|
|
|
|
|
|
|
|
|
String schoolClassId = userinfo.getSchoolClassId();
|
|
|
|
|
//根据ClassId去查询班级名
|
|
|
|
|
SchoolClass existingClass = schoolClassMapper.selectByPrimaryKey(schoolClassId);
|
|
|
|
|
String className = existingClass.getClassName();
|
|
|
|
|
zyUserInfo.setClassId(Integer.valueOf(schoolClassId));
|
|
|
|
|
zyUserInfo.setClassName(className);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 检查用户是否已存在
|
|
|
|
|
UserinfoExample userInfoExample = new UserinfoExample();
|
|
|
|
|
userInfoExample.createCriteria().andUsernameEqualTo(username);
|
|
|
|
|
|