Commit 39ca43af by 查志伟

Merge branch 'feature/去除支付超时时间' into qa

parents 541019a6 b113ca49
...@@ -57,12 +57,6 @@ public class ExposureOrderController { ...@@ -57,12 +57,6 @@ public class ExposureOrderController {
@ApiAnnotation(logMessage = "获取超时时间, 生成取餐码") @ApiAnnotation(logMessage = "获取超时时间, 生成取餐码")
@PostMapping("/getPaySuccessData")
public BaseResponse<PaySuccessDataVo> generateTackCode(@Validated @LogParams @RequestBody GetPaySuccessDataRequest request) {
return ResponseUtil.success(exposureOrderService.getPaySuccessData(request));
}
@ApiAnnotation(logMessage = "获取超时时间, 生成取餐码,上线后删除getPaySuccessData")
@PostMapping("/getPaySuccessDataV2") @PostMapping("/getPaySuccessDataV2")
public BaseResponse<PaySuccessDataVo> getPaySuccessDataV2(@Validated @LogParams @RequestBody GetPaySuccessDataV2Request request) { public BaseResponse<PaySuccessDataVo> getPaySuccessDataV2(@Validated @LogParams @RequestBody GetPaySuccessDataV2Request request) {
return ResponseUtil.success(exposureOrderService.getPaySuccessDataV2(request)); return ResponseUtil.success(exposureOrderService.getPaySuccessDataV2(request));
......
package cn.freemud.entities.vo;
import lombok.Data;
@Data
public class GetPaySuccessDataRequest {
private Integer orderType;
private String orderClient;
private String partnerId;
private String storeId;
}
...@@ -16,11 +16,6 @@ public class PayConfigVo { ...@@ -16,11 +16,6 @@ public class PayConfigVo {
private String principalName; private String principalName;
/** /**
* 支付超时时间
*/
private String payTimeOut;
/**
* 门店支付编号 * 门店支付编号
*/ */
private String payCode; private String payCode;
......
...@@ -43,31 +43,13 @@ public class ExposureOrderService { ...@@ -43,31 +43,13 @@ public class ExposureOrderService {
public PayConfigVo getPayConfig(GetPayConfigVo req) { public PayConfigVo getPayConfig(GetPayConfigVo req) {
PayConfigVo vo = new PayConfigVo(); PayConfigVo vo = new PayConfigVo();
vo.setPrincipalName(payService.getPaymentPrincipalName(req.getPartnerId(), req.getAppId())); vo.setPrincipalName(payService.getPaymentPrincipalName(req.getPartnerId(), req.getAppId()));
vo.setPayTimeOut(payService.getPartnerPayOvertime(req.getPartnerId()));
vo.setPayCode(payService.getPayCodeByCondition(req.getAppId(), req.getStoreId(), req.getChannel())); vo.setPayCode(payService.getPayCodeByCondition(req.getAppId(), req.getStoreId(), req.getChannel()));
return vo; return vo;
} }
public PaySuccessDataVo getPaySuccessData(GetPaySuccessDataRequest reqVo) {
Integer type = TakeCodeOrderType.getTakeCodeOrderType(reqVo.getOrderType());
String takeCode = orderTackCodeManager.generateTackCode(type,
reqVo.getPartnerId(),
reqVo.getStoreId(),
null,
OrderTackCodeFactory.getByOrderClient(reqVo.getOrderClient()).getGenerateTackCodeFunc());
Integer v1Type = orderCenterSdkAdapter.getOldOrderType(reqVo.getOrderType());
Integer timeout = orderBusinessService.getPaySuccessTimeout(reqVo.getPartnerId(),
reqVo.getStoreId(),
v1Type);
PaySuccessDataVo vo = new PaySuccessDataVo();
vo.setTakeCode(takeCode);
vo.setTimeout(timeout);
return vo;
}
/** /**
* 获取超时时间, 生成取餐码,上线后删除getPaySuccessData * 获取超时时间, 生成取餐码
* @param reqVo * @param reqVo
* @return * @return
*/ */
...@@ -79,7 +61,7 @@ public class ExposureOrderService { ...@@ -79,7 +61,7 @@ public class ExposureOrderService {
null, null,
OrderTackCodeFactory.getByOrderClient(reqVo.getOrderClient()).getGenerateTackCodeFunc()); OrderTackCodeFactory.getByOrderClient(reqVo.getOrderClient()).getGenerateTackCodeFunc());
Integer timeout = 0; int timeout = 0;
//查询待支付订单时效配置 //查询待支付订单时效配置
BaseResponse<List<QueryByKeysResp>> listBaseResponse = orderServiceClient.queryByKeys(new QueryByKeysReq(reqVo.getPartnerId())); BaseResponse<List<QueryByKeysResp>> listBaseResponse = orderServiceClient.queryByKeys(new QueryByKeysReq(reqVo.getPartnerId()));
if (listBaseResponse == null || !Objects.equals("100", listBaseResponse.getCode())) { if (listBaseResponse == null || !Objects.equals("100", listBaseResponse.getCode())) {
...@@ -89,15 +71,15 @@ public class ExposureOrderService { ...@@ -89,15 +71,15 @@ public class ExposureOrderService {
for(QueryByKeysResp resp : listBaseResponse.getResult()){ for(QueryByKeysResp resp : listBaseResponse.getResult()){
// 外卖订单 // 外卖订单
if (Objects.equals(v1Type, OrderTypeV1.TAKE_OUT.getCode()) && Objects.equals("UNPAID_TIMEOUT_CLOSE_TIME_WMXF",resp.getConfigName())) { if (Objects.equals(v1Type, OrderTypeV1.TAKE_OUT.getCode()) && Objects.equals("UNPAID_TIMEOUT_CLOSE_TIME_WMXF",resp.getConfigName())) {
timeout = Integer.valueOf(resp.getConfigValue()); timeout = Integer.parseInt(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()) ) }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()); timeout = Integer.parseInt(resp.getConfigValue());
}else if(Objects.equals(reqVo.getBizType(), BizTypeEnum.ORDINARY.getBizType()) && Objects.equals(reqVo.getMarketingType(), MarketTypeEnum.POST_ORDER.getIndex()) }else if(Objects.equals(reqVo.getBizType(), BizTypeEnum.ORDINARY.getBizType()) && Objects.equals(reqVo.getMarketingType(), MarketTypeEnum.POST_ORDER.getIndex())
&& Objects.equals("UNPAID_TIMEOUT_CLOSE_TIME_TSHF",resp.getConfigName())){ && Objects.equals("UNPAID_TIMEOUT_CLOSE_TIME_TSHF",resp.getConfigName())){
//堂食后付 //堂食后付
timeout = Integer.valueOf(resp.getConfigValue()); timeout = Integer.parseInt(resp.getConfigValue());
} }
} }
PaySuccessDataVo vo = new PaySuccessDataVo(); PaySuccessDataVo vo = new PaySuccessDataVo();
...@@ -113,7 +95,6 @@ public class ExposureOrderService { ...@@ -113,7 +95,6 @@ public class ExposureOrderService {
public PayConfigVo getMallPayConfig(GetMallPayConfigVo req) { public PayConfigVo getMallPayConfig(GetMallPayConfigVo req) {
PayConfigVo vo = new PayConfigVo(); PayConfigVo vo = new PayConfigVo();
vo.setPrincipalName(payService.getPaymentPrincipalName(req.getPartnerId(), req.getAppId())); vo.setPrincipalName(payService.getPaymentPrincipalName(req.getPartnerId(), req.getAppId()));
vo.setPayTimeOut(payService.getPartnerPayOvertime(req.getPartnerId()));
AssortmentOpenPlatformIappWxappStore wxAppStore = payService.getIappWxappStoreInfo(req.getAppId(), AggregationTypeEnum.TYPE_7.getCode()); AssortmentOpenPlatformIappWxappStore wxAppStore = payService.getIappWxappStoreInfo(req.getAppId(), AggregationTypeEnum.TYPE_7.getCode());
if (wxAppStore == null) { if (wxAppStore == null) {
wxAppStore = new AssortmentOpenPlatformIappWxappStore(); wxAppStore = new AssortmentOpenPlatformIappWxappStore();
......
...@@ -452,11 +452,11 @@ public class PayServiceImpl { ...@@ -452,11 +452,11 @@ public class PayServiceImpl {
paymentRequest.setReverseNotifyiDcUrl(reverseNotifyiDcUrl); paymentRequest.setReverseNotifyiDcUrl(reverseNotifyiDcUrl);
paymentRequest.setPayCode(payCode); paymentRequest.setPayCode(payCode);
// if ("2080".equals(partnerId)) { // if ("2080".equals(partnerId)) {
//【ID1035981】【蜜雪冰城】订单C端,拼接order_body字段:蜜雪冰城+门店编号 //【ID1035981】【蜜雪冰城】订单C端,拼接order_body字段:蜜雪冰城+门店编号
// paymentRequest.setPrincipalName("蜜雪冰城" + storeId + "店"); // paymentRequest.setPrincipalName("蜜雪冰城" + storeId + "店");
// } else { // } else {
// saas 查询小程序配置 // saas 查询小程序配置
paymentRequest.setPrincipalName(this.getPaymentPrincipalName(partnerId, appId)); paymentRequest.setPrincipalName(this.getPaymentPrincipalName(partnerId, appId));
// } // }
return paymentRequest; return paymentRequest;
} }
...@@ -585,51 +585,51 @@ public class PayServiceImpl { ...@@ -585,51 +585,51 @@ public class PayServiceImpl {
} }
//使用支付FeignClient //使用支付FeignClient
// if (usePayFeignClient) { // if (usePayFeignClient) {
orderPayResponse = new OrderPayResponse(); orderPayResponse = new OrderPayResponse();
String clientCode = this.getPayCodeByChanel(paymentRequest.getWxAppId(), orderBean.getShopId()); String clientCode = this.getPayCodeByChanel(paymentRequest.getWxAppId(), orderBean.getShopId());
if (StringUtils.isBlank(clientCode)) { if (StringUtils.isBlank(clientCode)) {
orderPayResponse.setMsg("请先联系相关人员配置商户对应的支付渠道"); orderPayResponse.setMsg("请先联系相关人员配置商户对应的支付渠道");
return orderPayResponse; return orderPayResponse;
} }
requestDto.setClientCode(Long.parseLong(clientCode)); 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 = paymentNewClient.unifiedOrder(requestDto);
com.freemud.application.sdk.api.base.BaseResponse<UnifiedPayResponseDto> response = null; com.freemud.application.sdk.api.base.BaseResponse<UnifiedPayResponseDto> response = null;
//处理超时情况,后续冲正mq正常冲正,同支付sdk逻辑 //处理超时情况,后续冲正mq正常冲正,同支付sdk逻辑
try { try {
response = this.unifiedOrder(requestDto); response = this.unifiedOrder(requestDto);
} catch (Exception e) { } catch (Exception e) {
AppLogUtil.errorLog("获取预支付信息异常", JSONObject.toJSONString(requestDto), null, e); AppLogUtil.errorLog("获取预支付信息异常", JSONObject.toJSONString(requestDto), null, e);
} }
//预支付接口失败 //预支付接口失败
if (null == response || !Objects.equals(ResponseCodeConstant.RESPONSE_SUCCESS_STR, response.getCode()) if (null == response || !Objects.equals(ResponseCodeConstant.RESPONSE_SUCCESS_STR, response.getCode())
|| !Objects.equals(ResponseCodeConstant.RESPONSE_SUCCESS, response.getData().getResultCode())) { || !Objects.equals(ResponseCodeConstant.RESPONSE_SUCCESS, response.getData().getResultCode())) {
String errorMessage = "unified fail"; String errorMessage = "unified fail";
if (null != response) { if (null != response) {
errorMessage = StringUtils.isNotEmpty(response.getMessage()) ? response.getMessage() : response.getData().getResultMsg(); 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);
} }
//抖音支付 //打印业务异常
if (PayChannelType.TIKTOKPAY.getIndex().toString().equalsIgnoreCase(orderBean.getPayChannelType())) { if (response != null && printUnifiedPayResponseError) {
orderPayResponse.setPayChannelType(PayChannelType.TIKTOKPAY); AppLogUtil.errorLog("获取预支付信息失败", JSONObject.toJSONString(requestDto), JSONObject.toJSONString(response), null);
} }
//预支付失败需要把原因进行记录
orderPayResponse.setMsg(errorMessage);
return orderPayResponse; 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); // com.freemud.application.sdk.api.base.BaseResponse<UnifiedOrderResponse> responseBase = standardPaymentService.unifiedOrder(request, trackingNo);
// if (!ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(responseBase.getCode())) { // if (!ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(responseBase.getCode())) {
...@@ -1392,7 +1392,7 @@ public class PayServiceImpl { ...@@ -1392,7 +1392,7 @@ public class PayServiceImpl {
paymentQueryOrderRequest.setPartnerId(refundRequest.getPartnerId()); paymentQueryOrderRequest.setPartnerId(refundRequest.getPartnerId());
paymentQueryOrderRequest.setStoreId(refundRequest.getStoreId()); paymentQueryOrderRequest.setStoreId(refundRequest.getStoreId());
paymentQueryOrderRequest.setFrontTransId(refundRequest.getOrgTransId()); 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 { try {
payQueryOrderResponse = omsPaymentClient.payQueryOrder(paymentQueryOrderRequest); payQueryOrderResponse = omsPaymentClient.payQueryOrder(paymentQueryOrderRequest);
}catch (Exception e){ }catch (Exception e){
......
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