|
@@ -16,6 +16,8 @@ import com.qs.mp.admin.domain.param.IndexTicketBoxTopQueryParam;
|
|
|
import com.qs.mp.admin.domain.param.IndexTicketSiteTopQueryParam;
|
|
|
import com.qs.mp.admin.domain.param.UserTicketOrderQueryParam;
|
|
|
import com.qs.mp.admin.domain.vo.*;
|
|
|
+import com.qs.mp.admin.service.ICouponPkgService;
|
|
|
+import com.qs.mp.admin.service.ICouponService;
|
|
|
import com.qs.mp.admin.service.IGoodsService;
|
|
|
import com.qs.mp.admin.service.ITicketBoxGoodsService;
|
|
|
import com.qs.mp.admin.service.ITicketBoxService;
|
|
@@ -142,6 +144,12 @@ public class UserTicketOrderServiceImpl extends
|
|
|
@Autowired
|
|
|
private IGoodsService goodsService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICouponService couponService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ICouponPkgService couponPkgService;
|
|
|
+
|
|
|
@Override
|
|
|
public String submitOrder(Long userId, TicketOrderSettleVO orderSettleVO,
|
|
|
UserShareVO userShareVO) {
|
|
@@ -360,7 +368,7 @@ public class UserTicketOrderServiceImpl extends
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public boolean batchCancelOrder(String boxId, List<String> orderIds) {
|
|
|
int sumTicket = 0;
|
|
|
for (String orderId : orderIds) {
|
|
@@ -384,6 +392,7 @@ public class UserTicketOrderServiceImpl extends
|
|
|
ticketBox.getSaleQty() - qty)
|
|
|
.set(
|
|
|
ticketBox.getStatus() == TicketBoxStatusEnum.PUT_OFF
|
|
|
+ && TicketTypeEnum.ONLINE.equals(ticketBox.getType())
|
|
|
&& ticketBox.getManualOff() != 1,
|
|
|
TicketBox::getStatus, TicketBoxStatusEnum.PUT_ON)
|
|
|
.eq(TicketBox::getBoxId, ticketBox.getBoxId())
|
|
@@ -498,18 +507,21 @@ public class UserTicketOrderServiceImpl extends
|
|
|
Assert.isTrue(rtn, "支付回调用户购票订单处理,更新盲票状态失败,ticketId:" + ticket.getTicketId());
|
|
|
|
|
|
|
|
|
- // 如果为线上票则发送关联商品到用户仓库
|
|
|
- TicketBox ticketBox = ticketBoxService.getById(ticketOrder.getBoxId());
|
|
|
- if (TicketTypeEnum.ONLINE.equals(ticketBox.getType())) {
|
|
|
- List<TicketBoxGoods> ticketBoxGoodsList = ticketBoxGoodsService.list(new LambdaQueryWrapper<TicketBoxGoods>()
|
|
|
- .eq(TicketBoxGoods::getBoxId, ticketBox.getBoxId()));
|
|
|
- if (CollectionUtils.isNotEmpty(ticketBoxGoodsList)) {
|
|
|
- for (TicketBoxGoods ticketBoxGoods : ticketBoxGoodsList) {
|
|
|
- Goods goods = goodsService.getById(Long.valueOf(ticketBoxGoods.getRefId()));
|
|
|
+ // TODO: 线上和线下票如果有关联商品,都要发送关联商品到用户的仓库中
|
|
|
+ List<TicketBoxGoods> ticketBoxGoodsList = ticketBoxGoodsService.list(new LambdaQueryWrapper<TicketBoxGoods>()
|
|
|
+ .eq(TicketBoxGoods::getBoxId, ticketOrder.getBoxId()));
|
|
|
+ if (CollectionUtils.isNotEmpty(ticketBoxGoodsList)) {
|
|
|
+ // 发送关联商品
|
|
|
+ for (TicketBoxGoods ticketBoxGoods : ticketBoxGoodsList) {
|
|
|
|
|
|
+ if (TicketBoxGoodsTypeEnum.GOODS.equals(ticketBoxGoods.getType())) {
|
|
|
+ Goods goods = goodsService.getById(Long.valueOf(ticketBoxGoods.getRefId()));
|
|
|
userPrizeStorageService.takeInStorage(orderItem.getUserId(),goods.getTitle(),goods.getPicUrl(),
|
|
|
ticketBoxGoods.getRefId(),PrizeStorageInTypeEnum.TICKET_GOODS,orderItem.getItemId());
|
|
|
-
|
|
|
+ } else if (TicketBoxGoodsTypeEnum.COUPON.equals(ticketBoxGoods.getType())) {
|
|
|
+ couponService.distribute(ticket, orderItem.getUserId(), ticketBoxGoods.getRefId());
|
|
|
+ } else if (TicketBoxGoodsTypeEnum.COUPON_PKG.equals(ticketBoxGoods.getType())) {
|
|
|
+ couponPkgService.distribute(ticket, orderItem.getUserId(), ticketBoxGoods.getRefId());
|
|
|
}
|
|
|
}
|
|
|
}
|