|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.glxp.sale.admin.controller.auth;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ReUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
@ -106,8 +107,9 @@ public class RegisterController {
|
|
|
|
|
if (!customerContactEntity.getMobile().equals(checkCodeRequest.getPhoneNum())) {
|
|
|
|
|
return ResultVOUtils.error(500, "手机号与注册时不一致");
|
|
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(500, "手机号与注册时不一致");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -132,8 +134,9 @@ public class RegisterController {
|
|
|
|
|
//验证码存入redis中
|
|
|
|
|
redisUtil.set(Constant.CAPTCHAS + checkCodeRequest.getPhoneNum(), json, 300L);
|
|
|
|
|
return ResultVOUtils.success("发送成功" + " " + mobile_code);
|
|
|
|
|
} else
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(500, "验证码发送失败");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -222,13 +225,21 @@ public class RegisterController {
|
|
|
|
|
if (isExitPhone) {
|
|
|
|
|
return ResultVOUtils.error(500, "该手机号已被注册");
|
|
|
|
|
}
|
|
|
|
|
//校验邮箱是否正确
|
|
|
|
|
if (StrUtil.isNotBlank(userRegisterEntity.getEmail())) {
|
|
|
|
|
boolean match = ReUtil.isMatch("^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$", userRegisterEntity.getEmail());
|
|
|
|
|
if (!match) {
|
|
|
|
|
return ResultVOUtils.error(500, "邮箱格式错误");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String company_check = systemParamConfigService.selectValueByParamKey("register_company_check");
|
|
|
|
|
if (StrUtil.isNotBlank(company_check) && company_check.equals("1")) {
|
|
|
|
|
//新用户注册时根据往来单位字典进行企业名称校验
|
|
|
|
|
CustomerInfoEntity customerInfoEntity = customerInfoService.selectById(Long.parseLong(userRegisterEntity.getCompanyId()));
|
|
|
|
|
if (customerInfoEntity != null)
|
|
|
|
|
if (customerInfoEntity != null) {
|
|
|
|
|
return ResultVOUtils.error(500, "该企业已被注册!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
userRegisterEntity.setRegisterTime(DateUtil.getDateTime());
|
|
|
|
@ -292,10 +303,6 @@ public class RegisterController {
|
|
|
|
|
return ResultVOUtils.error(500, "手机号与该用户不匹配");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (!b) {
|
|
|
|
|
// return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
|
|
|
|
// }
|
|
|
|
|
return ResultVOUtils.success("密码修改成功");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -309,7 +316,14 @@ public class RegisterController {
|
|
|
|
|
}
|
|
|
|
|
long userId = generateUserId();
|
|
|
|
|
UserRegisterEntity userRegisterEntity = userRegisterService.selectById(registerCheckRequest.getId());
|
|
|
|
|
userId = Long.parseLong(userRegisterEntity.getCompanyId());
|
|
|
|
|
if (StrUtil.isBlank(userRegisterEntity.getCompanyId()) && StrUtil.isNotBlank(registerCheckRequest.getCompanyName())) {
|
|
|
|
|
//系统参数设置了 新用户注册时是否根据往来单位字典进行企业名称校验 不校验
|
|
|
|
|
//根据公司名称查询往来单位信息
|
|
|
|
|
BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByName(registerCheckRequest.getCompanyName());
|
|
|
|
|
userId = Long.parseLong(basicUnitMaintainEntity.getErpId());
|
|
|
|
|
} else {
|
|
|
|
|
userId = Long.parseLong(userRegisterEntity.getCompanyId());
|
|
|
|
|
}
|
|
|
|
|
userRegisterEntity.setCheckType(registerCheckRequest.getCheckType());
|
|
|
|
|
userRegisterEntity.setCheckTime(DateUtil.getDateTime());
|
|
|
|
|
userRegisterEntity.setUserId(userId + "");
|
|
|
|
|