判断金额问题
This commit is contained in:
parent
e9890a3856
commit
8d329e6b05
@ -44,7 +44,6 @@ public class AppWxPayController {
|
||||
@ApiOperation(value = "微信支付回调", notes = "微信支付回调")
|
||||
@PostMapping("/payNotify")
|
||||
@IgnoreToken
|
||||
@RequestToFile
|
||||
public ApiResponse<?> payNotify(HttpServletRequest request) {
|
||||
wxPayService.payNotify(request);
|
||||
return ApiResponse.success(BizCodeEnum.REQUEST_OK);
|
||||
@ -61,7 +60,6 @@ public class AppWxPayController {
|
||||
@ApiOperation(value = "微信支付退款回调", notes = "微信支付退款回调")
|
||||
@PostMapping("/refundNotify")
|
||||
@IgnoreToken
|
||||
@RequestToFile
|
||||
public ApiResponse<?> refundNotify(@RequestBody String refundResult) throws GeneralSecurityException, IOException {
|
||||
return ApiResponse.buildResult(wxPayService.refundNotify(refundResult) ?
|
||||
BizCodeEnum.SUCCESS :
|
||||
|
@ -17,6 +17,7 @@ import java.util.List;
|
||||
@ApiModel("移动端订单信息响应类")
|
||||
public class OrderAppRespVO {
|
||||
private Long id;
|
||||
private Integer type;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
|
@ -163,7 +163,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
goodsName = "景区照片包";
|
||||
}
|
||||
}
|
||||
if (order.getPayPrice().equals(BigDecimal.ZERO)) {
|
||||
if (order.getPayPrice().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
// 0元支付
|
||||
WxPayRespVO wxPayRespVO = new WxPayRespVO();
|
||||
wxPayRespVO.setNeedPay(false);
|
||||
@ -172,7 +172,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
wxPayOrderReqVO.setOpenId(order.getOpenId())
|
||||
.setMemberId(order.getMemberId())
|
||||
.setOrderSn(order.getId())
|
||||
.setTotalPrice(BigDecimalUtil.convertToCents(order.getPrice()))
|
||||
.setTotalPrice(BigDecimalUtil.convertToCents(order.getPayPrice()))
|
||||
.setGoodsName(goodsName)
|
||||
.setDescription(goodsName);
|
||||
|
||||
@ -350,9 +350,13 @@ public class OrderServiceImpl implements OrderService {
|
||||
return ApiResponse.fail("订单添加失败");
|
||||
}
|
||||
//点击支付按钮统计
|
||||
|
||||
WxPayRespVO wxPayRespVO = initiatePayment(order, orderItems);
|
||||
return ApiResponse.success(wxPayRespVO);
|
||||
if (order.getPayPrice().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
orderBiz.paidOrder(order.getId());
|
||||
return ApiResponse.success(new WxPayRespVO());
|
||||
} else {
|
||||
WxPayRespVO wxPayRespVO = initiatePayment(order, orderItems);
|
||||
return ApiResponse.success(wxPayRespVO);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -404,9 +408,13 @@ public class OrderServiceImpl implements OrderService {
|
||||
log.error("订单明细添加失败");
|
||||
return ApiResponse.fail("订单添加失败");
|
||||
}
|
||||
|
||||
WxPayRespVO wxPayRespVO = initiatePayment(order, orderItems);
|
||||
return ApiResponse.success(wxPayRespVO);
|
||||
if (order.getPayPrice().equals(BigDecimal.ZERO)) {
|
||||
orderBiz.paidOrder(order.getId());
|
||||
return ApiResponse.success(new WxPayRespVO());
|
||||
} else {
|
||||
WxPayRespVO wxPayRespVO = initiatePayment(order, orderItems);
|
||||
return ApiResponse.success(wxPayRespVO);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user