检验报告

3.2.4.44
wyb 2 years ago
parent 2ebaaeb4d3
commit 6556a69f84

@ -1,5 +1,6 @@
{
"icu": "重症文件分段id",
"sa": "手麻文件分段id",
"examination": "检验报告文件分段id",
"other": "其他文件分段id"
}

@ -35,6 +35,14 @@ public interface ReceiveServer {
*/
String pushICUReport(String icuReportMessage);
/**
*
*
* @param examinationReportMessage
* @return
*/
public String pushExaminationReport(String examinationReportMessage);
/**
* -
*

@ -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);

@ -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<String, Object> bodyMap=new HashMap<>();
Map<String, Object> patientMap=new HashMap<>();
patientMap.put("patientid","8099350542");
List<Map<String, Object>> 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<String, Object> 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<String, Object> 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();
}
}

@ -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 -

@ -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);

Loading…
Cancel
Save