Merge branch 'ww' into test

This commit is contained in:
2024-10-18 15:29:28 +08:00
5 changed files with 15 additions and 24 deletions

View File

@@ -177,7 +177,7 @@ public class TbProductStockDetailServiceImpl implements TbProductStockDetailServ
stockDetail.setUnitName(tbShopUnit==null?"":tbShopUnit.getName());
stockDetail.setCreatedAt(System.currentTimeMillis());
stockDetail.setUpdatedAt(System.currentTimeMillis());
stockDetail.setOperator(SecurityUtils.getCurrentUsername());
stockDetail.setOperator(SecurityUtils.getCurrentUserNickName());
tbProductStockDetailRepository.save(stockDetail);
product.setStockNumber(product.getStockNumber()-resources.getStockNumber().intValue());
tbProductRepository.save(product);

View File

@@ -104,12 +104,15 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
@Override
@Transactional(rollbackFor = Exception.class)
public TbPlussShopStaffDto create(TbPlussShopStaff resources) {
if (!PhoneUtil.validator(resources.getPhone())){
throw new BadRequestException("手机号格式有误");
if (org.apache.commons.lang3.StringUtils.isBlank(resources.getAccount())) {
throw new BadRequestException("员工账号为空");
}
if (userRepository.findByUsername(resources.getShopId()+"@"+resources.getAccount()) != null) {
throw new BadRequestException("员工账号已存在");
}
if (!PhoneUtil.validator(resources.getPhone())){
throw new BadRequestException("手机号格式有误");
}
if (pattern.matcher(resources.getCode()).find()) {
throw new BadRequestException("员工编号不能包含中文");