cup 2 år sedan
förälder
incheckning
e8bc560cca

+ 1 - 1
mp-service/src/main/java/com/qs/mp/channel/service/impl/ChannelMoneyLogServiceImpl.java

@@ -36,7 +36,7 @@ public class ChannelMoneyLogServiceImpl extends ServiceImpl<ChannelMoneyLogMappe
   private IChannelService channelService;
 
   @Override
-  @Transactional
+  @Transactional(rollbackFor = Exception.class)
   public boolean changeMoney(ChannelMoneyLog moneyLog) {
     //查询数据更新对象,用户做脏读乐观锁版本标识别
     Channel channel = channelService.getById(moneyLog.getChannelId());

+ 8 - 6
mp-service/src/main/java/com/qs/mp/user/service/impl/UserTicketOrderServiceImpl.java

@@ -609,16 +609,18 @@ public class UserTicketOrderServiceImpl extends
             TicketBox ticketBox = ticketBoxService.getById(channelCommParam.getBoxId());
 
             // 如果有推广员则先给推广员分佣
-            Channel channel = new Channel();
             if (channelCommParam.getPromoterId() != null && channelCommParam.getPromoterId() > 0) {
-                channel = channelService.getById(channelCommParam.getPromoterId());
-                if (channel == null) {
-                    channel = channelService.getById(channelCommParam.getChannelId());
+                Channel promoter = channelService.getById(channelCommParam.getPromoterId());
+                if (promoter != null) {
+                    ChannelCommission siteCommission = saveSiteCommAmt(channelCommParam, ticketBox, promoter);
+                    // 推广员账户余额增加
+                    changeMoney(promoter, siteCommission);
                 }
-            } else {
-                channel = channelService.getById(channelCommParam.getChannelId());
             }
 
+            // 给门店分佣
+            Channel channel = channelService.getById(channelCommParam.getChannelId());
+
             ChannelCommission siteCommission = saveSiteCommAmt(channelCommParam, ticketBox, channel);
             // 经销商账户余额增加
             changeMoney(channel, siteCommission);