From 7d93787129cd4a99dd76fc598838b8a92dfdee78 Mon Sep 17 00:00:00 2001 From: xhxu Date: Wed, 6 Jul 2022 18:31:30 +0800 Subject: [PATCH] //msg ttpay --- .../market/TtCouponGoodsController.java | 3 + .../controller/WxOrderController.java | 132 +++++++++--------- 2 files changed, 69 insertions(+), 66 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/TtCouponGoodsController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/TtCouponGoodsController.java index 74fefdbb1..61f5ffd99 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/TtCouponGoodsController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/TtCouponGoodsController.java @@ -130,6 +130,9 @@ public class TtCouponGoodsController extends BaseController { if(coupon == null){ return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); } + if(coupon.getSalePrice() == null || coupon.getSalePrice().intValue() == 0){ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"免费券无需提审"); + } try { return ttCouponGoodsService.productSave(coupon); diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java index ca9b52487..f078ea121 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java @@ -423,72 +423,72 @@ public class WxOrderController extends BaseController { // } // } - @ApiOperation(value = "继续支付", notes = "{\"composeOrderId\":\"string\"}") - @PostMapping("/continueToPay") - public ResultData continueToPay(@RequestBody Map paramMap) { - logger.info("/api/order/continueToPay" + paramMap.toString()); - String orderIdStr = (String) paramMap.get("composeOrderId"); - if (StringUtils.isBlank(orderIdStr)) { - logger.info("orderId不能为空: " + paramMap.toString()); - return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); - } - Long orderId = 0L; - try { - orderId = Long.valueOf(orderIdStr); - } catch (NumberFormatException e) { - logger.error("orderId参数不正确: " + paramMap.toString() + ", e:" + e.getMessage()); - return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId参数不正确"); - } - - WxBatchOrder batchOrder = wxOrderService.getWxBatchOrder(getTenantInfo(),orderId); - if(batchOrder == null){ - return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未找到订单"); - } - - WxPayOrder payOrder = new WxPayOrder(); - payOrder.setOrderId(orderId); - payOrder.updateTenantInfo(getTenantInfo()); - payOrder.setPayVendor(batchOrder.getPayVendor()); - payOrder.setComposeOrder(batchOrder.getOrderType()); - - try { - WxPayOrder byObj = wxPayOrderService.getByObj(payOrder); - if(byObj == null){ - return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未找到支付订单"); - } - if(EnumPayStatus.PAY_STATUS_WAIT.getCode().equals(byObj.getPayOrderStatus())){ - WxComposeOrder composeOrder = orderFactory.getOrderAdapterService(byObj.getComposeOrder()).getComposeOrder(byObj.getOrderId(), byObj.getTenantId()); - - WxAppinfo appInfo = wxAppinfoService.getCAppInfo(byObj, EnumPayWay.getEnum(byObj.getPayVendor()).getPlat()); - //WxCUser user = getUser(); - //WxAppinfo appInfo = getAppInfo(user.getAppId()); - if (null == appInfo) { - return new ResultData(ErrorCode.PAY_ORDER_ERROR, "当前支付类型["+byObj.getPayVendor()+"]找不到C端appInfo"); - } - WxPayAccount payAccount = wxPayAccountService.getById(appInfo.getPayId()); - try { - WxPayOrder wo = wxPayOrderService.handleWxOrderQuery(byObj, composeOrder,appInfo, payAccount, IdWorker.get(),false); - if (null != wo) { - Map map = new HashMap<>(); - map.put("outOrderNo",orderId); - return new ResultData(map); - } - }catch(MallinkException e) { - //已经同步了微信的支付状态,表示已经更新 - return new ResultData(e.getErrorCode(),e.getMessage()); - } - return new ResultData(ErrorCode.PAY_ORDER_QUERY_ERROR.getCode(), "查询微信订单支付状态失败,请稍后!"); - }else{ - return new ResultData(ErrorCode.PAY_ORDER_QUERY_ERROR.getCode(), "订单"+EnumPayStatus.getEnum(payOrder.getPayOrderStatus()).getMessage()); - } - } catch (MallinkException e) { - logger.error("支付状态更新失败2: " + orderId + ", e:" + e.getMessage(),e); - return new ResultData(e.getErrorCode(), e.getMessage()); - } catch (Exception e) { - logger.error("支付状态更新失败3: " + orderId + ", e:" + e.getMessage(),e); - return new ResultData(ErrorCode.PAY_ORDER_ERROR, "支付状态更新失败3: " + orderId + ", e:" + e.getMessage()); - } - } +// @ApiOperation(value = "继续支付", notes = "{\"composeOrderId\":\"string\"}") +// @PostMapping("/continueToPay") +// public ResultData continueToPay(@RequestBody Map paramMap) { +// logger.info("/api/order/continueToPay" + paramMap.toString()); +// String orderIdStr = (String) paramMap.get("composeOrderId"); +// if (StringUtils.isBlank(orderIdStr)) { +// logger.info("orderId不能为空: " + paramMap.toString()); +// return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); +// } +// Long orderId = 0L; +// try { +// orderId = Long.valueOf(orderIdStr); +// } catch (NumberFormatException e) { +// logger.error("orderId参数不正确: " + paramMap.toString() + ", e:" + e.getMessage()); +// return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId参数不正确"); +// } +// +// WxBatchOrder batchOrder = wxOrderService.getWxBatchOrder(getTenantInfo(),orderId); +// if(batchOrder == null){ +// return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未找到订单"); +// } +// +// WxPayOrder payOrder = new WxPayOrder(); +// payOrder.setOrderId(orderId); +// payOrder.updateTenantInfo(getTenantInfo()); +// payOrder.setPayVendor(batchOrder.getPayVendor()); +// payOrder.setComposeOrder(batchOrder.getOrderType()); +// +// try { +// WxPayOrder byObj = wxPayOrderService.getByObj(payOrder); +// if(byObj == null){ +// return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未找到支付订单"); +// } +// if(EnumPayStatus.PAY_STATUS_WAIT.getCode().equals(byObj.getPayOrderStatus())){ +// WxComposeOrder composeOrder = orderFactory.getOrderAdapterService(byObj.getComposeOrder()).getComposeOrder(byObj.getOrderId(), byObj.getTenantId()); +// +// WxAppinfo appInfo = wxAppinfoService.getCAppInfo(byObj, EnumPayWay.getEnum(byObj.getPayVendor()).getPlat()); +// //WxCUser user = getUser(); +// //WxAppinfo appInfo = getAppInfo(user.getAppId()); +// if (null == appInfo) { +// return new ResultData(ErrorCode.PAY_ORDER_ERROR, "当前支付类型["+byObj.getPayVendor()+"]找不到C端appInfo"); +// } +// WxPayAccount payAccount = wxPayAccountService.getById(appInfo.getPayId()); +// try { +// WxPayOrder wo = wxPayOrderService.handleWxOrderQuery(byObj, composeOrder,appInfo, payAccount, IdWorker.get(),false); +// if (null != wo) { +// Map map = new HashMap<>(); +// map.put("outOrderNo",orderId); +// return new ResultData(map); +// } +// }catch(MallinkException e) { +// //已经同步了微信的支付状态,表示已经更新 +// return new ResultData(e.getErrorCode(),e.getMessage()); +// } +// return new ResultData(ErrorCode.PAY_ORDER_QUERY_ERROR.getCode(), "查询微信订单支付状态失败,请稍后!"); +// }else{ +// return new ResultData(ErrorCode.PAY_ORDER_QUERY_ERROR.getCode(), "订单"+EnumPayStatus.getEnum(payOrder.getPayOrderStatus()).getMessage()); +// } +// } catch (MallinkException e) { +// logger.error("支付状态更新失败2: " + orderId + ", e:" + e.getMessage(),e); +// return new ResultData(e.getErrorCode(), e.getMessage()); +// } catch (Exception e) { +// logger.error("支付状态更新失败3: " + orderId + ", e:" + e.getMessage(),e); +// return new ResultData(ErrorCode.PAY_ORDER_ERROR, "支付状态更新失败3: " + orderId + ", e:" + e.getMessage()); +// } +// }