|
@@ -337,22 +337,22 @@ public class UserTicketOrderServiceImpl extends
|
|
|
// 线下购票,优先给当前票的经销商渠道分润
|
|
|
TicketBox ticketBox = ticketBoxService.getById(ticketOrder.getBoxId());
|
|
|
Channel channel = channelService.getById(ticketOrder.getChannelId());
|
|
|
- ChannelCommission channelCommission = saveCommAmt(ticketOrder, ticketBox, channel);
|
|
|
+ ChannelCommission siteCommission = saveSiteCommAmt(ticketOrder, ticketBox, channel);
|
|
|
// 经销商账户余额增加
|
|
|
ChannelMoneyLog moneyLog = new ChannelMoneyLog();
|
|
|
moneyLog.setChannelId(channel.getChannelId());
|
|
|
moneyLog.setType(ChannelMoneyEnum.COMMISSION);
|
|
|
- moneyLog.setLogMoney(channelCommission.getCommAmt());
|
|
|
+ moneyLog.setLogMoney(siteCommission.getCommAmt());
|
|
|
moneyLog.setBizTime(new Date());
|
|
|
moneyLog.setRefType(ChannelMoneyBizTypeEnum.COMMISSION);
|
|
|
- moneyLog.setRefId(String.valueOf(channelCommission.getId()));
|
|
|
+ moneyLog.setRefId(String.valueOf(siteCommission.getId()));
|
|
|
channelMoneyLogService.changeMoney(moneyLog);
|
|
|
|
|
|
- int sumCommAmt = channelCommission.getCommAmt();
|
|
|
+ int sumCommAmt = siteCommission.getCommAmt();
|
|
|
// 渠道分润
|
|
|
while (channel.getParentId() > 0) {
|
|
|
channel = channelService.getById(channel.getParentId());
|
|
|
-
|
|
|
+ ChannelCommission channelCommission = new ChannelCommission();
|
|
|
}
|
|
|
// 线下票如果用户没被绑定,则保存经销商用户绑定关系
|
|
|
|
|
@@ -364,19 +364,19 @@ 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;
|
|
|
+ private ChannelCommission saveSiteCommAmt(UserTicketOrder ticketOrder, TicketBox ticketBox, Channel channel) {
|
|
|
+ ChannelCommission siteCommission = new ChannelCommission();
|
|
|
+ siteCommission.setChannelId(channel.getChannelId());
|
|
|
+ siteCommission.setOrderId(ticketOrder.getOrderId());
|
|
|
+ siteCommission.setBoxId(ticketOrder.getBoxId());
|
|
|
+ siteCommission.setSaleAmt(ticketOrder.getPayAmt());
|
|
|
+ siteCommission.setSaleCommRate(ticketBox.getSaleCommRate());
|
|
|
+ siteCommission.setSaleCommAmt(new BigDecimal(siteCommission.getSaleAmt()).multiply(
|
|
|
+ siteCommission.getSaleCommRate()).intValue());
|
|
|
+ siteCommission.setCommRate(channel.getCommRate());
|
|
|
+ siteCommission.setCommAmt(new BigDecimal(siteCommission.getSaleCommAmt()).multiply(
|
|
|
+ siteCommission.getCommRate()).intValue());
|
|
|
+ channelCommissionService.save(siteCommission);
|
|
|
+ return siteCommission;
|
|
|
}
|
|
|
}
|