驳回租车 调用取消核销接口
This commit is contained in:
		| @ -15,6 +15,8 @@ public enum PaymentTypeEnum { | ||||
|     WX_DQ("WX_DQ", "微信代扣"), | ||||
|     ZFB_PAY("ZFB_PAY", "支付宝支付"), | ||||
|     ZFB_DQ("ZFB_DQ", "支付宝代扣"), | ||||
|     MT("MT", "美团团购"), | ||||
|     DY("DY", "抖音团购"), | ||||
|     ; | ||||
|     private final String code; | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ public interface DouyinService { | ||||
|  | ||||
|     CertificateVerifyResponse verify(CertificateVerifyRequest req); | ||||
|  | ||||
|     CertificateCancelResponse cancel(CertificateCancelRequest req); | ||||
|     CertificateCancelResponse cancel(String certificateId, String verifyId) ; | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -15,6 +15,6 @@ public interface MeiTuanService { | ||||
|  | ||||
|     MeituanResponse<TuangouReceiptConsumeResponse> consume(VerifyGroupBuyCouponsReq req); | ||||
|  | ||||
|     MeituanResponse<TuangouReceiptReverseconsumeResponse> reverseconsume(VerifyGroupBuyCouponsReq req, String dealId); | ||||
|     MeituanResponse<TuangouReceiptReverseconsumeResponse> reverseconsume(Integer storeId,String couponCode, String dealId); | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -159,7 +159,7 @@ public class DouyinServiceImpl  implements DouyinService { | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public CertificateCancelResponse cancel(CertificateCancelRequest req) { | ||||
|     public CertificateCancelResponse cancel(String certificateId, String verifyId) { | ||||
|         // 获取当前有效的access_token | ||||
|         String accessToken = douyinTokenManager.getCurrentToken(); | ||||
|  | ||||
| @ -174,8 +174,8 @@ public class DouyinServiceImpl  implements DouyinService { | ||||
|  | ||||
|             CertificateCancelRequest sdkRequest = new CertificateCancelRequest(); | ||||
|             sdkRequest.setAccessToken(accessToken); | ||||
|             sdkRequest.setVerifyId(req.getVerifyId()); | ||||
|             sdkRequest.setCertificateId(req.getCertificateId()); | ||||
|             sdkRequest.setVerifyId(verifyId); | ||||
|             sdkRequest.setCertificateId(certificateId); | ||||
|  | ||||
|             CertificateCancelResponse sdkResponse = client.CertificateCancel(sdkRequest); | ||||
|             System.out.println(JSONObject.toJSONString(sdkResponse)); | ||||
|  | ||||
| @ -126,16 +126,16 @@ public class MeiTuanServiceImpl implements MeiTuanService { | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public MeituanResponse<TuangouReceiptReverseconsumeResponse> reverseconsume(VerifyGroupBuyCouponsReq req, String dealId) { | ||||
|     public MeituanResponse<TuangouReceiptReverseconsumeResponse> reverseconsume(Integer storeId,String couponCode, String dealId) { | ||||
|         try { | ||||
|             MeituanClient meituanClient = DefaultMeituanClient.builder(DeveloperId, Signkey).build(); | ||||
|             CompanyStoreDTO companyStoreDTO = getAppAuthToken(req.getStoreId().intValue()); | ||||
|             CompanyStoreDTO companyStoreDTO = getAppAuthToken(storeId); | ||||
|  | ||||
|             TuangouReceiptReverseconsumeRequest tuangouReceiptReverseconsumeRequest = new TuangouReceiptReverseconsumeRequest(); | ||||
|  | ||||
|             tuangouReceiptReverseconsumeRequest.setAppShopAccount(companyStoreDTO.getStoreNumber()); | ||||
|             tuangouReceiptReverseconsumeRequest.setAppShopAccountName(companyStoreDTO.getName()); | ||||
|             tuangouReceiptReverseconsumeRequest.setReceiptCode(req.getCouponCode()); | ||||
|             tuangouReceiptReverseconsumeRequest.setReceiptCode(couponCode); | ||||
|             tuangouReceiptReverseconsumeRequest.setDealId(dealId); | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -146,6 +146,7 @@ public class OrderServiceImpl implements OrderService { | ||||
|             thirdRentCarOrder.setCustomerPhone(userInfoDTO.getPhoneNumber()); | ||||
|             thirdRentCarOrder.setThirdOrderNo(productIdMap.get("mtOrderId")); | ||||
|             thirdRentCarOrder.setCouponCode(req.getCouponCode()); | ||||
|             thirdRentCarOrder.setRentBatteyRuleId(carModelPackageDTO.getBatteyRuleId()); | ||||
|  | ||||
|             RentCarOrderResultDTO rentCarOrderResultDTO = thirdPlatformRentCarOrder(thirdRentCarOrder); | ||||
|             return rentCarOrderResultDTO; | ||||
| @ -210,6 +211,7 @@ public class OrderServiceImpl implements OrderService { | ||||
|             thirdRentCarOrder.setCustomerPhone(userInfoDTO.getPhoneNumber()); | ||||
|             thirdRentCarOrder.setThirdOrderNo(productIdMap.get("dyCertificateId")); | ||||
|             thirdRentCarOrder.setCouponCode(productIdMap.get("dyVerifyId")); | ||||
|             thirdRentCarOrder.setRentBatteyRuleId(carModelPackageDTO.getBatteyRuleId()); | ||||
|  | ||||
|             RentCarOrderResultDTO rentCarOrderResultDTO = thirdPlatformRentCarOrder(thirdRentCarOrder); | ||||
|  | ||||
| @ -1372,6 +1374,7 @@ public class OrderServiceImpl implements OrderService { | ||||
|             throw new BizException("订单状态异常,非待取车或待还车状态,无法驳回"); | ||||
|         } | ||||
|  | ||||
|  | ||||
|         if(orderMainPO.getOrderStatus().equals(OrderStatusEnum.WAIT_PICK.getCode())){ | ||||
|             //获取租车子订单 | ||||
|             LambdaQueryWrapper<OrderSubPO> orderSubWrapper = new LambdaQueryWrapper<>(); | ||||
| @ -1380,6 +1383,13 @@ public class OrderServiceImpl implements OrderService { | ||||
|                     .eq(OrderSubPO::getSuborderType, SubOrderTypeEnum.RENTCAR.getCode()) | ||||
|                     .eq(OrderSubPO::getPayStatus, PayStatusEnum.SUCCESS).last(" limit 1"); | ||||
|             OrderSubPO orderSubPO = orderSubRepo.getOne(orderSubWrapper); | ||||
|  | ||||
|             if(orderSubPO.getPaymentMethod().equals(PaymentTypeEnum.MT.getCode())){ | ||||
|                 meiTuanService.reverseconsume(orderMainPO.getStoreId().intValue(), orderSubPO.getPaymentId(), orderSubPO.getTransactionId()); | ||||
|             }else if (orderSubPO.getPaymentMethod().equals(PaymentTypeEnum.DY.getCode())){ | ||||
|                 douyinService.cancel(orderSubPO.getTransactionId(), orderSubPO.getPaymentId()); | ||||
|             } | ||||
|  | ||||
|             //异步退款订单 | ||||
|             ThreadPoolUtils.getThreadPool().execute(() -> { | ||||
|                 //变更订单状态,记录结束订单时间,记录订单备注 | ||||
|  | ||||
| @ -15,6 +15,9 @@ public class CarModelPackageDTO { | ||||
|     @ApiModelProperty("套餐ID") | ||||
|     private Long carRuleId; | ||||
|  | ||||
|     @ApiModelProperty("租电套餐ID") | ||||
|     private Long batteyRuleId; | ||||
|  | ||||
|     @ApiModelProperty("美团商品ID") | ||||
|     private String mtProductId; | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user