From 89c87525940b5f3e4d1ae305a51f26507cc9e92f Mon Sep 17 00:00:00 2001 From: LionCity <18026623439@163.com> Date: Mon, 1 Jun 2020 18:23:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=94=AF=E4=BB=98=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E7=B2=BE=E5=BA=A6=E4=B8=A2=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/wechat/web/controller/WechatController.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/yshop-api/src/main/java/co/yixiang/modules/wechat/web/controller/WechatController.java b/yshop-api/src/main/java/co/yixiang/modules/wechat/web/controller/WechatController.java index cbe2e642..e9504efc 100644 --- a/yshop-api/src/main/java/co/yixiang/modules/wechat/web/controller/WechatController.java +++ b/yshop-api/src/main/java/co/yixiang/modules/wechat/web/controller/WechatController.java @@ -22,6 +22,7 @@ import co.yixiang.modules.user.entity.YxUserRecharge; import co.yixiang.modules.user.service.YxUserRechargeService; import co.yixiang.mp.config.WxMpConfiguration; import co.yixiang.mp.config.WxPayConfiguration; +import co.yixiang.utils.BigNum; import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse; import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; import com.github.binarywang.wxpay.bean.notify.WxPayRefundNotifyResult; @@ -159,7 +160,7 @@ public class WechatController extends BaseController { WxPayService wxPayService = WxPayConfiguration.getPayService(); WxPayRefundNotifyResult result = wxPayService.parseRefundNotifyResult(xmlData); String orderId = result.getReqInfo().getOutTradeNo(); - Integer refundFee = result.getReqInfo().getRefundFee()/100; + BigDecimal refundFee = BigNum.div(result.getReqInfo().getRefundFee(), 100); YxStoreOrderQueryVo orderInfo = orderService.getOrderInfo(orderId,0); if(orderInfo.getRefundStatus() == 2){ return WxPayNotifyResponse.success("处理成功!"); @@ -168,16 +169,14 @@ public class WechatController extends BaseController { //修改状态 storeOrder.setId(orderInfo.getId()); storeOrder.setRefundStatus(2); - storeOrder.setRefundPrice(BigDecimal.valueOf(refundFee)); + storeOrder.setRefundPrice(refundFee); orderService.updateById(storeOrder); return WxPayNotifyResponse.success("处理成功!"); - } catch (WxPayException e) { + } catch (WxPayException | IllegalAccessException e) { log.error(e.getMessage()); return WxPayNotifyResponse.fail(e.getMessage()); } } - - /** * 微信验证消息 */