|
|
|
@ -104,6 +104,8 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
String sortingTimeKey = String.valueOf(FileUtils.getJsonByName("sortingTime"));
|
|
|
|
|
// 获取患者主索引号
|
|
|
|
|
String empId = String.valueOf(FileUtils.getJsonByName(Codes.EMP_ID.getMessage()));
|
|
|
|
|
//电子病历封存id
|
|
|
|
|
String seal = String.valueOf(FileUtils.getJsonByName("sealId"));
|
|
|
|
|
//判断是否为撤销
|
|
|
|
|
String isJudge = String.valueOf(FileUtils.getJsonByName("isJudge"));
|
|
|
|
|
if (StringUtils.isBlank(isJudge) || isJudge.equals("0")) {
|
|
|
|
@ -119,7 +121,6 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
logger.info("------新增/修改------");
|
|
|
|
|
} else if (judgeIndexElement.getText().equals("1")) {
|
|
|
|
|
logger.info("---------撤回--------");
|
|
|
|
|
|
|
|
|
|
CanlcelDto canlcelDto = new CanlcelDto();
|
|
|
|
|
String serialnum = String.valueOf(FileUtils.getJsonByName("serialnum"));
|
|
|
|
|
String serialnumElement = getElementText(elementRoot, serialnum.split(","));
|
|
|
|
@ -144,10 +145,10 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
String sortingTime;
|
|
|
|
|
String assortid;
|
|
|
|
|
String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
|
|
|
|
|
if(collectorid.equals("1")){
|
|
|
|
|
if (collectorid.equals("1")) {
|
|
|
|
|
assortid = String.valueOf(FileUtils.getJsonByName("assortid"));
|
|
|
|
|
}else {
|
|
|
|
|
assortid = getAssortid(elementRoot);
|
|
|
|
|
} else {
|
|
|
|
|
assortid = getAssortid(elementRoot);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reportDownDto = new ReportDownDto();
|
|
|
|
@ -158,9 +159,80 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
reportDownPatientDto = new ReportDownPatientDto();
|
|
|
|
|
//获取jzh
|
|
|
|
|
String empIdText = getElementText(elementRoot, empId.split(","));
|
|
|
|
|
//获取封存id
|
|
|
|
|
String sealId = getElementTextCanBeEmpty(elementRoot, seal.split(","));
|
|
|
|
|
if (null != sealId && !"".equals(sealId)) {
|
|
|
|
|
reportDownPatientDto.setJzh(empIdText);
|
|
|
|
|
reportDownPatientDto.setSealId(sealId);
|
|
|
|
|
logger.info("封存患者jzh : " + empIdText);
|
|
|
|
|
reportDownDto.setPatient(reportDownPatientDto);
|
|
|
|
|
List<Element> elementList = xmlUtils.getJsonByName(elementRoot);
|
|
|
|
|
for (Element element : elementList) {
|
|
|
|
|
filetitle = getElementText(element, filetitleKey.split(","));
|
|
|
|
|
downurl = getElementText(element, downurlKey.split(","));
|
|
|
|
|
//downurl = handleDownUrl(downurl);
|
|
|
|
|
//添加护理提交时间
|
|
|
|
|
if (collectorid.equals("1")) {
|
|
|
|
|
nurseSubmitTime = getElementText(element, nurseSubmitTime.split(","));
|
|
|
|
|
afCollectTaskService.updateNurseSubmitTime(reportDownDto, nurseSubmitTime);
|
|
|
|
|
afCollectTaskService.insertNurseState(reportDownDto, nurseSubmitTime);
|
|
|
|
|
}
|
|
|
|
|
//获取电子病历排序时间
|
|
|
|
|
sortingTime = getElementTextCanBeEmpty(element, sortingTimeKey.split(","));
|
|
|
|
|
//获取采集流水号
|
|
|
|
|
serialnum = getElementText(element, serialnmnKey.split(","));
|
|
|
|
|
reportDownScanFileDto = new ReportDownScanFileDto();
|
|
|
|
|
reportDownScanFileDto.setDownurl(downurl);
|
|
|
|
|
reportDownScanFileDto.setFiletitle(filetitle);
|
|
|
|
|
reportDownScanFileDto.setSerialnum(serialnum);
|
|
|
|
|
reportDownScanFileDto.setSortdate(sortingTime);
|
|
|
|
|
reportDownScanFileDto.setFilesource(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filesource"))));
|
|
|
|
|
reportDownScanFileDto.setFilestoragetype(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filestoragetype"))));
|
|
|
|
|
//判断是否为base64
|
|
|
|
|
if (reportDownScanFileDto.getDownurl().length() > 200) {
|
|
|
|
|
reportDownScanFileDto.setFiletype(2);
|
|
|
|
|
}
|
|
|
|
|
reportDownDtoArr.add(reportDownScanFileDto);
|
|
|
|
|
}
|
|
|
|
|
if (reportDownDtoArr.size() <= 0) {
|
|
|
|
|
throw new RuntimeException("不存在必要的基本信息");
|
|
|
|
|
} else {
|
|
|
|
|
reportDownDto.setScanfiles(reportDownDtoArr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
afCollectTaskService.insertSeal(reportDownDto);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String post = "";
|
|
|
|
|
logger.info("--------执行上传功能----------");
|
|
|
|
|
|
|
|
|
|
Map params = JSON.parseObject(JSON.toJSONString(reportDownDto), Map.class);
|
|
|
|
|
if (reportDownDto.getScanfiles().get(0).getFiletype() == 1) {
|
|
|
|
|
logger.info("封存id--"+reportDownDto.getPatient().getSealId()+ ": 上传参数:" + params);
|
|
|
|
|
}
|
|
|
|
|
long l = System.currentTimeMillis();
|
|
|
|
|
post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.SEALUPLOAD.getMessage())), headMap, params);
|
|
|
|
|
long l1 = System.currentTimeMillis();
|
|
|
|
|
logger.info("封存id--"+reportDownDto.getPatient().getSealId()+"请求下载耗时----------" + (l1 - l));
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(post)) {
|
|
|
|
|
logger.info("封存id--"+reportDownDto.getPatient().getSealId()+"--------上传时出现错误,可能是文件服务没有启动----------");
|
|
|
|
|
throw new RuntimeException("封存id--"+reportDownDto.getPatient().getSealId()+"上传时出现错误,可能是文件服务没有启动");
|
|
|
|
|
}
|
|
|
|
|
Map resMap = JSON.parseObject(post, Map.class);
|
|
|
|
|
long l7 = System.currentTimeMillis();
|
|
|
|
|
logger.info("接口总耗时--------" + (l7 - l6));
|
|
|
|
|
if (String.valueOf(resMap.get("code")).equals("500")) {
|
|
|
|
|
|
|
|
|
|
//病理没有就诊流水号的根据住院号和检查申请日期时间匹配患者
|
|
|
|
|
// String empIdText = getElementTextCanBeEmpty(elementRoot, empId.split(","));
|
|
|
|
|
logger.info("封存id--"+reportDownDto.getPatient().getSealId()+ "--------上传失败!" + resMap.get("msg"));
|
|
|
|
|
throw new RuntimeException("封存id--"+reportDownDto.getPatient().getSealId()+ "上传失败:" + resMap.get("msg"));
|
|
|
|
|
} else {
|
|
|
|
|
logger.info("----------执行成功-----------");
|
|
|
|
|
return ResultUtils.success().asXML();
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
//病理没有就诊流水号的根据住院号和检查申请日期时间匹配患者
|
|
|
|
|
// String empIdText = getElementTextCanBeEmpty(elementRoot, empId.split(","));
|
|
|
|
|
// if (null==empIdText||empIdText.equals("")){
|
|
|
|
|
// String examApplyDates = getElementText(elementRoot, examApplyDate.split(","));
|
|
|
|
|
// String inPatientNos = getElementText(elementRoot, inPatientNo.split(","));
|
|
|
|
@ -177,143 +249,137 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// doctorSubmitTime = getElementText(elementRoot, doctorSubmitTime.split(","));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除电子病历数据
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
long l2 = System.currentTimeMillis();
|
|
|
|
|
String patientId = afCollectTaskService.getpatientIdByEmpId(empIdText);
|
|
|
|
|
long l3 = System.currentTimeMillis();
|
|
|
|
|
logger.info("查询patient_id耗时"+(l3-l2));
|
|
|
|
|
//删除af_downfile表数据
|
|
|
|
|
// long l4 = System.currentTimeMillis();
|
|
|
|
|
// int i = afCollectTaskService.deleteByPatientIdAndCollectorId(patientId, collectorid);
|
|
|
|
|
// long l5 = System.currentTimeMillis();
|
|
|
|
|
// logger.info("删除"+empIdText+"af_downfile表"+i+"条数据耗时-----"+(l5-l4));
|
|
|
|
|
// //删除t_scan_assort表数据
|
|
|
|
|
// long l8 = System.currentTimeMillis();
|
|
|
|
|
// int i1 = afCollectTaskService.deleteByPatientIdAndAssortId(patientId, assortid);
|
|
|
|
|
// long l11 = System.currentTimeMillis();
|
|
|
|
|
// logger.info("删除"+empIdText+"t_scan_assort表"+i1+"条数据耗时-----"+(l11-l8));
|
|
|
|
|
// //删除af_collect_task表数据
|
|
|
|
|
// long l9 = System.currentTimeMillis();
|
|
|
|
|
// int i2 = afCollectTaskService.deleteByPatientIdAndSysFlag(patientId, collectorid);
|
|
|
|
|
// long l10 = System.currentTimeMillis();
|
|
|
|
|
// logger.info("删除"+empIdText+"af_collect_task表"+i2+"条数据耗时-----"+(l10-l9));
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
reportDownPatientDto.setJzh(empIdText);
|
|
|
|
|
logger.info("患者主索引号:" + empIdText);
|
|
|
|
|
reportDownDto.setPatient(reportDownPatientDto);
|
|
|
|
|
List<Element> elementList = xmlUtils.getJsonByName(elementRoot);
|
|
|
|
|
for (Element element : elementList) {
|
|
|
|
|
filetitle = getElementText(element, filetitleKey.split(","));
|
|
|
|
|
downurl = getElementText(element, downurlKey.split(","));
|
|
|
|
|
//downurl = handleDownUrl(downurl);
|
|
|
|
|
//添加护理提交时间
|
|
|
|
|
// if (filetitle.equals("体温单")||filetitle.equals("护理记录单(通用)")||filetitle.equals("首次护理记录单(通用)")){
|
|
|
|
|
// nurseSubmitTime = getElementText(element, nurseSubmitTime.split(","));
|
|
|
|
|
// afCollectTaskService.updateNurseSubmitTime(reportDownDto, nurseSubmitTime);
|
|
|
|
|
// afCollectTaskService.insertNurseState(reportDownDto,nurseSubmitTime);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取电子病历排序时间
|
|
|
|
|
sortingTime = getElementTextCanBeEmpty(element,sortingTimeKey.split(","));
|
|
|
|
|
//获取采集流水号
|
|
|
|
|
serialnum = getElementText(element, serialnmnKey.split(","));
|
|
|
|
|
reportDownScanFileDto = new ReportDownScanFileDto();
|
|
|
|
|
reportDownScanFileDto.setDownurl(downurl);
|
|
|
|
|
reportDownScanFileDto.setFiletitle(filetitle);
|
|
|
|
|
reportDownScanFileDto.setSerialnum(serialnum);
|
|
|
|
|
reportDownScanFileDto.setSortdate(sortingTime);
|
|
|
|
|
reportDownScanFileDto.setFilesource(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filesource"))));
|
|
|
|
|
reportDownScanFileDto.setFilestoragetype(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filestoragetype"))));
|
|
|
|
|
//判断是否为base64
|
|
|
|
|
if (reportDownScanFileDto.getDownurl().length() > 200) {
|
|
|
|
|
reportDownScanFileDto.setFiletype(2);
|
|
|
|
|
// doctorSubmitTime = getElementText(elementRoot, doctorSubmitTime.split(","));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除电子病历数据
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// long l2 = System.currentTimeMillis();
|
|
|
|
|
// String patientId = afCollectTaskService.getpatientIdByEmpId(empIdText);
|
|
|
|
|
// long l3 = System.currentTimeMillis();
|
|
|
|
|
// logger.info("查询patient_id耗时" + (l3 - l2));
|
|
|
|
|
// //删除af_downfile表数据
|
|
|
|
|
// long l4 = System.currentTimeMillis();
|
|
|
|
|
// int i = afCollectTaskService.deleteByPatientIdAndCollectorId(patientId, collectorid);
|
|
|
|
|
// long l5 = System.currentTimeMillis();
|
|
|
|
|
// logger.info("删除" + empIdText + "af_downfile表" + i + "条数据耗时-----" + (l5 - l4));
|
|
|
|
|
// //删除t_scan_assort表数据
|
|
|
|
|
// long l8 = System.currentTimeMillis();
|
|
|
|
|
// int i1 = afCollectTaskService.deleteByPatientIdAndAssortId(patientId, assortid);
|
|
|
|
|
// long l11 = System.currentTimeMillis();
|
|
|
|
|
// logger.info("删除" + empIdText + "t_scan_assort表" + i1 + "条数据耗时-----" + (l11 - l8));
|
|
|
|
|
// //删除af_collect_task表数据
|
|
|
|
|
// long l9 = System.currentTimeMillis();
|
|
|
|
|
// int i2 = afCollectTaskService.deleteByPatientIdAndSysFlag(patientId, collectorid);
|
|
|
|
|
// long l10 = System.currentTimeMillis();
|
|
|
|
|
// logger.info("删除" + empIdText + "af_collect_task表" + i2 + "条数据耗时-----" + (l10 - l9));
|
|
|
|
|
reportDownPatientDto.setJzh(empIdText);
|
|
|
|
|
logger.info("患者主索引号:" + empIdText);
|
|
|
|
|
reportDownDto.setPatient(reportDownPatientDto);
|
|
|
|
|
List<Element> elementList = xmlUtils.getJsonByName(elementRoot);
|
|
|
|
|
for (Element element : elementList) {
|
|
|
|
|
filetitle = getElementText(element, filetitleKey.split(","));
|
|
|
|
|
downurl = getElementText(element, downurlKey.split(","));
|
|
|
|
|
//downurl = handleDownUrl(downurl);
|
|
|
|
|
//添加护理提交时间
|
|
|
|
|
if (collectorid.equals("1")) {
|
|
|
|
|
nurseSubmitTime = getElementText(element, nurseSubmitTime.split(","));
|
|
|
|
|
afCollectTaskService.updateNurseSubmitTime(reportDownDto, nurseSubmitTime);
|
|
|
|
|
afCollectTaskService.insertNurseState(reportDownDto, nurseSubmitTime);
|
|
|
|
|
}
|
|
|
|
|
//获取电子病历排序时间
|
|
|
|
|
// sortingTime = getElementTextCanBeEmpty(element, sortingTimeKey.split(","));
|
|
|
|
|
//获取采集流水号
|
|
|
|
|
serialnum = getElementText(element, serialnmnKey.split(","));
|
|
|
|
|
reportDownScanFileDto = new ReportDownScanFileDto();
|
|
|
|
|
reportDownScanFileDto.setDownurl(downurl);
|
|
|
|
|
reportDownScanFileDto.setFiletitle(filetitle);
|
|
|
|
|
reportDownScanFileDto.setSerialnum(serialnum);
|
|
|
|
|
// reportDownScanFileDto.setSortdate(sortingTime);
|
|
|
|
|
reportDownScanFileDto.setFilesource(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filesource"))));
|
|
|
|
|
reportDownScanFileDto.setFilestoragetype(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filestoragetype"))));
|
|
|
|
|
//判断是否为base64
|
|
|
|
|
if (reportDownScanFileDto.getDownurl().length() > 200) {
|
|
|
|
|
reportDownScanFileDto.setFiletype(2);
|
|
|
|
|
}
|
|
|
|
|
reportDownDtoArr.add(reportDownScanFileDto);
|
|
|
|
|
}
|
|
|
|
|
if (reportDownDtoArr.size() <= 0) {
|
|
|
|
|
throw new RuntimeException("不存在必要的基本信息");
|
|
|
|
|
} else {
|
|
|
|
|
reportDownDto.setScanfiles(reportDownDtoArr);
|
|
|
|
|
}
|
|
|
|
|
if (collectorid.equals("22")) {
|
|
|
|
|
//查询正式住院患者信息
|
|
|
|
|
TBasic tBasic = tBasicMapper.selectByjzh(empIdText);
|
|
|
|
|
if (null != tBasic) {
|
|
|
|
|
//查询预住院患者信息
|
|
|
|
|
TBasicExtend tBasicExtend = tBasicExtendMapper.selectByPatientId(tBasic.getPatientId());
|
|
|
|
|
if (null != tBasicExtend) {
|
|
|
|
|
TBasic tBasicPre = tBasicMapper.selectByjzh(tBasicExtend.getPreJzh());
|
|
|
|
|
if (null != tBasicPre) {
|
|
|
|
|
int pre = tScanAssortMapper.updateByPatientId(tBasic.getPatientId(), tBasicPre.getPatientId());
|
|
|
|
|
if (pre <= 0) {
|
|
|
|
|
logger.info("当前预住院没有文件!");
|
|
|
|
|
} else {
|
|
|
|
|
logger.info("本次预住院合并" + pre + "份报告");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
logger.info("未查询到预住院患者信息!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
reportDownDtoArr.add(reportDownScanFileDto);
|
|
|
|
|
}
|
|
|
|
|
if (reportDownDtoArr.size() <= 0) {
|
|
|
|
|
throw new RuntimeException("不存在必要的基本信息");
|
|
|
|
|
} else {
|
|
|
|
|
reportDownDto.setScanfiles(reportDownDtoArr);
|
|
|
|
|
}
|
|
|
|
|
// if (collectorid.equals("22")){
|
|
|
|
|
// //查询正式住院患者信息
|
|
|
|
|
// TBasic tBasic = tBasicMapper.selectByjzh(empIdText);
|
|
|
|
|
// if (null!=tBasic){
|
|
|
|
|
// //查询预住院患者信息
|
|
|
|
|
// TBasicExtend tBasicExtend = tBasicExtendMapper.selectByPatientId(tBasic.getPatientId());
|
|
|
|
|
// if (null!=tBasicExtend){
|
|
|
|
|
// TBasic tBasicPre = tBasicMapper.selectByjzh(tBasicExtend.getPreJzh());
|
|
|
|
|
// if (null!=tBasicPre){
|
|
|
|
|
// int pre = tScanAssortMapper.updateByPatientId(tBasic.getPatientId(), tBasicPre.getPatientId());
|
|
|
|
|
// if (pre <= 0) {
|
|
|
|
|
// logger.info("当前预住院没有文件!");
|
|
|
|
|
// }else {
|
|
|
|
|
// logger.info("本次预住院合并"+pre+"份报告");
|
|
|
|
|
// }
|
|
|
|
|
// }else {
|
|
|
|
|
// logger.info("未查询到预住院患者信息!");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//插入医生提交时间
|
|
|
|
|
// afCollectTaskService.updateDoctorSubmitTime(reportDownDto, doctorSubmitTime);
|
|
|
|
|
//插入医生提交状态
|
|
|
|
|
// afCollectTaskService.insertDoctorState(reportDownDto,doctorSubmitTime);
|
|
|
|
|
//插入文件af_collect_task表数据
|
|
|
|
|
//插入医生提交时间
|
|
|
|
|
// afCollectTaskService.updateDoctorSubmitTime(reportDownDto, doctorSubmitTime);
|
|
|
|
|
//插入医生提交状态
|
|
|
|
|
// afCollectTaskService.insertDoctorState(reportDownDto, doctorSubmitTime);
|
|
|
|
|
//插入文件af_collect_task表数据
|
|
|
|
|
// synchronized (lock) {
|
|
|
|
|
// System.err.println(reportDownDto);
|
|
|
|
|
afCollectTaskService.insert(reportDownDto);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// System.err.println(reportDownDto);
|
|
|
|
|
afCollectTaskService.insert(reportDownDto);
|
|
|
|
|
// }
|
|
|
|
|
String post = "";
|
|
|
|
|
logger.info("--------执行上传功能----------");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map params = JSON.parseObject(JSON.toJSONString(reportDownDto), Map.class);
|
|
|
|
|
if (reportDownDto.getScanfiles().get(0).getFiletype() == 1) {
|
|
|
|
|
logger.info("上传参数:" + params);
|
|
|
|
|
}
|
|
|
|
|
long l = System.currentTimeMillis();
|
|
|
|
|
post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.UPLOAD.getMessage())), headMap, params);
|
|
|
|
|
long l1 = System.currentTimeMillis();
|
|
|
|
|
logger.info("请求下载耗时----------"+(l1-l));
|
|
|
|
|
String post = "";
|
|
|
|
|
logger.info("--------执行上传功能----------");
|
|
|
|
|
Map params = JSON.parseObject(JSON.toJSONString(reportDownDto), Map.class);
|
|
|
|
|
if (reportDownDto.getScanfiles().get(0).getFiletype() == 1) {
|
|
|
|
|
logger.info(reportDownDto.getPatient().getJzh() + ": 上传参数:" + params);
|
|
|
|
|
}
|
|
|
|
|
long l = System.currentTimeMillis();
|
|
|
|
|
post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.UPLOAD.getMessage())), headMap, params);
|
|
|
|
|
long l1 = System.currentTimeMillis();
|
|
|
|
|
logger.info("请求下载耗时----------" + (l1 - l));
|
|
|
|
|
// String post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.UPLOAD.getMessage())), map, headMap);
|
|
|
|
|
if (StringUtils.isBlank(post)) {
|
|
|
|
|
logger.info("--------上传时出现错误,可能是文件服务没有启动----------");
|
|
|
|
|
throw new RuntimeException("上传时出现错误,可能是文件服务没有启动");
|
|
|
|
|
}
|
|
|
|
|
Map resMap = JSON.parseObject(post, Map.class);
|
|
|
|
|
long l7 = System.currentTimeMillis();
|
|
|
|
|
logger.info("接口总耗时--------"+(l7-l6));
|
|
|
|
|
if (String.valueOf(resMap.get("code")).equals("500")) {
|
|
|
|
|
throw new RuntimeException(String.valueOf(resMap.get("msg")));
|
|
|
|
|
} else {
|
|
|
|
|
logger.info("----------执行成功-----------");
|
|
|
|
|
return ResultUtils.success().asXML();
|
|
|
|
|
if (StringUtils.isBlank(post)) {
|
|
|
|
|
logger.info("--------上传时出现错误,可能是文件服务没有启动----------");
|
|
|
|
|
throw new RuntimeException("上传时出现错误,可能是文件服务没有启动");
|
|
|
|
|
}
|
|
|
|
|
Map resMap = JSON.parseObject(post, Map.class);
|
|
|
|
|
long l7 = System.currentTimeMillis();
|
|
|
|
|
logger.info("接口总耗时--------" + (l7 - l6));
|
|
|
|
|
if (String.valueOf(resMap.get("code")).equals("500")) {
|
|
|
|
|
logger.info(reportDownDto.getPatient().getJzh() + "--------上传失败!" + resMap.get("msg"));
|
|
|
|
|
throw new RuntimeException(reportDownDto.getPatient().getJzh() + "上传失败:" + resMap.get("msg"));
|
|
|
|
|
} else {
|
|
|
|
|
logger.info("----------执行成功-----------");
|
|
|
|
|
return ResultUtils.success().asXML();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
// mrReportErrorService.insert(xml);
|
|
|
|
|
// mrReportErrorService.insert(xml);
|
|
|
|
|
logger.error(e.getMessage());
|
|
|
|
|
// String stackTrace = ExceptionUtils.getStackTrace(e);
|
|
|
|
|
// logger.info("错误信息----------"+stackTrace);
|
|
|
|
|
String stackTrace = ExceptionUtils.getStackTrace(e);
|
|
|
|
|
logger.info("错误信息----------" + stackTrace);
|
|
|
|
|
return ResultUtils.fail(e.getMessage());
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
// mrReportErrorService.insert(xml);
|
|
|
|
|
// mrReportErrorService.insert(xml);
|
|
|
|
|
logger.error(e.getMessage());
|
|
|
|
|
// String stackTrace = ExceptionUtils.getStackTrace(e);
|
|
|
|
|
// logger.info("错误信息----------"+stackTrace);
|
|
|
|
|
String stackTrace = ExceptionUtils.getStackTrace(e);
|
|
|
|
|
logger.info("错误信息----------" + stackTrace);
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
return ResultUtils.fail(e.getMessage());
|
|
|
|
|
}
|
|
|
|
@ -322,6 +388,7 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 肇庆门急诊报告接收
|
|
|
|
|
*
|
|
|
|
|
* @param xml
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
@ -356,7 +423,7 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
String serialnum;
|
|
|
|
|
String filetitle;
|
|
|
|
|
String downurl;
|
|
|
|
|
// String sortingTime;
|
|
|
|
|
// String sortingTime;
|
|
|
|
|
int filetype = Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filetype")));
|
|
|
|
|
String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
|
|
|
|
|
|
|
|
|
@ -379,7 +446,7 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
downurl = getElementText(element, downurlKey.split(","));
|
|
|
|
|
serialnum = getElementText(element, serialnmnKey.split(","));
|
|
|
|
|
reportDownScanFileDto = new ReportDownScanFileDto();
|
|
|
|
|
reportDownScanFileDto.setDownurl(downurl.substring(1,downurl.length() - 1));
|
|
|
|
|
reportDownScanFileDto.setDownurl(downurl.substring(1, downurl.length() - 1));
|
|
|
|
|
reportDownScanFileDto.setFiletitle(filetitle);
|
|
|
|
|
reportDownScanFileDto.setSerialnum(serialnum);
|
|
|
|
|
reportDownScanFileDto.setFiletype(filetype);
|
|
|
|
@ -397,7 +464,7 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
reportDownDto.setScanfiles(reportDownDtoArr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// System.err.println(reportDownDto);
|
|
|
|
|
// System.err.println(reportDownDto);
|
|
|
|
|
|
|
|
|
|
afCollectTaskService.insertOut(reportDownDto);
|
|
|
|
|
|
|
|
|
@ -409,7 +476,7 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
long l = System.currentTimeMillis();
|
|
|
|
|
post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.UPLOAD.getMessage())), headMap, params);
|
|
|
|
|
long l1 = System.currentTimeMillis();
|
|
|
|
|
logger.info("请求下载耗时----------"+(l1-l));
|
|
|
|
|
logger.info("请求下载耗时----------" + (l1 - l));
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(post)) {
|
|
|
|
|
logger.info("--------上传时出现错误,可能是文件服务没有启动----------");
|
|
|
|
@ -417,7 +484,7 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
}
|
|
|
|
|
Map resMap = JSON.parseObject(post, Map.class);
|
|
|
|
|
long l7 = System.currentTimeMillis();
|
|
|
|
|
logger.info("接口总耗时--------"+(l7-l6));
|
|
|
|
|
logger.info("接口总耗时--------" + (l7 - l6));
|
|
|
|
|
if (String.valueOf(resMap.get("code")).equals("500")) {
|
|
|
|
|
throw new RuntimeException(String.valueOf(resMap.get("msg")));
|
|
|
|
|
} else {
|
|
|
|
@ -459,7 +526,7 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
return url;
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
@ -684,10 +751,9 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// public static void main(String[] args) {
|
|
|
|
|
// depdf();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
depdf();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|