|
@@ -60,8 +60,10 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
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.setRequestBodys(naliRetList.get(3));
|
|
|
|
|
|
- if (StringUtil.isBlank(retUrl)){
|
|
|
|
|
|
+ if (StringUtil.isBlank(retUrl)) {
|
|
return saveInquiryDTO;
|
|
return saveInquiryDTO;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -84,27 +86,31 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
|
|
|
saveInquiryDTO.setBody(retUrl);
|
|
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;
|
|
return saveInquiryDTO;
|
|
}
|
|
}
|
|
|
|
|
|
private List<String> getUrl(SaveInquiryVO saveInquiryVO) {
|
|
private List<String> getUrl(SaveInquiryVO saveInquiryVO) {
|
|
List<String> ret = Lists.newArrayList();
|
|
List<String> ret = Lists.newArrayList();
|
|
String retUrl = null;
|
|
String retUrl = null;
|
|
|
|
+ Request request = null;
|
|
Response response = null;
|
|
Response response = null;
|
|
try {
|
|
try {
|
|
String encodingAesKey = "";
|
|
String encodingAesKey = "";
|
|
Client client = new Client(apiUrl, appKey, appSecret, 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()) {
|
|
if (response.isSuccess()) {
|
|
JSONResponseBean result = response.getJsonResponseBean();
|
|
JSONResponseBean result = response.getJsonResponseBean();
|
|
retUrl = result.getBody().toString();
|
|
retUrl = result.getBody().toString();
|
|
@@ -113,6 +119,8 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
}
|
|
}
|
|
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.getBodys()));
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -124,7 +132,11 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
Map<String, Object> detail = new HashMap<>();
|
|
Map<String, Object> detail = new HashMap<>();
|
|
detail.put("question", i.getQuestion());
|
|
detail.put("question", i.getQuestion());
|
|
detail.put("answer", i.getAnswer());
|
|
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);
|
|
details.add(detail);
|
|
});
|
|
});
|
|
|
|
|
|
@@ -135,6 +147,8 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
body.put("appId", saveInquiryVO.getAppId());
|
|
body.put("appId", saveInquiryVO.getAppId());
|
|
body.put("fromId", saveInquiryVO.getFrom());
|
|
body.put("fromId", saveInquiryVO.getFrom());
|
|
body.put("sources", "langtong");
|
|
body.put("sources", "langtong");
|
|
|
|
+ body.put("supplement", saveInquiryVO.getSupplement());
|
|
|
|
+ body.put("pushList", saveInquiryVO.getPushList());
|
|
if (saveInquiryVO.getDepartment().indexOf("全科") != -1) {
|
|
if (saveInquiryVO.getDepartment().indexOf("全科") != -1) {
|
|
body.put("diagnosis", saveInquiryVO.getDiagnosis());
|
|
body.put("diagnosis", saveInquiryVO.getDiagnosis());
|
|
}
|
|
}
|