|
|
|
@ -149,7 +149,7 @@ public class BgtsServiceImpl implements IBgtsService {
|
|
|
|
|
reportDownScanFileDto.setDownurl(String.valueOf(map.get(downurl)));
|
|
|
|
|
reportDownScanFileDto.setFilestoragetype(filestoragetype);
|
|
|
|
|
reportDownScanFileDto.setFilesource(filesource);
|
|
|
|
|
reportDownScanFileDto.setFiletitle(map.get(filetitle)==null?"重症"+(new Date().getTime()):String.valueOf(map.get(filetitle)));
|
|
|
|
|
reportDownScanFileDto.setFiletitle(map.get(filetitle)==null?"重症"+(System.currentTimeMillis()):String.valueOf(map.get(filetitle)));
|
|
|
|
|
reportDownScanFileDto.setSerialnum(StringUtils.isNotBlank(String.valueOf(map.get(serialnum)))?String.valueOf(map.get(serialnum)):String.valueOf(idWorker.nextId()));
|
|
|
|
|
reportDownScanFileDtos.add(reportDownScanFileDto);
|
|
|
|
|
reportDownDto.setScanfiles(reportDownScanFileDtos);
|
|
|
|
@ -217,7 +217,6 @@ public class BgtsServiceImpl implements IBgtsService {
|
|
|
|
|
* @param empId
|
|
|
|
|
*/
|
|
|
|
|
private void collectExams(List<String[]> exams, String empId,ReportDownDto reportDownDto) throws Exception {
|
|
|
|
|
// reportDownDto.setTaskid(id);
|
|
|
|
|
//调用上传接口
|
|
|
|
|
Map<String, Object> headMap = new HashMap<>();
|
|
|
|
|
headMap.put("Content-Type", "application/json");
|
|
|
|
@ -269,30 +268,12 @@ public class BgtsServiceImpl implements IBgtsService {
|
|
|
|
|
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
|
|
|
|
|
reportDownScanFileDto.setSerialnum(exam[0]);
|
|
|
|
|
reportDownScanFileDto.setFiletitle(exam[1]);
|
|
|
|
|
// 1、创建document对象
|
|
|
|
|
Document document = DocumentHelper.createDocument();
|
|
|
|
|
// Element request = document.addElement("Request");
|
|
|
|
|
// Element msg = request.addElement("Msg");
|
|
|
|
|
// msg.addElement("EXAM_NO").setText(exam[0]);
|
|
|
|
|
// List<String> bgtsDetailParam = (List<String>) FileUtils.getJsonByName("bgtsDetailParam");
|
|
|
|
|
// Element request = null;
|
|
|
|
|
// for (int i = 0; i < bgtsDetailParam.size(); i++) {
|
|
|
|
|
// if (i == 0) {
|
|
|
|
|
// request = document.addElement(bgtsDetailParam.get(i));
|
|
|
|
|
// } else {
|
|
|
|
|
// request = request.addElement(bgtsDetailParam.get(i));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
Element esbEntry = document.addElement("ESBEntry");
|
|
|
|
|
Element request = HttpUtils.reqElement(esbEntry, 0);
|
|
|
|
|
request.addElement("EXAM_NO").setText(exam[0]);
|
|
|
|
|
String resXml = invokeWs(esbEntry.asXML());
|
|
|
|
|
XmlUtils reqXmlUtils=new XmlUtils(FileUtils.getXmlPath());
|
|
|
|
|
Element esbEntry = reqXmlUtils.getMsgElement();
|
|
|
|
|
esbEntry.element("EXAM_NO").setText(exam[0]);
|
|
|
|
|
String resXml = invokeWs(reqXmlUtils.getDocument().asXML());
|
|
|
|
|
//解析XML
|
|
|
|
|
XmlUtils xmlUtils = new XmlUtils(new ByteArrayInputStream(resXml.getBytes("UTF-8")));
|
|
|
|
|
// List<String> dis = new ArrayList<>();
|
|
|
|
|
// dis.add("MsgInfo");
|
|
|
|
|
// dis.add("Msg");
|
|
|
|
|
// dis.add("ReportInfo");
|
|
|
|
|
List<String> dis = (List<String>) FileUtils.getJsonByName("bgtsDetailRespon");
|
|
|
|
|
//数据所在节点
|
|
|
|
|
Element element = xmlUtils.getElement(dis);
|
|
|
|
@ -308,25 +289,12 @@ public class BgtsServiceImpl implements IBgtsService {
|
|
|
|
|
*/
|
|
|
|
|
private List<String[]> getExamNo(String empId) throws Exception {
|
|
|
|
|
List<String[]> exams = new ArrayList<>();
|
|
|
|
|
// 1、创建document对象
|
|
|
|
|
Document document = DocumentHelper.createDocument();
|
|
|
|
|
// Element request = document.addElement("Request");
|
|
|
|
|
// Element msg = request.addElement("Msg");
|
|
|
|
|
// msg.addElement("EMPI_ID").setText(empId);
|
|
|
|
|
// List<String> bgtsParam = (List<String>) FileUtils.getJsonByName("bgtsParam");
|
|
|
|
|
// Element request = null;
|
|
|
|
|
// for (int i = 0; i < bgtsParam.size(); i++) {
|
|
|
|
|
// if (i == 0) {
|
|
|
|
|
// request = document.addElement(bgtsParam.get(i));
|
|
|
|
|
// } else {
|
|
|
|
|
// request = request.addElement(bgtsParam.get(i));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
Element esbEntry = document.addElement("ESBEntry");
|
|
|
|
|
Element reqElement = HttpUtils.reqElement(esbEntry, 1);
|
|
|
|
|
reqElement.addElement("EMPI_ID").setText(empId);
|
|
|
|
|
|
|
|
|
|
XmlUtils reqXmlUtils=new XmlUtils(FileUtils.getXmlPath());
|
|
|
|
|
Element reqElement = reqXmlUtils.getMsgElement();
|
|
|
|
|
reqElement.element("INHOSP_NO").setText(empId);
|
|
|
|
|
logger.info("-------根据患者主索引号查询多个报告单号,地址:" + wsUrl + ",方法:" + wsLocalMethod + "---------");
|
|
|
|
|
String xml = esbEntry.asXML();
|
|
|
|
|
String xml = reqXmlUtils.getDocument().asXML();
|
|
|
|
|
logger.info("---------------------------");
|
|
|
|
|
logger.info(xml);
|
|
|
|
|
logger.info("----------------------------");
|
|
|
|
@ -336,9 +304,6 @@ public class BgtsServiceImpl implements IBgtsService {
|
|
|
|
|
logger.info("-----------------------------");
|
|
|
|
|
//解析XML
|
|
|
|
|
XmlUtils xmlUtils = new XmlUtils(new ByteArrayInputStream(resXml.getBytes("UTF-8")));
|
|
|
|
|
// List<String> dis = new ArrayList<>();
|
|
|
|
|
// dis.add("MsgInfo");
|
|
|
|
|
// dis.add("Msg");
|
|
|
|
|
List<String> dis = (List<String>) FileUtils.getJsonByName("bgtsRespon");
|
|
|
|
|
//数据所在节点
|
|
|
|
|
Element element = xmlUtils.getElement(dis);
|
|
|
|
@ -369,20 +334,6 @@ public class BgtsServiceImpl implements IBgtsService {
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
public String invokeWs(String xml) throws Exception {
|
|
|
|
|
// Object[] object = new Object[]{xml};//请求参数
|
|
|
|
|
// org.apache.axis.client.Service service = new org.apache.axis.client.Service();
|
|
|
|
|
// Call call = (Call) service.createCall();
|
|
|
|
|
// call.setTargetEndpointAddress(wsUrl);// 远程调用路径
|
|
|
|
|
// // 调用的命名空间和方法名
|
|
|
|
|
//// call.setOperationName(new QName(wsNamespaceUrl, wsLocalMethod));
|
|
|
|
|
// call.setOperationName(wsLocalMethod);
|
|
|
|
|
// call.setUseSOAPAction(true);
|
|
|
|
|
//// call.setSOAPActionURI(wsNamespaceUrl + "pushSurveyReport");
|
|
|
|
|
// call.addParameter("arg0", XMLType.XSD_STRING, ParameterMode.IN);
|
|
|
|
|
// call.setReturnType(XMLType.XSD_STRING);// 返回值类型:String
|
|
|
|
|
// call.setTimeout(100000);//超时
|
|
|
|
|
// String result = (String) call.invoke(object);// 远程调用
|
|
|
|
|
// System.out.println(result);
|
|
|
|
|
logger.info("-----\n客户端调用服务端:" + wsUrl + "方法:" + wsLocalMethod + "\n------------");
|
|
|
|
|
JAXDynamicClientFactory dcf = JAXDynamicClientFactory.newInstance();
|
|
|
|
|
Client client = dcf.createClient(wsUrl);
|
|
|
|
|