ソースを参照

测试获取支付链接

jinshihui 10 ヶ月 前
親
コミット
4e7e7cfbdc

+ 0 - 1
commons/src/main/java/com/jzg/commons/core/base/BaseController.java

@@ -133,7 +133,6 @@ public class BaseController {
      */
     public String getUserSystemCode(){
         String authorizationHeader = getToken();
-        log.info("authorizationHeader的值:{}",authorizationHeader);
         if(authorizationHeader == null){
             //如果是内部请求的话 返回空值
             return "";

+ 9 - 1
commons/src/main/java/com/jzg/commons/entity/quote/vo/aggregated/PaymentLinkResultsVo.java

@@ -14,10 +14,18 @@ import lombok.NoArgsConstructor;
 @Data
 public class PaymentLinkResultsVo {
 
+    /**
+     * 支付链接状态
+     */
     private boolean payLinkStatus;
 
+    /**
+     * 支付链接
+     */
     private String paymentLink;
 
+    /**
+     * 错误信息
+     */
     private String errorMsg;
-
 }

+ 5 - 2
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/UnifyOrderManager.java

@@ -382,7 +382,7 @@ public class UnifyOrderManager {
         InsOrders insOrders = insOrdersService.getById(paymentLinkVo.getOrder().getOrdersNo());
         AssertionUtils.isFail(Objects.isNull(insOrders), "订单不存在");
         InsOrdersCarInfo insOrdersCarInfo = insOrdersCarInfoService.getByOrderId(insOrders.getId());
-        //获取保司实体
+        //获取保司信息
         HttpResult<EsmInsCompany> esmInsCompanyHttpResult = platformClient.findById(insOrders.getCompanyId(), baseController.getToken());
         paymentLinkVo.getOrder().setInsuranceCompanyCode(esmInsCompanyHttpResult.getData().getCompanyCode());
         paymentLinkVo.getOrder().setInsuranceCompanyId(esmInsCompanyHttpResult.getData().getId());
@@ -398,9 +398,12 @@ public class UnifyOrderManager {
         paymentLinkVo.setInsOrdersPolicy(insOrdersPolicy);
         paymentLinkVo.setInsOrdersCosts(insOrdersCosts);
 
+        // 生成支付链接
         PaymentLinkResultsVo paymentLinkResultsVo = quoteService.getPaymentLink(paymentLinkVo);
         log.info("paymentLinkResultsVo对象的值:{}", JSON.toJSONString(paymentLinkResultsVo));
-
+        if(Objects.isNull(paymentLinkResultsVo.getPaymentLink())){
+            throw new SystemException(paymentLinkResultsVo.getErrorMsg());
+        }
         // 保存支付链接
         insOrders.setPayLink(paymentLinkResultsVo.getPaymentLink());
         insOrdersService.updateById(insOrders);

+ 11 - 0
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/factory/CompanyFactory.java

@@ -184,10 +184,21 @@ public class CompanyFactory {
         return getQuotationBase(Integer.parseInt(insOrders.getApiType()), companyCode);
     }
 
+    /**
+     * 根据保司编码获取支付链接请求基类
+     * @param insOrders
+     * @param companyCode
+     * @param baseController
+     * @param paymentLinkVo
+     * @return QuotationBaseService
+     */
     public QuotationBaseService getPaymentLinkService(InsOrders insOrders, String companyCode, BaseController baseController, PaymentLinkVo paymentLinkVo) {
         //设置归属信息
         String token = baseController.getToken();
+        log.info("token的值:{}",token);
         String systemCode = baseController.getAppSystemCode();
+        log.info("systemCode的值:{}",systemCode);
+
         HttpResult<PtlAgreementAttribution> agreementAttribution = platformClient.getAgreementAttribution(insOrders.getAgreementId(), token, systemCode);
         AssertionUtils.isFail(agreementAttribution.getCode() == 500, "获取协议属性失败");
         Map<String, String> fieldMap = agreementAttribution.getData().getFields().stream()

+ 3 - 1
tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/crawler/component/ZiJinCrawlerRequestComponent.java

@@ -319,8 +319,10 @@ public class ZiJinCrawlerRequestComponent {
     public ZiJinCrawlerPaymentLinkResponse payment(ZiJinCrawlerPaymentLinkRequest ziJinCrawlerPaymentLinkRequest, HttpHeaders headers) throws NotFoundException, IOException {
         //设置headers
         HttpHeaders httpHeaders = setHttpHeaders();
+
         String jsonString = JSON.toJSONString(ziJinCrawlerPaymentLinkRequest);
-        ResponseEntity<ZiJinCrawlerPaymentLinkResponse> responseEntity = requestComponent.post(RequestUrl.QRCODE.getRequestUrl(ziJinCrawlerProperties.getBaseUrl()), ziJinCrawlerPaymentLinkRequest, ZiJinCrawlerPaymentLinkResponse.class, httpHeaders);
+        log.info("ziJinCrawlerPaymentLinkRequest请求参数的值:{}", jsonString);
+        ResponseEntity<ZiJinCrawlerPaymentLinkResponse> responseEntity = requestComponent.post(RequestUrl.QRCODE.getRequestUrl(ziJinCrawlerProperties.getBaseUrl()), jsonString, ZiJinCrawlerPaymentLinkResponse.class, httpHeaders);
         return responseEntity.getBody();
     }
 

+ 43 - 10
tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/crawler/entity/response/ZiJinCrawlerPaymentLinkRequest.java

@@ -1,52 +1,85 @@
 package com.jzg.quotation.zijin.crawler.entity.response;
 
+import com.alibaba.fastjson.annotation.JSONField;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
+import java.io.Serial;
+import java.io.Serializable;
 import java.util.List;
 
 /**
  * 紫金支付链接请求实体类
  */
 @Data
-public class ZiJinCrawlerPaymentLinkRequest {
+public class ZiJinCrawlerPaymentLinkRequest implements Serializable {
 
-    // 微信公众号标识
+    @Serial
+    private static final long serialVersionUID = 6073378305816078077L;
+
+    /**
+     * 微信公众号标识
+     */
     @JsonProperty("weChatOfficialFlag")
+    @JSONField(ordinal = 1)
     private String weChatOfficialFlag;
 
-    // 支付申请信息列表
+    /**
+     * 支付申请信息列表
+     */
     @JsonProperty("paymentApplicationDtos")
+    @JSONField(ordinal = 2)
     private List<PaymentApplicationDto> paymentApplicationDtos;
 
-    // 操作员代码
+    /**
+     * 操作员代码
+     */
     @JsonProperty("operatorCode")
+    @JSONField(ordinal = 3)
     private String operatorCode;
 
-    // 公司代码
+    /**
+     * 公司代码
+     */
     @JsonProperty("companyCode")
+    @JSONField(ordinal = 4)
     private String companyCode;
 
     /**
      * 支付申请信息DTO
      */
     @Data
-    public static class PaymentApplicationDto {
+    public static class PaymentApplicationDto implements Serializable{
+
+        @Serial
+        private static final long serialVersionUID = -2564009521961061736L;
 
-        // 业务编号(订单号)
+        /**
+         * 业务编号(订单号)
+         */
         @JsonProperty("businessNo")
+        @JSONField(ordinal = 1)
         private String businessNo;
 
-        // 业务类型:D-订单
+        /**
+         * 业务类型:D-订单
+         */
         @JsonProperty("businessType")
+        @JSONField(ordinal = 2)
         private String businessType;
 
-        // 调用系统代码:0201-支付系统
+        /**
+         * 调用系统代码:0201-支付系统
+         */
         @JsonProperty("invokeSystem")
+        @JSONField(ordinal = 3)
         private String invokeSystem;
 
-        // 保费金额
+        /**
+         * 保费金额
+         */
         @JsonProperty("premium")
+        @JSONField(ordinal = 4)
         private String premium;
     }
 }

+ 1 - 1
tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/crawler/enums/RequestUrl.java

@@ -29,7 +29,7 @@ public enum RequestUrl implements CrawlerRequestUrlStandard {
     //上传影像
     UPLOAD_IMAGE("/dpgateway/insurance-order/carInsurance/uploadFile", "上传影像"),
     // 支付链接
-    QRCODE("/pubsrv/ecpay/payment/order/select/orderNo", "支付二维码"),
+    QRCODE("/api/v1/insurance/public/paymentApplication/pushMessage", "支付二维码"),
     // 查询订单状态
     QUERY_ORDER_STATUS("/kscd-frontend/order/queryOrderList", "查询订单状态"),
     // 下载电子保单

+ 11 - 3
tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/crawler/service/impl/ZiJinCrawlerRequestImpl.java

@@ -262,13 +262,21 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
             paymentApplicationDto.setInvokeSystem("0201");
             paymentApplicationDto.setPremium(ziJinCrawlerOrder.getTotalPremium());
             ziJinCrawlerPaymentLinkRequest.setPaymentApplicationDtos(Collections.singletonList(paymentApplicationDto));
-            ziJinCrawlerPaymentLinkRequest.setOperatorCode("");
-            ziJinCrawlerPaymentLinkRequest.setCompanyCode("");
+            ziJinCrawlerPaymentLinkRequest.setOperatorCode("214000151");
+            ziJinCrawlerPaymentLinkRequest.setCompanyCode("2140000601");
 
             //获取支付链接
             ZiJinCrawlerPaymentLinkResponse ziJinCrawlerPaymentLinkResponse = ziJinCrawlerRequestComponent.payment(ziJinCrawlerPaymentLinkRequest, headers);
+            log.info("ziJinCrawlerPaymentLinkResponse参数的值:{}", JSON.toJSONString(ziJinCrawlerPaymentLinkResponse));
             PaymentLinkResultsVo paymentLinkResultsVo = new PaymentLinkResultsVo();
-            paymentLinkResultsVo.setPaymentLink(ziJinCrawlerPaymentLinkResponse.getWechatUrl());
+            //支付链接获取成功
+            if("0000".equals(ziJinCrawlerPaymentLinkResponse.getRtnCode())){
+                paymentLinkResultsVo.setPayLinkStatus(true);
+                paymentLinkResultsVo.setPaymentLink(ziJinCrawlerPaymentLinkResponse.getWechatUrl());
+            }else{
+                paymentLinkResultsVo.setPayLinkStatus(false);
+                paymentLinkResultsVo.setErrorMsg(ziJinCrawlerPaymentLinkResponse.getRtnMsg());
+            }
             return paymentLinkResultsVo;
         } catch (NotFoundException e) {
             e.printStackTrace();

ファイルの差分が大きいため隠しています
+ 0 - 0
tenant/insurance/quotation-zijin/src/main/resources/js/auto.js


+ 1 - 1
tenant/insurance/quotation-zijin/src/main/resources/js/content.js

@@ -1 +1 @@
-___content ="kXaQJL2IxqG7x4gqGyZvTszzpIoUrUk4yYovyxOOtyrDU5SABVT3WLpll0y.qV5gyeqr0u.X7W.RJ9T8B62vFNVHi4UwcT2dUh8j2BcL9G1PU6lTkks08lOTZyWGT6kne5sNHJ5lWdEh475DMo8YBDMbtZWDRbBORG45fywExI0amC1oZNAtNrcDxTAjwDDlAdIyVt5MDjq";
+___content ="yU9BReHOscOXziWWhuqWhEqSBLoiQjCA8uMCSeot5IObZ2_xeZU_IxDNkxes4zy7iLvJ5op_p9fNnOQIgHzdvgmbfcRukr_7dWNH24nBKtuDBoMce8pxa.weiRD5CfFUObheFUO5KJvivd.f60rivIHilfox1lQ4a1s7w7dkLtxsfA0.tt6RdgqUai.wvN5s89hy9_EvXjE";

ファイルの差分が大きいため隠しています
+ 0 - 0
tenant/insurance/quotation-zijin/src/main/resources/js/tsssss.js


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません