|
|
@@ -258,11 +258,14 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
payRequest.setDonMoney(sku.getPrice());
|
|
|
}
|
|
|
|
|
|
- List<Long> dpSIds = payRequest.getDpSIds();
|
|
|
- if (CollUtil.isNotEmpty(dpSIds)) {
|
|
|
+ List<Long> dpIds = payRequest.getDpIds();
|
|
|
+ if (dpIds.size() > 1) {
|
|
|
+ throw BusinessRuntimeException.getInstance("暂只支持优惠加购一件商品");
|
|
|
+ }
|
|
|
+ if (CollUtil.isNotEmpty(dpIds)) {
|
|
|
//是否满足关联
|
|
|
- GoodsDiscountPlusPurchaseRelationDto purchaseRelationDto = discountPlusPurchaseRelationMapper.countDiscountGoodsRelation(dpSIds, sku.getId());
|
|
|
- if (purchaseRelationDto.getCount() != dpSIds.size()) {
|
|
|
+ GoodsDiscountPlusPurchaseRelationDto purchaseRelationDto = discountPlusPurchaseRelationMapper.countDiscountGoodsRelation(dpIds, sku.getId());
|
|
|
+ if (purchaseRelationDto.getCount() != dpIds.size()) {
|
|
|
throw BusinessRuntimeException.getInstance("下单异常,请重新下单");
|
|
|
}
|
|
|
BigDecimal pay_money = sku.getPrice().add(purchaseRelationDto.getTotalMoney());
|
|
|
@@ -270,7 +273,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
orderDon.setMoney(pay_money);
|
|
|
}
|
|
|
orderDon.setIsDp(true);
|
|
|
- orderDon.setDpSIds(dpSIds);
|
|
|
+ orderDon.setDpIds(dpIds);
|
|
|
}
|
|
|
|
|
|
orderDon.setMoney(payRequest.getDonMoney());
|
|
|
@@ -349,6 +352,13 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
}
|
|
|
}
|
|
|
orderDon.setSpecialType(goodsDon.getSpecialType());
|
|
|
+ StringBuilder payTitle = new StringBuilder();
|
|
|
+ payTitle.append(goodsDon.getTitle());
|
|
|
+ payTitle.append(sku.getSpecVal());
|
|
|
+ if (orderDon.getIsDp()) {
|
|
|
+ List<Long> dpIds1 = orderDon.getDpIds();
|
|
|
+ orderDon.setPayTitle();
|
|
|
+ }
|
|
|
return orderDon;
|
|
|
}
|
|
|
|
|
|
@@ -1144,7 +1154,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
log.info("虚物订单orderNo:{}开始更新车票信息", order.getOrderNo());
|
|
|
//修改车位状态
|
|
|
GroupsRelation relation = groupsRelationMapper.selectById(order.getRelationId());
|
|
|
- if (CollUtil.isNotEmpty(order.getDpSIds())) {
|
|
|
+ if (CollUtil.isNotEmpty(order.getDpIds())) {
|
|
|
//是否已经发送优惠加购车票
|
|
|
Integer count = orderRelationTicketRelationMapper.selectCount(Wrappers.lambdaQuery(OrderDiscountPlusPurchaseTicketRelation.class)
|
|
|
.eq(OrderDiscountPlusPurchaseTicketRelation::getOrderId, order.getId()));
|
|
|
@@ -1152,7 +1162,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
return;
|
|
|
}
|
|
|
//发送优惠加购 规格车票
|
|
|
- List<GoodsDonSku> relationSkus = discountPlusPurchaseRelationMapper.selectRelationSkuByDpId(order.getDpSIds(), sku.getId());
|
|
|
+ List<GoodsDonSku> relationSkus = discountPlusPurchaseRelationMapper.selectRelationSkuByDpId(order.getDpIds(), sku.getId());
|
|
|
List<Long> dis_relation_ids = new ArrayList<>();
|
|
|
relationSkus.forEach(reSku -> {
|
|
|
GroupsRelation relationNoOrder = exchangeCodeService.getRelationNoOrder(reSku, order.getUserId());
|