Эх сурвалжийг харах

广电电渠新域名增加

mac 2 жил өмнө
parent
commit
6b5941ebea

+ 5 - 0
kxs-product/kxs-product-biz/src/main/java/com/kxs/product/biz/config/RsaProperties.java

@@ -31,6 +31,11 @@ public class RsaProperties {
 		 */
 		private String url;
 
+		/**
+		 * 电渠请求地址
+		 */
+		private String dqUrl;
+
 		/**
 		 * 机构号
 		 */

+ 9 - 9
kxs-product/kxs-product-biz/src/main/java/com/kxs/product/biz/service/impl/KxsGdServiceImpl.java

@@ -14,6 +14,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.kxs.common.core.exception.GlobalCustomerException;
 import com.kxs.common.mq.handlers.IMQSender;
+import com.kxs.product.api.amqp.rabbit.RabbitGdActQueueMQ;
 import com.kxs.product.api.model.KxsGdOrder;
 import com.kxs.product.api.model.KxsGdReport;
 import com.kxs.product.api.req.gd.GdCommonReq;
@@ -21,7 +22,6 @@ import com.kxs.product.api.req.gd.GdQueryCardOrderReq;
 import com.kxs.product.api.req.gd.GdSimOrderReq;
 import com.kxs.product.api.res.gd.GdCommRes;
 import com.kxs.product.api.res.gd.GdQueryOrderRes;
-import com.kxs.product.api.amqp.rabbit.RabbitGdActQueueMQ;
 import com.kxs.product.api.res.gd.GdSimOrderRes;
 import com.kxs.product.biz.config.RsaProperties;
 import com.kxs.product.biz.constant.enums.GdReportEnum;
@@ -39,7 +39,6 @@ import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.util.List;
 import java.util.Map;
-import java.util.Optional;
 
 /**
  * KXS 广电 服务实现
@@ -72,7 +71,7 @@ public class KxsGdServiceImpl implements KxsGdService {
                     .queryEndTime(endTime)
                     .pageNo(String.valueOf(pageNo))
                     .pageSize(String.valueOf(pageSize)).build();
-            String response = sendToGd("/ycsim-business/openapi/query_card_order_info", req);
+            String response = sendToGd(rsaProperties.getGd().getUrl() + "/ycsim-business/openapi/query_card_order_info", req);
             GdCommRes<GdQueryOrderRes> commRes = JSONUtil.toBean(response, new TypeReference<>() {}, true);
             if(commRes.getResultCode() != 1){
                 throw new GlobalCustomerException(commRes.getErrorDesc());
@@ -115,7 +114,7 @@ public class KxsGdServiceImpl implements KxsGdService {
         GdSimOrderReq req = GdSimOrderReq.builder()
                 .orderNos(JSON.toJSONString(orderNos))
                 .build();
-        String response = sendToGd("/ycsim-agent-service/openapi/online_sim_order/get_order_info", req);
+        String response = sendToGd(rsaProperties.getGd().getDqUrl() + "/ycsim-agent-service/openapi/online_sim_order/get_order_info", req);
         GdCommRes<List<GdSimOrderRes>> commRes = JSONUtil.toBean(response, new TypeReference<GdCommRes<List<GdSimOrderRes>>>() {}, true);
         if(commRes.getResultCode() != 1){
             throw new GlobalCustomerException(commRes.getErrorDesc());
@@ -148,7 +147,7 @@ public class KxsGdServiceImpl implements KxsGdService {
                         .eq(KxsGdReport::getIsCheck, GdReportEnum.CHECK_NO.getType())
                         .eq(KxsGdReport::getGdMobile, kxsGdOrder.getGdMobile()));
                 if (kxsGdReport == null) {
-                    return;
+                    continue;
                 }
                 kxsGdReport.setIsCheck(GdReportEnum.CHECK_SUC.getType());
                 kxsGdReportMapper.updateById(kxsGdReport);
@@ -255,11 +254,9 @@ public class KxsGdServiceImpl implements KxsGdService {
                 + "," + order.getGdMobile());
     }
 
-    private  String sendToGd(String uri, GdCommonReq req){
+    private  String sendToGd(String url, GdCommonReq req){
         try {
 
-            String url = "https://" + rsaProperties.getGd().getUrl() + uri;
-
             long timestamp = System.currentTimeMillis() / 1000;
             req.setTimestamp(timestamp);
             req.setBrhNo(rsaProperties.getGd().getBrhNo());
@@ -272,7 +269,10 @@ public class KxsGdServiceImpl implements KxsGdService {
                     .body(body)
                     .timeout(50000)//超时,毫秒
                     .execute().body();
-            Optional.ofNullable(response).orElseThrow(() -> new GlobalCustomerException("调用接口失败"));
+            if (response == null || !JSONUtil.isTypeJSON(response)) {
+                log.error("响应报文非有效格式{}", response);
+                throw new GlobalCustomerException("广电响应报文非有效格式");
+            }
 
             return response;