diff --git a/data-config/js-table-type.json b/data-config/js-table-type.json index 3a7fd45..58c9f99 100644 --- a/data-config/js-table-type.json +++ b/data-config/js-table-type.json @@ -1,5 +1,6 @@ { "icu": "重症文件分段id", "sa": "手麻文件分段id", + "examination": "检验报告文件分段id", "other": "其他文件分段id" } \ No newline at end of file diff --git a/src/main/java/com/docus/server/collection/webservice/ReceiveServer.java b/src/main/java/com/docus/server/collection/webservice/ReceiveServer.java index db13c85..c7121c7 100644 --- a/src/main/java/com/docus/server/collection/webservice/ReceiveServer.java +++ b/src/main/java/com/docus/server/collection/webservice/ReceiveServer.java @@ -35,6 +35,14 @@ public interface ReceiveServer { */ String pushICUReport(String icuReportMessage); + /** + * 接收检验报告信息 + * + * @param examinationReportMessage 检验报告信息 + * @return 返回信息 + */ + public String pushExaminationReport(String examinationReportMessage); + /** * 接收检查报告的信息 - 新增 * diff --git a/src/main/java/com/docus/server/collection/webservice/impl/ReceiveServerImpl.java b/src/main/java/com/docus/server/collection/webservice/impl/ReceiveServerImpl.java index 8d69e5e..486b833 100644 --- a/src/main/java/com/docus/server/collection/webservice/impl/ReceiveServerImpl.java +++ b/src/main/java/com/docus/server/collection/webservice/impl/ReceiveServerImpl.java @@ -59,6 +59,11 @@ public class ReceiveServerImpl implements ReceiveServer { return reportServer.pushICUReport(icuReportMessage); } + @Override + public String pushExaminationReport(String examinationReportMessage) { + return reportServer.pushExaminationReport(examinationReportMessage); + } + @Override public String pushAddInspectionReport(String inspectionReportMessage) { return reportServer.pushAddInspectionReport(inspectionReportMessage); diff --git a/src/main/java/com/docus/server/report/listener/ReportDownListener.java b/src/main/java/com/docus/server/report/listener/ReportDownListener.java index 9f06d50..7a2ab4d 100644 --- a/src/main/java/com/docus/server/report/listener/ReportDownListener.java +++ b/src/main/java/com/docus/server/report/listener/ReportDownListener.java @@ -3,6 +3,7 @@ package com.docus.server.report.listener; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSON; import com.docus.core.util.Func; import com.docus.infrastructure.web.api.CommonResult; import com.docus.infrastructure.web.api.ResultCode; @@ -19,10 +20,15 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.context.event.EventListener; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; +import sun.misc.BASE64Encoder; import javax.annotation.Resource; +import java.io.FileInputStream; +import java.io.IOException; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; @@ -128,4 +134,63 @@ public class ReportDownListener { HTTP_POST_LOCK.unlock(); } } + + public static void main(String[] args) throws IOException { + BASE64Encoder encoder = new BASE64Encoder(); + + + String url="http://192.168.161.102:9291/api/downplatform/scansionReportBatch"; +// String url="http://127.0.0.1:9291/api/downplatform/scansionReportBatch"; + Map bodyMap=new HashMap<>(); + Map patientMap=new HashMap<>(); + patientMap.put("patientid","8099350542"); + List> scanfiles=new ArrayList<>(); + + +// FileInputStream inputStream = new FileInputStream("d://wyb.png"); +// System.out.println(inputStream.available()); +// byte[] bytes = new byte[inputStream.available()]; +// inputStream.read(bytes,0,inputStream.available()); +// inputStream.close(); +// String base641 = encoder.encode(bytes); +// Map scanfile1Map=new HashMap<>(); +// scanfile1Map.put("assortid","docustestAssortID"); +// scanfile1Map.put("downurl",base641); +// scanfile1Map.put("filestoragetype",1); +// scanfile1Map.put("filetitle","嘉时测试图片1"); +// scanfile1Map.put("filetype","2"); +// scanfile1Map.put("serialnum","嘉时测试图片1"); + + + + FileInputStream inputStream2 = new FileInputStream("d://jianli_02.jpg"); + System.out.println(inputStream2.available()); + byte[] bytes2 = new byte[inputStream2.available()]; + inputStream2.read(bytes2,0,inputStream2.available()); + inputStream2.close(); + String base642 = encoder.encode(bytes2); + Map scanfile2Map=new HashMap<>(); + scanfile2Map.put("assortid","docustestAssortID"); + scanfile2Map.put("downurl",base642); + scanfile2Map.put("filestoragetype",1); + scanfile2Map.put("filetitle","嘉时测试图片2"); + scanfile2Map.put("filetype","2"); + scanfile2Map.put("serialnum","嘉时测试图片2"); + + +// +// scanfiles.add(scanfile1Map); + scanfiles.add(scanfile2Map); + bodyMap.put("patient",patientMap); + bodyMap.put("ip","wybtest"); + bodyMap.put("collectorid","docus测试扫描"); + bodyMap.put("scanfiles",scanfiles); + bodyMap.put("scanusercode","docus测试"); + bodyMap.put("scanusername","docus测试"); + HttpRequest post = HttpUtil.createPost(url); + post.timeout(5 * 1000); + post.header("Content-Type", "application/json; charset=utf-8"); + post.body(JSON.toJSONString(bodyMap)); + HttpResponse response = post.execute(); + } } diff --git a/src/main/java/com/docus/server/report/webservice/IReportServer.java b/src/main/java/com/docus/server/report/webservice/IReportServer.java index 99cc0ca..89a8e34 100644 --- a/src/main/java/com/docus/server/report/webservice/IReportServer.java +++ b/src/main/java/com/docus/server/report/webservice/IReportServer.java @@ -1,6 +1,5 @@ package com.docus.server.report.webservice; -import javax.jws.WebMethod; import javax.jws.WebService; /** @@ -23,6 +22,14 @@ public interface IReportServer { */ String pushICUReport(String icuReportMessage); + /** + * 接收检验报告信息 + * + * @param examinationReportMessage 检验报告信息 + * @return 返回信息 + */ + String pushExaminationReport(String examinationReportMessage); + /** * 接收检查报告的信息 - 新增 * @param inspectionReportMessage 检查报告信息 - 新增 diff --git a/src/main/java/com/docus/server/report/webservice/impl/SdryReportServerImpl.java b/src/main/java/com/docus/server/report/webservice/impl/SdryReportServerImpl.java index 97774ab..f5b3097 100644 --- a/src/main/java/com/docus/server/report/webservice/impl/SdryReportServerImpl.java +++ b/src/main/java/com/docus/server/report/webservice/impl/SdryReportServerImpl.java @@ -192,6 +192,27 @@ public class SdryReportServerImpl implements IReportServer { } } + @Override + public String pushExaminationReport(String examinationReportMessage){ + log.info("收到检验报告消息:{}", examinationReportMessage); + String msgId = ""; + try { + XmlUtil xmlUtil = XmlUtil.of(examinationReportMessage); + Node msgNode = xmlUtil.getNode("/Request/Msg/ID"); + msgId = msgNode.getTextContent(); + ReportDto reportDto = getReportDtoByJSXML(xmlUtil); + verifyReportDto(reportDto); + reportService.report(reportDto); + return JSXMLResult.success(msgId); + } catch (BaseException baseException) { + log.error(baseException.getMessage(), baseException); + return JSXMLResult.failed(msgId, baseException.getMessage()); + } catch (Exception ex) { + log.error(ex.getMessage(), ex); + return JSXMLResult.failed(msgId, "系统故障!"); + } + } + @Override public String pushAddInspectionReport(String inspectionReportMessage) { log.info("收到检查报告新增消息:{}", inspectionReportMessage);