|
|
@ -26,6 +26,7 @@ import javax.imageio.ImageIO; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import java.awt.image.BufferedImage; |
|
|
|
import java.awt.image.BufferedImage; |
|
|
|
import java.io.*; |
|
|
|
import java.io.*; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.UUID; |
|
|
|
import java.util.UUID; |
|
|
|
|
|
|
|
|
|
|
@ -75,6 +76,13 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements |
|
|
|
&& employeeAndUserVO.getPrimaryCode() != null |
|
|
|
&& employeeAndUserVO.getPrimaryCode() != null |
|
|
|
&& employeeAndUserVO.getPrimaryCode().length() != 0) { |
|
|
|
&& employeeAndUserVO.getPrimaryCode().length() != 0) { |
|
|
|
// 没有绑定手机号,现在绑定
|
|
|
|
// 没有绑定手机号,现在绑定
|
|
|
|
|
|
|
|
List<String> phoneAccounts = this.getBaseMapper().listPhoneAccount(); |
|
|
|
|
|
|
|
for (String pAccount : phoneAccounts) { |
|
|
|
|
|
|
|
// 判断该手机号是否已经绑定过了
|
|
|
|
|
|
|
|
if (employeeAndUserVO.getPrimaryPhone().equals(pAccount)) { |
|
|
|
|
|
|
|
ExceptionCast.cast(HrmsCode.USER_PHONE_ACCOUNT_REPETITION); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
String code = RedisUtil.get(employeeAndUserVO.getPrimaryPhone()); |
|
|
|
String code = RedisUtil.get(employeeAndUserVO.getPrimaryPhone()); |
|
|
|
if (code == null || code.length() == 0 || !Objects.equals(employeeAndUserVO.getPrimaryCode(), code)) { |
|
|
|
if (code == null || code.length() == 0 || !Objects.equals(employeeAndUserVO.getPrimaryCode(), code)) { |
|
|
|
ExceptionCast.cast(HrmsCode.USER_PHONE_CODE_MISTAKE); |
|
|
|
ExceptionCast.cast(HrmsCode.USER_PHONE_CODE_MISTAKE); |
|
|
@ -101,6 +109,13 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements |
|
|
|
ExceptionCast.cast(HrmsCode.USER_PRIMARY_CODE_MISTAKE); |
|
|
|
ExceptionCast.cast(HrmsCode.USER_PRIMARY_CODE_MISTAKE); |
|
|
|
} |
|
|
|
} |
|
|
|
RedisUtil.del(employeeAndUserVO.getPrimaryPhone()); |
|
|
|
RedisUtil.del(employeeAndUserVO.getPrimaryPhone()); |
|
|
|
|
|
|
|
// 判断更换的手机号是否已绑定过用户
|
|
|
|
|
|
|
|
List<String> phoneAccounts = this.getBaseMapper().listPhoneAccount(); |
|
|
|
|
|
|
|
for (String pAccount : phoneAccounts) { |
|
|
|
|
|
|
|
if (employeeAndUserVO.getNewPhone().equals(pAccount)) { |
|
|
|
|
|
|
|
ExceptionCast.cast(HrmsCode.USER_PHONE_ACCOUNT_REPETITION); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
String newCode = RedisUtil.get(employeeAndUserVO.getNewPhone()); |
|
|
|
String newCode = RedisUtil.get(employeeAndUserVO.getNewPhone()); |
|
|
|
if (newCode == null || newCode.length() == 0 |
|
|
|
if (newCode == null || newCode.length() == 0 |
|
|
|
|| !Objects.equals(newCode, employeeAndUserVO.getNewCode())) { |
|
|
|
|| !Objects.equals(newCode, employeeAndUserVO.getNewCode())) { |
|
|
@ -204,6 +219,13 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements |
|
|
|
if (phone == null || phone.length() == 0 || code == null || code.length() == 0) { |
|
|
|
if (phone == null || phone.length() == 0 || code == null || code.length() == 0) { |
|
|
|
ExceptionCast.cast(HrmsCode.USER_PHONE_OR_CODE_NOT_NULL); |
|
|
|
ExceptionCast.cast(HrmsCode.USER_PHONE_OR_CODE_NOT_NULL); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 判断当前手机号是否已绑定用户
|
|
|
|
|
|
|
|
List<String> phoneAccounts = this.getBaseMapper().listPhoneAccount(); |
|
|
|
|
|
|
|
for (String phoneAccount : phoneAccounts) { |
|
|
|
|
|
|
|
if (phone.equals(phoneAccount)) { |
|
|
|
|
|
|
|
ExceptionCast.cast(HrmsCode.USER_PHONE_ACCOUNT_REPETITION); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (RedisUtil.get(phone) == null || RedisUtil.get(phone).length() == 0 |
|
|
|
if (RedisUtil.get(phone) == null || RedisUtil.get(phone).length() == 0 |
|
|
|
|| !Objects.equals(code, RedisUtil.get(phone))) { |
|
|
|
|| !Objects.equals(code, RedisUtil.get(phone))) { |
|
|
|
ExceptionCast.cast(HrmsCode.USER_BINDING_FAIL); |
|
|
|
ExceptionCast.cast(HrmsCode.USER_BINDING_FAIL); |
|
|
|