扣减库存改成public,事务传播改成REQUIRED,不然事务传播会失效
This commit is contained in:
@ -105,7 +105,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
||||
public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, YxStoreOrder> implements YxStoreOrderService {
|
||||
|
||||
@Autowired
|
||||
@ -1449,7 +1449,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
||||
* 减库存增加销量
|
||||
* @param cartInfo 购物车
|
||||
*/
|
||||
private void deStockIncSale(List<YxStoreCartQueryVo> cartInfo) {
|
||||
public void deStockIncSale(List<YxStoreCartQueryVo> cartInfo) {
|
||||
for (YxStoreCartQueryVo storeCartVO : cartInfo) {
|
||||
Long combinationId = storeCartVO.getCombinationId();
|
||||
Long seckillId = storeCartVO.getSeckillId();
|
||||
|
@ -43,7 +43,7 @@ import java.util.stream.Collectors;
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Service
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
||||
public class YxStoreProductAttrServiceImpl extends BaseServiceImpl<StoreProductAttrMapper, YxStoreProductAttr> implements YxStoreProductAttrService {
|
||||
|
||||
@Autowired
|
||||
|
@ -65,7 +65,7 @@ import java.util.stream.Collectors;
|
||||
* @date 2020-05-12
|
||||
*/
|
||||
@Service
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
||||
public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMapper, YxStoreProduct> implements YxStoreProductService {
|
||||
|
||||
@Autowired
|
||||
|
Reference in New Issue
Block a user