!24 🐛 防止循环依赖引用错误

Merge pull request !24 from 徐晓伟/ApplicationContext
This commit is contained in:
大粽子
2023-06-15 03:16:09 +00:00
committed by Gitee
2 changed files with 12 additions and 2 deletions

View File

@@ -46,6 +46,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -118,9 +119,13 @@ public class OrderServiceImpl implements OrderService {
@Autowired
private StoreSeckillService storeSeckillService;
@Autowired
private StoreCombinationService storeCombinationService;
@Autowired
public void setStoreCombinationService(ApplicationContext applicationContext) {
this.storeCombinationService = applicationContext.getBean(StoreCombinationService.class);
}
@Autowired
private StoreBargainService storeBargainService;

View File

@@ -35,6 +35,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.support.TransactionTemplate;
@@ -90,9 +91,13 @@ public class StoreCombinationServiceImpl extends ServiceImpl<StoreCombinationDao
@Autowired
private StoreOrderService storeOrderService;
@Autowired
private OrderService orderService;
@Autowired
public void setOrderService(ApplicationContext applicationContext) {
this.orderService = applicationContext.getBean(OrderService.class);
}
@Autowired
private RedisUtil redisUtil;