|
@@ -2,20 +2,31 @@ package com.diagbot.facade;
|
|
|
|
|
|
|
|
|
|
import com.diagbot.dto.SaveInquiryTriageDTO;
|
|
import com.diagbot.dto.SaveInquiryTriageDTO;
|
|
|
|
+import com.diagbot.entity.Client;
|
|
import com.diagbot.entity.InquiryTriage;
|
|
import com.diagbot.entity.InquiryTriage;
|
|
|
|
+import com.diagbot.entity.JSONResponseBean;
|
|
|
|
+import com.diagbot.entity.Request;
|
|
|
|
+import com.diagbot.entity.Response;
|
|
import com.diagbot.service.impl.InquiryTriageServiceImpl;
|
|
import com.diagbot.service.impl.InquiryTriageServiceImpl;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.DateUtil;
|
|
import com.diagbot.util.DateUtil;
|
|
|
|
+import com.diagbot.util.FastJsonUtils;
|
|
import com.diagbot.util.GsonUtil;
|
|
import com.diagbot.util.GsonUtil;
|
|
import com.diagbot.util.HttpUtils;
|
|
import com.diagbot.util.HttpUtils;
|
|
import com.diagbot.util.StringUtil;
|
|
import com.diagbot.util.StringUtil;
|
|
import com.diagbot.vo.HospitalVO;
|
|
import com.diagbot.vo.HospitalVO;
|
|
import com.diagbot.vo.SaveInquiryTriageVO;
|
|
import com.diagbot.vo.SaveInquiryTriageVO;
|
|
|
|
+import com.google.common.collect.Lists;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description:
|
|
* @Description:
|
|
@@ -23,10 +34,17 @@ import java.util.List;
|
|
* @time: 2020/3/23 10:33
|
|
* @time: 2020/3/23 10:33
|
|
*/
|
|
*/
|
|
@Component
|
|
@Component
|
|
|
|
+@Slf4j
|
|
public class InquiryTriageFacade extends InquiryTriageServiceImpl {
|
|
public class InquiryTriageFacade extends InquiryTriageServiceImpl {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
OptInfoFacade optInfoFacade;
|
|
OptInfoFacade optInfoFacade;
|
|
|
|
+ @Value("${nalizx.apiUrl}")
|
|
|
|
+ private String apiUrl;
|
|
|
|
+ @Value("${nalizx.appKey}")
|
|
|
|
+ private String appKey;
|
|
|
|
+ @Value("${nalizx.appSecret}")
|
|
|
|
+ private String appSecret;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @param saveInquiryVO
|
|
* @param saveInquiryVO
|
|
@@ -53,21 +71,27 @@ public class InquiryTriageFacade extends InquiryTriageServiceImpl {
|
|
//邵逸夫医院 心理测试 对接纳里时,返回url
|
|
//邵逸夫医院 心理测试 对接纳里时,返回url
|
|
SaveInquiryTriageDTO saveInquiryDTO = new SaveInquiryTriageDTO();
|
|
SaveInquiryTriageDTO saveInquiryDTO = new SaveInquiryTriageDTO();
|
|
|
|
|
|
-/* if (saveInquiryVO.getHospitalCode().equals("邵逸夫医院")
|
|
|
|
|
|
+
|
|
|
|
+ if (saveInquiryVO.getHospitalCode().equals("邵逸夫医院")
|
|
&& saveInquiryVO.getIdType().equals(1)) {
|
|
&& saveInquiryVO.getIdType().equals(1)) {
|
|
|
|
+ //去咨询
|
|
List<String> naliRetList = getUrl(saveInquiryVO);
|
|
List<String> naliRetList = getUrl(saveInquiryVO);
|
|
String retUrl = naliRetList.get(0);
|
|
String retUrl = naliRetList.get(0);
|
|
saveInquiryDTO.setBody(retUrl);
|
|
saveInquiryDTO.setBody(retUrl);
|
|
saveInquiryDTO.setResponse(naliRetList.get(1));
|
|
saveInquiryDTO.setResponse(naliRetList.get(1));
|
|
saveInquiryDTO.setRequest(naliRetList.get(2));
|
|
saveInquiryDTO.setRequest(naliRetList.get(2));
|
|
saveInquiryDTO.setRequestBodys(naliRetList.get(3));
|
|
saveInquiryDTO.setRequestBodys(naliRetList.get(3));
|
|
- }*/
|
|
|
|
|
|
+ }else if(saveInquiryVO.getHospitalCode().equals("邵逸夫医院")
|
|
|
|
+ && saveInquiryVO.getIdType().equals(2)){
|
|
|
|
+ //去挂号。
|
|
|
|
+ //TODO
|
|
|
|
+ }
|
|
return saveInquiryDTO;
|
|
return saveInquiryDTO;
|
|
}
|
|
}
|
|
|
|
|
|
private List<String> getUrl(SaveInquiryTriageVO saveInquiryVO) {
|
|
private List<String> getUrl(SaveInquiryTriageVO saveInquiryVO) {
|
|
//TODO 待定
|
|
//TODO 待定
|
|
- /*List<String> ret = Lists.newArrayList();
|
|
|
|
|
|
+ List<String> ret = Lists.newArrayList();
|
|
String retUrl = null;
|
|
String retUrl = null;
|
|
Request request = null;
|
|
Request request = null;
|
|
Response response = null;
|
|
Response response = null;
|
|
@@ -88,7 +112,29 @@ public class InquiryTriageFacade extends InquiryTriageServiceImpl {
|
|
ret.add(retUrl);
|
|
ret.add(retUrl);
|
|
ret.add(FastJsonUtils.getBeanToJson(response));
|
|
ret.add(FastJsonUtils.getBeanToJson(response));
|
|
ret.add(FastJsonUtils.getBeanToJson(request));
|
|
ret.add(FastJsonUtils.getBeanToJson(request));
|
|
- ret.add(FastJsonUtils.getBeanToJson(request.getBodys()));*/
|
|
|
|
- return null;
|
|
|
|
|
|
+ ret.add(FastJsonUtils.getBeanToJson(request.getBodys()));
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+ private Request getltcs(SaveInquiryTriageVO saveInquiryVO) {
|
|
|
|
+ List bodyList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Map<String, Object> body = new HashMap<>();
|
|
|
|
+ body.put("disDeptist",saveInquiryVO.getDisDeptist() );
|
|
|
|
+ //body.put("patName", saveInquiryVO.getPatName());
|
|
|
|
+ body.put("patAge", saveInquiryVO.getPatAge());
|
|
|
|
+ body.put("patSex", saveInquiryVO.getPatSex());
|
|
|
|
+ body.put("idType", saveInquiryVO.getIdType());
|
|
|
|
+ body.put("symptom", saveInquiryVO.getSymptom());
|
|
|
|
+ body.put("supplement", saveInquiryVO.getSupplement());
|
|
|
|
+
|
|
|
|
+ bodyList.add(body);
|
|
|
|
+
|
|
|
|
+ //X-Service-Id对应的值
|
|
|
|
+ String serviceId = "consult.questionRecordService";
|
|
|
|
+ //X-Service-Method对应的值
|
|
|
|
+ String method = "saveQuestionRecord";
|
|
|
|
+ return new Request(serviceId, method, bodyList);
|
|
}
|
|
}
|
|
}
|
|
}
|