chunping 3 anni fa
parent
commit
b1db0b3a3c

+ 1 - 1
mp-service/src/main/java/com/qs/mp/user/domain/UserTicketOrder.java

@@ -102,7 +102,7 @@ public class UserTicketOrder implements Serializable {
   /**
    * 结佣标识,1代表已结佣 0代表未结佣
    */
-  @TableField("coupon_info")
+  @TableField("comm_status")
   @JSONField(serialzeFeatures = SerializerFeature.WriteEnumUsingToString)
   private CommStatusEnum commStatus;
 

+ 18 - 14
mp-service/src/main/java/com/qs/mp/user/service/impl/UserTicketOrderServiceImpl.java

@@ -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;
+  }
 }