员工账号校验
耗材出入库 备注
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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("员工编号不能包含中文");
|
||||
|
||||
Reference in New Issue
Block a user