账户校验

This commit is contained in:
2024-07-26 14:32:39 +08:00
parent aee7e1fa0f
commit 0d81d6ea5a

View File

@@ -16,6 +16,7 @@
package cn.ysk.cashier.service.impl.shopimpl;
import cn.ysk.cashier.exception.BadRequestException;
import cn.ysk.cashier.exception.EntityExistException;
import cn.ysk.cashier.pojo.shop.TbPlussShopStaff;
import cn.ysk.cashier.system.domain.Dept;
import cn.ysk.cashier.system.domain.Job;
@@ -129,6 +130,9 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
job.setId(10L);
jobs.add(job);
user.setJobs(jobs);
if (userRepository.findByUsername(user.getUsername()) != null) {
throw new EntityExistException(User.class, "username", user.getUsername());
}
userRepository.save(user);
return tbPlussShopStaffMapper.toDto(tbPlussShopStaffRepository.save(resources));
}