|
@@ -325,10 +325,10 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
}
|
|
}
|
|
|
|
|
|
//记得将重复拼团校验放开
|
|
//记得将重复拼团校验放开
|
|
-// List<Long> uidList = pinkList.stream().map(StorePink::getUid).collect(Collectors.toList());
|
|
|
|
-// if (uidList.contains(dto.getUserId())) {
|
|
|
|
-// throw new ServiceException("重复拼团");
|
|
|
|
-// }
|
|
|
|
|
|
+ List<Long> uidList = pinkList.stream().map(StorePink::getUid).collect(Collectors.toList());
|
|
|
|
+ if (uidList.contains(dto.getUserId())) {
|
|
|
|
+ throw new ServiceException("重复拼团");
|
|
|
|
+ }
|
|
joinGroup(teamPink, dto, count, pinkList.size());
|
|
joinGroup(teamPink, dto, count, pinkList.size());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -431,14 +431,14 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
Map<Long, List<StorePink>> collect = pinkList.stream().collect(Collectors.groupingBy(StorePink::getSpsId));
|
|
Map<Long, List<StorePink>> collect = pinkList.stream().collect(Collectors.groupingBy(StorePink::getSpsId));
|
|
log.info("collect:" + collect.toString());
|
|
log.info("collect:" + collect.toString());
|
|
//记得将重复拼团校验放开
|
|
//记得将重复拼团校验放开
|
|
-// List<List<StorePink>> availableGroups = collect.values().stream()
|
|
|
|
-// .filter(list -> !list.stream().map(StorePink::getUid).collect(Collectors.toList()).contains(dto.getUserId()))
|
|
|
|
-// .collect(Collectors.toList());
|
|
|
|
List<List<StorePink>> availableGroups = collect.values().stream()
|
|
List<List<StorePink>> availableGroups = collect.values().stream()
|
|
|
|
+ .filter(list -> !list.stream().map(StorePink::getUid).collect(Collectors.toList()).contains(dto.getUserId()))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ // List<List<StorePink>> availableGroups = collect.values().stream()
|
|
|
|
|
|
|
|
|
|
- .filter(list -> true)
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
+ // .filter(list -> true)
|
|
|
|
+ // .collect(Collectors.toList());
|
|
|
|
|
|
log.info("availableGroups:" + availableGroups.toString());
|
|
log.info("availableGroups:" + availableGroups.toString());
|
|
// 如果没有用户未参与的拼团,直接返回,让调用方处理创建新团的逻辑
|
|
// 如果没有用户未参与的拼团,直接返回,让调用方处理创建新团的逻辑
|
|
@@ -458,7 +458,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
if (CollectionUtils.isNotEmpty(maxPinkList)) {
|
|
if (CollectionUtils.isNotEmpty(maxPinkList)) {
|
|
List<Long> uidList = maxPinkList.stream().map(StorePink::getUid).collect(Collectors.toList());
|
|
List<Long> uidList = maxPinkList.stream().map(StorePink::getUid).collect(Collectors.toList());
|
|
//记得将重复拼团校验放开
|
|
//记得将重复拼团校验放开
|
|
- // if (!uidList.contains(dto.getUserId())) {
|
|
|
|
|
|
+ if (!uidList.contains(dto.getUserId())) {
|
|
//团长
|
|
//团长
|
|
StorePink pink = maxPinkList.stream().filter(i -> i.getKId().equals(0)).collect(Collectors.toList()).get(0);
|
|
StorePink pink = maxPinkList.stream().filter(i -> i.getKId().equals(0)).collect(Collectors.toList()).get(0);
|
|
int count = pink.getPeople() - (CollUtil.isEmpty(maxPinkList) ? 0 : maxPinkList.size());
|
|
int count = pink.getPeople() - (CollUtil.isEmpty(maxPinkList) ? 0 : maxPinkList.size());
|
|
@@ -469,7 +469,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
} else {
|
|
} else {
|
|
throw new ServiceException("拼团人数超员请重新发起拼团 pinkid:" + pink.getId());
|
|
throw new ServiceException("拼团人数超员请重新发起拼团 pinkid:" + pink.getId());
|
|
}
|
|
}
|
|
- // }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1650,7 +1650,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
// if (storeOrder.getCouponId() > 0) {
|
|
// if (storeOrder.getCouponId() > 0) {
|
|
// storeCouponUserService.updateById(finalStoreCouponUser);
|
|
// storeCouponUserService.updateById(finalStoreCouponUser);
|
|
// }
|
|
// }
|
|
- // // 保存购物车商品详情
|
|
|
|
|
|
+ //
|
|
storeOrderInfoService.saveOrderInfos(storeOrderInfos);
|
|
storeOrderInfoService.saveOrderInfos(storeOrderInfos);
|
|
|
|
|
|
|
|
|
|
@@ -1685,7 +1685,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
}
|
|
}
|
|
|
|
|
|
// 加入自动未支付自动取消队列
|
|
// 加入自动未支付自动取消队列
|
|
- redisUtil.lPush(Constants.ORDER_AUTO_CANCEL_KEY, storeOrder.getOrderId());
|
|
|
|
|
|
+ // redisUtil.lPush(Constants.ORDER_AUTO_CANCEL_KEY, storeOrder.getOrderId());
|
|
MyRecord record = new MyRecord();
|
|
MyRecord record = new MyRecord();
|
|
record.set("orderId", storeOrder.getId());
|
|
record.set("orderId", storeOrder.getId());
|
|
record.set("orderNo", orderNo);
|
|
record.set("orderNo", orderNo);
|