ソースを参照

[支付][修改]:分账相关表增加冗余租户id和商户id

release_toaliyun_real
hupeng 7年前
コミット
464fe8f570
7個のファイルの変更105行の追加42行の削除
  1. +14
    -12
      mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingOrder.java
  2. +25
    -13
      mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingReceiver.java
  3. +35
    -11
      mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingResult.java
  4. +3
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java
  5. +4
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverServiceImpl.java
  6. +9
    -3
      mallinkService/src/main/resources/mapper/WxProfitSharingReceiverMapper.xml
  7. +15
    -3
      mallinkService/src/main/resources/mapper/WxProfitSharingResultMapper.xml

+ 14
- 12
mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingOrder.java ファイルの表示

@@ -155,18 +155,18 @@ public class WxProfitSharingOrder implements Serializable {
public static enum Field
{
Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC")
,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC")
,OrderId_ASC("`orderId` ASC"),OrderId_DESC("`orderId` DESC")
,PayAmount_ASC("`payAmount` ASC"),PayAmount_DESC("`payAmount` DESC")
,PayTimeEnd_ASC("`payTimeEnd` ASC"),PayTimeEnd_DESC("`payTimeEnd` DESC")
,PayTimeStart_ASC("`payTimeStart` ASC"),PayTimeStart_DESC("`payTimeStart` DESC")
,TransactionId_ASC("`transactionId` ASC"),TransactionId_DESC("`transactionId` DESC")
,SharingOrderId_ASC("`sharingOrderId` ASC"),SharingOrderId_DESC("`sharingOrderId` DESC")
,ErrorMsg_ASC("`errorMsg` ASC"),ErrorMsg_DESC("`errorMsg` DESC")
,SharingStatus_ASC("`sharingStatus` ASC"),SharingStatus_DESC("`sharingStatus` DESC")
,UpdateTime_ASC("`updateTime` ASC"),UpdateTime_DESC("`updateTime` DESC")
,CreateTime_ASC("`createTime` ASC"),CreateTime_DESC("`createTime` DESC")
,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC")
,MerchantId_ASC("`merchant_id` ASC"),MerchantId_DESC("`merchant_id` DESC")
,OrderId_ASC("`order_id` ASC"),OrderId_DESC("`order_id` DESC")
,PayAmount_ASC("`pay_amount` ASC"),PayAmount_DESC("`pay_amount` DESC")
,PayTimeEnd_ASC("`pay_time_end` ASC"),PayTimeEnd_DESC("`pay_time_end` DESC")
,PayTimeStart_ASC("`pay_time_start` ASC"),PayTimeStart_DESC("`pay_time_start` DESC")
,TransactionId_ASC("`transaction_id` ASC"),TransactionId_DESC("`transaction_id` DESC")
,SharingOrderNo_ASC("`sharing_order_no` ASC"),SharingOrderNo_DESC("`sharing_order_no` DESC")
,ErrorMsg_ASC("`error_msg` ASC"),ErrorMsg_DESC("`error_msg` DESC")
,SharingStatus_ASC("`sharing_status` ASC"),SharingStatus_DESC("`sharing_status` DESC")
,UpdateTime_ASC("`update_time` ASC"),UpdateTime_DESC("`update_time` DESC")
,CreateTime_ASC("`create_time` ASC"),CreateTime_DESC("`create_time` DESC")
;
private String value;
Field(String value){
@@ -199,6 +199,8 @@ public class WxProfitSharingOrder implements Serializable {
sb.append(",");
sb.append(fields[k].toString());
}

this.sortColumns = sb.toString();
}


+ 25
- 13
mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingReceiver.java ファイルの表示

@@ -38,9 +38,11 @@ public class WxProfitSharingReceiver implements Serializable {
public void setIds(List<Long> ids) {
this.ids = ids;
}


/*接收方(商场租户id)**/
@io.swagger.annotations.ApiModelProperty(value="接收方(商场租户id)",name="tenantId")
private String tenantId;
/*商户ID**/
@io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId")
private Long merchantId;
@@ -83,6 +85,14 @@ public class WxProfitSharingReceiver implements Serializable {
this.status = status;
}

public String getTenantId() {
return tenantId;
}

public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}

public Long getMerchantId() {
return merchantId;
}
@@ -149,16 +159,17 @@ public class WxProfitSharingReceiver implements Serializable {
public static enum Field
{
Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC")
,ReceiverType_ASC("`receiverType` ASC"),ReceiverType_DESC("`receiverType` DESC")
,ReceiverAccount_ASC("`receiverAccount` ASC"),ReceiverAccount_DESC("`receiverAccount` DESC")
,ReceiverComments_ASC("`receiverComments` ASC"),ReceiverComments_DESC("`receiverComments` DESC")
,CreateTime_ASC("`createTime` ASC"),CreateTime_DESC("`createTime` DESC")
,UpdateTime_ASC("`updateTime` ASC"),UpdateTime_DESC("`updateTime` DESC")
,SharingType_ASC("`sharingType` ASC"),SharingType_DESC("`sharingType` DESC")
,BankNo_ASC("`bankNo` ASC"),BankNo_DESC("`bankNo` DESC")
,TrueName_ASC("`trueName` ASC"),TrueName_DESC("`trueName` DESC")
,BankCode_ASC("`bankCode` ASC"),BankCode_DESC("`bankCode` DESC")
,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC")
,MerchantId_ASC("`merchant_id` ASC"),MerchantId_DESC("`merchant_id` DESC")
,ReceiverType_ASC("`receiver_type` ASC"),ReceiverType_DESC("`receiver_type` DESC")
,ReceiverAccount_ASC("`receiver_account` ASC"),ReceiverAccount_DESC("`receiver_account` DESC")
,ReceiverComments_ASC("`receiver_comments` ASC"),ReceiverComments_DESC("`receiver_comments` DESC")
,CreateTime_ASC("`create_time` ASC"),CreateTime_DESC("`create_time` DESC")
,UpdateTime_ASC("`update_time` ASC"),UpdateTime_DESC("`update_time` DESC")
,SharingType_ASC("`sharing_type` ASC"),SharingType_DESC("`sharing_type` DESC")
,BankNo_ASC("`bank_no` ASC"),BankNo_DESC("`bank_no` DESC")
,TrueName_ASC("`true_name` ASC"),TrueName_DESC("`true_name` DESC")
,BankCode_ASC("`bank_code` ASC"),BankCode_DESC("`bank_code` DESC")
;
private String value;
Field(String value){
@@ -191,6 +202,7 @@ public class WxProfitSharingReceiver implements Serializable {
sb.append(",");
sb.append(fields[k].toString());
}
this.sortColumns = sb.toString();
}


+ 35
- 11
mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingResult.java ファイルの表示

@@ -38,9 +38,15 @@ public class WxProfitSharingResult implements Serializable {
public void setIds(List<Long> ids) {
this.ids = ids;
}


/*接收方(商场租户id)**/
@io.swagger.annotations.ApiModelProperty(value="接收方(商场租户id)",name="tenantId")
private String tenantId;
/*商户ID**/
@io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId")
private Long merchantId;

/*分账订单号**/
@io.swagger.annotations.ApiModelProperty(value="分账订单号",name="sharingOrderId")
private Long sharingOrderId;
@@ -113,20 +119,37 @@ public class WxProfitSharingResult implements Serializable {
public void setFailedReason(String _failedReason) {
failedReason = _failedReason;
}
public Long getMerchantId() {
return merchantId;
}

public void setMerchantId(Long merchantId) {
this.merchantId = merchantId;
}

public String getTenantId() {

return tenantId;
}

public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}


public static enum Field
{
Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
,SharingOrderId_ASC("`sharingOrderId` ASC"),SharingOrderId_DESC("`sharingOrderId` DESC")
,SharingReceiverId_ASC("`sharingReceiverId` ASC"),SharingReceiverId_DESC("`sharingReceiverId` DESC")
,PayAmount_ASC("`payAmount` ASC"),PayAmount_DESC("`payAmount` DESC")
,UpdateTime_ASC("`updateTime` ASC"),UpdateTime_DESC("`updateTime` DESC")
,CreateTime_ASC("`createTime` ASC"),CreateTime_DESC("`createTime` DESC")
,SharingStatus_ASC("`sharingStatus` ASC"),SharingStatus_DESC("`sharingStatus` DESC")
,FinishTime_ASC("`finishTime` ASC"),FinishTime_DESC("`finishTime` DESC")
,FailedReason_ASC("`failedReason` ASC"),FailedReason_DESC("`failedReason` DESC")
,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC")
,MerchantId_ASC("`merchant_id` ASC"),MerchantId_DESC("`merchant_id` DESC")
,SharingOrderId_ASC("`sharing_order_id` ASC"),SharingOrderId_DESC("`sharing_order_id` DESC")
,SharingReceiverId_ASC("`sharing_receiver_id` ASC"),SharingReceiverId_DESC("`sharing_receiver_id` DESC")
,PayAmount_ASC("`pay_amount` ASC"),PayAmount_DESC("`pay_amount` DESC")
,UpdateTime_ASC("`update_time` ASC"),UpdateTime_DESC("`update_time` DESC")
,CreateTime_ASC("`create_time` ASC"),CreateTime_DESC("`create_time` DESC")
,SharingStatus_ASC("`sharing_status` ASC"),SharingStatus_DESC("`sharing_status` DESC")
,FinishTime_ASC("`finish_time` ASC"),FinishTime_DESC("`finish_time` DESC")
,FailedReason_ASC("`failed_reason` ASC"),FailedReason_DESC("`failed_reason` DESC")
;
private String value;
Field(String value){
@@ -159,6 +182,7 @@ public class WxProfitSharingResult implements Serializable {
sb.append(",");
sb.append(fields[k].toString());
}
this.sortColumns = sb.toString();
}


+ 3
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java ファイルの表示

@@ -184,6 +184,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
wxProfitSharingP.setSign_type("HMAC-SHA256");
//添加分账接受方
WxProfitSharingReceiver wxProfitSharingReceiver = new WxProfitSharingReceiver();
wxProfitSharingReceiver.setTenantId(wxOrder.getTenantId());
wxProfitSharingReceiver.setMerchantId(wxOrder.getMerchantId());
wxProfitSharingReceiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode());
wxProfitSharingReceiver.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode());
@@ -207,6 +208,8 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
WxProfitSharingResult result = new WxProfitSharingResult();

result.setId(idworker.nextId());
result.setTenantId(record.getTenantId());
result.setMerchantId(record.getMerchantId());
result.setSharingOrderId(record.getId());
result.setSharingReceiverId(receiver.getId());
result.setPayAmount(wxPayOrder.getShareAmount());


+ 4
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverServiceImpl.java ファイルの表示

@@ -85,6 +85,7 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv
@Override
public WxProfitSharingReceiver findReceiver(WxMerchant merchant) {
WxProfitSharingReceiver receiver = new WxProfitSharingReceiver();
receiver.setTenantId(merchant.getTenantId());
receiver.setMerchantId(merchant.getId());
receiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode());
receiver.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode());
@@ -103,6 +104,7 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv
appInfo = wxAppinfoMapper.findList(appInfo).get(0);
WxPayAccount payAccount = wxPayAccountMapper.selectByPrimaryKey(appInfo.getPayId());

receiver.setTenantId(merchant.getTenantId());
receiver.setMerchantId(merchant.getId());
receiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode());
receiver.setId(IdWorker.get().nextId());
@@ -172,6 +174,7 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv
WxPayAccount payAccount = wxPayAccountMapper.selectByPrimaryKey(appInfo.getPayId());

WxProfitSharingReceiver receiver = new WxProfitSharingReceiver();
receiver.setTenantId(merchant.getTenantId());
receiver.setMerchantId(merchant.getId());
receiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode());
receiver.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode());
@@ -238,6 +241,7 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv
public ResultData updateReceiver(WxMerchant merchant, WxProfitSharingReceiver receiver) {

WxProfitSharingReceiver oldReceiver = new WxProfitSharingReceiver();
oldReceiver.setTenantId(merchant.getTenantId());
oldReceiver.setMerchantId(merchant.getId());
oldReceiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode());
oldReceiver.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode());


+ 9
- 3
mallinkService/src/main/resources/mapper/WxProfitSharingReceiverMapper.xml ファイルの表示

@@ -3,6 +3,7 @@
<mapper namespace="com.iformall.mapper.WxProfitSharingReceiverMapper">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxProfitSharingReceiver">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
<result column="receiver_type" jdbcType="INTEGER" property="receiverType" />
<result column="receiver_account" jdbcType="VARCHAR" property="receiverAccount" />
@@ -17,7 +18,7 @@
</resultMap>
<sql id="allColumns">
`id`,`merchant_id`,`receiver_type`,`receiver_account`,`receiver_comments`,`create_time`,`update_time`,`sharing_type`,`bank_no`,`true_name`,`bank_code`,`status`
`id`,`tenant_id`,`merchant_id`,`receiver_type`,`receiver_account`,`receiver_comments`,`create_time`,`update_time`,`sharing_type`,`bank_no`,`true_name`,`bank_code`,`status`
</sql>

<sql id="dynamicWhereConditions">
@@ -26,8 +27,13 @@
<if test=" null != id ">
and `id` = #{id}
</if>
</if>

<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}

</if>

<if test=" null != merchantId ">
and `merchant_id` = #{merchantId}


+ 15
- 3
mallinkService/src/main/resources/mapper/WxProfitSharingResultMapper.xml ファイルの表示

@@ -3,6 +3,8 @@
<mapper namespace="com.iformall.mapper.WxProfitSharingResultMapper">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxProfitSharingResult">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
<result column="sharing_order_id" jdbcType="BIGINT" property="sharingOrderId" />
<result column="sharing_receiver_id" jdbcType="BIGINT" property="sharingReceiverId" />
<result column="pay_amount" jdbcType="INTEGER" property="payAmount" />
@@ -14,7 +16,7 @@
</resultMap>
<sql id="allColumns">
`id`,`sharing_order_id`,`sharing_receiver_id`,`pay_amount`,`update_time`,`create_time`,`sharing_status`,`finish_time`,`failed_reason`
`id`,`tenant_id`,`merchant_id`,`sharing_order_id`,`sharing_receiver_id`,`pay_amount`,`update_time`,`create_time`,`sharing_status`,`finish_time`,`failed_reason`
</sql>

<sql id="dynamicWhereConditions">
@@ -23,8 +25,18 @@
<if test=" null != id ">
and `id` = #{id}
</if>
</if>

<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}

</if>

<if test=" null != merchantId ">
and `merchant_id` = #{merchantId}

</if>

<if test=" null != sharingOrderId ">
and `sharing_order_id` = #{sharingOrderId}


読み込み中…
キャンセル
保存