员工账号重复校验

This commit is contained in:
GYJ 2024-11-22 10:10:52 +08:00
parent d7ba8509d5
commit 33b0c2bb10
1 changed files with 3 additions and 1 deletions

View File

@ -153,7 +153,9 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
resources.setPassword(null);
}
checkStaffParams(resources);
if (pattern.matcher(resources.getCode()).find()) {
throw new BadRequestException("员工编号不能包含中文");
}
TbPlussShopStaff tbPlussShopStaff = tbPlussShopStaffRepository.findById(resources.getId()).orElseGet(TbPlussShopStaff::new);
User sysUser = userRepository.findByUsername(resources.getShopId()+"@"+tbPlussShopStaff.getAccount());