Przeglądaj źródła

纳里对接加参修改

rengb 5 lat temu
rodzic
commit
17c618efb4

+ 4 - 0
znwz-service/src/main/java/com/diagbot/dto/SaveInquiryDTO.java

@@ -23,4 +23,8 @@ public class SaveInquiryDTO {
 
     private String response;
 
+    private String request;
+
+    private String requestBodys;
+
 }

+ 22 - 14
znwz-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java

@@ -60,8 +60,10 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
         String retUrl = naliRetList.get(0);
         saveInquiryDTO.setBody(retUrl);
         saveInquiryDTO.setResponse(naliRetList.get(1));
+        saveInquiryDTO.setRequest(naliRetList.get(2));
+        saveInquiryDTO.setRequestBodys(naliRetList.get(3));
 
-        if (StringUtil.isBlank(retUrl)){
+        if (StringUtil.isBlank(retUrl)) {
             return saveInquiryDTO;
         }
 
@@ -84,27 +86,31 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
 
         saveInquiryDTO.setBody(retUrl);
 
-//        //记录日志
-//        OptInfo optInfo = new OptInfo();
-//        BeanUtil.copyProperties(saveInquiryVO, optInfo);
-//        optInfo.setGmtModified(now);
-//        optInfo.setGmtCreate(now);
-//        optInfo.setIp(HttpUtils.getIpAddress());
-//        optInfo.setSource(saveInquiryVO.getFrom());
-//        optInfo.setOptType("2");
-//        optInfoFacade.save(optInfo);
+        //        //记录日志
+        //        OptInfo optInfo = new OptInfo();
+        //        BeanUtil.copyProperties(saveInquiryVO, optInfo);
+        //        optInfo.setGmtModified(now);
+        //        optInfo.setGmtCreate(now);
+        //        optInfo.setIp(HttpUtils.getIpAddress());
+        //        optInfo.setSource(saveInquiryVO.getFrom());
+        //        optInfo.setOptType("2");
+        //        optInfoFacade.save(optInfo);
         return saveInquiryDTO;
     }
 
     private List<String> getUrl(SaveInquiryVO saveInquiryVO) {
         List<String> ret = Lists.newArrayList();
         String retUrl = null;
+        Request request = null;
         Response response = null;
         try {
             String encodingAesKey = "";
             Client client = new Client(apiUrl, appKey, appSecret, encodingAesKey);
-            response = client.execute(getltcs(saveInquiryVO));
-            log.info(FastJsonUtils.getBeanToJson(response));
+            request = getltcs(saveInquiryVO);
+            response = client.execute(request);
+            log.info("request:" + FastJsonUtils.getBeanToJson(request));
+            log.info("requestBodys:" + FastJsonUtils.getBeanToJson(request.getBodys()));
+            log.info("response:" + FastJsonUtils.getBeanToJson(response));
             if (response.isSuccess()) {
                 JSONResponseBean result = response.getJsonResponseBean();
                 retUrl = result.getBody().toString();
@@ -113,6 +119,8 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
         }
         ret.add(retUrl);
         ret.add(FastJsonUtils.getBeanToJson(response));
+        ret.add(FastJsonUtils.getBeanToJson(request));
+        ret.add(FastJsonUtils.getBeanToJson(request.getBodys()));
         return ret;
     }
 
@@ -124,8 +132,8 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
             Map<String, Object> detail = new HashMap<>();
             detail.put("question", i.getQuestion());
             detail.put("answer", i.getAnswer());
-            List<Map<String,Object>> optionMapList = Lists.newArrayList();
-            i.getOptions().forEach(option->{
+            List<Map<String, Object>> optionMapList = Lists.newArrayList();
+            i.getOptions().forEach(option -> {
                 optionMapList.add(FastJsonUtils.getJsonToMap(option));
             });
             detail.put("options", optionMapList);