From 464fe8f570b4557e14e4d6c7407cfd3661b2a6e2 Mon Sep 17 00:00:00 2001 From: hupeng Date: Tue, 16 Oct 2018 12:28:10 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=94=AF=E4=BB=98][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E5=88=86=E8=B4=A6=E7=9B=B8=E5=85=B3=E8=A1=A8=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=86=97=E4=BD=99=E7=A7=9F=E6=88=B7id=E5=92=8C=E5=95=86?= =?UTF-8?q?=E6=88=B7id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/po/WxProfitSharingOrder.java | 26 ++++++----- .../domain/po/WxProfitSharingReceiver.java | 38 +++++++++------ .../domain/po/WxProfitSharingResult.java | 46 ++++++++++++++----- .../impl/WxProfitSharingOrderServiceImpl.java | 3 ++ .../WxProfitSharingReceiverServiceImpl.java | 4 ++ .../mapper/WxProfitSharingReceiverMapper.xml | 12 +++-- .../mapper/WxProfitSharingResultMapper.xml | 18 ++++++-- 7 files changed, 105 insertions(+), 42 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingOrder.java b/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingOrder.java index 83da4322b..ac5c2af00 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingOrder.java +++ b/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(); } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingReceiver.java b/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingReceiver.java index 39314dc14..aa0b8777f 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingReceiver.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingReceiver.java @@ -38,9 +38,11 @@ public class WxProfitSharingReceiver implements Serializable { public void setIds(List 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(); } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingResult.java b/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingResult.java index 2f97fbe80..1d01fa3a6 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingResult.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingResult.java @@ -38,9 +38,15 @@ public class WxProfitSharingResult implements Serializable { public void setIds(List 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(); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java index d30d2e764..639774e84 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java +++ b/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()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverServiceImpl.java index 4261e6128..c28b8fb11 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverServiceImpl.java +++ b/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()); diff --git a/mallinkService/src/main/resources/mapper/WxProfitSharingReceiverMapper.xml b/mallinkService/src/main/resources/mapper/WxProfitSharingReceiverMapper.xml index 18b0297ad..23ad2532a 100644 --- a/mallinkService/src/main/resources/mapper/WxProfitSharingReceiverMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxProfitSharingReceiverMapper.xml @@ -3,6 +3,7 @@ + @@ -17,7 +18,7 @@ - `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` @@ -26,8 +27,13 @@ and `id` = #{id} - - + + + + and `tenant_id` = #{tenantId} + + + and `merchant_id` = #{merchantId} diff --git a/mallinkService/src/main/resources/mapper/WxProfitSharingResultMapper.xml b/mallinkService/src/main/resources/mapper/WxProfitSharingResultMapper.xml index 600e1dcd8..a91c65c09 100644 --- a/mallinkService/src/main/resources/mapper/WxProfitSharingResultMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxProfitSharingResultMapper.xml @@ -3,6 +3,8 @@ + + @@ -14,7 +16,7 @@ - `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` @@ -23,8 +25,18 @@ and `id` = #{id} - - + + + + and `tenant_id` = #{tenantId} + + + + + and `merchant_id` = #{merchantId} + + + and `sharing_order_id` = #{sharingOrderId}