Browse Source

[分账][修复]:手续费问题,分账result填写pay_amount

release_toaliyun_real
Stormeye.Wu 7 years ago
parent
commit
5199a9e235
2 changed files with 18 additions and 1 deletions
  1. +13
    -0
      mallinkService/src/main/java/com/simple/domain/po/WxPayAccount.java
  2. +5
    -1
      mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingOrderServiceImpl.java

+ 13
- 0
mallinkService/src/main/java/com/simple/domain/po/WxPayAccount.java View File

@@ -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){


+ 5
- 1
mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingOrderServiceImpl.java View File

@@ -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 <WxProfitSharingResult> resultList = new ArrayList<WxProfitSharingResult>();
for (int i=0;i<wxProfitSharingReceiverList.size();i++){
@@ -199,7 +202,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
JSONObject jo = new JSONObject();
jo.put("type",EnumProfitSharingReceiverType.getEnum(receiver.getReceiverType()).getMessage());
jo.put("account",receiver.getReceiverAccount());
jo.put("amount",record.getPayAmount()); //temp: sharing all money with only owner
jo.put("amount", total_amount); //temp: sharing all money with only owner
jo.put("description",receiver.getReceiverComments());
receivers.add(jo);

@@ -208,6 +211,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ
result.setId(idworker.nextId());
result.setSharingOrderId(record.getId());
result.setSharingReceiverId(receiver.getId());
result.setPayAmount(total_amount);
result.setCreateTime(currentDate);
result.setUpdateTime(currentDate);
resultList.add(result);


Loading…
Cancel
Save