Merge remote-tracking branch 'origin/dev' into zs

This commit is contained in:
2024-08-02 09:12:28 +08:00
8 changed files with 28 additions and 16 deletions

View File

@@ -374,6 +374,8 @@ public class TbProductServiceImpl implements TbProductService {
}
}
// 默认开启共享库存和库存
// product.setIsDistribute(1);
TbProduct save = tbProductRepository.save(product);
if (save.getId() == null) {
throw new BadRequestException("添加商品失败");

View File

@@ -84,7 +84,7 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
TbPlussShopStaff tbPlussShopStaff = tbPlussShopStaffRepository.findById(id).orElseGet(TbPlussShopStaff::new);
ValidationUtil.isNull(tbPlussShopStaff.getId(),"TbPlussShopStaff","id",id);
TbPlussShopStaffDto dto = tbPlussShopStaffMapper.toDto(tbPlussShopStaff);
UserDto userDto = userService.findByName(tbPlussShopStaff.getAccount());
UserDto userDto = userService.findByName(tbPlussShopStaff.getShopId()+"@"+tbPlussShopStaff.getAccount());
// dto.setUser(userDto);
if(!CollectionUtils.isEmpty(userDto.getRoles())){
dto.setRoleId(userDto.getRoles().stream().findFirst().get().getId());
@@ -100,7 +100,7 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
if (!PhoneUtil.validator(resources.getPhone())){
throw new BadRequestException("手机号格式有误");
}
if (userRepository.findByUsername(resources.getAccount()) != null) {
if (userRepository.findByUsername(resources.getShopId()+"@"+resources.getAccount()) != null) {
throw new BadRequestException("员工账号已存在");
}
@@ -163,7 +163,7 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
TbPlussShopStaff tbPlussShopStaff = tbPlussShopStaffRepository.findById(resources.getId()).orElseGet(TbPlussShopStaff::new);
User sysUser = userRepository.findByUsername(resources.getShopId()+"@"+tbPlussShopStaff.getAccount());
if(!tbPlussShopStaff.getAccount().equals(resources.getAccount())){
if (userRepository.findByUsername(resources.getAccount()) != null) {
if (userRepository.findByUsername(resources.getShopId()+"@"+resources.getAccount()) != null) {
throw new BadRequestException("员工账号不可重复");
}
}