|
@@ -4,14 +4,19 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.diagbot.dto.InquiryDTO;
|
|
|
import com.diagbot.dto.InquiryPatDTO;
|
|
|
+import com.diagbot.entity.Client;
|
|
|
import com.diagbot.entity.InquiryDetail;
|
|
|
import com.diagbot.entity.InquiryInfo;
|
|
|
+import com.diagbot.entity.JSONResponseBean;
|
|
|
+import com.diagbot.entity.Request;
|
|
|
+import com.diagbot.entity.Response;
|
|
|
import com.diagbot.enums.IdTypeEnum;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.service.impl.InquiryDetailServiceImpl;
|
|
|
import com.diagbot.service.impl.InquiryInfoServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
+import com.diagbot.util.FastJsonUtils;
|
|
|
import com.diagbot.util.HttpUtils;
|
|
|
import com.diagbot.util.IdCard;
|
|
|
import com.diagbot.util.IntegerUtil;
|
|
@@ -21,12 +26,18 @@ import com.diagbot.vo.InquiryDetailVO;
|
|
|
import com.diagbot.vo.InquiryPatInquiryVO;
|
|
|
import com.diagbot.vo.InquiryPatVO;
|
|
|
import com.diagbot.vo.SaveInquiryVO;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @Description:
|
|
@@ -34,6 +45,7 @@ import java.util.List;
|
|
|
* @time: 2020/2/1 23:33
|
|
|
*/
|
|
|
@Component
|
|
|
+@Slf4j
|
|
|
public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
|
|
|
|
|
@@ -46,6 +58,13 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
@Qualifier("inquiryDetailServiceImpl")
|
|
|
private InquiryDetailServiceImpl inquiryDetailService;
|
|
|
|
|
|
+ @Value("${nali.apiUrl}")
|
|
|
+ private String apiUrl;
|
|
|
+ @Value("${nali.appKey}")
|
|
|
+ private String appKey;
|
|
|
+ @Value("${nali.appSecret}")
|
|
|
+ private String appSecret;
|
|
|
+
|
|
|
public void saveInquiry(SaveInquiryVO saveInquiryVO) {
|
|
|
if (StringUtil.isBlank(saveInquiryVO.getHospitalCode())) {
|
|
|
saveInquiryVO.setHospitalCode("朗通通用");
|
|
@@ -139,4 +158,64 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
|
|
|
+// 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);
|
|
|
+// 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();
|
|
|
+// }
|
|
|
+// } catch (Exception e) {
|
|
|
+// }
|
|
|
+// ret.add(retUrl);
|
|
|
+// ret.add(FastJsonUtils.getBeanToJson(response));
|
|
|
+// ret.add(FastJsonUtils.getBeanToJson(request));
|
|
|
+// ret.add(FastJsonUtils.getBeanToJson(request.getBodys()));
|
|
|
+// return ret;
|
|
|
+// }
|
|
|
+//
|
|
|
+// private Request getltcs(SaveInquiryVO saveInquiryVO) {
|
|
|
+// List bodyList = new ArrayList<>();
|
|
|
+//
|
|
|
+// List<Map<String, Object>> details = new ArrayList<>();
|
|
|
+// saveInquiryVO.getDetailList().forEach(i -> {
|
|
|
+// 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 -> {
|
|
|
+// optionMapList.add(FastJsonUtils.getJsonToMap(option));
|
|
|
+// });
|
|
|
+// detail.put("options", optionMapList);
|
|
|
+// details.add(detail);
|
|
|
+// });
|
|
|
+//
|
|
|
+// Map<String, Object> body = new HashMap<>();
|
|
|
+// body.put("details", details);
|
|
|
+// body.put("doctorId", Integer.parseInt(saveInquiryVO.getDoctorId()));
|
|
|
+// body.put("mpiId", saveInquiryVO.getMpiId());
|
|
|
+// body.put("appId", saveInquiryVO.getAppId());
|
|
|
+// body.put("fromId", saveInquiryVO.getFrom());
|
|
|
+// body.put("sources", "langtong");
|
|
|
+// body.put("supplement", saveInquiryVO.getSupplement());
|
|
|
+// body.put("pushList", saveInquiryVO.getPushList());
|
|
|
+// body.put("inquiryId", saveInquiryVO.getInquiryId());
|
|
|
+// bodyList.add(body);
|
|
|
+//
|
|
|
+// //X-Service-Id对应的值
|
|
|
+// String serviceId = "consult.questionRecordService";
|
|
|
+// //X-Service-Method对应的值
|
|
|
+// String method = "saveQuestionRecord";
|
|
|
+// return new Request(serviceId, method, bodyList);
|
|
|
+// }
|
|
|
}
|