扣减库存改成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
@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();

View File

@ -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

View File

@ -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