|
@@ -66,8 +66,12 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class,isolation = Isolation.READ_COMMITTED)
|
|
|
public void addGoods(Goods goods, Integer operatorId) {
|
|
|
- Goods existsGood = goodsDao.findBySn(goods.getSn());
|
|
|
+ if(StringUtils.isBlank(goods.getSn())){
|
|
|
+ throw new BizException("请指定商品货号");
|
|
|
+ }
|
|
|
+ Goods existsGood = goodsDao.lockBySn(goods.getSn());
|
|
|
if(Objects.nonNull(existsGood)){
|
|
|
throw new BizException("商品货号重复");
|
|
|
}else{
|