会员购买补充

This commit is contained in:
张松
2025-09-27 18:40:09 +08:00
parent a59f76cd76
commit 9c877ea969

View File

@@ -40,19 +40,19 @@ public class OrderPayController {
@DubboReference @DubboReference
private SysParamsService paramsService; private SysParamsService paramsService;
// @PostMapping("/creditPay") @PostMapping("/creditPay")
// @Debounce(value = "#payParam.checkOrderPay.orderId") @Debounce(value = "#payParam.checkOrderPay.orderId")
// public CzgResult<Object> creditPayOrder(@RequestHeader Long shopId, @Validated @RequestBody OrderPayParamDTO payParam) { public CzgResult<Object> creditPayOrder(@RequestHeader Long shopId, @Validated @RequestBody OrderPayParamDTO payParam) {
// payParam.setShopId(shopId); payParam.setShopId(shopId);
// return payService.creditPayOrder(payParam); return payService.creditPayOrder(payParam);
// } }
//
// @PostMapping("/cashPay") @PostMapping("/cashPay")
// @Debounce(value = "#payParam.checkOrderPay.orderId") @Debounce(value = "#payParam.checkOrderPay.orderId")
// public CzgResult<Object> cashPayOrder(@RequestHeader Long shopId, @Validated @RequestBody OrderPayParamDTO payParam) { public CzgResult<Object> cashPayOrder(@RequestHeader Long shopId, @Validated @RequestBody OrderPayParamDTO payParam) {
// payParam.setShopId(shopId); payParam.setShopId(shopId);
// return payService.cashPayOrder(payParam); return payService.cashPayOrder(payParam);
// } }
/** /**
* 充值并付款 * 充值并付款
@@ -66,128 +66,128 @@ public class OrderPayController {
return payService.rechargePayOrder(ServletUtil.getClientIP(request), payParam); return payService.rechargePayOrder(ServletUtil.getClientIP(request), payParam);
} }
// /** /**
// * 会员支付 * 会员支付
// * payType 必填 * payType 必填
// * <p> * <p>
// * scanCode(收银机使用) 会员码支付 authCode 必填 * scanCode(收银机使用) 会员码支付 authCode 必填
// * userPay(收银机使用) 选择用户支付 userId必填 * userPay(收银机使用) 选择用户支付 userId必填
// * <p> * <p>
// * accountPay(小程序使用) 密码支付 用户密码pwd 必填 * accountPay(小程序使用) 密码支付 用户密码pwd 必填
// */ */
// @PostMapping("/vipPay") @PostMapping("/vipPay")
// @Debounce(value = "#payParam.checkOrderPay.orderId") @Debounce(value = "#payParam.checkOrderPay.orderId")
// public CzgResult<Object> vipPayOrder(@RequestHeader Long shopId, @Validated @RequestBody OrderPayParamDTO payParam) { public CzgResult<Object> vipPayOrder(@RequestHeader Long shopId, @Validated @RequestBody OrderPayParamDTO payParam) {
// payParam.setShopId(shopId); payParam.setShopId(shopId);
// AssertUtil.isBlank(payParam.getPayType(), "支付类型不可为空"); AssertUtil.isBlank(payParam.getPayType(), "支付类型不可为空");
// return payService.vipPayOrder(payParam); return payService.vipPayOrder(payParam);
// } }
//
// /** /**
// * h5支付 * h5支付
// */ */
// @PostMapping("/h5Pay") @PostMapping("/h5Pay")
// @Debounce(value = "#payParam.checkOrderPay.orderId") @Debounce(value = "#payParam.checkOrderPay.orderId")
// public CzgResult<Map<String, Object>> h5PayOrder(@RequestHeader Long shopId, HttpServletRequest request, @Validated @RequestBody OrderPayParamDTO payParam) { public CzgResult<Map<String, Object>> h5PayOrder(@RequestHeader Long shopId, HttpServletRequest request, @Validated @RequestBody OrderPayParamDTO payParam) {
// payParam.setShopId(shopId); payParam.setShopId(shopId);
// return payService.h5PayOrder(ServletUtil.getClientIP(request, ""), payParam); return payService.h5PayOrder(ServletUtil.getClientIP(request, ""), payParam);
// } }
//
// /** /**
// * js支付 * js支付
// * <p> * <p>
// * payType 必填 支付方式aliPay 支付宝wechatPay 微信 * payType 必填 支付方式aliPay 支付宝wechatPay 微信
// * openId 必填 * openId 必填
// */ */
// @PostMapping("/jsPay") @PostMapping("/jsPay")
// @Debounce(value = "#payParam.checkOrderPay.orderId") @Debounce(value = "#payParam.checkOrderPay.orderId")
// public CzgResult<Map<String, Object>> jsPayOrder(@RequestHeader Long shopId, HttpServletRequest request, @Validated @RequestBody OrderPayParamDTO payParam) { public CzgResult<Map<String, Object>> jsPayOrder(@RequestHeader Long shopId, HttpServletRequest request, @Validated @RequestBody OrderPayParamDTO payParam) {
// payParam.setShopId(shopId); payParam.setShopId(shopId);
// return payService.jsPayOrder(ServletUtil.getClientIP(request), payParam); return payService.jsPayOrder(ServletUtil.getClientIP(request), payParam);
// } }
//
// /** /**
// * 小程序支付 * 小程序支付
// * payType 必填 支付方式aliPay 支付宝wechatPay 微信 * payType 必填 支付方式aliPay 支付宝wechatPay 微信
// * openId 必填 * openId 必填
// */ */
// @PostMapping("/ltPayOrder") @PostMapping("/ltPayOrder")
// @Debounce(value = "#payParam.checkOrderPay.orderId") @Debounce(value = "#payParam.checkOrderPay.orderId")
// public CzgResult<Map<String, Object>> ltPayOrder(@RequestHeader Long shopId, HttpServletRequest request, @Validated @RequestBody OrderPayParamDTO payParam) { public CzgResult<Map<String, Object>> ltPayOrder(@RequestHeader Long shopId, HttpServletRequest request, @Validated @RequestBody OrderPayParamDTO payParam) {
// payParam.setShopId(shopId); payParam.setShopId(shopId);
// return payService.ltPayOrder(ServletUtil.getClientIP(request), payParam); return payService.ltPayOrder(ServletUtil.getClientIP(request), payParam);
// } }
//
// /** /**
// * 正扫 * 正扫
// */ */
// @PostMapping("/scanPay") @PostMapping("/scanPay")
// @Debounce(value = "#payParam.checkOrderPay.orderId") @Debounce(value = "#payParam.checkOrderPay.orderId")
// public CzgResult<Map<String, Object>> scanPayOrder(@RequestHeader Long shopId, HttpServletRequest request, @Validated @RequestBody OrderPayParamDTO payParam) { public CzgResult<Map<String, Object>> scanPayOrder(@RequestHeader Long shopId, HttpServletRequest request, @Validated @RequestBody OrderPayParamDTO payParam) {
// payParam.setShopId(shopId); payParam.setShopId(shopId);
// return payService.scanPayOrder(ServletUtil.getClientIP(request), payParam); return payService.scanPayOrder(ServletUtil.getClientIP(request), payParam);
// } }
//
// /** /**
// * 反扫 * 反扫
// * authCode 必填 扫描码 * authCode 必填 扫描码
// */ */
// @PostMapping("/microPay") @PostMapping("/microPay")
// @Debounce(value = "#payParam.checkOrderPay.orderId") @Debounce(value = "#payParam.checkOrderPay.orderId")
// public CzgResult<Map<String, Object>> microPayOrder(@RequestHeader Long shopId, @Validated @RequestBody OrderPayParamDTO payParam) { public CzgResult<Map<String, Object>> microPayOrder(@RequestHeader Long shopId, @Validated @RequestBody OrderPayParamDTO payParam) {
// payParam.setShopId(shopId); payParam.setShopId(shopId);
// return payService.microPayOrder(payParam); return payService.microPayOrder(payParam);
// } }
//
// /** /**
// * 获取店铺订单支付URL * 获取店铺订单支付URL
// */ */
// @GetMapping("/shopPayApi/orderPayUrl") @GetMapping("/shopPayApi/orderPayUrl")
// @Debounce(value = "#checkOrderPay.orderId") @Debounce(value = "#checkOrderPay.orderId")
// public CzgResult<String> getOrderPayUrl(@RequestHeader Long shopId, @RequestParam(required = false) String extend, public CzgResult<String> getOrderPayUrl(@RequestHeader Long shopId, @RequestParam(required = false) String extend,
// CheckOrderPay checkOrderPay) { CheckOrderPay checkOrderPay) {
// AssertUtil.isNull(shopId, "店铺id不能为空"); AssertUtil.isNull(shopId, "店铺id不能为空");
// AssertUtil.isNull(checkOrderPay, "订单信息不能为空"); AssertUtil.isNull(checkOrderPay, "订单信息不能为空");
// Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
// map.put("shopId", shopId); map.put("shopId", shopId);
// map.put("orderId", checkOrderPay.getOrderId()); map.put("orderId", checkOrderPay.getOrderId());
// map.put("payAmount", checkOrderPay.getOrderAmount()); map.put("payAmount", checkOrderPay.getOrderAmount());
// map.put("extend", StrUtil.isEmpty(extend) ? "" : extend); map.put("extend", StrUtil.isEmpty(extend) ? "" : extend);
// if (checkOrderPay.getOrderId() != null) { if (checkOrderPay.getOrderId() != null) {
// OrderInfo orderInfo = orderInfoService.checkOrderPay(checkOrderPay); OrderInfo orderInfo = orderInfoService.checkOrderPay(checkOrderPay);
// map.put("payAmount", orderInfo.getOrderAmount()); map.put("payAmount", orderInfo.getOrderAmount());
// } }
// String baseUrl = paramsService.getSysParamValue(SysParamCodeEnum.SHOP_ORDER_PAY_BASE_URL.getCode()); String baseUrl = paramsService.getSysParamValue(SysParamCodeEnum.SHOP_ORDER_PAY_BASE_URL.getCode());
// String buildUrl = URLUtil.buildQuery(map, Charset.defaultCharset()); String buildUrl = URLUtil.buildQuery(map, Charset.defaultCharset());
// String fullUrl = baseUrl.concat("?").concat(buildUrl); String fullUrl = baseUrl.concat("?").concat(buildUrl);
// return CzgResult.success(fullUrl); return CzgResult.success(fullUrl);
// } }
//
// /** /**
// * payType 必填 支付方式aliPay 支付宝wechatPay 微信 * payType 必填 支付方式aliPay 支付宝wechatPay 微信
// * openId 必填 * openId 必填
// * checkOrderPay.orderAmount 必填 * checkOrderPay.orderAmount 必填
// */ */
// @PostMapping("/shopPayApi/js2Pay") @PostMapping("/shopPayApi/js2Pay")
// @Debounce(value = "#payParam.checkOrderPay.orderId") @Debounce(value = "#payParam.checkOrderPay.orderId")
// public CzgResult<Map<String, Object>> js2PayOrder(HttpServletRequest request, @RequestBody OrderPayParamDTO payParam) { public CzgResult<Map<String, Object>> js2PayOrder(HttpServletRequest request, @RequestBody OrderPayParamDTO payParam) {
// return payService.js2PayOrder(ServletUtil.getClientIP(request), payParam); return payService.js2PayOrder(ServletUtil.getClientIP(request), payParam);
// } }
//
// /** /**
// * 获取订单状态 * 获取订单状态
// * unpaid-待支付;in-production 制作中;wait-out 待取餐;;done-订单完成;refunding-申请退单;refund-退单;part-refund 部分退单;cancelled-取消订单 * unpaid-待支付;in-production 制作中;wait-out 待取餐;;done-订单完成;refunding-申请退单;refund-退单;part-refund 部分退单;cancelled-取消订单
// */ */
// @GetMapping("/queryOrderStatus") @GetMapping("/queryOrderStatus")
// public CzgResult<String> queryOrderStatus(Long orderId) { public CzgResult<String> queryOrderStatus(Long orderId) {
// CzgResult<String> result = CzgResult.success(); CzgResult<String> result = CzgResult.success();
// String status = orderInfoService.queryChain().select(OrderInfo::getStatus).eq(OrderInfo::getId, orderId).oneAs(String.class); String status = orderInfoService.queryChain().select(OrderInfo::getStatus).eq(OrderInfo::getId, orderId).oneAs(String.class);
// result.setData(status); result.setData(status);
// switch (status) { switch (status) {
// case "unpaid" -> result.setMsg("等待用户付款"); case "unpaid" -> result.setMsg("等待用户付款");
// case "done" -> result.setMsg("支付完成"); case "done" -> result.setMsg("支付完成");
// case "cancelled" -> result.setMsg("订单已取消"); case "cancelled" -> result.setMsg("订单已取消");
// } }
// return result; return result;
// } }
} }