From 14040be2005d26454fd6a03614b7e8bb4e0df831 Mon Sep 17 00:00:00 2001 From: hcy <314517173@qq.com> Date: Fri, 31 May 2024 09:23:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B4=B9=E7=94=A8=E6=B8=85?= =?UTF-8?q?=E5=8D=95=E4=B8=8A=E4=BC=A0=EF=BC=8C=E5=87=BA=E9=99=A2=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E4=BD=8D=E6=95=B0=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/emr/service/CommomService.java | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/emr/service/CommomService.java b/src/main/java/com/emr/service/CommomService.java index a258ae9..7c752ca 100644 --- a/src/main/java/com/emr/service/CommomService.java +++ b/src/main/java/com/emr/service/CommomService.java @@ -707,23 +707,23 @@ public class CommomService { outSrc = EMRRECORDJSP + File.separator + root + "/jiashi/tifToJpgLoad/" + format1 + ".jpg"; } else { String driveLetterPath = srcPath.replaceAll("\\\\", "/"); - if(driveLetterPath.startsWith("/")){ + if (driveLetterPath.startsWith("/")) { //截取字符串为磁盘路径 int thirdBackslashIndex = driveLetterPath.indexOf('/', driveLetterPath.indexOf('/', driveLetterPath.indexOf('/') + 1) + 1); if (thirdBackslashIndex != -1) { - driveLetterPath = driveLetterPath.substring(thirdBackslashIndex+1); + driveLetterPath = driveLetterPath.substring(thirdBackslashIndex + 1); } //将原图片地址转换成映射地址 //获取盘符并转换映射地址的头部地址 root = selectRootByNotWater(driveLetterPath); - if(root == null){ + if (root == null) { outSrc = srcPath; - }else{ + } else { //获取盘符后面的地址 picPath = driveLetterPath.substring(driveLetterPath.indexOf('/')); outSrc = EMRRECORDJSP + File.separator + root + picPath; } - }else{ + } else { root = selectRootByNotWater(driveLetterPath); //获取盘符后面的地址 String str1 = driveLetterPath.substring(0, driveLetterPath.indexOf("/")); @@ -1072,24 +1072,23 @@ public class CommomService { } //病案号转为数值型 //inpatientNo =String.valueOf(Long.parseLong(inpatientNo)); + String disDateStr = ""; + CommomVo commomVo = null; + if (disDate.length() >= 8) { + //格式化日期 + disDateStr = disDate.substring(0, 4) + "-" + disDate.substring(4, 6) + "-" + disDate.substring(6, 8); + commomVo = commomMapper.getCommomTableList(inpatientNo, disDateStr); + } - //格式化日期 - String disDateStr = disDate.substring(0, 4) + "-" + disDate.substring(4, 6) + "-" + disDate.substring(6, 8); - - CommomVo commomVo = commomMapper.getCommomTableList(inpatientNo, disDateStr); - - - if (ObjectUtils.isEmpty(commomVo)) { - + //病案信息不存在或者pdf名称出院日期位数不对 + if (ObjectUtils.isEmpty(commomVo) || disDate.length() < 8) { exportInpVo = new ExportInpVo(); exportInpVo.setInpatientNo(inpatientNo); exportInpVo.setDisDate(disDateStr); exportInpVoList.add(exportInpVo); continue; - } - if (commomVo != null && StringUtils.isNotBlank(commomVo.getFilePath())) { /*File filePath = new File(commomVo.getFilePath()); if (!filePath.exists()) {