Przeglądaj źródła

更新运营中心账户变动记录到新表,更新v2的表字段

mac 2 lat temu
rodzic
commit
20fb658db2

+ 35 - 36
kxs-user/kxs-user-api/src/main/java/com/kxs/user/api/model/KxsLeaderAmountLog.java

@@ -15,30 +15,11 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 /**
- * 盟主储备金变动记录(KxsLeaderAmountLog)表实体类
- *
- * Sort //老库类型
- * //11:盟主储蓄金增减单(兑换机具券 机具券兑换 系统增加(盟主储蓄金) 系统扣减(盟主储蓄金) 储备金购买)
- * // 示例:+/-金额
- * //  盟主储蓄金:剩余盟主储蓄金
- * // 12:可提现余额增减单(系统增加(可提现余额) 系统扣减(可提现余额))
- * // 示例:+/-金额
- * //  可提现余额:剩余可提现余额
- * // 13:盟主储蓄金减少可提现余额增加(推荐大/小盟主 商城购机 购机奖励)
- * // 示例:-金额
- * //  盟主储蓄金:剩余盟主储蓄金
- * //  可提现余额:+金额
- *
- * ChangeAmt //变动金额
- * AfterAmt //变动后余额
- * Remark //标题
- * SeoDescription //描述
+ * 盟主金额变动记录(KxsLeaderAmountLog)表实体类
  *
  * @author 系统
- * @since 2024-02-22 15:39:26
+ * @since 2024-03-28 13:57:27
  */
-
-
 @EqualsAndHashCode(callSuper = true)
 @Data
 public class KxsLeaderAmountLog extends Model<KxsLeaderAmountLog> implements Serializable {
@@ -109,9 +90,6 @@ public class KxsLeaderAmountLog extends Model<KxsLeaderAmountLog> implements Ser
 
     /**
      * 操作金额
-     * 盟主储蓄金增减单=11
-     * 可提现余额增减单=12
-     * 盟主储蓄金减少可提现余额增加=13
      */
     @Schema(description = "操作金额")
     private BigDecimal amount;
@@ -119,21 +97,11 @@ public class KxsLeaderAmountLog extends Model<KxsLeaderAmountLog> implements Ser
 
     /**
      * 金额类型
-     * 盟主储蓄金增减单=11
-     * 可提现余额增减单=12
-     * 盟主储蓄金减少可提现余额增加=13
      */
     @Schema(description = "金额类型")
     private Integer variationType;
 
 
-    /**
-     * 收支类型 对应change_type表
-     */
-    @Schema(description = "金额类型")
-    private Integer changeType;
-
-
     /**
      * 原因
      */
@@ -161,12 +129,43 @@ public class KxsLeaderAmountLog extends Model<KxsLeaderAmountLog> implements Ser
     @Schema(description = "大盟主的用户ID 标记")
     private Integer sourceUserId;
 
+
     /**
-     * 商城订单ID
+     * 订单ID
      */
-    @Schema(description = "商城订单ID")
+    @Schema(description = "订单ID")
     private Integer orderId;
 
 
+    /**
+     * 收支类型 对应change_type表
+     */
+    @Schema(description = "收支类型 对应change_type表")
+    private Integer changeType;
+
+
+    /**
+     * 变动可提现额度
+     */
+    @Schema(description = "变动可提现额度")
+    private BigDecimal useWithdrawalMount;
+
+
+    /**
+     * 变动后可提现额度
+     */
+    @Schema(description = "变动后可提现额度")
+    private BigDecimal afterWithdrawalMount;
+
+
+    /**
+     * 变动前可提现额度
+     */
+    @Schema(description = "变动前可提现额度")
+    private BigDecimal beforeWithdrawalAmount;
+
+
+
+
 }
 

+ 45 - 6
kxs-user/kxs-user-api/src/main/java/com/kxs/user/api/model/KxsPartnerAmountLog.java

@@ -18,7 +18,7 @@ import lombok.EqualsAndHashCode;
  * 合伙人金额变动记录(KxsPartnerAmountLog)表实体类
  *
  * @author 系统
- * @since 2024-02-22 15:39:26
+ * @since 2024-03-28 13:41:58
  */
 @EqualsAndHashCode(callSuper = true)
 @Data
@@ -82,9 +82,9 @@ public class KxsPartnerAmountLog extends Model<KxsPartnerAmountLog> implements S
 
 
     /**
-     * 变动后金额
+     * 变动后未使用金额
      */
-    @Schema(description = "变动后金额")
+    @Schema(description = "变动后未使用金额")
     private BigDecimal afterAmount;
 
 
@@ -97,9 +97,6 @@ public class KxsPartnerAmountLog extends Model<KxsPartnerAmountLog> implements S
 
     /**
      * 金额类型
-     * 可提现余额增减=0
-     * 可使用余额增减=1
-     * 关键分仓额度增减=2
      */
     @Schema(description = "金额类型")
     private Integer variationType;
@@ -126,6 +123,48 @@ public class KxsPartnerAmountLog extends Model<KxsPartnerAmountLog> implements S
     private String remark;
 
 
+    /**
+     * 使用关联分仓额度
+     */
+    @Schema(description = "使用关联分仓额度")
+    private BigDecimal useStoreAmount;
+
+
+    /**
+     * 使用未使用额度
+     */
+    @Schema(description = "使用未使用额度")
+    private BigDecimal useTotalAmt;
+
+
+    /**
+     * 使用可提现额度
+     */
+    @Schema(description = "使用可提现额度")
+    private BigDecimal useWithdrawalMount;
+
+
+    /**
+     * 使用后关联分仓额度
+     */
+    @Schema(description = "使用后关联分仓额度")
+    private BigDecimal afterStoreAmount;
+
+
+    /**
+     * 使用后可提现额度
+     */
+    @Schema(description = "使用后可提现额度")
+    private BigDecimal afterWithdrawalMount;
+
+
+    /**
+     * 收支类别
+     */
+    @Schema(description = "收支类别")
+    private Integer changeType;
+
+
 
 
 }

+ 14 - 3
kxs-user/kxs-user-biz/src/main/java/com/kxs/user/biz/service/impl/KxsTotalDebtServiceImpl.java

@@ -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,13 +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);
             //添加日志
@@ -170,14 +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);

+ 5 - 1
kxs-user/kxs-user-biz/src/main/resources/mapper/KxsLeaderAmountLogMapper.xml

@@ -12,13 +12,17 @@
         <result column="before_amount" property="beforeAmount" />
         <result column="after_amount" property="afterAmount" />
         <result column="amount" property="amount" />
-        <result column="change_type" property="changeType" />
         <result column="variation_type" property="variationType" />
         <result column="variation_cause" property="variationCause" />
         <result column="kind" property="kind" />
         <result column="remark" property="remark" />
         <result column="source_user_id" property="sourceUserId" />
         <result column="order_id" property="orderId" />
+        <result column="change_type" property="changeType" />
+        <result column="use_withdrawal_mount" property="useWithdrawalMount" />
+        <result column="after_withdrawal_mount" property="afterWithdrawalMount" />
+        <result column="before_withdrawal_amount" property="beforeWithdrawalAmount" />
+
     </resultMap>
 
 </mapper>

+ 2 - 2
kxs-user/kxs-user-biz/src/main/resources/mapper/KxsOpMapper.xml

@@ -4,8 +4,8 @@
 
 
     <insert id="addAmountLog">
-        insert into AmountRecord (UserId, SeoDescription, UseAmount, AfterValidForGetAmount, AfterTotalAmt, AfterValidAmount, CreateDate)
-        values (#{amountLog.userId}, #{amountLog.remark}, #{amountLog.amount},#{param.withdrawalAmount},#{param.amount}, #{param.storeAmount}, NOW())
+        insert into AmountRecordNew (UserId, ChangeTypeId, ShowType, Remark, UseAmount, AfterValidForGetAmount, UseValidForGetAmount, OperateType, CreateDate)
+        values (#{amountLog.userId},  #{amountLog.changeType}, 11, #{amountLog.remark}, #{amountLog.amount},#{param.withdrawalAmount},#{amountLog.amount}, 2, NOW())
     </insert>
 
 

+ 6 - 1
kxs-user/kxs-user-biz/src/main/resources/mapper/KxsPartnerAmountLogMapper.xml

@@ -16,7 +16,12 @@
         <result column="variation_cause" property="variationCause" />
         <result column="kind" property="kind" />
         <result column="remark" property="remark" />
-
+        <result column="use_store_amount" property="useStoreAmount" />
+        <result column="use_total_amt" property="useTotalAmt" />
+        <result column="use_withdrawal_mount" property="useWithdrawalMount" />
+        <result column="after_store_amount" property="afterStoreAmount" />
+        <result column="after_withdrawal_mount" property="afterWithdrawalMount" />
+        <result column="change_type" property="changeType" />
 
     </resultMap>