|
|
@@ -18,6 +18,7 @@ import com.kxs.user.biz.constant.enums.UserVariationTypeEnum;
|
|
|
import com.kxs.user.biz.mapper.*;
|
|
|
import com.kxs.user.biz.mapper.old.KxsMainServerMapper;
|
|
|
import com.kxs.user.biz.mapper.old.KxsOpServerMapper;
|
|
|
+import com.kxs.user.biz.service.KxsPartnerAmountLogService;
|
|
|
import com.kxs.user.biz.service.KxsTotalDebtService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -52,6 +53,10 @@ public class KxsTotalDebtServiceImpl extends ServiceImpl<KxsTotalDebtMapper, Kxs
|
|
|
|
|
|
private final KxsOpServerMapper kxsOpServerMapper;
|
|
|
|
|
|
+ private final KxsPartnerAmountLogMapper kxsPartnerAmountLogMapper;
|
|
|
+
|
|
|
+ private final KxsLeaderAmountLogMapper kxsLeaderAmountLogMapper;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public IPage<TotalDebtListVO> getByPage(Page<KxsTotalDebt> page, String keyword) {
|
|
|
@@ -114,12 +119,16 @@ public class KxsTotalDebtServiceImpl extends ServiceImpl<KxsTotalDebtMapper, Kxs
|
|
|
KxsPartnerAmountLog kxsPartnerAmountLog = new KxsPartnerAmountLog();
|
|
|
kxsPartnerAmountLog.setUserId(kxsTotalDebt.getUserId());
|
|
|
kxsPartnerAmountLog.setBeforeAmount(NumberUtil.add(kxsPartner.getWithdrawalAmount(),partnerDeductAmount));
|
|
|
- kxsPartnerAmountLog.setAfterAmount(kxsPartner.getWithdrawalAmount());
|
|
|
kxsPartnerAmountLog.setAmount(partnerDeductAmount);
|
|
|
+ kxsPartnerAmountLog.setAfterWithdrawalMount(kxsPartner.getWithdrawalAmount());
|
|
|
kxsPartnerAmountLog.setKind(KindTypeEnum.SUB.getType());
|
|
|
kxsPartnerAmountLog.setRemark("预借款项还款");
|
|
|
kxsPartnerAmountLog.setVariationType(UserVariationTypeEnum.PARTNER_WITHDRAW_BALANCE.getType());
|
|
|
+ kxsPartnerAmountLog.setChangeType(21);
|
|
|
+ //添加到老库
|
|
|
kxsOpServerMapper.addAmountLog(kxsPartner, kxsPartnerAmountLog);
|
|
|
+ //添加到新库
|
|
|
+// kxsPartnerAmountLogMapper.insert(kxsPartnerAmountLog);
|
|
|
//扣除成功 增加欠款日志
|
|
|
BigDecimal afterAmount = NumberUtil.sub(kxsTotalDebt.getTotalDebt(),partnerDeductAmount);
|
|
|
//添加日志
|
|
|
@@ -169,12 +178,17 @@ public class KxsTotalDebtServiceImpl extends ServiceImpl<KxsTotalDebtMapper, Kxs
|
|
|
KxsLeaderAmountLog kxsLeaderAmountLog = new KxsLeaderAmountLog();
|
|
|
kxsLeaderAmountLog.setUserId(kxsTotalDebt.getUserId());
|
|
|
kxsLeaderAmountLog.setRemark("预借款项还款");
|
|
|
- kxsLeaderAmountLog.setBeforeAmount(NumberUtil.add(userAmount.getLeaderBalanceAmount(), leaderDeductAmount));
|
|
|
- kxsLeaderAmountLog.setAfterAmount(userAmount.getLeaderBalanceAmount());
|
|
|
+ kxsLeaderAmountLog.setBeforeWithdrawalAmount(NumberUtil.add(userAmount.getLeaderBalanceAmount(), leaderDeductAmount));
|
|
|
+ kxsLeaderAmountLog.setAfterWithdrawalMount(userAmount.getLeaderBalanceAmount());
|
|
|
kxsLeaderAmountLog.setAmount(leaderDeductAmount);
|
|
|
+ kxsLeaderAmountLog.setUseWithdrawalMount(leaderDeductAmount);
|
|
|
kxsLeaderAmountLog.setKind(KindTypeEnum.SUB.getType());
|
|
|
kxsLeaderAmountLog.setVariationType(UserVariationTypeEnum.LEADER_WITHDRAW_BALANCE.getType());
|
|
|
+ kxsLeaderAmountLog.setChangeType(342);
|
|
|
+ //添加到老库
|
|
|
kxsMainServerMapper.addAmountLog(kxsLeaderAmountLog);
|
|
|
+ //添加到新库
|
|
|
+// kxsLeaderAmountLogMapper.insert(kxsLeaderAmountLog);
|
|
|
|
|
|
//扣除盟主余额成功
|
|
|
BigDecimal afterAmount = kxsTotalDebt.getTotalDebt().subtract(leaderDeductAmount);
|