Parcourir la source

Merge branch 'dev/znwz20200131_init' into dev/zzcx20200228_duijie

# Conflicts:
#	znwz-service/src/main/java/com/diagbot/vo/SaveInquiryVO.java
gaodm il y a 5 ans
Parent
commit
05c59b46e5

+ 8 - 3
config-server/src/main/resources/shared/znwz-service-dev.yml

@@ -104,7 +104,12 @@ io.github.lvyahui8.spring:
   base-packages: com.diagbot.aggregate
   thread-number: 12
 
+#nali:
+#  apiUrl: http://116.62.170.131:8096/openapi-devtest/gateway
+#  appKey: ngari5e34e52511dc394f
+#  appSecret: 11dc394fc05518c1
+
 nali:
-  apiUrl: http://116.62.170.131:8096/openapi-devtest/gateway
-  appKey: ngari5e34e52511dc394f
-  appSecret: 11dc394fc05518c1
+  apiUrl: https://ssltest.ngarihealth.com/openapi-prerelease/gateway
+  appKey: ngari5e48d9ec11dc3978
+  appSecret: 11dc397869c2d24a

+ 8 - 3
config-server/src/main/resources/shared/znwz-service-local.yml

@@ -104,7 +104,12 @@ io.github.lvyahui8.spring:
   base-packages: com.diagbot.aggregate
   thread-number: 12
 
+#nali:
+#  apiUrl: http://116.62.170.131:8096/openapi-devtest/gateway
+#  appKey: ngari5e34e52511dc394f
+#  appSecret: 11dc394fc05518c1
+
 nali:
-  apiUrl: http://116.62.170.131:8096/openapi-devtest/gateway
-  appKey: ngari5e34e52511dc394f
-  appSecret: 11dc394fc05518c1
+  apiUrl: https://ssltest.ngarihealth.com/openapi-prerelease/gateway
+  appKey: ngari5e48d9ec11dc3978
+  appSecret: 11dc397869c2d24a

+ 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;
+
 }

+ 27 - 13
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,7 +132,11 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
             Map<String, Object> detail = new HashMap<>();
             detail.put("question", i.getQuestion());
             detail.put("answer", i.getAnswer());
-            detail.put("options", i.getOptions());
+            List<Map<String, Object>> optionMapList = Lists.newArrayList();
+            i.getOptions().forEach(option -> {
+                optionMapList.add(FastJsonUtils.getJsonToMap(option));
+            });
+            detail.put("options", optionMapList);
             details.add(detail);
         });
 
@@ -135,6 +147,8 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
         body.put("appId", saveInquiryVO.getAppId());
         body.put("fromId", saveInquiryVO.getFrom());
         body.put("sources", "langtong");
+        body.put("supplement", saveInquiryVO.getSupplement());
+        body.put("pushList", saveInquiryVO.getPushList());
         if (saveInquiryVO.getDepartment().indexOf("全科") != -1) {
             body.put("diagnosis", saveInquiryVO.getDiagnosis());
         }

+ 11 - 12
znwz-service/src/main/java/com/diagbot/vo/SaveInquiryVO.java

@@ -8,7 +8,6 @@ import lombok.Setter;
 import javax.validation.Valid;
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.NotNull;
 import java.util.List;
 
 /**
@@ -31,29 +30,25 @@ public class SaveInquiryVO {
     /**
      * 医院名称
      */
-    @ApiModelProperty(value = "医院名称", required = true)
-    @NotBlank(message = "医院名称必传")
+    @ApiModelProperty(value = "医院名称")
     private String organName;
 
     /**
      * 医生所在科室名称
      */
-    @ApiModelProperty(value = "医生所在科室名称", required = true)
-    @NotBlank(message = "医生所在科室名称必传")
+    @ApiModelProperty(value = "医生所在科室名称")
     private String department;
 
     /**
      * 医生ID
      */
-    @ApiModelProperty(value = "医生ID", required = true)
-    @NotBlank(message = "医生ID必传")
+    @ApiModelProperty(value = "医生ID")
     private String doctorId;
 
     /**
      * 医生名称
      */
-    @ApiModelProperty(value = "医生名称", required = true)
-    @NotBlank(message = "医生名称必传")
+    @ApiModelProperty(value = "医生名称")
     private String doctorName;
 
     /**
@@ -83,11 +78,9 @@ public class SaveInquiryVO {
     /**
      * 诊断
      */
-    @ApiModelProperty(value = "诊断", required = true)
-    @NotBlank(message = "诊断必传")
+    @ApiModelProperty(value = "诊断")
     private String diagnosis;
 
-
     /**
      * 问诊明细
      */
@@ -103,6 +96,12 @@ public class SaveInquiryVO {
     @NotBlank(message = "链接来源必传")
     private String from;
 
+    @ApiModelProperty(value = "补充内容")
+    private String supplement;
+
+    @ApiModelProperty(value = "大数据推送结果")
+    private List<String> pushList;
+
     @ApiModelProperty(value = "自诊程序产生的ID")
     private Long inquiryId;