Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -270,6 +270,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUserEntity
|
|||||||
if (user.getMobile().equals(param.getMobile())) {
|
if (user.getMobile().equals(param.getMobile())) {
|
||||||
throw new RuntimeException("新旧手机号不能相同~");
|
throw new RuntimeException("新旧手机号不能相同~");
|
||||||
}
|
}
|
||||||
this.update(Wrappers.lambdaUpdate(SysUserEntity.class).eq(SysUserEntity::getUserId, param.getUserId()).set(SysUserEntity::getMobile, param.getMobile()));
|
// 查询是否已有相同手机号
|
||||||
|
long count = this.count(Wrappers.lambdaQuery(SysUserEntity.class).eq(SysUserEntity::getMobile, param.getMobile()).ne(SysUserEntity::getUserId, param.getUserId()));
|
||||||
|
if (count > 0) {
|
||||||
|
throw new RuntimeException("系统中已有该手机号,无法录入~");
|
||||||
|
}
|
||||||
|
this.update(Wrappers.lambdaUpdate(SysUserEntity.class).eq(SysUserEntity::getUserId, param.getUserId()).set(SysUserEntity::getUserCode, param.getMobile()).set(SysUserEntity::getMobile, param.getMobile()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.starry.common.utils;
|
package com.starry.common.utils;
|
||||||
|
|
||||||
import java.util.UUID;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author admin
|
* @author admin
|
||||||
@@ -10,11 +10,11 @@ public class IdUtils {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成16位的UUID
|
* 生成8位的UUID
|
||||||
*
|
*
|
||||||
* @return UUID
|
* @return UUID
|
||||||
*/
|
*/
|
||||||
public static String getUuid() {
|
public static String getUuid() {
|
||||||
return UUID.randomUUID().toString().replaceAll("-", "").substring(0, 12);
|
return RandomUtil.randomString(8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user