diff --git a/suimangCApi/src/main/java/com/iformall/controller/ProductOrderController.java b/suimangCApi/src/main/java/com/iformall/controller/ProductOrderController.java index 1901f01..d2c2fd4 100644 --- a/suimangCApi/src/main/java/com/iformall/controller/ProductOrderController.java +++ b/suimangCApi/src/main/java/com/iformall/controller/ProductOrderController.java @@ -127,6 +127,13 @@ public class ProductOrderController extends BaseController { if(payVendorEnum == null){ return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"支付方式参数错误"); } + + if(EnumProductOrderPayVendor.PAY_WAY_WECHAT.getCode().equals(payVendor)){ + if(StringUtils.isBlank(openId)){ + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"openId为空"); + } + } + Long id = null; try{ id = Long.parseLong(orderNumber); @@ -139,11 +146,8 @@ public class ProductOrderController extends BaseController { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未查询到订单"); } - if(EnumProductOrderPayVendor.PAY_WAY_WECHAT.getCode().equals(record.getPayVendor())){ - if(StringUtils.isBlank(openId)){ - return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"openId为空"); - } - } + productOrder.setOpenId(openId); + productOrder.setPayVendor(payVendor); ResultData resultData = productOrderService.createPay(productOrder);