Commit 1db7fbc3 by xiaoer.li@freemud.com

Merge branch 'feature/fix-混合支付核销券优化' into qa

parents 7aea696e b5105340
...@@ -229,7 +229,16 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService { ...@@ -229,7 +229,16 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService {
} }
// 下单成锁定劵,冻结失败提示下单失败并冲正库存积分等,判断支付渠道,积分和svc卡直接核销,无需锁定10102 = svc卡支付 || 支付金额小于等于0 // 下单成锁定劵,冻结失败提示下单失败并冲正库存积分等,判断支付渠道,积分和svc卡直接核销,无需锁定10102 = svc卡支付 || 支付金额小于等于0
if((!StringUtils.isEmpty(orderBean.getPayChannel()) && orderBean.getPayChannel().equalsIgnoreCase("10102")) || orderBean.getAmount() <=0){ // 混合支付
OrderBean.OrderPayItem svc = null;
if (CollectionUtils.isNotEmpty(orderBean.getOrderPayItem()) && orderBean.getOrderPayItem().size()==1) {
svc = orderBean.getOrderPayItem().stream()
.filter(e ->e.getPayChannelType()!=null && e.getPayChannelType().equals(PayChannelType.SVC.getIndex().intValue()))
.findFirst()
.orElse(null);
}
//svc 或是混合svc支付直接核销
if((!StringUtils.isEmpty(orderBean.getPayChannel()) && orderBean.getPayChannel().equalsIgnoreCase("10102")) || orderBean.getAmount() <=0 || (svc!=null) ){
// 核销优惠券,核销失败提示下单失败并冲正库存积分等 // 核销优惠券,核销失败提示下单失败并冲正库存积分等
CouponRequest couponVerificationRequest = orderSdkAdapter.convert2CouponVerificationRequest(orderBean, accounts); CouponRequest couponVerificationRequest = orderSdkAdapter.convert2CouponVerificationRequest(orderBean, accounts);
if (couponVerificationRequest!=null){ if (couponVerificationRequest!=null){
......
...@@ -222,7 +222,7 @@ public class OrderCallBackMQService { ...@@ -222,7 +222,7 @@ public class OrderCallBackMQService {
} }
// 混合支付 // 混合支付
Integer userAmount = 0; Integer userAmount = 0;
if (orderInfoReqs.getOrderPayItemCreateReqList().size()>0) { if (orderInfoReqs.getOrderPayItemCreateReqList()!=null && orderInfoReqs.getOrderPayItemCreateReqList().size()>0) {
OrderPayItemReqs orderPayItemReqs = orderInfoReqs.getOrderPayItemCreateReqList() OrderPayItemReqs orderPayItemReqs = orderInfoReqs.getOrderPayItemCreateReqList()
.stream() .stream()
.filter(s -> s.getPayChannelType().equals(PayChannelType.WECHAT.getIndex().intValue()) || s.getPayChannelType().equals(PayChannelType.ALIPAY.getIndex().intValue())) .filter(s -> s.getPayChannelType().equals(PayChannelType.WECHAT.getIndex().intValue()) || s.getPayChannelType().equals(PayChannelType.ALIPAY.getIndex().intValue()))
......
...@@ -16,7 +16,7 @@ import lombok.NoArgsConstructor; ...@@ -16,7 +16,7 @@ import lombok.NoArgsConstructor;
@Data @Data
@NoArgsConstructor @NoArgsConstructor
public class SvcComPayResponseDto { public class SvcComPayResponseDto {
private Integer code; private String code;
private String message; private String message;
private Result result; private Result result;
@Data @Data
......
...@@ -3331,7 +3331,7 @@ public class OrderServiceImpl implements Orderservice { ...@@ -3331,7 +3331,7 @@ public class OrderServiceImpl implements Orderservice {
.orElse(null); .orElse(null);
//现金+svc 现金 //现金+svc 现金
if (payPlatforms.size()==2 || payPlatforms.size()==1 && cashPay!=null) { if (payPlatforms.size()==2 || (payPlatforms.size()==1 && cashPay!=null)) {
orderPayResponse = orderAdapter.convent2OrderCombPayResponse(combPayResponse.getData().getPayPlatformResponseList(),orderBean.getCompanyId(),storeId); orderPayResponse = orderAdapter.convent2OrderCombPayResponse(combPayResponse.getData().getPayPlatformResponseList(),orderBean.getCompanyId(),storeId);
orderPayResponse.setOpenId(paymentRequest.getOpenId()); orderPayResponse.setOpenId(paymentRequest.getOpenId());
orderPayResponse.setWxAppid(paymentRequest.getWxAppId()); orderPayResponse.setWxAppid(paymentRequest.getWxAppId());
...@@ -3449,10 +3449,11 @@ public class OrderServiceImpl implements Orderservice { ...@@ -3449,10 +3449,11 @@ public class OrderServiceImpl implements Orderservice {
query = svcComPayClient.query(requestDto); query = svcComPayClient.query(requestDto);
if (query!=null) break; if (query!=null) break;
} }
log.info("order checkSvcComPay:{}",JSON.toJSONString(query));
if (query==null || !ResponseResult.SUCCESS.getCode().equals(query.getCode())) { if (query==null || !ResponseResult.SUCCESS.getCode().equals(query.getCode())) {
return false; return false;
} }
if (partnerId.equals(query.getResult().getValue())) { if (query.getResult()!=null && query.getResult().getValue()) {
return true; return true;
} }
else { else {
......
...@@ -16,7 +16,7 @@ import lombok.NoArgsConstructor; ...@@ -16,7 +16,7 @@ import lombok.NoArgsConstructor;
@Data @Data
@NoArgsConstructor @NoArgsConstructor
public class SvcComPayResponseDto { public class SvcComPayResponseDto {
private Integer code; private String code;
private String message; private String message;
private Result result; private Result result;
@Data @Data
......
...@@ -2115,7 +2115,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -2115,7 +2115,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if (query==null || !ResponseResult.SUCCESS.getCode().equals(query.getCode())) { if (query==null || !ResponseResult.SUCCESS.getCode().equals(query.getCode())) {
return false; return false;
} }
if (partnerId.equals(query.getResult().getValue())) { if (query.getResult()!=null && query.getResult().getValue()) {
return true; return true;
} }
else { else {
......
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