From 5199a9e2350b16bcd54bc787615379c7a82c2ac8 Mon Sep 17 00:00:00 2001 From: "Stormeye.Wu" Date: Fri, 7 Sep 2018 07:07:53 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=88=86=E8=B4=A6][=E4=BF=AE=E5=A4=8D]:?= =?UTF-8?q?=E6=89=8B=E7=BB=AD=E8=B4=B9=E9=97=AE=E9=A2=98,=E5=88=86?= =?UTF-8?q?=E8=B4=A6result=E5=A1=AB=E5=86=99pay=5Famount?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/simple/domain/po/WxPayAccount.java | 13 +++++++++++++ .../impl/WxProfitSharingOrderServiceImpl.java | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/mallinkService/src/main/java/com/simple/domain/po/WxPayAccount.java b/mallinkService/src/main/java/com/simple/domain/po/WxPayAccount.java index 7545a7682..a063e8f2d 100644 --- a/mallinkService/src/main/java/com/simple/domain/po/WxPayAccount.java +++ b/mallinkService/src/main/java/com/simple/domain/po/WxPayAccount.java @@ -65,6 +65,9 @@ public class WxPayAccount implements Serializable { /**是否开启分账**/ @io.swagger.annotations.ApiModelProperty(value="0:未开启分账1:开启分账",name="type") private boolean share; + /**手续费**/ + @io.swagger.annotations.ApiModelProperty(value="手续费",name="rate") + private Integer rate; public String getTenantId() { return tenantId; @@ -119,6 +122,15 @@ public class WxPayAccount implements Serializable { public void setShare(boolean share) { this.share = share; } + + public Integer getRate() { + return rate; + } + + public void setRate(Integer rate) { + this.rate = rate; + } + public String getPayNotifyUrl() { return notifyUrl + "/pay"; } @@ -141,6 +153,7 @@ public class WxPayAccount implements Serializable { ,CertPath_ASC("`cert_path` ASC"),CertPath_DESC("`cert_path` DESC") ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") ,Share_ASC("`share` ASC"),Share_DESC("`share` DESC") + ,Rate_ASC("`rate` ASC"),Rate_DESC("`rate` DESC") ; private String value; Field(String value){ diff --git a/mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingOrderServiceImpl.java b/mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingOrderServiceImpl.java index 30d6d84b2..5b5533ab4 100644 --- a/mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingOrderServiceImpl.java @@ -191,6 +191,9 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ if (wxProfitSharingReceiverList.size()<=0 || wxProfitSharingReceiverList.size() > 50) { throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getCode(), ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getMessage()); } + // 计算分账总金额,总金额-0.6% + Double amountD = Math.ceil(record.getPayAmount()*1.0D*(1000-payAccount.getRate())/1000); + Integer total_amount = amountD.intValue(); JSONArray receivers = new JSONArray(); List resultList = new ArrayList(); for (int i=0;i