|
@@ -25,6 +25,7 @@ import com.zhongzheng.common.exception.BaseException;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.type.EncryptHandler;
|
|
|
import com.zhongzheng.common.utils.*;
|
|
|
+import com.zhongzheng.common.utils.http.HttpUtils;
|
|
|
import com.zhongzheng.common.utils.ip.IpUtils;
|
|
|
import com.zhongzheng.modules.alisms.service.IAliSmsService;
|
|
|
import com.zhongzheng.modules.collect.domain.CollectBank;
|
|
@@ -41,6 +42,7 @@ import com.zhongzheng.modules.course.service.ICourseService;
|
|
|
import com.zhongzheng.modules.course.service.ICourseSubjectService;
|
|
|
import com.zhongzheng.modules.goods.domain.Goods;
|
|
|
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.service.IClassGradeUserService;
|
|
|
import com.zhongzheng.modules.grade.service.impl.ClassGradeServiceImpl;
|
|
@@ -144,6 +146,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
private ICourseSectionService iCourseSectionService;
|
|
|
@Value("${liveGotoURL}")
|
|
|
private String liveGotoURL;
|
|
|
+ @Value("${oldSys.goods}")
|
|
|
+ private String OLD_GOODS;
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -725,7 +729,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
if(!save(inertData)){
|
|
|
throw new CustomException("注册失败");
|
|
|
}
|
|
|
- iSmsService.sendPwdSms(bo.getTel(),pwd);
|
|
|
+// iSmsService.sendPwdSms(bo.getTel(),pwd);
|
|
|
return inertData.getUserId();
|
|
|
}
|
|
|
|
|
@@ -1015,11 +1019,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
}
|
|
|
}*/
|
|
|
UserSystemRegisterBo registerBo = BeanUtil.toBean(bo, UserSystemRegisterBo.class);
|
|
|
+ String tel = "";
|
|
|
if (Validator.isNotEmpty(user1)){
|
|
|
//手机号码存在,身份证不一致 (随机生成)
|
|
|
- registerBo.setTel(createTel());
|
|
|
+ tel = createTel();
|
|
|
+ registerBo.setTel(tel);
|
|
|
}else {
|
|
|
- registerBo.setTel(bo.getTelphone());
|
|
|
+ tel = bo.getTelphone();
|
|
|
+ registerBo.setTel(tel);
|
|
|
}
|
|
|
if(Validator.isNotEmpty(bo.getSex())){
|
|
|
if(bo.getSex().equals("男")){
|
|
@@ -1038,6 +1045,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
if(userId.longValue()>0){
|
|
|
UserIdCardBatchVo user = BeanUtil.toBean(bo, UserIdCardBatchVo.class);
|
|
|
user.setUserId(userId);
|
|
|
+ user.setTelphone(tel);
|
|
|
list1.add(user);
|
|
|
continue;
|
|
|
}
|
|
@@ -1645,11 +1653,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
User user = getOne(queryWrapper);
|
|
|
if(Validator.isEmpty(user)){
|
|
|
iUserLoginErrorService.saveErrorLog(bo.getAccount());
|
|
|
- throw new CustomException("登录信息错误");
|
|
|
+ //判断旧系统是否有账号
|
|
|
+ oldAccountLogin(bo,1);
|
|
|
}
|
|
|
else if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
|
|
|
{
|
|
|
- throw new BaseException("对不起,您的账号:已停用");
|
|
|
+ //判断旧系统是否有账号
|
|
|
+ oldAccountLogin(bo,1);
|
|
|
}
|
|
|
String password = null;
|
|
|
if(bo.getPwd().length()>20){
|
|
@@ -1684,6 +1694,58 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
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
|
|
|
public Boolean bindIdCard(UserAppBindIdBo bo) {
|
|
|
if(Validator.isEmpty(bo.getIdCard())){
|