You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
878 lines
47 KiB
878 lines
47 KiB
package com.web.controller;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.hai.common.exception.ErrorCode;
|
|
import com.hai.common.exception.ErrorHelp;
|
|
import com.hai.common.exception.SysCode;
|
|
import com.hai.common.pay.WechatPayUtil;
|
|
import com.hai.common.pay.entity.WeChatPayReqInfo;
|
|
import com.hai.common.pay.util.MD5Util;
|
|
import com.hai.common.security.AESEncodeUtil;
|
|
import com.hai.common.security.UserCenter;
|
|
import com.hai.common.utils.DateUtil;
|
|
import com.hai.common.utils.ResponseMsgUtil;
|
|
import com.hai.config.UnionPayConfig;
|
|
import com.hai.config.WxOrderConfig;
|
|
import com.hai.entity.*;
|
|
import com.hai.enum_type.GasChannel;
|
|
import com.hai.enum_type.GasChannelPayPlatformType;
|
|
import com.hai.enum_type.MerchantStoreSourceType;
|
|
import com.hai.enum_type.UserCardType;
|
|
import com.hai.model.HighMerchantStoreModel;
|
|
import com.hai.model.HighUserModel;
|
|
import com.hai.model.ResponseData;
|
|
import com.hai.order.model.combine.CombineOrderModel;
|
|
import com.hai.order.service.OrderPayBeforeService;
|
|
import com.hai.order.service.OrderService;
|
|
import com.hai.order.service.OrderPayService;
|
|
import com.hai.order.type.OrderProductType;
|
|
import com.hai.order.type.OrderStatus;
|
|
import com.hai.order.type.PlatformType;
|
|
import com.hai.order.utils.OrderUtil;
|
|
import com.hai.pay.channel.huift.TradeService;
|
|
import com.hai.pay.channel.huipay.config.HuiConfig;
|
|
import com.hai.service.*;
|
|
import com.web.config.SysConst;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.bouncycastle.LICENSE;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import java.math.BigDecimal;
|
|
import java.util.*;
|
|
import java.util.concurrent.ThreadLocalRandom;
|
|
|
|
/**
|
|
* 订单支付
|
|
*
|
|
* @className: OrderPayController
|
|
* @author: HuRui
|
|
* @date: 2022/8/30
|
|
**/
|
|
@Controller
|
|
@RequestMapping("/orderPay")
|
|
@Api(value = "订单支付")
|
|
public class OrderPayController {
|
|
|
|
private static Logger log = LoggerFactory.getLogger(OrderPayController.class);
|
|
|
|
@Resource
|
|
private UserCenter userCenter;
|
|
|
|
@Resource
|
|
private HighUserCardService userCardService;
|
|
|
|
@Resource
|
|
private HighUserPayPasswordService userPayPasswordService;
|
|
|
|
@Resource
|
|
private HighMerchantStoreService merchantStoreService;
|
|
|
|
@Resource
|
|
private OrderService orderService;
|
|
|
|
@Resource
|
|
private OrderPayService orderPayService;
|
|
|
|
@Resource
|
|
private UnionPayConfig unionPayConfig;
|
|
|
|
@Resource
|
|
private HighGasService gasService;
|
|
|
|
@Resource
|
|
private HighCouponService couponService;
|
|
|
|
@Resource
|
|
private HighGasChannelConfigService gasChannelConfigService;
|
|
|
|
@Resource
|
|
private HighMerchantTripartitePlatformService merTripartitePlatformService;
|
|
|
|
@Resource
|
|
private WechatPayUtil wechatPayUtil;
|
|
|
|
@Resource
|
|
private OrderPayBeforeService orderPayBeforeService;
|
|
@Resource
|
|
private TradeService huiftTradeService;
|
|
|
|
@Resource
|
|
private SecConfigService secConfigService;
|
|
@Resource
|
|
private HighQzOrderService qzOrderService;
|
|
|
|
@Resource
|
|
private HuiConfig huiConfig;
|
|
|
|
@RequestMapping(value = "/wechatPay", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ApiOperation(value = "微信支付")
|
|
public ResponseData wechatPay(@RequestBody JSONObject body) {
|
|
try {
|
|
|
|
System.out.println("微信支付===================" + body);
|
|
|
|
if (body == null
|
|
|| StringUtils.isBlank(body.getString("orderNo"))
|
|
// || body.getInteger("openIdType") == null
|
|
|| StringUtils.isBlank(body.getString("openId"))
|
|
) {
|
|
log.error("wxPay error!", "参数错误");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
|
|
}
|
|
|
|
// 查询订单
|
|
HighOrder order = orderService.getOrderDetailByNo(body.getString("orderNo"));
|
|
if (!order.getOrderStatus().equals(OrderStatus.STATUS1.getNumber())) {
|
|
log.error("wxPay ERROR", "订单不处于待支付状态");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.ORDER_NO_STAY_PAY, "");
|
|
}
|
|
Integer openIdType = body.getInteger("openIdType");
|
|
// 是否分账
|
|
String profitSharing = "N";
|
|
// 订单标题
|
|
String orderTitle = "购买商品";
|
|
|
|
// 微信支付
|
|
String nonce_str = MD5Util.MD5Encode(String.valueOf(ThreadLocalRandom.current().nextInt(10000)), "UTF-8");
|
|
int total_fee = order.getPayPrice().multiply(new BigDecimal("100")).intValue();
|
|
WeChatPayReqInfo weChatPayReqInfo = new WeChatPayReqInfo();
|
|
weChatPayReqInfo.setAppid(SysConst.getSysConfig().getWxPayMchAppId()); // 公众号id
|
|
weChatPayReqInfo.setMch_id(SysConst.getSysConfig().getWxPayMchId()); // 商户号
|
|
if (PlatformType.TYPE2.getNumber().equals(body.getInteger("platformType"))) {
|
|
if (openIdType != null && openIdType.equals(2)) {
|
|
weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_QYX_MP); // 黔印象公众号
|
|
} else {
|
|
weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_QYX_MINI); // 黔印象小程序
|
|
}
|
|
} else if (PlatformType.TYPE3.getNumber().equals(body.getInteger("platformType"))) {
|
|
if (openIdType != null && openIdType.equals(2)) {
|
|
weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_HSG_MP); // 黔印象公众号
|
|
} else {
|
|
weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_ZXJZ_MINI); // 黔印象小程序
|
|
}
|
|
}else {
|
|
if (openIdType != null && openIdType.equals(2)) {
|
|
weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_HSG_MP); // 商户号公众号
|
|
} else {
|
|
weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_HSG_MINI); // 嗨森逛小程序
|
|
}
|
|
}
|
|
|
|
// 订单产品类型
|
|
OrderProductType productType = OrderProductType.getDataByType(order.getProductType());
|
|
if (productType != null) {
|
|
orderTitle = productType.getName();
|
|
}
|
|
JSONObject objectGas = new JSONObject();
|
|
|
|
Integer payPlatformType = 1;
|
|
String payPlatformKey = null;
|
|
String payPlatformMerNo = null;
|
|
System.out.println(order);
|
|
|
|
if (PlatformType.TYPE2.getNumber().equals(body.getInteger("platformType"))) {
|
|
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1648729281);
|
|
} else {
|
|
if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE1.getNumber())) {
|
|
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195);
|
|
|
|
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE2.getNumber())) {
|
|
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195);
|
|
|
|
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE3.getNumber())) {
|
|
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195);
|
|
|
|
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE4.getNumber())) {
|
|
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195);
|
|
|
|
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE5.getNumber())) {
|
|
HighCoupon coupon = couponService.getCouponById(order.getHighChildOrderList().get(0).getGoodsId());
|
|
if (coupon.getCouponSource() != null && coupon.getCouponSource().equals(4)) {
|
|
// GZ_SINOPEC_QUOTA 单日限购数量
|
|
SecConfig gzSinopecQuota = secConfigService.findByCodeType("GZ_SINOPEC_QUOTA");
|
|
if (gzSinopecQuota != null
|
|
&& couponService.userBuySourceLimitNumber(order.getMemId(), 4) >= Integer.parseInt(gzSinopecQuota.getCodeValue())) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂时无法支付,已达单日限购数量");
|
|
}
|
|
if (order.getMemDiscountId() != null) {
|
|
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195);
|
|
} else {
|
|
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1634835264);
|
|
}
|
|
}else if(coupon.getCouponSource().equals(8)) {
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type3);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
payPlatformType = gasChannelConfig.getPayPlatformType();
|
|
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
|
|
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
|
|
|
|
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
}else if(coupon.getCouponSource().equals(10)) {
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type8);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
payPlatformType = gasChannelConfig.getPayPlatformType();
|
|
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
|
|
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
|
|
|
|
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
} else {
|
|
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195);
|
|
}
|
|
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE6.getNumber())) {
|
|
// 查询油站
|
|
HighMerchantStoreModel store = merchantStoreService.getMerchantStoreById(order.getHighChildOrderList().get(0).getGoodsId());
|
|
if (store == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的加油站");
|
|
}
|
|
if (store.getPrestoreType().equals(1)) {
|
|
if (order.getTotalPrice().compareTo(gasService.getMerPriceByMerId(store.getMerchantId())) == 1) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂时无法进行支付,请联系平台客服");
|
|
}
|
|
}
|
|
|
|
if (store.getSourceType().equals(MerchantStoreSourceType.type1.getNumber())) {
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type1);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
|
|
if (store.getSourceType().equals(1)) {
|
|
// 预存类型 0:非预存 1:预存门店
|
|
if (store.getPrestoreType().equals(0)) {
|
|
// 第三方平台
|
|
HighMerchantTripartitePlatform merTripartitePlatform = merTripartitePlatformService.getDetail(store.getMerchantId());
|
|
// 微信直连
|
|
if (merTripartitePlatform != null && merTripartitePlatform.getPlatformType().equals(1)) {
|
|
weChatPayReqInfo.setSub_mch_id(merTripartitePlatform.getPlatformMerNumber());
|
|
|
|
} else if (merTripartitePlatform != null && merTripartitePlatform.getPlatformType().equals(2)) {
|
|
payPlatformType = merTripartitePlatform.getPlatformType();
|
|
payPlatformKey = merTripartitePlatform.getPlatformMerKey();
|
|
payPlatformMerNo = merTripartitePlatform.getPlatformMerNumber();
|
|
|
|
} else {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
|
|
// 是否分账
|
|
profitSharing = merTripartitePlatform.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
}
|
|
}
|
|
|
|
} else if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) {
|
|
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type2);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
|
|
payPlatformType = gasChannelConfig.getPayPlatformType();
|
|
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
|
|
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
|
|
|
|
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
|
|
} else if (store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) {
|
|
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type3);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
payPlatformType = gasChannelConfig.getPayPlatformType();
|
|
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
|
|
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
|
|
|
|
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
|
|
} else if (store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber())) {
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type4);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
payPlatformType = gasChannelConfig.getPayPlatformType();
|
|
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
|
|
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
|
|
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
|
|
} else if (store.getSourceType().equals(MerchantStoreSourceType.type5.getNumber())) {
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type5);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
payPlatformType = gasChannelConfig.getPayPlatformType();
|
|
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
|
|
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
|
|
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
|
|
} else if (store.getSourceType().equals(MerchantStoreSourceType.type6.getNumber())) {
|
|
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type6);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
payPlatformType = gasChannelConfig.getPayPlatformType();
|
|
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
|
|
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
|
|
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
|
|
} else if (store.getSourceType().equals(MerchantStoreSourceType.type7.getNumber())) {
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type7);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
payPlatformType = gasChannelConfig.getPayPlatformType();
|
|
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
|
|
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
|
|
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
|
|
} else {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
|
|
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE7.getNumber())) {
|
|
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195);
|
|
|
|
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE8.getNumber())) {
|
|
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1665668540);
|
|
|
|
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE9.getNumber())) {
|
|
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1667177808);
|
|
|
|
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE12.getNumber())) {
|
|
// weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195);
|
|
//
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type2);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
|
|
payPlatformType = gasChannelConfig.getPayPlatformType();
|
|
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
|
|
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
|
|
|
|
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE15.getNumber())) {
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type7);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
payPlatformType = gasChannelConfig.getPayPlatformType();
|
|
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
|
|
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
|
|
weChatPayReqInfo.setSub_mch_id(gasChannelConfig.getPayPlatformMerNo());
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
|
|
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE16.getNumber())) {
|
|
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195);
|
|
|
|
payPlatformType = 2;
|
|
payPlatformMerNo = "2023090816465844909";
|
|
payPlatformKey = "ZatCMLMSZxnkc2rk7dtpTORMLcKetcKt";
|
|
profitSharing = "N";
|
|
|
|
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE17.getNumber())) {
|
|
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195);
|
|
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE20.getNumber())) {
|
|
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195);
|
|
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE21.getNumber())) {
|
|
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195);
|
|
} else {
|
|
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1609882817);
|
|
}
|
|
}
|
|
|
|
|
|
// weChatPayReqInfo.setOpenid(openId);
|
|
weChatPayReqInfo.setSub_openid(body.getString("openId"));
|
|
weChatPayReqInfo.setNonce_str(nonce_str); // 随机字符串
|
|
weChatPayReqInfo.setBody(orderTitle); // 商品描述
|
|
weChatPayReqInfo.setOut_trade_no(order.getOrderNo()); // 商户订单号
|
|
weChatPayReqInfo.setTotal_fee(total_fee); // 总金额
|
|
weChatPayReqInfo.setSpbill_create_ip("1.95.43.71"); // 终端ip
|
|
weChatPayReqInfo.setNotify_url(SysConst.getSysConfig().getWxPayNotifyUrl()); // 通知url
|
|
weChatPayReqInfo.setTrade_type("JSAPI"); // 交易类型
|
|
weChatPayReqInfo.setAttach(null); // 附件参数
|
|
weChatPayReqInfo.setProfit_sharing(profitSharing); // 是否分账 Y:是 N:否
|
|
weChatPayReqInfo.setTime_start(DateUtil.date2String(order.getCreateTime(), "yyyyMMddHHmmss"));
|
|
weChatPayReqInfo.setTime_expire(DateUtil.date2String(DateUtil.addMinute(order.getCreateTime(), 10), "yyyyMMddHHmmss"));
|
|
|
|
SortedMap<Object, Object> sortedMap;
|
|
|
|
System.out.println("-----------------------" + payPlatformType);
|
|
|
|
if (payPlatformType == 2) {
|
|
objectGas.put("outTradeNo" , order.getOrderNo());
|
|
objectGas.put("transType" , "JSAPI");
|
|
objectGas.put("payMode" , "WECHAT");
|
|
objectGas.put("totalAmount" , order.getPayPrice());
|
|
objectGas.put("profitSharing" , 0);
|
|
objectGas.put("notifyUrl" , SysConst.getSysConfig().getHuiPayNotify());
|
|
objectGas.put("subject" , orderTitle);
|
|
objectGas.put("userId" , body.getString("openId"));
|
|
|
|
sortedMap = huiConfig.preorder(objectGas , payPlatformKey , payPlatformMerNo);
|
|
|
|
order.setAccountMerchantNum(payPlatformMerNo);
|
|
order.setProfitSharingStatus(false);
|
|
order.setPayChannel(2);
|
|
orderService.updateOrderData(order);
|
|
} else {
|
|
//附加数据,区分订单类型
|
|
Map<String, String> payMap = new HashMap<>();
|
|
payMap.put("app_id", weChatPayReqInfo.getSub_appid());
|
|
payMap.put("api_key", SysConst.getSysConfig().getWxPayApiKey());
|
|
payMap.put("unified_order_url", SysConst.getSysConfig().getWxPayUnifiedOrderUrl());
|
|
|
|
sortedMap = wechatPayUtil.goWechatPay(weChatPayReqInfo, payMap);
|
|
|
|
order.setAccountMerchantNum(weChatPayReqInfo.getSub_mch_id());
|
|
order.setProfitSharingStatus(profitSharing.equals("Y"));
|
|
order.setPayChannel(1);
|
|
orderService.updateOrderData(order);
|
|
}
|
|
|
|
|
|
return ResponseMsgUtil.success(sortedMap);
|
|
|
|
} catch (Exception e) {
|
|
log.error("OrderController -> create() error!", e);
|
|
return ResponseMsgUtil.exception(e);
|
|
}
|
|
}
|
|
|
|
@RequestMapping(value = "/alipay", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ApiOperation(value = "支付宝支付")
|
|
public ResponseData alipay(@RequestBody JSONObject body) {
|
|
try {
|
|
System.out.println("支付宝支付===================" + body);
|
|
if (body == null
|
|
|| StringUtils.isBlank(body.getString("orderNo"))
|
|
|| StringUtils.isBlank(body.getString("userId"))
|
|
) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
|
|
}
|
|
|
|
// 查询订单
|
|
HighOrder order = orderService.getOrderDetailByNo(body.getString("orderNo"));
|
|
if (!order.getOrderStatus().equals(OrderStatus.STATUS1.getNumber())) {
|
|
log.error("wxPay ERROR", "订单不处于待支付状态");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.ORDER_NO_STAY_PAY, "");
|
|
}
|
|
// 是否分账
|
|
String profitSharing = "N";
|
|
// 订单标题
|
|
String orderTitle = "购买商品";
|
|
|
|
Integer payPlatformType = null;
|
|
String payPlatformKey = null;
|
|
String payPlatformMerNo = null;
|
|
|
|
|
|
if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE6.getNumber())) {
|
|
// 查询油站
|
|
HighMerchantStoreModel store = merchantStoreService.getMerchantStoreById(order.getHighChildOrderList().get(0).getGoodsId());
|
|
if (store == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的加油站");
|
|
}
|
|
if (store.getPrestoreType().equals(1)) {
|
|
if (order.getTotalPrice().compareTo(gasService.getMerPriceByMerId(store.getMerchantId())) == 1) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂时无法进行支付,请联系平台客服");
|
|
}
|
|
}
|
|
|
|
if (store.getSourceType().equals(MerchantStoreSourceType.type1.getNumber())) {
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type1, GasChannelPayPlatformType.type2);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
|
|
if (store.getSourceType().equals(MerchantStoreSourceType.type1.getNumber())) {
|
|
// 预存类型 0:非预存 1:预存门店
|
|
if (store.getPrestoreType().equals(0)) {
|
|
// 第三方平台
|
|
HighMerchantTripartitePlatform merTripartitePlatform = merTripartitePlatformService.getDetail(store.getMerchantId());
|
|
if (merTripartitePlatform != null && merTripartitePlatform.getPlatformType().equals(GasChannelPayPlatformType.type2.getType())) {
|
|
payPlatformType = merTripartitePlatform.getPlatformType();
|
|
payPlatformKey = merTripartitePlatform.getPlatformMerKey();
|
|
payPlatformMerNo = merTripartitePlatform.getPlatformMerNumber();
|
|
|
|
} else {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
// 是否分账
|
|
profitSharing = merTripartitePlatform.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
} else if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) {
|
|
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type2);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
payPlatformType = gasChannelConfig.getPayPlatformType();
|
|
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
|
|
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
|
|
} else if (store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) {
|
|
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type3);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
payPlatformType = gasChannelConfig.getPayPlatformType();
|
|
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
|
|
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
|
|
} else if (store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber())) {
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type4);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
payPlatformType = gasChannelConfig.getPayPlatformType();
|
|
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
|
|
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
|
|
} else if (store.getSourceType().equals(MerchantStoreSourceType.type5.getNumber())) {
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type5);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
payPlatformType = gasChannelConfig.getPayPlatformType();
|
|
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
|
|
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
|
|
} else if (store.getSourceType().equals(MerchantStoreSourceType.type6.getNumber())) {
|
|
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type6);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
payPlatformType = gasChannelConfig.getPayPlatformType();
|
|
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
|
|
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
|
|
} else if (store.getSourceType().equals(MerchantStoreSourceType.type7.getNumber())) {
|
|
|
|
// 查询支付配置
|
|
HighGasChannelConfig gasChannelConfig = gasChannelConfigService.getConfig(GasChannel.type7);
|
|
if (gasChannelConfig == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
payPlatformType = gasChannelConfig.getPayPlatformType();
|
|
payPlatformMerNo = gasChannelConfig.getPayPlatformMerNo();
|
|
payPlatformKey = gasChannelConfig.getPayPlatformMerKey();
|
|
profitSharing = gasChannelConfig.getProfitSharingStatus().equals(true) ? "Y" : "N";
|
|
|
|
} else {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置支付参数,请稍后重试!");
|
|
}
|
|
|
|
}
|
|
|
|
JSONObject payParam = new JSONObject();
|
|
payParam.put("outTradeNo" , order.getOrderNo());
|
|
payParam.put("transType" , "JSAPI");
|
|
payParam.put("payMode" , "ALIPAY");
|
|
payParam.put("totalAmount" , order.getPayPrice());
|
|
payParam.put("profitSharing" , profitSharing.equals("Y")?1:0);
|
|
payParam.put("notifyUrl" , SysConst.getSysConfig().getHuiPayNotify());
|
|
payParam.put("subject" , orderTitle);
|
|
payParam.put("userId" , body.getString("userId"));
|
|
|
|
|
|
SortedMap<Object, Object> sortedMap = huiConfig.preorder(payParam, payPlatformKey, payPlatformMerNo);
|
|
order.setAccountMerchantNum(payPlatformMerNo);
|
|
order.setProfitSharingStatus(false);
|
|
order.setPayChannel(payPlatformType);
|
|
orderService.updateOrderData(order);
|
|
|
|
return ResponseMsgUtil.success(sortedMap);
|
|
|
|
} catch (Exception e) {
|
|
log.error("OrderController -> create() error!", e);
|
|
return ResponseMsgUtil.exception(e);
|
|
}
|
|
}
|
|
|
|
@RequestMapping(value = "/cardPay", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ApiOperation(value = "卡支付")
|
|
public ResponseData cardPay(@RequestBody JSONObject body) {
|
|
try {
|
|
if (body == null
|
|
|| StringUtils.isBlank(body.getString("orderNo"))
|
|
|| StringUtils.isBlank(body.getString("cardNo"))
|
|
|| StringUtils.isBlank(body.getString("password"))) {
|
|
log.error("oilCardPay error!", "参数错误");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
|
|
}
|
|
|
|
// 获取当前操作人信息
|
|
HighUserModel userInfoModel = userCenter.getSessionModel(HighUserModel.class);
|
|
if (userInfoModel == null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, "");
|
|
}
|
|
String password = body.getString("password");
|
|
|
|
// 查询用户与卡号的关系
|
|
HighUserCard userCard = userCardService.getDetailByUserCardNo(userInfoModel.getHighUser().getId(), body.getString("cardNo"));
|
|
if (userCard == null) {
|
|
log.error("OrderController --> cardPay() ERROR", "未绑定卡号");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未绑定卡号");
|
|
}
|
|
// 查询用户支付密码
|
|
HighUserPayPassword userPayPassword = userPayPasswordService.getDetailByUser(userInfoModel.getHighUser().getId());
|
|
if (userPayPassword == null) {
|
|
log.error("cardPay error!", "未设置支付密码");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_SET_USER_PAY_PWD, "");
|
|
}
|
|
if (StringUtils.isBlank(password)) {
|
|
log.error("cardPay error!", "未输入支付密码");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_ENTER_USER_PAY_PWD, "");
|
|
}
|
|
// 支付密码是否正确
|
|
if (!AESEncodeUtil.aesEncrypt(password).equals(userPayPassword.getPassword())) {
|
|
log.error("cardPay error!", "");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.USER_PAY_PWD_ERROR, "");
|
|
}
|
|
// 查询订单
|
|
HighOrder order = orderService.getOrderDetailByNo(body.getString("orderNo"));
|
|
if (!order.getOrderStatus().equals(OrderStatus.STATUS1.getNumber())) {
|
|
log.error("OrderController --> cardPay() ERROR", "订单不处于待支付状态");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.ORDER_NO_STAY_PAY, "");
|
|
}
|
|
|
|
// 支付业务交易
|
|
orderPayBeforeService.payOrderCheck(order);
|
|
|
|
if (userCard.getType().equals(UserCardType.type1.getType())) {
|
|
return ResponseMsgUtil.success(orderPayService.hltCardPay(order, userCard));
|
|
|
|
} else if (userCard.getType().equals(UserCardType.type2.getType())) {
|
|
if (order.getMemDiscountId() != null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "个人油卡不支持优惠券折扣!");
|
|
}
|
|
return ResponseMsgUtil.success(orderPayService.oilCardPay(order, userCard));
|
|
|
|
} else if (userCard.getType().equals(UserCardType.type3.getType())) {
|
|
if (order.getMemDiscountId() != null) {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "车队油卡不支持优惠券折扣!");
|
|
}
|
|
return ResponseMsgUtil.success(orderPayService.oilCardFleetPay(order, userCard, body.getString("carLicensePlate") , body.getString("phone")));
|
|
|
|
} else {
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的卡号类型");
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
log.error("OrderPayController -> cardPay() error!", e);
|
|
return ResponseMsgUtil.exception(e);
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/unionPay", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ApiOperation(value = "银联支付")
|
|
public ResponseData unionPay(@RequestBody JSONObject body, HttpServletRequest request) {
|
|
try {
|
|
if (body == null || StringUtils.isBlank(body.getString("orderNo"))) {
|
|
log.error("orderToPay error!", "参数错误");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
|
|
}
|
|
|
|
HighOrder order = orderService.getOrderDetailByNo(body.getString("orderNo"));
|
|
if (order == null) {
|
|
log.error("OrderController --> orderToPay() ERROR", "未找到订单信息");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_ORDER, "");
|
|
}
|
|
if (!order.getOrderStatus().equals(OrderStatus.STATUS1.getNumber())) {
|
|
log.error("OrderController --> orderToPay() ERROR", "订单不处于待支付状态");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.ORDER_NO_STAY_PAY, "");
|
|
}
|
|
|
|
// 支付前业务校验
|
|
orderPayBeforeService.payOrderCheck(order);
|
|
|
|
order.setAccountMerchantNum(UnionPayConfig.MER_ID2);
|
|
order.setProfitSharingStatus(false);
|
|
orderService.updateOrderData(order);
|
|
return ResponseMsgUtil.success(unionPayConfig.upPreOrder(UnionPayConfig.MER_ID2, UnionPayConfig.TERM_ID2, order.getOrderNo(), order.getPayPrice(), "购买商品", SysConst.getSysConfig().getUnionPayNotifyUrl(), request));
|
|
|
|
} catch (Exception e) {
|
|
log.error("orderToPay error!", e);
|
|
return ResponseMsgUtil.exception(e);
|
|
}
|
|
}
|
|
|
|
@RequestMapping(value = "/huiftPay", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ApiOperation(value = "贵行V家园小程序支付")
|
|
public ResponseData huiftPay(@RequestBody JSONObject body, HttpServletRequest request) {
|
|
try {
|
|
if (body == null || StringUtils.isBlank(body.getString("orderNo"))) {
|
|
log.error("orderToPay error!", "参数错误");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
|
|
}
|
|
|
|
HighOrder order = orderService.getOrderDetailByNo(body.getString("orderNo"));
|
|
if (order == null) {
|
|
log.error("OrderController --> huiftPay() ERROR", "未找到订单信息");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_ORDER, "");
|
|
}
|
|
if (!order.getOrderStatus().equals(OrderStatus.STATUS1.getNumber())) {
|
|
log.error("OrderController --> huiftPay() ERROR", "订单不处于待支付状态");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.ORDER_NO_STAY_PAY, "");
|
|
}
|
|
|
|
// 支付前业务校验
|
|
orderPayBeforeService.payOrderCheck(order);
|
|
|
|
JSONObject thirdPreOrder = huiftTradeService.thirdPreOrder(order);
|
|
order.setPayChannel(3);
|
|
order.setPayChannelOrderNo(thirdPreOrder.getString("preOrderNo"));
|
|
order.setProfitSharingStatus(false);
|
|
orderService.updateOrderData(order);
|
|
|
|
return ResponseMsgUtil.success(thirdPreOrder);
|
|
|
|
} catch (Exception e) {
|
|
log.error("orderToPay error!", e);
|
|
return ResponseMsgUtil.exception(e);
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/huiftPayQz", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ApiOperation(value = "贵行V家园小程序支付千猪【电影票】")
|
|
public ResponseData huiftPayQz(@RequestBody JSONObject body, HttpServletRequest request) {
|
|
try {
|
|
if (body == null || StringUtils.isBlank(body.getString("orderNo"))) {
|
|
log.error("orderToPay error!", "参数错误");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
|
|
}
|
|
|
|
// 组装订单
|
|
HighOrder order = qzOrderService.assemblyQzOrder(body.getString("orderNo"), "CINEMA");
|
|
if (order == null) {
|
|
log.error("orderToPay error!", "创建订单失败");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "创建订单失败");
|
|
}
|
|
|
|
JSONObject thirdPreOrder = huiftTradeService.thirdPreOrder(order);
|
|
order.setPayChannel(3);
|
|
order.setPayChannelOrderNo(thirdPreOrder.getString("preOrderNo"));
|
|
order.setProfitSharingStatus(false);
|
|
orderService.updateOrderData(order);
|
|
|
|
return ResponseMsgUtil.success(thirdPreOrder);
|
|
|
|
} catch (Exception e) {
|
|
log.error("orderToPay error!", e);
|
|
return ResponseMsgUtil.exception(e);
|
|
}
|
|
}
|
|
|
|
@RequestMapping(value = "wechatCombinePay" , method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ApiOperation(value = "微信合单支付")
|
|
public ResponseData wechatCombinePay(@RequestBody JSONObject body, HttpServletRequest request) {
|
|
|
|
if (body == null
|
|
|| StringUtils.isBlank(body.getString("combineOrderNo"))
|
|
|| StringUtils.isBlank(body.getString("openId"))
|
|
) {
|
|
log.error("wechatCombinePay error!", "参数错误");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
|
|
}
|
|
|
|
Map<String , Object> map = new HashMap<>();
|
|
map.put("combineOrderNo" , body.getString("combineOrderNo"));
|
|
|
|
List<HighOrder> orders = orderService.getOrderList(map);
|
|
|
|
CombineOrderModel combineOrderModel = new CombineOrderModel();
|
|
|
|
return ResponseMsgUtil.success("");
|
|
}
|
|
|
|
@RequestMapping(value = "counterPay" , method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ApiOperation(value = "聚合收银台")
|
|
public ResponseData counterPay(@RequestBody JSONObject body, HttpServletRequest request) {
|
|
|
|
if (body == null
|
|
|| StringUtils.isBlank(body.getString("combineOrderNo"))
|
|
|| StringUtils.isBlank(body.getString("openId"))
|
|
) {
|
|
log.error("wechatCombinePay error!", "参数错误");
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
|
|
}
|
|
|
|
Map<String , Object> map = new HashMap<>();
|
|
map.put("combineOrderNo" , body.getString("combineOrderNo"));
|
|
|
|
List<HighOrder> orders = orderService.getOrderList(map);
|
|
|
|
CombineOrderModel combineOrderModel = new CombineOrderModel();
|
|
|
|
return ResponseMsgUtil.success("");
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|