Merge branch 'master' into fencang

fencang
anthonyywj2 3 years ago
commit 664b4c47e3

@ -1,5 +1,6 @@
package com.glxp.sale.admin.controller.auth; package com.glxp.sale.admin.controller.auth;
import cn.hutool.core.util.ReUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
@ -106,8 +107,9 @@ public class RegisterController {
if (!customerContactEntity.getMobile().equals(checkCodeRequest.getPhoneNum())) { if (!customerContactEntity.getMobile().equals(checkCodeRequest.getPhoneNum())) {
return ResultVOUtils.error(500, "手机号与注册时不一致"); return ResultVOUtils.error(500, "手机号与注册时不一致");
} }
} else } else {
return ResultVOUtils.error(500, "手机号与注册时不一致"); return ResultVOUtils.error(500, "手机号与注册时不一致");
}
} }
} }
@ -132,8 +134,9 @@ public class RegisterController {
//验证码存入redis中 //验证码存入redis中
redisUtil.set(Constant.CAPTCHAS + checkCodeRequest.getPhoneNum(), json, 300L); redisUtil.set(Constant.CAPTCHAS + checkCodeRequest.getPhoneNum(), json, 300L);
return ResultVOUtils.success("发送成功" + " " + mobile_code); return ResultVOUtils.success("发送成功" + " " + mobile_code);
} else } else {
return ResultVOUtils.error(500, "验证码发送失败"); return ResultVOUtils.error(500, "验证码发送失败");
}
} }
@ -222,13 +225,21 @@ public class RegisterController {
if (isExitPhone) { if (isExitPhone) {
return ResultVOUtils.error(500, "该手机号已被注册"); 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"); String company_check = systemParamConfigService.selectValueByParamKey("register_company_check");
if (StrUtil.isNotBlank(company_check) && company_check.equals("1")) { if (StrUtil.isNotBlank(company_check) && company_check.equals("1")) {
//新用户注册时根据往来单位字典进行企业名称校验 //新用户注册时根据往来单位字典进行企业名称校验
CustomerInfoEntity customerInfoEntity = customerInfoService.selectById(Long.parseLong(userRegisterEntity.getCompanyId())); CustomerInfoEntity customerInfoEntity = customerInfoService.selectById(Long.parseLong(userRegisterEntity.getCompanyId()));
if (customerInfoEntity != null) if (customerInfoEntity != null) {
return ResultVOUtils.error(500, "该企业已被注册!"); return ResultVOUtils.error(500, "该企业已被注册!");
}
} }
userRegisterEntity.setRegisterTime(DateUtil.getDateTime()); userRegisterEntity.setRegisterTime(DateUtil.getDateTime());
@ -292,10 +303,6 @@ public class RegisterController {
return ResultVOUtils.error(500, "手机号与该用户不匹配"); return ResultVOUtils.error(500, "手机号与该用户不匹配");
} }
// if (!b) {
// return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
// }
return ResultVOUtils.success("密码修改成功"); return ResultVOUtils.success("密码修改成功");
} }
@ -309,7 +316,14 @@ public class RegisterController {
} }
long userId = generateUserId(); long userId = generateUserId();
UserRegisterEntity userRegisterEntity = userRegisterService.selectById(registerCheckRequest.getId()); 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.setCheckType(registerCheckRequest.getCheckType());
userRegisterEntity.setCheckTime(DateUtil.getDateTime()); userRegisterEntity.setCheckTime(DateUtil.getDateTime());
userRegisterEntity.setUserId(userId + ""); userRegisterEntity.setUserId(userId + "");

@ -11,9 +11,6 @@
<if test="companyName != null and '' !=companyName"> <if test="companyName != null and '' !=companyName">
AND companyName like concat(#{companyName},'%') AND companyName like concat(#{companyName},'%')
</if> </if>
</where>
<where>
<if test="checkType != null and ''!=checkType"> <if test="checkType != null and ''!=checkType">
AND checkType = #{checkType} AND checkType = #{checkType}
</if> </if>

@ -164,6 +164,7 @@
UPDATE io_codes UPDATE io_codes
<trim prefix="set" suffixOverrides=","> <trim prefix="set" suffixOverrides=",">
<if test="relId != null">relId=#{relId},</if> <if test="relId != null">relId=#{relId},</if>
<if test="serialNo != null">`serialNo`=#{serialNo},</if>
<if test="fromCorp != null">fromCorp=#{fromCorp},</if> <if test="fromCorp != null">fromCorp=#{fromCorp},</if>
<if test="fromCorpId != null">fromCorpId=#{fromCorpId},</if> <if test="fromCorpId != null">fromCorpId=#{fromCorpId},</if>
<if test="count != null">`count`=#{count},</if> <if test="count != null">`count`=#{count},</if>

@ -145,6 +145,7 @@
<if test="produceDate != null">`produceDate`=#{produceDate},</if> <if test="produceDate != null">`produceDate`=#{produceDate},</if>
<if test="expireDate != null">`expireDate`=#{expireDate},</if> <if test="expireDate != null">`expireDate`=#{expireDate},</if>
<if test="batchNo != null">`batchNo`=#{batchNo},</if> <if test="batchNo != null">`batchNo`=#{batchNo},</if>
<if test="serialNo != null">`serialNo`=#{serialNo},</if>
<if test="relId != null">`relId`=#{relId},</if> <if test="relId != null">`relId`=#{relId},</if>
<if test="serialNo != null">`serialNo`=#{serialNo},</if> <if test="serialNo != null">`serialNo`=#{serialNo},</if>
</set> </set>
@ -161,6 +162,7 @@
<if test="fromCorp != null">`fromCorp`=#{fromCorp},</if> <if test="fromCorp != null">`fromCorp`=#{fromCorp},</if>
<if test="locStorageCode != null">`locStorageCode`=#{locStorageCode},</if> <if test="locStorageCode != null">`locStorageCode`=#{locStorageCode},</if>
<if test="supId != null">`supId`=#{supId},</if> <if test="supId != null">`supId`=#{supId},</if>
<if test="serialNo != null">`serialNo`=#{serialNo},</if>
<if test="relId != null">`relId`=#{relId},</if> <if test="relId != null">`relId`=#{relId},</if>
<if test="serialNo != null">`serialNo`=#{serialNo},</if> <if test="serialNo != null">`serialNo`=#{serialNo},</if>
</set> </set>

Loading…
Cancel
Save