修复精度丢失问题

This commit is contained in:
cnzzs
2017-08-08 22:24:22 -07:00
parent c192489016
commit 089836bf2f
2 changed files with 3 additions and 3 deletions

View File

@@ -363,7 +363,7 @@ public class FuiouPayService extends BasePayService {
df.setTimeZone(TimeZone.getTimeZone("GMT+8"));
params.put("origin_order_date",df.format(new Date()));//原交易日期
params.put("origin_order_id",tradeNo);//原订单号
params.put("refund_amt",refundAmount);//退款金额
params.put("refund_amt",refundAmount.multiply(new BigDecimal(100)).setScale( 0, BigDecimal.ROUND_HALF_UP).intValue());//退款金额
params.put("rem","");//备注
params.put("md5",createSign(SignUtils.parameters2MD5Str(params,"|"),payConfigStorage.getInputCharset()));
JSONObject resultJson = getHttpRequestTemplate().postForObject(getReqUrl() + URL_FuiouSmpRefundGate,params,JSONObject.class);

View File

@@ -453,8 +453,8 @@ public class WxPayService extends BasePayService {
parameters.put("out_trade_no", outTradeNo);
parameters.put("out_refund_no", outTradeNo);
}
parameters.put("total_fee", totalAmount.multiply(new BigDecimal(100)).intValue());
parameters.put("refund_fee", refundAmount.multiply(new BigDecimal(100)).intValue());
parameters.put("total_fee", totalAmount.multiply(new BigDecimal(100)).setScale( 0, BigDecimal.ROUND_HALF_UP).intValue());
parameters.put("refund_fee", refundAmount.multiply(new BigDecimal(100)).setScale( 0, BigDecimal.ROUND_HALF_UP).intValue());
parameters.put("op_user_id", payConfigStorage.getPid());
//设置签名