员工账号校验

耗材出入库 备注
This commit is contained in:
2024-10-18 15:29:00 +08:00
parent 31e21e4705
commit 8b49d17982
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

@@ -97,12 +97,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("员工编号不能包含中文");