去掉重复校验

This commit is contained in:
黎润豪 2026-04-08 17:24:04 +08:00
parent 4d1cfa397c
commit 209eb48bb7
1 changed files with 11 additions and 11 deletions

View File

@ -162,17 +162,17 @@ public class TUsersappController {
String mobileAbstr = DigestUtils.md5DigestAsHex(mobile.getBytes(StandardCharsets.UTF_8)); String mobileAbstr = DigestUtils.md5DigestAsHex(mobile.getBytes(StandardCharsets.UTF_8));
// 查询是否存在相同的身份证号或手机号(排除当前用户) // 查询是否存在相同的身份证号或手机号(排除当前用户)
LambdaQueryWrapper<UserSupInfo> wrapper = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<UserSupInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.and(w -> w // wrapper.and(w -> w
.eq(UserSupInfo::getIdcardAbstr, identityNoAbstr) // .eq(UserSupInfo::getIdcardAbstr, identityNoAbstr)
.or() // .or()
.eq(UserSupInfo::getMobileAbstr, mobileAbstr) // .eq(UserSupInfo::getMobileAbstr, mobileAbstr)
).ne(UserSupInfo::getUserid, userId); // ).ne(UserSupInfo::getUserid, userId);
//
long count = userSupInfoService.count(wrapper); // long count = userSupInfoService.count(wrapper);
if (count > 0) { // if (count > 0) {
throw new BusinessException("身份证号或手机号已被其他用户占用"); // throw new BusinessException("身份证号或手机号已被其他用户占用");
} // }
// 使用SM4加密后存储到数据库 // 使用SM4加密后存储到数据库
String identityNoEnc = SM4Utils.encrypt(identityNo, sm4Key); String identityNoEnc = SM4Utils.encrypt(identityNo, sm4Key);