|
@@ -6,6 +6,7 @@ import cn.hutool.core.convert.Convert;
|
|
|
import cn.hutool.core.lang.Validator;
|
|
import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -24,8 +25,14 @@ import com.zhongzheng.common.exception.BaseException;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.type.EncryptHandler;
|
|
import com.zhongzheng.common.type.EncryptHandler;
|
|
|
import com.zhongzheng.common.utils.*;
|
|
import com.zhongzheng.common.utils.*;
|
|
|
|
|
+import com.zhongzheng.common.utils.file.FileUtils;
|
|
|
|
|
+import com.zhongzheng.common.utils.http.HttpUtils;
|
|
|
import com.zhongzheng.common.utils.ip.IpUtils;
|
|
import com.zhongzheng.common.utils.ip.IpUtils;
|
|
|
|
|
+import com.zhongzheng.modules.alioss.bo.OssRequest;
|
|
|
|
|
+import com.zhongzheng.modules.alioss.service.OssService;
|
|
|
import com.zhongzheng.modules.alisms.service.IAliSmsService;
|
|
import com.zhongzheng.modules.alisms.service.IAliSmsService;
|
|
|
|
|
+import com.zhongzheng.modules.base.domain.UserProfile;
|
|
|
|
|
+import com.zhongzheng.modules.base.service.IUserProfileService;
|
|
|
import com.zhongzheng.modules.collect.domain.CollectBank;
|
|
import com.zhongzheng.modules.collect.domain.CollectBank;
|
|
|
import com.zhongzheng.modules.collect.domain.CollectCourse;
|
|
import com.zhongzheng.modules.collect.domain.CollectCourse;
|
|
|
import com.zhongzheng.modules.collect.domain.CollectNote;
|
|
import com.zhongzheng.modules.collect.domain.CollectNote;
|
|
@@ -35,38 +42,54 @@ import com.zhongzheng.modules.collect.mapper.CollectNoteMapper;
|
|
|
import com.zhongzheng.modules.course.domain.Course;
|
|
import com.zhongzheng.modules.course.domain.Course;
|
|
|
import com.zhongzheng.modules.course.domain.CourseSection;
|
|
import com.zhongzheng.modules.course.domain.CourseSection;
|
|
|
import com.zhongzheng.modules.course.domain.CourseSubject;
|
|
import com.zhongzheng.modules.course.domain.CourseSubject;
|
|
|
|
|
+import com.zhongzheng.modules.course.domain.Major;
|
|
|
import com.zhongzheng.modules.course.service.ICourseSectionService;
|
|
import com.zhongzheng.modules.course.service.ICourseSectionService;
|
|
|
import com.zhongzheng.modules.course.service.ICourseService;
|
|
import com.zhongzheng.modules.course.service.ICourseService;
|
|
|
import com.zhongzheng.modules.course.service.ICourseSubjectService;
|
|
import com.zhongzheng.modules.course.service.ICourseSubjectService;
|
|
|
|
|
+import com.zhongzheng.modules.course.service.IMajorService;
|
|
|
|
|
+import com.zhongzheng.modules.exam.service.IExamApplyService;
|
|
|
import com.zhongzheng.modules.goods.domain.Goods;
|
|
import com.zhongzheng.modules.goods.domain.Goods;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
|
|
+import com.zhongzheng.modules.goods.vo.UserNewGoodsVo;
|
|
|
import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
|
|
import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
|
|
|
import com.zhongzheng.modules.grade.service.IClassGradeUserService;
|
|
import com.zhongzheng.modules.grade.service.IClassGradeUserService;
|
|
|
|
|
+import com.zhongzheng.modules.grade.service.impl.ClassGradeServiceImpl;
|
|
|
import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
|
|
import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
|
|
|
|
|
+import com.zhongzheng.modules.system.domain.SysTask;
|
|
|
import com.zhongzheng.modules.system.domain.SysTenant;
|
|
import com.zhongzheng.modules.system.domain.SysTenant;
|
|
|
import com.zhongzheng.modules.system.service.ISysConfigService;
|
|
import com.zhongzheng.modules.system.service.ISysConfigService;
|
|
|
|
|
+import com.zhongzheng.modules.system.service.ISysTaskService;
|
|
|
import com.zhongzheng.modules.system.service.ISysTenantService;
|
|
import com.zhongzheng.modules.system.service.ISysTenantService;
|
|
|
import com.zhongzheng.modules.user.bo.*;
|
|
import com.zhongzheng.modules.user.bo.*;
|
|
|
import com.zhongzheng.modules.user.domain.User;
|
|
import com.zhongzheng.modules.user.domain.User;
|
|
|
|
|
+import com.zhongzheng.modules.user.domain.UserCertificate;
|
|
|
import com.zhongzheng.modules.user.domain.UserStudyLog;
|
|
import com.zhongzheng.modules.user.domain.UserStudyLog;
|
|
|
import com.zhongzheng.modules.user.domain.UserVisitLog;
|
|
import com.zhongzheng.modules.user.domain.UserVisitLog;
|
|
|
import com.zhongzheng.modules.user.entity.ClientLoginUser;
|
|
import com.zhongzheng.modules.user.entity.ClientLoginUser;
|
|
|
import com.zhongzheng.modules.user.mapper.UserMapper;
|
|
import com.zhongzheng.modules.user.mapper.UserMapper;
|
|
|
import com.zhongzheng.modules.user.service.*;
|
|
import com.zhongzheng.modules.user.service.*;
|
|
|
import com.zhongzheng.modules.user.vo.*;
|
|
import com.zhongzheng.modules.user.vo.*;
|
|
|
|
|
+import org.slf4j.Logger;
|
|
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
+import java.io.File;
|
|
|
|
|
+import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
import java.io.InputStream;
|
|
|
import java.lang.reflect.Field;
|
|
import java.lang.reflect.Field;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
|
+import java.nio.file.Files;
|
|
|
|
|
+import java.nio.file.Path;
|
|
|
|
|
+import java.nio.file.Paths;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
-
|
|
|
|
|
|
|
+import java.util.stream.Stream;
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -78,6 +101,8 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
@Service
|
|
|
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {
|
|
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {
|
|
|
|
|
|
|
|
|
|
+ private static Logger log = LoggerFactory.getLogger(UserServiceImpl.class);
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private CollectCourseMapper collectCourseMapper;
|
|
private CollectCourseMapper collectCourseMapper;
|
|
|
|
|
|
|
@@ -110,19 +135,24 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private RedisCache redisCache;
|
|
private RedisCache redisCache;
|
|
|
-
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ISysTaskService iSysTaskService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ICourseSubjectService iCourseSubjectService;
|
|
private ICourseSubjectService iCourseSubjectService;
|
|
|
-
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IUserCertificateService iUserCertificateService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TokenService tokenService;
|
|
private TokenService tokenService;
|
|
|
-
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IMajorService iMajorService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IUserVisitLogService iUserVisitLogService;
|
|
private IUserVisitLogService iUserVisitLogService;
|
|
|
-
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IUserProfileService iUserProfileService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IUserStudyLogService iUserStudyLogService;
|
|
private IUserStudyLogService iUserStudyLogService;
|
|
|
-
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IExamApplyService iExamApplyService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IUserLoginErrorService iUserLoginErrorService;
|
|
private IUserLoginErrorService iUserLoginErrorService;
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -131,13 +161,18 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
private IGoodsService iGoodsService;
|
|
private IGoodsService iGoodsService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ISysTenantService iSysTenantService;
|
|
private ISysTenantService iSysTenantService;
|
|
|
-
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private OssService ossService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ICourseService iCourseService;
|
|
private ICourseService iCourseService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ICourseSectionService iCourseSectionService;
|
|
private ICourseSectionService iCourseSectionService;
|
|
|
@Value("${liveGotoURL}")
|
|
@Value("${liveGotoURL}")
|
|
|
private String liveGotoURL;
|
|
private String liveGotoURL;
|
|
|
|
|
+ @Value("${oldSys.goods}")
|
|
|
|
|
+ private String OLD_GOODS;
|
|
|
|
|
+ @Value("${record.downloadPath}")
|
|
|
|
|
+ private String RECORD_DOWNLOAD;
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -225,6 +260,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
return list;
|
|
return list;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<UserVo> dangAnList(UserQueryBo bo) {
|
|
|
|
|
+ List<User> list = baseMapper.dangAnList(bo);
|
|
|
|
|
+ return entity2UserVo(list);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public List<UserStatstVo> statsList(UserQueryBo bo) {
|
|
public List<UserStatstVo> statsList(UserQueryBo bo) {
|
|
|
List<UserStatstVo> list = new ArrayList<>();
|
|
List<UserStatstVo> list = new ArrayList<>();
|
|
@@ -693,8 +734,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
if (ObjectUtils.isNotNull(bo.getEduLevel())){
|
|
if (ObjectUtils.isNotNull(bo.getEduLevel())){
|
|
|
inertData.setEduLevel(bo.getEduLevel());
|
|
inertData.setEduLevel(bo.getEduLevel());
|
|
|
}
|
|
}
|
|
|
- if (ObjectUtils.isNotNull(bo.getSex())){
|
|
|
|
|
- inertData.setSex(bo.getSex());
|
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(bo.getSexNum())){
|
|
|
|
|
+ inertData.setSex(bo.getSexNum());
|
|
|
}
|
|
}
|
|
|
if (ObjectUtils.isNotNull(bo.getIdcard())){
|
|
if (ObjectUtils.isNotNull(bo.getIdcard())){
|
|
|
inertData.setIdCard(bo.getIdcard());
|
|
inertData.setIdCard(bo.getIdcard());
|
|
@@ -719,7 +760,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
if(!save(inertData)){
|
|
if(!save(inertData)){
|
|
|
throw new CustomException("注册失败");
|
|
throw new CustomException("注册失败");
|
|
|
}
|
|
}
|
|
|
- iSmsService.sendPwdSms(bo.getTel(),pwd);
|
|
|
|
|
|
|
+// iSmsService.sendPwdSms(bo.getTel(),pwd);
|
|
|
return inertData.getUserId();
|
|
return inertData.getUserId();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -897,7 +938,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
errorList.add(itemImport);
|
|
errorList.add(itemImport);
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- iSmsService.sendPwdSms(itemImport.getTelphone(),pwd);
|
|
|
|
|
|
|
+// iSmsService.sendPwdSms(itemImport.getTelphone(),pwd);
|
|
|
itemImport.setUserId(inertData.getUserId());
|
|
itemImport.setUserId(inertData.getUserId());
|
|
|
itemImport.setImportNo(importNo);
|
|
itemImport.setImportNo(importNo);
|
|
|
itemImport.setStudentCode(inertData.getUserAccount());
|
|
itemImport.setStudentCode(inertData.getUserAccount());
|
|
@@ -910,6 +951,69 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
return resultMap;
|
|
return resultMap;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Long importUser(UserImportAddBo itemImport, String importNo) {
|
|
|
|
|
+ if(Validator.isEmpty(itemImport.getTelphone())||itemImport.getTelphone().length()!=11){
|
|
|
|
|
+ throw new CustomException("手机号不能为空或者格式不对");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(Validator.isEmpty(itemImport.getIdCard())){
|
|
|
|
|
+ throw new CustomException("身份证不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(Validator.isEmpty(itemImport.getRealname())){
|
|
|
|
|
+ throw new CustomException("真实姓名不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ User user = getOne(new LambdaQueryWrapper<User>()
|
|
|
|
|
+ .eq(User::getIdCard,EncryptHandler.encrypt(itemImport.getIdCard())).last("limit 1"));
|
|
|
|
|
+ if(Validator.isNotNull(user)){
|
|
|
|
|
+ return user.getUserId();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ User user2 = getOne(new LambdaQueryWrapper<User>()
|
|
|
|
|
+ .eq(User::getTelphone,EncryptHandler.encrypt(itemImport.getTelphone())).last("limit 1"));
|
|
|
|
|
+ if(Validator.isNotEmpty(user2)){
|
|
|
|
|
+ throw new CustomException(itemImport.getTelphone(),439);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ User inertData = new User();
|
|
|
|
|
+ inertData.setTelphone(itemImport.getTelphone());
|
|
|
|
|
+ //隐藏手机号作为初始昵称
|
|
|
|
|
+ inertData.setNickname(TelPhoneUtils.hideTelPhone(itemImport.getTelphone()));
|
|
|
|
|
+ //雪花算法产生账号ID
|
|
|
|
|
+ SnowflakeIdUtils idWorker = new SnowflakeIdUtils(3, 1);
|
|
|
|
|
+ inertData.setUserAccount(String.valueOf(idWorker.nextId()));
|
|
|
|
|
+ inertData.setSex(1);
|
|
|
|
|
+ if(Validator.isNotEmpty(itemImport.getSex())){
|
|
|
|
|
+ inertData.setSex(itemImport.getSex().equals("女")?2:1);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(Validator.isNotEmpty(itemImport.getEduLevel())){
|
|
|
|
|
+ inertData.setEduLevel(itemImport.getEduLevel());
|
|
|
|
|
+ }
|
|
|
|
|
+ inertData.setIdCard(itemImport.getIdCard());
|
|
|
|
|
+ inertData.setRealname(itemImport.getRealname());
|
|
|
|
|
+ if (StringUtils.isNotBlank(itemImport.getCompanyName())) {
|
|
|
|
|
+ inertData.setCompanyName(itemImport.getCompanyName());
|
|
|
|
|
+ }
|
|
|
|
|
+ inertData.setEduLevel(itemImport.getEduLevel());
|
|
|
|
|
+ inertData.setCompanyName(itemImport.getCompanyName());
|
|
|
|
|
+ inertData.setStatus(1);
|
|
|
|
|
+ inertData.setRegisterPlat("5");
|
|
|
|
|
+ inertData.setAvatar(Constants.DEFAULT_AVATAR);
|
|
|
|
|
+ inertData.setLastLoginIp(IpUtils.getIpAddr(ServletUtils.getRequest()));
|
|
|
|
|
+ inertData.setLastLoginTime(DateUtils.getNowTime());
|
|
|
|
|
+ inertData.setCreateTime(DateUtils.getNowTime());
|
|
|
|
|
+ inertData.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
|
+// 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)){
|
|
|
|
|
+ throw new CustomException("注册失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ return inertData.getUserId();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public Boolean updatePwd(UserAppUpdatePwdBo bo) {
|
|
public Boolean updatePwd(UserAppUpdatePwdBo bo) {
|
|
|
LambdaQueryWrapper<User> queryWrapper =new LambdaQueryWrapper<User>();
|
|
LambdaQueryWrapper<User> queryWrapper =new LambdaQueryWrapper<User>();
|
|
@@ -962,6 +1066,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
if(Validator.isEmpty(bo.getTelphone())){
|
|
if(Validator.isEmpty(bo.getTelphone())){
|
|
|
throw new CustomException("用户手机号码缺失");
|
|
throw new CustomException("用户手机号码缺失");
|
|
|
}
|
|
}
|
|
|
|
|
+ log.info("批量获取用户ID" + JSON.toJSONString(bo));
|
|
|
// if(Validator.isEmpty(bo.getIdCard())){
|
|
// if(Validator.isEmpty(bo.getIdCard())){
|
|
|
// throw new CustomException("用户身份证号码缺失");
|
|
// throw new CustomException("用户身份证号码缺失");
|
|
|
// }
|
|
// }
|
|
@@ -1008,18 +1113,21 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
}
|
|
}
|
|
|
}*/
|
|
}*/
|
|
|
UserSystemRegisterBo registerBo = BeanUtil.toBean(bo, UserSystemRegisterBo.class);
|
|
UserSystemRegisterBo registerBo = BeanUtil.toBean(bo, UserSystemRegisterBo.class);
|
|
|
|
|
+ String tel = "";
|
|
|
if (Validator.isNotEmpty(user1)){
|
|
if (Validator.isNotEmpty(user1)){
|
|
|
//手机号码存在,身份证不一致 (随机生成)
|
|
//手机号码存在,身份证不一致 (随机生成)
|
|
|
- registerBo.setTel(createTel());
|
|
|
|
|
|
|
+ tel = createTel();
|
|
|
|
|
+ registerBo.setTel(tel);
|
|
|
}else {
|
|
}else {
|
|
|
- registerBo.setTel(bo.getTelphone());
|
|
|
|
|
|
|
+ tel = bo.getTelphone();
|
|
|
|
|
+ registerBo.setTel(tel);
|
|
|
}
|
|
}
|
|
|
if(Validator.isNotEmpty(bo.getSex())){
|
|
if(Validator.isNotEmpty(bo.getSex())){
|
|
|
if(bo.getSex().equals("男")){
|
|
if(bo.getSex().equals("男")){
|
|
|
- registerBo.setSex(1);
|
|
|
|
|
|
|
+ registerBo.setSexNum(1);
|
|
|
}
|
|
}
|
|
|
else if(bo.getSex().equals("女")){
|
|
else if(bo.getSex().equals("女")){
|
|
|
- registerBo.setSex(2);
|
|
|
|
|
|
|
+ registerBo.setSexNum(2);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if(Validator.isNotEmpty(bo.getEducation())){
|
|
if(Validator.isNotEmpty(bo.getEducation())){
|
|
@@ -1031,6 +1139,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
if(userId.longValue()>0){
|
|
if(userId.longValue()>0){
|
|
|
UserIdCardBatchVo user = BeanUtil.toBean(bo, UserIdCardBatchVo.class);
|
|
UserIdCardBatchVo user = BeanUtil.toBean(bo, UserIdCardBatchVo.class);
|
|
|
user.setUserId(userId);
|
|
user.setUserId(userId);
|
|
|
|
|
+ user.setTelphone(tel);
|
|
|
list1.add(user);
|
|
list1.add(user);
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
@@ -1611,6 +1720,305 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
return baseMapper.getByCardNoTenant(idCard);
|
|
return baseMapper.getByCardNoTenant(idCard);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Map<String, Object> importSevenUser(List<UserPeriodImportBo> userList) {
|
|
|
|
|
+ if (CollectionUtils.isEmpty(userList)) {
|
|
|
|
|
+ throw new IllegalArgumentException("请勿导入空表格");
|
|
|
|
|
+ }
|
|
|
|
|
+ List<UserPeriodImportBo> errorList = new ArrayList<>();
|
|
|
|
|
+ List<UserPeriodImportBo> successList = new ArrayList<>();
|
|
|
|
|
+ String importNo = ServletUtils.getEncoded("IMPORT");
|
|
|
|
|
+ for (UserPeriodImportBo itemImport : userList) {
|
|
|
|
|
+ if(Validator.isEmpty(itemImport.getUserPhone())||itemImport.getUserPhone().length()!=11){
|
|
|
|
|
+ itemImport.setCause("手机号不能为空或者格式不对");
|
|
|
|
|
+ errorList.add(itemImport);
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(Validator.isEmpty(itemImport.getUserCard())){
|
|
|
|
|
+ itemImport.setCause("身份证不能为空");
|
|
|
|
|
+ errorList.add(itemImport);
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(Validator.isEmpty(itemImport.getUserName())){
|
|
|
|
|
+ itemImport.setCause("真实姓名不能为空");
|
|
|
|
|
+ errorList.add(itemImport);
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ User user = getOne(new LambdaQueryWrapper<User>()
|
|
|
|
|
+ .eq(User::getTelphone,EncryptHandler.encrypt(itemImport.getUserPhone())).last("limit 1"));
|
|
|
|
|
+ if(Validator.isNotNull(user)){
|
|
|
|
|
+ if(Validator.isNotEmpty(user.getIdCard())&&Validator.isNotEmpty(itemImport.getUserCard())&&!itemImport.getUserCard().equals(user.getIdCard())){
|
|
|
|
|
+ throw new CustomException(itemImport.getUserCard()+"身份证号码不一致");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(Validator.isEmpty(user.getIdCard())){
|
|
|
|
|
+ //更新身份证和姓名
|
|
|
|
|
+ user.setIdCard(itemImport.getUserCard());
|
|
|
|
|
+ user.setRealname(itemImport.getUserName());
|
|
|
|
|
+ updateById(user);
|
|
|
|
|
+ }
|
|
|
|
|
+ //手机号已存在
|
|
|
|
|
+ itemImport.setUserId(user.getUserId());
|
|
|
|
|
+ itemImport.setStudentCode(user.getUserAccount());
|
|
|
|
|
+ itemImport.setUserName(user.getRealname());
|
|
|
|
|
+ itemImport.setUserCard(user.getIdCard());
|
|
|
|
|
+ successList.add(itemImport);
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ User user2 = getOne(new LambdaQueryWrapper<User>()
|
|
|
|
|
+ .eq(User::getIdCard,EncryptHandler.encrypt(itemImport.getUserCard())).last("limit 1"));
|
|
|
|
|
+ if(Validator.isNotEmpty(user2)){
|
|
|
|
|
+ throw new CustomException(itemImport.getUserName()+"身份证号码已存在,创建失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ User inertData = new User();
|
|
|
|
|
+ inertData.setTelphone(itemImport.getUserPhone());
|
|
|
|
|
+ //隐藏手机号作为初始昵称
|
|
|
|
|
+ inertData.setNickname(TelPhoneUtils.hideTelPhone(itemImport.getUserPhone()));
|
|
|
|
|
+ //雪花算法产生账号ID
|
|
|
|
|
+ SnowflakeIdUtils idWorker = new SnowflakeIdUtils(3, 1);
|
|
|
|
|
+ inertData.setUserAccount(String.valueOf(idWorker.nextId()));
|
|
|
|
|
+ inertData.setSex(1);
|
|
|
|
|
+ if(Validator.isNotEmpty(itemImport.getSex())){
|
|
|
|
|
+ inertData.setSex(itemImport.getSex().equals("女")?2:1);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(Validator.isNotEmpty(itemImport.getEducation())){
|
|
|
|
|
+ inertData.setEduLevel(itemImport.getEducation());
|
|
|
|
|
+ }
|
|
|
|
|
+ inertData.setIdCard(itemImport.getUserCard());
|
|
|
|
|
+ inertData.setRealname(itemImport.getUserName());
|
|
|
|
|
+ inertData.setStatus(1);
|
|
|
|
|
+ inertData.setRegisterPlat("3");
|
|
|
|
|
+ inertData.setAvatar(Constants.DEFAULT_AVATAR);
|
|
|
|
|
+ inertData.setLastLoginIp(IpUtils.getIpAddr(ServletUtils.getRequest()));
|
|
|
|
|
+ inertData.setLastLoginTime(DateUtils.getNowTime());
|
|
|
|
|
+ inertData.setCreateTime(DateUtils.getNowTime());
|
|
|
|
|
+ inertData.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
|
+ //初始密码(身份证后6位)
|
|
|
|
|
+ String idCard = itemImport.getUserCard();
|
|
|
|
|
+ String pwd = idCard.substring(idCard.length() - 6); // 随机密码
|
|
|
|
|
+ inertData.setPassword(SecurityUtils.encryptPassword(pwd));
|
|
|
|
|
+ inertData.setImportNo(importNo); //设置导入编号 一个导入页面同时导入多次算一个编号
|
|
|
|
|
+ if(!save(inertData)){
|
|
|
|
|
+ itemImport.setCause("注册失败");
|
|
|
|
|
+ errorList.add(itemImport);
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ itemImport.setUserId(inertData.getUserId());
|
|
|
|
|
+ itemImport.setImportNo(importNo);
|
|
|
|
|
+ itemImport.setStudentCode(inertData.getUserAccount());
|
|
|
|
|
+ successList.add(itemImport);
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void userDataImportUp(List<UserDataImportBo> customerBos) {
|
|
|
|
|
+ if (CollectionUtils.isEmpty(customerBos)){
|
|
|
|
|
+ throw new CustomException("上传文件有误!请检查");
|
|
|
|
|
+ }
|
|
|
|
|
+ customerBos.forEach(item -> {
|
|
|
|
|
+ if (StringUtils.isBlank(item.getUserCard())){
|
|
|
|
|
+ throw new CustomException("身份证号码不能为空!");
|
|
|
|
|
+ }
|
|
|
|
|
+ User user = getOne(new LambdaQueryWrapper<User>()
|
|
|
|
|
+ .eq(User::getIdCard, EncryptHandler.encrypt(item.getUserCard()))
|
|
|
|
|
+ .eq(User::getStatus, 1));
|
|
|
|
|
+ if (Objects.isNull(user)){
|
|
|
|
|
+ throw new CustomException("用户获取失败,请检查身份证号码!");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //跟新用户资料
|
|
|
|
|
+ user.setRealname(item.getUserName());
|
|
|
|
|
+ if (ObjectUtils.isNotNull(item.getUserPhone())){
|
|
|
|
|
+ user.setTelphone(item.getUserPhone());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (ObjectUtils.isNotNull(item.getSex())){
|
|
|
|
|
+ user.setSex(StringUtils.isNotBlank(item.getSex()) && item.getSex().equals("男") ? 1:2);
|
|
|
|
|
+ }
|
|
|
|
|
+ user.setEduLevel(item.getEducation());
|
|
|
|
|
+ user.setSchool(item.getSchool());
|
|
|
|
|
+ if (ObjectUtils.isNotNull(item.getGraduationTime())){
|
|
|
|
|
+ user.setGraduationTime(DateUtils.formatDate(item.getGraduationTime(),"yyyy-MM-dd"));
|
|
|
|
|
+ }
|
|
|
|
|
+ user.setMajor(item.getMajor());
|
|
|
|
|
+ user.setWorkYear(item.getWorkYear());
|
|
|
|
|
+ user.setCompanyName(item.getCompany());
|
|
|
|
|
+ user.setUnitContact(item.getCompanyContact());
|
|
|
|
|
+ user.setUnitTel(item.getCompanyPhone());
|
|
|
|
|
+ updateById(user);
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void userDataImgImport(MultipartFile file) {
|
|
|
|
|
+ String zhiyuan = System.getProperty("user.dir");
|
|
|
|
|
+ String path = zhiyuan+"/zhongzheng-admin/src/main/resources/xueyuanzhiliao";
|
|
|
|
|
+ try {
|
|
|
|
|
+ FileUtils.unzipWithStream(file.getInputStream(),path);
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ throw new CustomException("文件解压错误");
|
|
|
|
|
+ }
|
|
|
|
|
+ // 路径
|
|
|
|
|
+ try (Stream<Path> paths = Files.walk(Paths.get(path))){
|
|
|
|
|
+ List<Path> fileNames = paths
|
|
|
|
|
+ .filter(Files::isRegularFile)
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ if (com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(fileNames)){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ for (Path fileName : fileNames) {
|
|
|
|
|
+ Path name = fileName.getFileName();
|
|
|
|
|
+ //身份证号码
|
|
|
|
|
+ List<String> sign = Arrays.stream(name.toString().split("&")).collect(Collectors.toList());
|
|
|
|
|
+ //身份证号
|
|
|
|
|
+ String idCard = sign.get(0);
|
|
|
|
|
+ User user = getOne(new LambdaQueryWrapper<User>()
|
|
|
|
|
+ .eq(User::getIdCard, EncryptHandler.encrypt(idCard)));
|
|
|
|
|
+ if (ObjectUtils.isNull(user)){
|
|
|
|
|
+ throw new CustomException("文件名称有误,请按命名规则修改文件名!");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //上传OSS
|
|
|
|
|
+ File userFile = new File(fileName.toString());
|
|
|
|
|
+ MultipartFile multipartFile = FileUtils.getMultipartFile(userFile);
|
|
|
|
|
+ OssRequest ossRequest = new OssRequest();
|
|
|
|
|
+ ossRequest.setUserId(user.getUserId());
|
|
|
|
|
+ ossRequest.setFile(multipartFile);
|
|
|
|
|
+ ossRequest.setImageStatus(0);
|
|
|
|
|
+ String upload = "";
|
|
|
|
|
+ try {
|
|
|
|
|
+ upload = ossService.upload(ossRequest);
|
|
|
|
|
+ }catch (Exception e) {
|
|
|
|
|
+ throw new CustomException(name+"上传oss失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (name.toString().contains("证件照")){
|
|
|
|
|
+ user.setOneInchPhotos(upload);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (name.toString().contains("身份证正面")){
|
|
|
|
|
+ user.setIdCardImg1(upload);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (name.toString().contains("身份证反面")){
|
|
|
|
|
+ user.setIdCardImg2(upload);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (name.toString().contains("承诺书")){
|
|
|
|
|
+ //专业
|
|
|
|
|
+ String major = sign.get(sign.size() - 1);
|
|
|
|
|
+ List<UserProfile> userProfiles = iExamApplyService.getUserProfiles(idCard, "考前培训施工现场专业人员", major);
|
|
|
|
|
+ for (UserProfile userItem : userProfiles) {
|
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(userItem.getKeyValue());
|
|
|
|
|
+ Map<String, Object> userMap = new HashMap<>();
|
|
|
|
|
+ for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
|
|
|
|
|
+ userMap.put(entry.getKey(), entry.getValue());
|
|
|
|
|
+ }
|
|
|
|
|
+ String key = "commitment_electr_signature";
|
|
|
|
|
+ String fieldName = "承诺书电子签";
|
|
|
|
|
+ JSONObject recentJson = JSONObject.parseObject(userMap.get(key).toString());
|
|
|
|
|
+ Map<String, Object> recentMap = new HashMap<>();
|
|
|
|
|
+ for (Map.Entry<String, Object> entry : recentJson.entrySet()) {
|
|
|
|
|
+ recentMap.put(entry.getKey(), entry.getValue());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (ObjectUtils.isNotNull(recentMap)){
|
|
|
|
|
+ recentMap.put("value",upload);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ recentMap.put("fieldKey",key);
|
|
|
|
|
+ recentMap.put("value",upload);
|
|
|
|
|
+ recentMap.put("fieldName",fieldName);
|
|
|
|
|
+ recentMap.put("status",0);
|
|
|
|
|
+ }
|
|
|
|
|
+ userMap.put(key,recentMap);
|
|
|
|
|
+ String content = JSONObject.toJSONString(userMap);
|
|
|
|
|
+ userItem.setKeyValue(content);
|
|
|
|
|
+ }
|
|
|
|
|
+ iUserProfileService.updateBatchById(userProfiles);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (name.toString().contains("证书")){
|
|
|
|
|
+ //专业
|
|
|
|
|
+ String majorName = sign.get(sign.size() - 1);
|
|
|
|
|
+ Major major = iMajorService.getOne(new LambdaQueryWrapper<Major>()
|
|
|
|
|
+ .eq(Major::getCategoryName, majorName)
|
|
|
|
|
+ .eq(Major::getStatus, 1)
|
|
|
|
|
+ .last("limit 1"));
|
|
|
|
|
+ if (ObjectUtil.isNotNull(major)){
|
|
|
|
|
+ iUserCertificateService.update(new LambdaUpdateWrapper<UserCertificate>()
|
|
|
|
|
+ .set(UserCertificate::getCertificatePath,upload)
|
|
|
|
|
+ .eq(UserCertificate::getUserId,user.getUserId())
|
|
|
|
|
+ .eq(UserCertificate::getMajorId,major.getId()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ updateById(user);
|
|
|
|
|
+ }
|
|
|
|
|
+ //删除本地文件
|
|
|
|
|
+ FileUtils.deleteFilePackage(path);
|
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ throw new CustomException("学员资料有误");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void userDataDownload(UserDownloadBo bo) {
|
|
|
|
|
+ if (CollectionUtils.isEmpty(bo.getUserIds())){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ //创建学员资料下载
|
|
|
|
|
+ SysTask task = new SysTask();
|
|
|
|
|
+ task.setTaskName(String.format("学员资料下载:操作人ID(%s),时间:%s",bo.getCreateSysUserId(),DateUtils.getTime()));
|
|
|
|
|
+ String code = ServletUtils.getEncoded("DA");
|
|
|
|
|
+ bo.setTaskCode(code);
|
|
|
|
|
+ task.setTaskCode(code);
|
|
|
|
|
+ task.setTaskNum(1);
|
|
|
|
|
+ task.setFinishNum(0);
|
|
|
|
|
+ task.setTaskStatus(1);
|
|
|
|
|
+ task.setTaskType(2);
|
|
|
|
|
+ task.setTaskParam(JSONObject.toJSONString(bo));
|
|
|
|
|
+ task.setSysUserId(bo.getCreateSysUserId());
|
|
|
|
|
+ task.setStatus(1);
|
|
|
|
|
+ task.setCreateTime(DateUtils.getNowTime());
|
|
|
|
|
+ task.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
|
+ iSysTaskService.save(task);
|
|
|
|
|
+ //发送下载请求
|
|
|
|
|
+ String tenantId = ServletUtils.getRequest().getHeader("TenantId");
|
|
|
|
|
+ HashMap<String, String> map = new HashMap<>();
|
|
|
|
|
+ map.put("TenantId", tenantId);
|
|
|
|
|
+ HttpUtils.sendPostJsonHeader(RECORD_DOWNLOAD, JSONObject.toJSONString(bo),map);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<UserDownloadVo> userDataDownloadList(Long userId) {
|
|
|
|
|
+ List<SysTask> list = iSysTaskService.list(new LambdaQueryWrapper<SysTask>()
|
|
|
|
|
+ .eq(SysTask::getSysUserId, userId)
|
|
|
|
|
+ .eq(SysTask::getStatus, 1)
|
|
|
|
|
+ .eq(SysTask::getTaskType, 2)
|
|
|
|
|
+ .orderByDesc(SysTask::getCreateTime));
|
|
|
|
|
+ if (CollectionUtils.isEmpty(list)){
|
|
|
|
|
+ return new ArrayList<>();
|
|
|
|
|
+ }
|
|
|
|
|
+ List<UserDownloadVo> collect = list.stream().map(item -> {
|
|
|
|
|
+ UserDownloadVo vo = new UserDownloadVo();
|
|
|
|
|
+ vo.setId(item.getId());
|
|
|
|
|
+ vo.setTaskCode(item.getTaskCode());
|
|
|
|
|
+ vo.setTaskStatus(item.getTaskStatus());
|
|
|
|
|
+ vo.setCreateSysUserId(item.getSysUserId());
|
|
|
|
|
+ vo.setTaskPath(item.getTaskPath());
|
|
|
|
|
+ vo.setTaskTime(item.getCreateTime());
|
|
|
|
|
+ return vo;
|
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
|
+ return collect;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void userDataDownloadUp(UserDataDownloadUpBo bo) {
|
|
|
|
|
+ SysTask task = iSysTaskService.getOne(new LambdaQueryWrapper<SysTask>()
|
|
|
|
|
+ .eq(SysTask::getTaskCode, bo.getTaskCode())
|
|
|
|
|
+ .eq(SysTask::getSysUserId, bo.getCreateSysUserId()));
|
|
|
|
|
+ if (ObjectUtils.isNull(task)){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ task.setTaskStatus(4);//已下载
|
|
|
|
|
+ iSysTaskService.updateById(task);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Map<String, Object> accountLogin(UserAppAccountLoginBo bo) {
|
|
public Map<String, Object> accountLogin(UserAppAccountLoginBo bo) {
|
|
@@ -1636,13 +2044,29 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
.or()
|
|
.or()
|
|
|
.eq(User::getIdCard,EncryptHandler.encrypt(bo.getAccount())));
|
|
.eq(User::getIdCard,EncryptHandler.encrypt(bo.getAccount())));
|
|
|
User user = getOne(queryWrapper);
|
|
User user = getOne(queryWrapper);
|
|
|
|
|
+ String tenantId = ServletUtils.getRequest().getHeader("TenantId");
|
|
|
|
|
+ Integer share = 0;
|
|
|
|
|
+ if (StringUtils.isNotBlank(tenantId) && "867735392558919680".equals(tenantId)){
|
|
|
|
|
+ share = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if(Validator.isEmpty(user)){
|
|
if(Validator.isEmpty(user)){
|
|
|
iUserLoginErrorService.saveErrorLog(bo.getAccount());
|
|
iUserLoginErrorService.saveErrorLog(bo.getAccount());
|
|
|
- throw new CustomException("登录信息错误");
|
|
|
|
|
|
|
+ //判断旧系统是否有账号
|
|
|
|
|
+ if (share > 0){
|
|
|
|
|
+ oldAccountLogin(bo,1);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ throw new CustomException("登录信息错误");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
|
|
else if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
|
|
|
{
|
|
{
|
|
|
- throw new BaseException("对不起,您的账号:已停用");
|
|
|
|
|
|
|
+ //判断旧系统是否有账号
|
|
|
|
|
+ if (share > 0){
|
|
|
|
|
+ oldAccountLogin(bo,1);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ throw new CustomException("对不起,您的账号:已停用");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
String password = null;
|
|
String password = null;
|
|
|
if(bo.getPwd().length()>20){
|
|
if(bo.getPwd().length()>20){
|
|
@@ -1661,7 +2085,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
if (!SecurityUtils.matchesPassword(password,user.getPassword()))
|
|
if (!SecurityUtils.matchesPassword(password,user.getPassword()))
|
|
|
{
|
|
{
|
|
|
iUserLoginErrorService.saveErrorLog(bo.getAccount());
|
|
iUserLoginErrorService.saveErrorLog(bo.getAccount());
|
|
|
- throw new BaseException("登录信息错误");
|
|
|
|
|
|
|
+ //判断旧系统是否有账号
|
|
|
|
|
+ if (share > 0){
|
|
|
|
|
+ oldAccountLogin(bo,1);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ throw new CustomException("登录信息错误");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
//如果活动分销码变动
|
|
//如果活动分销码变动
|
|
|
if (StringUtils.isNotBlank(bo.getShareActivityCode())){
|
|
if (StringUtils.isNotBlank(bo.getShareActivityCode())){
|
|
@@ -1677,6 +2106,58 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
return map;
|
|
return map;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void oldAccountLogin(UserAppAccountLoginBo bo,Integer type) {
|
|
|
|
|
+ String msg = type == 1?"登录信息错误":"对不起,您的账号:已停用";
|
|
|
|
|
+ Boolean codeFlag = true;
|
|
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
|
|
+ Long nowTime = DateUtils.getNowTime();
|
|
|
|
|
+ String sign = ToolsUtils.EncoderByMd5(bo.getAccount()+bo.getAccount()+nowTime + "pubilc2022");
|
|
|
|
|
+ params.put("stamp", nowTime.toString());
|
|
|
|
|
+ params.put("sign", sign);
|
|
|
|
|
+ params.put("idNum", bo.getAccount());
|
|
|
|
|
+ params.put("passwordSign", "1");
|
|
|
|
|
+ params.put("telphone",bo.getAccount());
|
|
|
|
|
+ String password = null;
|
|
|
|
|
+ if(bo.getPwd().length()>20){
|
|
|
|
|
+ String rsaPrivate = null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ InputStream certStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("config/pri.key");
|
|
|
|
|
+ rsaPrivate = AES.getStringByInputStream_1(certStream);
|
|
|
|
|
+ certStream.close();
|
|
|
|
|
+ password = AES.decrypt(bo.getPwd(),rsaPrivate);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ password = bo.getPwd();
|
|
|
|
|
+ }
|
|
|
|
|
+ params.put("password", password);
|
|
|
|
|
+ String respone = "";
|
|
|
|
|
+ try {
|
|
|
|
|
+ respone = HttpUtils.postFormBody(OLD_GOODS, params);
|
|
|
|
|
+ if (!respone.contains("\"code\":200")) {
|
|
|
|
|
+ codeFlag = false;
|
|
|
|
|
+ throw new CustomException("登录信息错误");
|
|
|
|
|
+ }
|
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(respone);
|
|
|
|
|
+ Object data = jsonObject.get("data");
|
|
|
|
|
+ if (ObjectUtils.isNotNull(data)){
|
|
|
|
|
+ UserNewGoodsVo vo = JSONObject.parseObject(JSONObject.toJSONString(data), UserNewGoodsVo.class);
|
|
|
|
|
+ throw new CustomException(vo.getPcUrl());
|
|
|
|
|
+ }else {
|
|
|
|
|
+ codeFlag = false;
|
|
|
|
|
+ throw new CustomException(msg);
|
|
|
|
|
+ }
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ if (codeFlag){
|
|
|
|
|
+ throw new CustomException(e.getMessage(),699);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ throw new CustomException(e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public Boolean bindIdCard(UserAppBindIdBo bo) {
|
|
public Boolean bindIdCard(UserAppBindIdBo bo) {
|
|
|
if(Validator.isEmpty(bo.getIdCard())){
|
|
if(Validator.isEmpty(bo.getIdCard())){
|