Browse Source

[微信手续费][修复]手续费重新计算

release_toaliyun_real
Stormeye.Wu 7 years ago
parent
commit
77a46c1952
1 changed files with 12 additions and 2 deletions
  1. +12
    -2
      mallinkService/src/main/java/com/simple/service/impl/WxPayOrderServiceImpl.java

+ 12
- 2
mallinkService/src/main/java/com/simple/service/impl/WxPayOrderServiceImpl.java View File

@@ -23,9 +23,11 @@ import com.simple.service.WxOrderService;
import com.simple.service.WxPayOrderService;
import com.simple.utils.*;
import io.swagger.models.auth.In;
import jdk.nashorn.internal.ir.IdentNode;
import me.chanjar.weixin.common.error.WxErrorException;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.simple.common.IdWorker;
@@ -154,8 +156,8 @@ public class WxPayOrderServiceImpl implements WxPayOrderService {
record.setShare(isShare.getCode());
if (isShare == EnumPayShare.YES) {
// 分账金额
Float dChargeFee = record.getPayAmount()*1.0f*payAccount.getRate()/1000;
Integer share_amount = record.getPayAmount() - Math.round(dChargeFee.floatValue());
Double dChargeFee = Math.ceil(record.getPayAmount()*1.0D*payAccount.getRate()/1000);
Integer share_amount = record.getPayAmount() - dChargeFee.intValue();
record.setShareAmount(share_amount);
}

@@ -914,4 +916,12 @@ public class WxPayOrderServiceImpl implements WxPayOrderService {
throw new MallinkException(ErrorCode.TEMPLATE_SEND_FAILED);
}
}

public static void main(String [] args) {
Integer v = 500;
Integer rate = 6;
Double dChargeFee = Math.ceil(v*1.0D*6/1000);
Integer share_amount = v - dChargeFee.intValue();
System.out.println("share value " + share_amount);
}
}

Loading…
Cancel
Save