Commit c7f6966a by jiangxiaoyang

还原支付蚂蚁门店代码

parent d91cb2be
......@@ -128,13 +128,4 @@ public class ExposureOrderController {
return ResponseUtil.success(exposureOrderService.getVirtualStore(req.getAppId(), req.getType()));
}
/**
* 查询支付配置paycode
*/
@ApiAnnotation(logMessage = "查询支付配置paycode")
@PostMapping("/getPayCode")
public BaseResponse<String> getPayCode(@Validated @LogParams @RequestBody GetPayCodeVo req) {
return ResponseUtil.success(exposureOrderService.getPayCode(req));
}
}
package cn.freemud.service;
import cn.freemud.base.entity.BaseResponse;
import cn.freemud.entities.vo.*;
import cn.freemud.entities.vo.GetMallPayConfigVo;
import cn.freemud.entities.vo.GetPayConfigVo;
import cn.freemud.entities.vo.GetPaySuccessDataRequest;
import cn.freemud.entities.vo.GetPaySuccessDataV2Request;
import cn.freemud.entities.vo.order.PayConfigVo;
import cn.freemud.entities.vo.order.PaySuccessDataVo;
import cn.freemud.entities.vo.order.QueryByKeysReq;
......@@ -91,7 +94,7 @@ public class ExposureOrderService {
if (Objects.equals(v1Type, OrderTypeV1.TAKE_OUT.getCode()) && Objects.equals("UNPAID_TIMEOUT_CLOSE_TIME_WMXF",resp.getConfigName())) {
timeout = Integer.valueOf(resp.getConfigValue());
}else if(Objects.equals(reqVo.getBizType(), BizTypeEnum.ORDINARY.getBizType()) && (Objects.equals(reqVo.getMarketingType(), MarketTypeEnum.ORDER.getIndex()) || Objects.equals(reqVo.getMarketingType(), MarketTypeEnum.CASHIER.getIndex()) )
&& Objects.equals("UNPAID_TIMEOUT_CLOSE_TIME_TSXF",resp.getConfigName())){
&& Objects.equals("UNPAID_TIMEOUT_CLOSE_TIME_TSXF",resp.getConfigName())){
//堂食先付
timeout = Integer.valueOf(resp.getConfigValue());
}else if(Objects.equals(reqVo.getBizType(), BizTypeEnum.ORDINARY.getBizType()) && Objects.equals(reqVo.getMarketingType(), MarketTypeEnum.POST_ORDER.getIndex())
......@@ -133,11 +136,4 @@ public class ExposureOrderService {
AssortmentOpenPlatformIappWxappStore wxAppStore = payService.getIappWxappStoreInfo(appId, type);
return wxAppStore == null ? "" : wxAppStore.getStoreId();
}
/**
* 查询支付配置paycode
*/
public String getPayCode(GetPayCodeVo req) {
return payService.getPayCode(req.getAppId(), req.getStoreId(), req.getChannel());
}
}
......@@ -451,11 +451,11 @@ public class PayServiceImpl {
paymentRequest.setReverseNotifyiDcUrl(reverseNotifyiDcUrl);
paymentRequest.setPayCode(payCode);
// if ("2080".equals(partnerId)) {
//【ID1035981】【蜜雪冰城】订单C端,拼接order_body字段:蜜雪冰城+门店编号
//【ID1035981】【蜜雪冰城】订单C端,拼接order_body字段:蜜雪冰城+门店编号
// paymentRequest.setPrincipalName("蜜雪冰城" + storeId + "店");
// } else {
// saas 查询小程序配置
paymentRequest.setPrincipalName(this.getPaymentPrincipalName(partnerId, appId));
// saas 查询小程序配置
paymentRequest.setPrincipalName(this.getPaymentPrincipalName(partnerId, appId));
// }
return paymentRequest;
}
......@@ -584,51 +584,51 @@ public class PayServiceImpl {
}
//使用支付FeignClient
// if (usePayFeignClient) {
orderPayResponse = new OrderPayResponse();
String clientCode = this.getPayCodeByChanel(paymentRequest.getWxAppId(), orderBean.getShopId());
if (StringUtils.isBlank(clientCode)) {
orderPayResponse.setMsg("请先联系相关人员配置商户对应的支付渠道");
return orderPayResponse;
}
requestDto.setClientCode(Long.parseLong(clientCode));
orderPayResponse = new OrderPayResponse();
String clientCode = this.getPayCodeByChanel(paymentRequest.getWxAppId(), orderBean.getShopId());
if (StringUtils.isBlank(clientCode)) {
orderPayResponse.setMsg("请先联系相关人员配置商户对应的支付渠道");
return orderPayResponse;
}
requestDto.setClientCode(Long.parseLong(clientCode));
// com.freemud.application.sdk.api.base.BaseResponse<UnifiedPayResponseDto> response = paymentNewClient.unifiedOrder(requestDto);
com.freemud.application.sdk.api.base.BaseResponse<UnifiedPayResponseDto> response = null;
//处理超时情况,后续冲正mq正常冲正,同支付sdk逻辑
try {
response = this.unifiedOrder(requestDto);
} catch (Exception e) {
AppLogUtil.errorLog("获取预支付信息异常", JSONObject.toJSONString(requestDto), null, e);
}
//预支付接口失败
if (null == response || !Objects.equals(ResponseCodeConstant.RESPONSE_SUCCESS_STR, response.getCode())
|| !Objects.equals(ResponseCodeConstant.RESPONSE_SUCCESS, response.getData().getResultCode())) {
String errorMessage = "unified fail";
if (null != response) {
errorMessage = StringUtils.isNotEmpty(response.getMessage()) ? response.getMessage() : response.getData().getResultMsg();
}
//打印业务异常
if (response != null && printUnifiedPayResponseError) {
AppLogUtil.errorLog("获取预支付信息失败", JSONObject.toJSONString(requestDto), JSONObject.toJSONString(response), null);
}
//预支付失败需要把原因进行记录
orderPayResponse.setMsg(errorMessage);
return orderPayResponse;
}
putDelMq(request.getPartnerId(), request.getStoreId(), response.getData().getFmId(), orderBean.getOid(), null);
this.convent2CreateOrderResponseVo(orderPayResponse, paymentRequest.getWxAppId(), response.getData());
orderPayResponse.setOpenId(paymentRequest.getOpenId());
orderPayResponse.setPartnerId(orderBean.getCompanyId());
orderPayResponse.setOrderId(orderBean.getOid());
orderPayResponse.setPayChannelType(PayChannelType.WECHAT);
if (orderPayResponse.getPayOrder() != null && StringUtils.isNotBlank(orderPayResponse.getPayOrder().getAliPayOrder())
&& !orderPayResponse.getPayOrder().getAliPayOrder().startsWith("wx")) {
orderPayResponse.setPayChannelType(PayChannelType.ALIPAY);
com.freemud.application.sdk.api.base.BaseResponse<UnifiedPayResponseDto> response = null;
//处理超时情况,后续冲正mq正常冲正,同支付sdk逻辑
try {
response = this.unifiedOrder(requestDto);
} catch (Exception e) {
AppLogUtil.errorLog("获取预支付信息异常", JSONObject.toJSONString(requestDto), null, e);
}
//预支付接口失败
if (null == response || !Objects.equals(ResponseCodeConstant.RESPONSE_SUCCESS_STR, response.getCode())
|| !Objects.equals(ResponseCodeConstant.RESPONSE_SUCCESS, response.getData().getResultCode())) {
String errorMessage = "unified fail";
if (null != response) {
errorMessage = StringUtils.isNotEmpty(response.getMessage()) ? response.getMessage() : response.getData().getResultMsg();
}
//抖音支付
if (PayChannelType.TIKTOKPAY.getIndex().toString().equalsIgnoreCase(orderBean.getPayChannelType())) {
orderPayResponse.setPayChannelType(PayChannelType.TIKTOKPAY);
//打印业务异常
if (response != null && printUnifiedPayResponseError) {
AppLogUtil.errorLog("获取预支付信息失败", JSONObject.toJSONString(requestDto), JSONObject.toJSONString(response), null);
}
//预支付失败需要把原因进行记录
orderPayResponse.setMsg(errorMessage);
return orderPayResponse;
}
putDelMq(request.getPartnerId(), request.getStoreId(), response.getData().getFmId(), orderBean.getOid(), null);
this.convent2CreateOrderResponseVo(orderPayResponse, paymentRequest.getWxAppId(), response.getData());
orderPayResponse.setOpenId(paymentRequest.getOpenId());
orderPayResponse.setPartnerId(orderBean.getCompanyId());
orderPayResponse.setOrderId(orderBean.getOid());
orderPayResponse.setPayChannelType(PayChannelType.WECHAT);
if (orderPayResponse.getPayOrder() != null && StringUtils.isNotBlank(orderPayResponse.getPayOrder().getAliPayOrder())
&& !orderPayResponse.getPayOrder().getAliPayOrder().startsWith("wx")) {
orderPayResponse.setPayChannelType(PayChannelType.ALIPAY);
}
//抖音支付
if (PayChannelType.TIKTOKPAY.getIndex().toString().equalsIgnoreCase(orderBean.getPayChannelType())) {
orderPayResponse.setPayChannelType(PayChannelType.TIKTOKPAY);
}
return orderPayResponse;
// }
// com.freemud.application.sdk.api.base.BaseResponse<UnifiedOrderResponse> responseBase = standardPaymentService.unifiedOrder(request, trackingNo);
// if (!ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(responseBase.getCode())) {
......@@ -1391,7 +1391,7 @@ public class PayServiceImpl {
paymentQueryOrderRequest.setPartnerId(refundRequest.getPartnerId());
paymentQueryOrderRequest.setStoreId(refundRequest.getStoreId());
paymentQueryOrderRequest.setFrontTransId(refundRequest.getOrgTransId());
com.freemud.application.sdk.api.base.BaseResponse<PaymentQueryOrderResponseDto> payQueryOrderResponse = null;
com.freemud.application.sdk.api.base.BaseResponse<PaymentQueryOrderResponseDto> payQueryOrderResponse = null;
try {
payQueryOrderResponse = omsPaymentClient.payQueryOrder(paymentQueryOrderRequest);
}catch (Exception e){
......@@ -1710,16 +1710,4 @@ public class PayServiceImpl {
return payTypeCode;
}
public String getPayCode(String wxAppid, String storeId, String channel) {
PayChannelType byIndex = PayChannelType.getByIndex(Byte.parseByte(channel));
if (byIndex.getEbcode() == null) return "";
AssortmentOpenPlatformIappWxappStore wxAppStore = assortmentOpenPlatformIappWxappStoreManager.selectWxappStoreByWxAppIdAndStoreId(wxAppid
, storeId
, byIndex.getEbcode());
if (wxAppStore != null && StringUtils.isNotBlank(wxAppStore.getPayCode())) {
return wxAppStore.getPayCode();
}
return "9";
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment