|
@@ -106,7 +106,7 @@ public class UserTicketOrderServiceImpl extends
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public String submitOrder(Long userId, TicketOrderSettleVO orderSettleVO) {
|
|
|
- if (StringUtils.isNotBlank(orderSettleVO.getBoxId())) {
|
|
|
+ if (StringUtils.isBlank(orderSettleVO.getTicketId())) {
|
|
|
return createOnlineOrder(userId, orderSettleVO);
|
|
|
}
|
|
|
|
|
@@ -337,18 +337,7 @@ public class UserTicketOrderServiceImpl extends
|
|
|
// 线下购票,优先给当前票的经销商渠道分润
|
|
|
TicketBox ticketBox = ticketBoxService.getById(ticketOrder.getBoxId());
|
|
|
Channel channel = channelService.getById(ticketOrder.getChannelId());
|
|
|
- ChannelCommission channelCommission = new ChannelCommission();
|
|
|
- channelCommission.setChannelId(channel.getChannelId());
|
|
|
- channelCommission.setOrderId(ticketOrder.getOrderId());
|
|
|
- channelCommission.setBoxId(ticketOrder.getBoxId());
|
|
|
- channelCommission.setSaleAmt(ticketOrder.getPayAmt());
|
|
|
- channelCommission.setSaleCommRate(ticketBox.getSaleCommRate());
|
|
|
- channelCommission.setSaleCommAmt(new BigDecimal(channelCommission.getSaleAmt()).multiply(
|
|
|
- channelCommission.getSaleCommRate()).intValue());
|
|
|
- channelCommission.setCommRate(channel.getCommRate());
|
|
|
- channelCommission.setCommAmt(new BigDecimal(channelCommission.getSaleCommAmt()).multiply(
|
|
|
- channelCommission.getCommRate()).intValue());
|
|
|
- channelCommissionService.save(channelCommission);
|
|
|
+ ChannelCommission channelCommission = saveCommAmt(ticketOrder, ticketBox, channel);
|
|
|
// 经销商账户余额增加
|
|
|
ChannelMoneyLog moneyLog = new ChannelMoneyLog();
|
|
|
moneyLog.setChannelId(channel.getChannelId());
|
|
@@ -360,7 +349,6 @@ public class UserTicketOrderServiceImpl extends
|
|
|
channelMoneyLogService.changeMoney(moneyLog);
|
|
|
|
|
|
int sumCommAmt = channelCommission.getCommAmt();
|
|
|
-
|
|
|
// 渠道分润
|
|
|
while (channel.getParentId() > 0) {
|
|
|
channel = channelService.getById(channel.getParentId());
|
|
@@ -375,4 +363,20 @@ public class UserTicketOrderServiceImpl extends
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ private ChannelCommission saveCommAmt(UserTicketOrder ticketOrder, TicketBox ticketBox, Channel channel) {
|
|
|
+ ChannelCommission channelCommission = new ChannelCommission();
|
|
|
+ channelCommission.setChannelId(channel.getChannelId());
|
|
|
+ channelCommission.setOrderId(ticketOrder.getOrderId());
|
|
|
+ channelCommission.setBoxId(ticketOrder.getBoxId());
|
|
|
+ channelCommission.setSaleAmt(ticketOrder.getPayAmt());
|
|
|
+ channelCommission.setSaleCommRate(ticketBox.getSaleCommRate());
|
|
|
+ channelCommission.setSaleCommAmt(new BigDecimal(channelCommission.getSaleAmt()).multiply(
|
|
|
+ channelCommission.getSaleCommRate()).intValue());
|
|
|
+ channelCommission.setCommRate(channel.getCommRate());
|
|
|
+ channelCommission.setCommAmt(new BigDecimal(channelCommission.getSaleCommAmt()).multiply(
|
|
|
+ channelCommission.getCommRate()).intValue());
|
|
|
+ channelCommissionService.save(channelCommission);
|
|
|
+ return channelCommission;
|
|
|
+ }
|
|
|
}
|