|
@@ -6,7 +6,6 @@ import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
@@ -16,8 +15,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.github.pagehelper.Page;
|
|
|
import com.zhongzheng.common.constant.Constants;
|
|
|
-import com.zhongzheng.common.core.domain.AjaxResult;
|
|
|
-import com.zhongzheng.common.core.domain.entity.SysUser;
|
|
|
import com.zhongzheng.common.core.domain.model.LoginUser;
|
|
|
import com.zhongzheng.common.core.redis.RedisCache;
|
|
|
import com.zhongzheng.common.enums.UserStatus;
|
|
@@ -33,20 +30,11 @@ import com.zhongzheng.modules.collect.domain.CollectNote;
|
|
|
import com.zhongzheng.modules.collect.mapper.CollectBankMapper;
|
|
|
import com.zhongzheng.modules.collect.mapper.CollectCourseMapper;
|
|
|
import com.zhongzheng.modules.collect.mapper.CollectNoteMapper;
|
|
|
-import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
|
|
|
-import com.zhongzheng.modules.course.bo.CourseQueryBo;
|
|
|
import com.zhongzheng.modules.course.domain.CourseSubject;
|
|
|
-import com.zhongzheng.modules.course.domain.MajorCategory;
|
|
|
-import com.zhongzheng.modules.course.service.ICourseService;
|
|
|
import com.zhongzheng.modules.course.service.ICourseSubjectService;
|
|
|
-import com.zhongzheng.modules.exam.domain.ExamKnowledge;
|
|
|
-import com.zhongzheng.modules.goods.vo.GoodsUserVo;
|
|
|
import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
|
|
|
import com.zhongzheng.modules.grade.service.IClassGradeUserService;
|
|
|
import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
|
|
|
-import com.zhongzheng.modules.inform.domain.InformSysUser;
|
|
|
-import com.zhongzheng.modules.order.domain.OrderBillGoods;
|
|
|
-import com.zhongzheng.modules.order.domain.OrderGoodsRefund;
|
|
|
import com.zhongzheng.modules.system.service.ISysConfigService;
|
|
|
import com.zhongzheng.modules.user.bo.*;
|
|
|
import com.zhongzheng.modules.user.domain.*;
|
|
@@ -54,9 +42,7 @@ import com.zhongzheng.modules.user.entity.ClientLoginUser;
|
|
|
import com.zhongzheng.modules.user.mapper.UserMapper;
|
|
|
import com.zhongzheng.modules.user.service.*;
|
|
|
import com.zhongzheng.modules.user.vo.*;
|
|
|
-import io.swagger.models.auth.In;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -64,7 +50,6 @@ import org.springframework.util.CollectionUtils;
|
|
|
import java.io.InputStream;
|
|
|
import java.lang.reflect.Field;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.sql.Timestamp;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -640,23 +625,23 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
if(bo.getTel().length()!=11){
|
|
|
throw new CustomException("手机号格式错误");
|
|
|
}
|
|
|
- /*if(bo.getIdCard()==null){
|
|
|
+ if(bo.getIdcard()==null){
|
|
|
throw new CustomException("身份证不能为空");
|
|
|
- }*/
|
|
|
- /*if(bo.getIdCard().length()!=18){
|
|
|
+ }
|
|
|
+ if(bo.getIdcard().length()!=18){
|
|
|
throw new CustomException("身份证格式错误");
|
|
|
}
|
|
|
- if(bo.getRealname()==null){
|
|
|
- throw new CustomException("真实姓名不能为空");
|
|
|
- }*/
|
|
|
+// if(bo.getRealname()==null){
|
|
|
+// throw new CustomException("真实姓名不能为空");
|
|
|
+// }
|
|
|
User user = getOne(new LambdaQueryWrapper<User>()
|
|
|
.eq(User::getTelphone,EncryptHandler.encrypt(bo.getTel())).last("limit 1"));
|
|
|
if(Validator.isNotNull(user)){
|
|
|
throw new CustomException("该手机号已注册");
|
|
|
}
|
|
|
- if(Validator.isNotEmpty(bo.getIdCard())){
|
|
|
+ if(Validator.isNotEmpty(bo.getIdcard())){
|
|
|
User user2 = getOne(new LambdaQueryWrapper<User>()
|
|
|
- .eq(User::getIdCard,EncryptHandler.encrypt(bo.getIdCard())).last("limit 1"));
|
|
|
+ .eq(User::getIdCard,EncryptHandler.encrypt(bo.getIdcard())).last("limit 1"));
|
|
|
if(Validator.isNotNull(user2)){
|
|
|
throw new CustomException("该身份证已被使用");
|
|
|
}
|
|
@@ -669,7 +654,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
SnowflakeIdUtils idWorker = new SnowflakeIdUtils(3, 1);
|
|
|
inertData.setUserAccount(String.valueOf(idWorker.nextId()));
|
|
|
inertData.setSex(1);
|
|
|
- inertData.setIdCard(bo.getIdCard());
|
|
|
+ inertData.setIdCard(bo.getIdcard());
|
|
|
inertData.setRealname(bo.getRealname());
|
|
|
inertData.setStatus(1);
|
|
|
inertData.setRegisterPlat(bo.getRegisterPlat());
|
|
@@ -679,7 +664,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
inertData.setLastLoginTime(DateUtils.getNowTime());
|
|
|
inertData.setCreateTime(DateUtils.getNowTime());
|
|
|
inertData.setUpdateTime(DateUtils.getNowTime());
|
|
|
- String pwd = ToolsUtils.getSmsCode(); // 随机密码
|
|
|
+// String pwd = ToolsUtils.getSmsCode(); // 随机密码
|
|
|
+ String pwd = bo.getIdcard().substring(bo.getIdcard().length() - 6);
|
|
|
inertData.setPassword(SecurityUtils.encryptPassword(pwd));
|
|
|
if(!save(inertData)){
|
|
|
throw new CustomException("注册失败");
|
|
@@ -690,6 +676,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
|
|
|
@Override
|
|
|
public Boolean registerUser(UserAppRegisterBo bo) {
|
|
|
+ if(StringUtils.isBlank(bo.getIdcard())){
|
|
|
+ throw new CustomException("身份证不能为空");
|
|
|
+ }
|
|
|
if(bo.getTel()==null){
|
|
|
throw new CustomException("手机号不能为空");
|
|
|
}
|
|
@@ -712,8 +701,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
if(Validator.isNotNull(user)){
|
|
|
throw new CustomException("该手机号已注册");
|
|
|
}
|
|
|
+ User userIdCard = getOne(new LambdaQueryWrapper<User>()
|
|
|
+ .eq(User::getIdCard,EncryptHandler.encrypt(bo.getIdcard())).last("limit 1"));
|
|
|
+ if(Validator.isNotNull(userIdCard)){
|
|
|
+ throw new CustomException("该身份证已注册");
|
|
|
+ }
|
|
|
User inertData = new User();
|
|
|
inertData.setTelphone(bo.getTel());
|
|
|
+ inertData.setIdCard(bo.getIdcard());
|
|
|
//隐藏手机号作为初始昵称
|
|
|
inertData.setNickname(TelPhoneUtils.hideTelPhone(bo.getTel()));
|
|
|
//雪花算法产生账号ID
|
|
@@ -756,11 +751,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
errorList.add(itemImport);
|
|
|
continue;
|
|
|
}
|
|
|
- /* if(Validator.isEmpty(itemImport.getIdCard())){
|
|
|
+ if(Validator.isEmpty(itemImport.getIdCard())){
|
|
|
itemImport.setCause("身份证不能为空");
|
|
|
errorList.add(itemImport);
|
|
|
continue;
|
|
|
- }*/
|
|
|
+ }
|
|
|
if(Validator.isEmpty(itemImport.getRealname())){
|
|
|
itemImport.setCause("真实姓名不能为空");
|
|
|
errorList.add(itemImport);
|
|
@@ -833,7 +828,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
inertData.setLastLoginTime(DateUtils.getNowTime());
|
|
|
inertData.setCreateTime(DateUtils.getNowTime());
|
|
|
inertData.setUpdateTime(DateUtils.getNowTime());
|
|
|
- String pwd = ToolsUtils.getSmsCode(); // 随机密码
|
|
|
+// String pwd = ToolsUtils.getSmsCode(); // 随机密码
|
|
|
+// inertData.setPassword(SecurityUtils.encryptPassword(pwd));
|
|
|
+ //初始密码(身份证后6位)
|
|
|
+ String idCard = itemImport.getIdCard();
|
|
|
+ String pwd = idCard.substring(idCard.length() - 6); // 随机密码
|
|
|
inertData.setPassword(SecurityUtils.encryptPassword(pwd));
|
|
|
inertData.setImportNo(importNo); //设置导入编号 一个导入页面同时导入多次算一个编号
|
|
|
if(!save(inertData)){
|
|
@@ -882,6 +881,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
if(Validator.isEmpty(bo.getTelphone())){
|
|
|
throw new CustomException("用户手机号码缺失");
|
|
|
}
|
|
|
+ if(Validator.isEmpty(bo.getIdCard())){
|
|
|
+ throw new CustomException("用户身份证号码缺失");
|
|
|
+ }
|
|
|
User user1 = getOne(new LambdaQueryWrapper<User>()
|
|
|
.eq(User::getTelphone,EncryptHandler.encrypt(bo.getTelphone())).last("limit 1"));
|
|
|
//手机号码存在
|