解决手续费计算规则
This commit is contained in:
parent
4882e59be9
commit
b11b8b9c2b
|
|
@ -50,7 +50,7 @@ public class AdapayUtils {
|
|||
* @return 保留两位小数的String
|
||||
*/
|
||||
public static String bigDecimalToString(BigDecimal b) {
|
||||
return b.setScale(2, RoundingMode.HALF_UP).toString();
|
||||
return b.setScale(2, RoundingMode.CEILING).toString();
|
||||
}
|
||||
|
||||
public synchronized static String createOrderNo(AdapayOrderType type) {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import org.springframework.util.CollectionUtils;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.DateTimeFormatterBuilder;
|
||||
|
|
@ -350,7 +351,7 @@ public class OrderDetailServiceImpl implements OrderDetailService {
|
|||
DivMember feeDivMember = new DivMember("0", AdapayUtils.bigDecimalToString(fee), true);
|
||||
divMembers.add(feeDivMember);
|
||||
|
||||
BigDecimal totalMoney = feeAmount.add(fee);
|
||||
BigDecimal totalMoney = feeAmount.add(fee.setScale(2, RoundingMode.CEILING));
|
||||
// 扣除交易费用
|
||||
String sureMoney = AdapayUtils.bigDecimalToString(totalMoney);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue