|
|
@@ -212,22 +212,17 @@ public class StorePinkServiceImpl extends AbstractService<StorePink> implements
|
|
|
@Resource
|
|
|
private OrderIndexService orderIndexService;
|
|
|
|
|
|
- @Resource
|
|
|
-private AsyncConfig asyncConfig;
|
|
|
+ @Resource
|
|
|
+ private AsyncConfig asyncConfig;
|
|
|
|
|
|
/**
|
|
|
* 中间索引表状态同步
|
|
|
*
|
|
|
* @param orderNo
|
|
|
- * @param status
|
|
|
*/
|
|
|
- private void upOrderIndex(String orderNo, PinkOrderStatusEnum status, StorePinkStatusEnum storePinkStatus) {
|
|
|
+ private void upOrderIndex(String orderNo, StorePinkStatusEnum storePinkStatus) {
|
|
|
OrderIndex orderIndex = new OrderIndex();
|
|
|
- orderIndex.setStatus(status.getKey());
|
|
|
- if (PinkOrderStatusEnum.GROUP_ORDER_PAID == status) {
|
|
|
- Date date = new Date();
|
|
|
- orderIndex.setPayTime(date);
|
|
|
- }
|
|
|
+
|
|
|
if (ObjectUtil.isNotEmpty(storePinkStatus)) {
|
|
|
orderIndex.setStorePinkStatus(storePinkStatus.getKey());
|
|
|
}
|
|
|
@@ -263,7 +258,13 @@ private AsyncConfig asyncConfig;
|
|
|
String s = I18nUtil.get("no.group.buying.orders");
|
|
|
throw new ServiceException(s + spsCode);
|
|
|
}
|
|
|
- //异步更新索引表,同步拼团单状态
|
|
|
+ // 异步更新索引表,同步拼团单状态
|
|
|
+ asyncConfig.taskExecutor().execute(() -> {
|
|
|
+ list.forEach(storePink -> {
|
|
|
+ this.upOrderIndex(storePink.getOrderId(), StorePinkStatusEnum.RESULTS_ANNOUNCED);
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
long count = list.stream().filter(i -> i.getLId().equals(1)).count();
|
|
|
if (count >= 1) {
|
|
|
throw new ServiceException(I18nUtil.get("already.have.a.chosen.one") + spsCode);
|