扣减库存改成public,事务传播改成REQUIRED,不然事务传播会失效

This commit is contained in:
hupeng
2020-08-09 20:17:11 +08:00
parent 754d4492e0
commit 6bfc195af5
3 changed files with 4 additions and 4 deletions

View File

@ -105,7 +105,7 @@ import java.util.stream.Collectors;
*/ */
@Slf4j @Slf4j
@Service @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 { public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, YxStoreOrder> implements YxStoreOrderService {
@Autowired @Autowired
@ -1449,7 +1449,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
* 减库存增加销量 * 减库存增加销量
* @param cartInfo 购物车 * @param cartInfo 购物车
*/ */
private void deStockIncSale(List<YxStoreCartQueryVo> cartInfo) { public void deStockIncSale(List<YxStoreCartQueryVo> cartInfo) {
for (YxStoreCartQueryVo storeCartVO : cartInfo) { for (YxStoreCartQueryVo storeCartVO : cartInfo) {
Long combinationId = storeCartVO.getCombinationId(); Long combinationId = storeCartVO.getCombinationId();
Long seckillId = storeCartVO.getSeckillId(); Long seckillId = storeCartVO.getSeckillId();

View File

@ -43,7 +43,7 @@ import java.util.stream.Collectors;
* @date 2020-05-12 * @date 2020-05-12
*/ */
@Service @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 { public class YxStoreProductAttrServiceImpl extends BaseServiceImpl<StoreProductAttrMapper, YxStoreProductAttr> implements YxStoreProductAttrService {
@Autowired @Autowired

View File

@ -65,7 +65,7 @@ import java.util.stream.Collectors;
* @date 2020-05-12 * @date 2020-05-12
*/ */
@Service @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 { public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMapper, YxStoreProduct> implements YxStoreProductService {
@Autowired @Autowired