Commit 646df96d by vega

电子风味卡对特殊返回进行展示

parent 8eef2357
...@@ -14,6 +14,10 @@ public class ResponseCodeConstant { ...@@ -14,6 +14,10 @@ public class ResponseCodeConstant {
public final static String RESPONSE_SUCCESS_0_STR = "0"; public final static String RESPONSE_SUCCESS_0_STR = "0";
public final static int RESPONSE_SUCCESS_0 = 0; public final static int RESPONSE_SUCCESS_0 = 0;
// 电子风味卡,密码错误或者余额不足,需要特殊处理
public final static String PASSWORD_WRONG = "8200407";
public final static String NOT_SUFFICIENT_FUND = "8200407";
private final static Set<Object> successResponseCodeSet = new HashSet<>(); private final static Set<Object> successResponseCodeSet = new HashSet<>();
static { static {
......
...@@ -1819,8 +1819,14 @@ public class OrderServiceImpl implements Orderservice { ...@@ -1819,8 +1819,14 @@ public class OrderServiceImpl implements Orderservice {
orderPayResponse = getOrderPayResponse(paymentRequest, createPrepayRequestDto.getFatherOrderBean()); orderPayResponse = getOrderPayResponse(paymentRequest, createPrepayRequestDto.getFatherOrderBean());
} }
if (orderPayResponse == null || Objects.isNull(orderPayResponse.getFmId())) { if (orderPayResponse == null || Objects.isNull(orderPayResponse.getFmId())) {
return failPreOrderPay(LogThreadLocal.getTrackingNo(), createPrepayRequestDto.getProductOrderBean(), cardCode, createPrepayRequestDto.getOrderClient(), BaseResponse baseResponse = failPreOrderPay(LogThreadLocal.getTrackingNo(), createPrepayRequestDto.getProductOrderBean(), cardCode, createPrepayRequestDto.getOrderClient(),
Objects.isNull(orderPayResponse) ? null : orderPayResponse.getMsg()); Objects.isNull(orderPayResponse) ? null : orderPayResponse.getMsg());
// 电子风味卡需要给用户特殊的返回
if (totalAmount > 0 && Objects.nonNull(createPrepayRequestDto.getUnionPayCard()) && Objects.nonNull(orderPayResponse) &&
(ResponseCodeConstant.PASSWORD_WRONG.equals(orderPayResponse.getPayTransId()) || ResponseCodeConstant.NOT_SUFFICIENT_FUND.equals(orderPayResponse.getPayTransId()))) {
baseResponse.setMessage(orderPayResponse.getMsg());
}
return baseResponse;
} }
createOrderResponse = orderAdapter.convent2CreateFatherSonOrderResponseVo(orderPayResponse, createPrepayRequestDto.getProductOrderBean()); createOrderResponse = orderAdapter.convent2CreateFatherSonOrderResponseVo(orderPayResponse, createPrepayRequestDto.getProductOrderBean());
BaseResponse baseEditResponse = this.updateOrderInfo(orderPayResponse, createPrepayRequestDto.getOrderExtInfoDTO(), createPrepayRequestDto.getProductOrderBean(), LogThreadLocal.getTrackingNo()); BaseResponse baseEditResponse = this.updateOrderInfo(orderPayResponse, createPrepayRequestDto.getOrderExtInfoDTO(), createPrepayRequestDto.getProductOrderBean(), LogThreadLocal.getTrackingNo());
...@@ -1884,6 +1890,10 @@ public class OrderServiceImpl implements Orderservice { ...@@ -1884,6 +1890,10 @@ public class OrderServiceImpl implements Orderservice {
request.setVer("2"); request.setVer("2");
com.freemud.application.sdk.api.base.BaseResponse<CodePayResponse> responseBase = paymentNewService.codePay(request, trackingNo); com.freemud.application.sdk.api.base.BaseResponse<CodePayResponse> responseBase = paymentNewService.codePay(request, trackingNo);
if (responseBase == null || !ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(responseBase.getCode()) || responseBase.getData().getData() == null) { if (responseBase == null || !ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(responseBase.getCode()) || responseBase.getData().getData() == null) {
// 需要把2种特殊情况抛给用户
if (Objects.nonNull(responseBase) && (ResponseCodeConstant.PASSWORD_WRONG.equals(responseBase.getCode()) || ResponseCodeConstant.NOT_SUFFICIENT_FUND.equals(responseBase.getCode()))) {
orderPayResponse.setPayTransId(responseBase.getCode());
}
orderPayResponse.setMsg(Objects.isNull(responseBase) ? "电子风味卡支付异常" : responseBase.getMessage()); orderPayResponse.setMsg(Objects.isNull(responseBase) ? "电子风味卡支付异常" : responseBase.getMessage());
} else { } else {
CodePayResponse.CodePayDate codePayResponse = responseBase.getData().getData(); CodePayResponse.CodePayDate codePayResponse = responseBase.getData().getData();
...@@ -2289,8 +2299,14 @@ public class OrderServiceImpl implements Orderservice { ...@@ -2289,8 +2299,14 @@ public class OrderServiceImpl implements Orderservice {
if(createOrderVo.getFaceCode() != null){ if(createOrderVo.getFaceCode() != null){
createOrderVo.setCardCode(createOrderVo.getFaceCode()); createOrderVo.setCardCode(createOrderVo.getFaceCode());
} }
return failPreOrderPay(LogThreadLocal.getTrackingNo(), productOrderBean, createOrderVo.getCardCode(), null, BaseResponse baseResponse = failPreOrderPay(LogThreadLocal.getTrackingNo(), productOrderBean, createOrderVo.getCardCode(), null,
Objects.isNull(orderPayResponse) ? null : orderPayResponse.getMsg()); Objects.isNull(orderPayResponse) ? null : orderPayResponse.getMsg());
// 电子风味卡需要给用户特殊的返回
if (totalAmount > 0 && Objects.nonNull(createOrderVo.getUnionPayCard()) && Objects.nonNull(orderPayResponse) &&
(ResponseCodeConstant.PASSWORD_WRONG.equals(orderPayResponse.getPayTransId()) || ResponseCodeConstant.NOT_SUFFICIENT_FUND.equals(orderPayResponse.getPayTransId()))) {
baseResponse.setMessage(orderPayResponse.getMsg());
}
return baseResponse;
} }
//更新订单extinfo信息 //更新订单extinfo信息
BaseResponse baseEditResponse = this.updateOrderInfo(orderPayResponse, orderExtInfoDTO, productOrderBean, LogThreadLocal.getTrackingNo()); BaseResponse baseEditResponse = this.updateOrderInfo(orderPayResponse, orderExtInfoDTO, productOrderBean, LogThreadLocal.getTrackingNo());
......
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