修改时 员工账户不可重复
This commit is contained in:
@@ -145,6 +145,11 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
|
||||
}
|
||||
TbPlussShopStaff tbPlussShopStaff = tbPlussShopStaffRepository.findById(resources.getId()).orElseGet(TbPlussShopStaff::new);
|
||||
User sysUser = userRepository.findByUsername(tbPlussShopStaff.getAccount());
|
||||
if(tbPlussShopStaff.getAccount().equals(resources.getAccount())){
|
||||
if (userRepository.findByUsername(resources.getAccount()) != null) {
|
||||
throw new BadRequestException("员工账号不可重复");
|
||||
}
|
||||
}
|
||||
resources.setUpdatedAt(Instant.now().toEpochMilli());
|
||||
ValidationUtil.isNull( tbPlussShopStaff.getId(),"TbPlussShopStaff","id",resources.getId());
|
||||
tbPlussShopStaff.copy(resources);
|
||||
|
||||
Reference in New Issue
Block a user