Browse Source

Merge branch 'dev' into 'mp-server-test'

提现申请

See merge request quanshu/mp-server!184
zhong chunping 3 years ago
parent
commit
6c7ebc42d0

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

@@ -42,6 +42,7 @@ public class ChannelMoneyLogServiceImpl extends ServiceImpl<ChannelMoneyLogMappe
     Channel channel = channelService.getById(moneyLog.getChannelId());
     Channel channel = channelService.getById(moneyLog.getChannelId());
 
 
     boolean income = checkIncome(moneyLog.getType());
     boolean income = checkIncome(moneyLog.getType());
+    int logMoney = moneyLog.getLogMoney();
     int money = 0;
     int money = 0;
     if (!income) {
     if (!income) {
       //根据收支方向,将金额转负,方便统一计算
       //根据收支方向,将金额转负,方便统一计算
@@ -62,9 +63,9 @@ public class ChannelMoneyLogServiceImpl extends ServiceImpl<ChannelMoneyLogMappe
     }
     }
     LogUtil.info(logger, "channelId:{0}, money:{1}", new Object[]{channel.getChannelId() , channel.getMoney()});
     LogUtil.info(logger, "channelId:{0}, money:{1}", new Object[]{channel.getChannelId() , channel.getMoney()});
 
 
-    //1、更新商户余额表
+    //1、更新渠道余额表
     boolean rtn = channelService.update(new LambdaUpdateWrapper<Channel>().set(Channel::getMoney, money)
     boolean rtn = channelService.update(new LambdaUpdateWrapper<Channel>().set(Channel::getMoney, money)
-            .set(ChannelMoneyEnum.WITHDRAW == moneyLog.getType() || ChannelMoneyEnum.WITHDRAW_FEE == moneyLog.getType(), Channel::getFrozenMoney, channel.getFrozenMoney() + moneyLog.getLogMoney())
+            .set(ChannelMoneyEnum.WITHDRAW == moneyLog.getType() || ChannelMoneyEnum.WITHDRAW_FEE == moneyLog.getType(), Channel::getFrozenMoney, channel.getFrozenMoney() + logMoney)
         .eq(Channel::getChannelId, channel.getChannelId()).eq(Channel::getMoney, channel.getMoney()));
         .eq(Channel::getChannelId, channel.getChannelId()).eq(Channel::getMoney, channel.getMoney()));
     Assert.isTrue(rtn, "渠道余额更新失败,channelId:" + channel.getChannelId());
     Assert.isTrue(rtn, "渠道余额更新失败,channelId:" + channel.getChannelId());
 
 

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

@@ -79,7 +79,7 @@ public class ChannelWithdrawServiceImpl extends ServiceImpl<ChannelWithdrawMappe
       feeMoneyLog.setLogMoney(channelWithdraw.getChargeAmt());
       feeMoneyLog.setLogMoney(channelWithdraw.getChargeAmt());
       feeMoneyLog.setBizTime(new Date());
       feeMoneyLog.setBizTime(new Date());
       feeMoneyLog.setRefId(String.valueOf(channelWithdraw.getId()));
       feeMoneyLog.setRefId(String.valueOf(channelWithdraw.getId()));
-      channelMoneyLogService.changeMoney(moneyLog);
+      channelMoneyLogService.changeMoney(feeMoneyLog);
     }
     }
     // 创建提现记录
     // 创建提现记录
     return rst;
     return rst;