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