소스 검색

平台收入

liujc 1 년 전
부모
커밋
fae7e0e1b5

+ 14 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/PlatformCashAccountRecord.java

@@ -1,6 +1,7 @@
 package com.yonge.cooleshow.biz.dal.entity;
 
 
+import com.yonge.cooleshow.biz.dal.enums.SourceTypeEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -35,6 +36,11 @@ public class PlatformCashAccountRecord implements Serializable {
     @ApiModelProperty(value = "交易金额")
     private BigDecimal transAmount;
 
+
+    @ApiModelProperty("数据类型(平台,老师)")
+    @TableField(value = "source_type_")
+    private SourceTypeEnum sourceType;
+
     @TableField("in_or_out_")
     @ApiModelProperty(value = "收支类型:IN、收入 OUT、支出")
     private InOrOutEnum inOrOut;
@@ -88,6 +94,14 @@ public class PlatformCashAccountRecord implements Serializable {
         this.updateTime = new Date();
     }
 
+    public SourceTypeEnum getSourceType() {
+        return sourceType;
+    }
+
+    public void setSourceType(SourceTypeEnum sourceType) {
+        this.sourceType = sourceType;
+    }
+
     public Long getId() {
         return id;
     }

+ 5 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/PaymentDivMemberRecordServiceImpl.java

@@ -970,10 +970,11 @@ public class PaymentDivMemberRecordServiceImpl extends ServiceImpl<PaymentDivMem
         AccountBizTypeEnum bizTypeEnum = AccountBizTypeEnum.valueOf(userPaymentOrder.getOrderType().name());
         BigDecimal amount = tenantdivMap.values().stream().reduce(BigDecimal.ZERO, BigDecimal::add);
         PostStatusEnum platformPostStatus = PostStatusEnum.RECORDED;
+        SourceTypeEnum sourceType = SourceTypeEnum.ORDER;
         if (accountTenantTo.getIncomeTenant() >0 ){
             amount = tenantdivMap.get(-1L);
             platformPostStatus = PostStatusEnum.WAIT;
-
+            sourceType = SourceTypeEnum.TENANT;
         }
 
         if (amount.compareTo(BigDecimal.ZERO) <= 0) {
@@ -983,6 +984,8 @@ public class PaymentDivMemberRecordServiceImpl extends ServiceImpl<PaymentDivMem
         PlatformCashAccountRecord platformCashAccountRecord = new PlatformCashAccountRecord(userPaymentOrder.getUserId(), amount,
                 InOrOutEnum.IN, platformPostStatus, bizTypeEnum, userPaymentOrder.getBizId(),
                 userPaymentOrder.getOrderNo(), date);
+        platformCashAccountRecord.setSourceType(sourceType);
+
         platformCashAccountRecordService.save(platformCashAccountRecord);
         if (accountTenantTo.getIncomeTenant() >0 ){
             // 写入机构支出到平台
@@ -1045,6 +1048,7 @@ public class PaymentDivMemberRecordServiceImpl extends ServiceImpl<PaymentDivMem
                 PlatformCashAccountRecord platformCashAccountRecord2 = new PlatformCashAccountRecord(userPaymentOrder.getUserId(), amount,
                         InOrOutEnum.OUT, PostStatusEnum.WAIT, bizTypeEnum, userPaymentOrder.getBizId(),
                         userPaymentOrder.getOrderNo(), date);
+                platformCashAccountRecord2.setSourceType(SourceTypeEnum.TENANT);
                 platformCashAccountRecordService.save(platformCashAccountRecord2);
                 platformCashAccountRecordId = platformCashAccountRecord2.getId();
             }

+ 2 - 2
cooleshow-user/user-biz/src/main/resources/config/mybatis/PlatformCashAccountRecordMapper.xml

@@ -158,8 +158,8 @@
 	<select id="queryCanAccountByBizType"
 			resultType="com.yonge.cooleshow.biz.dal.entity.PlatformCashAccountRecord">
 		select t.* from platform_cash_account_record t
-        left join tenant_account_record tar on tar.platform_cash_account_record_id_ = t.id_
-		where t.post_status_ = 'WAIT' and t.account_period_time_ &lt; now() and tar.id_ is null
+<!--        left join tenant_account_record tar on tar.platform_cash_account_record_id_ = t.id_-->
+		where t.post_status_ = 'WAIT' and t.account_period_time_ &lt; now() and t.source_type_ is null
 		and t.biz_type_ IN
 		<foreach collection="bizTypes" item="item" open="(" separator="," close=")">
 			#{item}