From 97262932a0baef693b39f165b4f7ebb073dc3155 Mon Sep 17 00:00:00 2001 From: zengwh <81383286@qq.com> Date: Sun, 18 Apr 2021 16:29:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A2=9E=E5=8A=A0=E6=B0=B4?= =?UTF-8?q?=E5=8D=B0=E6=96=87=E6=9C=AC=EF=BC=8C=E4=BF=AE=E6=94=B9=E7=97=85?= =?UTF-8?q?=E6=A1=88=E5=AE=A4=E5=AE=A1=E6=A0=B8=E9=A1=B5=E9=9D=A2=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=BA=B8=E8=B4=A8=E7=8A=B6=E6=80=81bug,=E5=BD=95?= =?UTF-8?q?=E5=85=A5=E7=BA=B8=E8=B4=A8=E4=BF=A1=E6=81=AFbug,=E5=90=88?= =?UTF-8?q?=E5=B9=B6pdfbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../emr/controller/lastVerifyController.java | 5 - .../emr/service/Archive_MasterService.java | 4 +- .../ipml/Archive_MasterServiceImpl.java | 94 +------------------ src/main/java/com/emr/util/Jpg2PdfUtil.java | 51 ++++++---- src/main/resources/config/config.properties | 2 +- .../resources/mapper/Archive_MasterMapper.xml | 26 ++--- .../mapper/EmrPaperPositionInfoMapper.xml | 6 ++ 7 files changed, 57 insertions(+), 131 deletions(-) diff --git a/src/main/java/com/emr/controller/lastVerifyController.java b/src/main/java/com/emr/controller/lastVerifyController.java index 842d586..cf8c8d2 100644 --- a/src/main/java/com/emr/controller/lastVerifyController.java +++ b/src/main/java/com/emr/controller/lastVerifyController.java @@ -75,8 +75,6 @@ public class lastVerifyController { archiveMasterVo.setEndDateTo(null); } try { - //是否查询纸质签收状态的相关处理 - archiveMasterService.setLastVerifyList(archiveMasterVo); OffsetLimitPage offsetLimitPage = archiveMasterService.selectByLast(archiveMasterVo, offset, limit); return offsetLimitPage; } catch (Exception e) { @@ -98,11 +96,8 @@ public class lastVerifyController { String tableThNames = "住院号,住院次数,名字,性别,出院科室,出院日期,主管医生,状态,纸质状态,纸质扫描"; String fieldCns = "inpNo,visitId,name,sex,deptName,dischargeDateTime,doctorInCharge,status,remark,checkName"; try { - //是否查询纸质签收状态的相关处理 - archiveMasterService.setLastVerifyList(archiveMasterVo); //构造excel的数据 List list = archiveMasterService.selectLastVerifyList(archiveMasterVo); - //文件名 String fileName = "病案室终审" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; //ExportExcelUtil diff --git a/src/main/java/com/emr/service/Archive_MasterService.java b/src/main/java/com/emr/service/Archive_MasterService.java index 30497e3..6ed0845 100644 --- a/src/main/java/com/emr/service/Archive_MasterService.java +++ b/src/main/java/com/emr/service/Archive_MasterService.java @@ -118,13 +118,13 @@ public interface Archive_MasterService { List selectLastVerifyList(Archive_Master_Vo archiveMasterVo); - Archive_Master_Vo setLastVerifyList(Archive_Master_Vo vo); - List loadDoctorInCharge(String deptName); List loadOverTimeDoctorInCharge(); List selectOracleGetSignList(StringBuilder patientIdStr, List selectList); + + //String selectLockInfoByMasterId(String archiveDetailId); } diff --git a/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java b/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java index 78ebf69..917c0c3 100644 --- a/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java +++ b/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java @@ -197,59 +197,6 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { return new OffsetLimitPage((Page) list); } - /** - * 查询纸质签收情况 - * @param vo - * @return - */ - @Override - public Archive_Master_Vo setLastVerifyList(Archive_Master_Vo vo) { - if(null != vo.getIsSign()){ - //查询护士长已审核与召回病历记账号集合 - List masters = archiveMasterMapper.selectPatientIdsForSign(); - //处理记账号返回字符串 - StringBuilder patientIds = new StringBuilder(); - if(!CollectionUtils.isEmpty(masters)){ - for(Archive_Master master : masters){ - if(StringUtils.isNotBlank(master.getPatientId())){ - if(StringUtils.isNotBlank(patientIds)){ - patientIds.append(","); - } - patientIds.append("'").append(master.getPatientId()).append("'"); - } - } - //将查询结果带入查询oracle返回集合 - List selectList = new ArrayList<>(); - List selectList1 = new ArrayList<>(); - //selectList.add("1304063"); - //selectList.add("1304458"); - if(masters.size() > 30){ - patientIds = null; - } - selectList = selectOracleGetSignList(patientIds,selectList); - if(!CollectionUtils.isEmpty(selectList)) { - for (Archive_Master master : masters) { - if (StringUtils.isNotBlank(master.getPatientId())) { - if (StringUtils.isNotBlank(master.getPatientId())) { - for (String patientId : selectList) { - if (master.getPatientId().equals(patientId)) { - selectList1.add(master.getPatientId()); - break; - } - } - } - } - } - } - //设置进查询条件 - if(!CollectionUtils.isEmpty(selectList1)) { - vo.setPatientIdsForSign(selectList1); - } - } - } - return vo; - } - /** * 终审列表 * */ @@ -267,8 +214,6 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { public List selectLastVerifyList(Archive_Master_Vo archiveMasterVo){ List list = archiveMasterMapper.selectByLast(archiveMasterVo); if(null != list && !list.isEmpty()){ - //记帐号集合 - StringBuilder patientIdStr = new StringBuilder(); //查询科室集合 Emr_Dictionary dictionary = new Emr_Dictionary(); dictionary.setTypecode("dept_code"); @@ -283,40 +228,6 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { }else if(status.equals(EnumVerify.DocState.CallBacked.getCode())){ masterVo.setStatus(EnumVerify.DocState.CallBacked.getName()); } - //科室转换 - //组织记帐号集合 - if(StringUtils.isNotBlank(masterVo.getPatientId())) { - if (StringUtils.isNotBlank(patientIdStr)) { - patientIdStr.append(",'").append(masterVo.getPatientId()).append("'"); - } else { - patientIdStr.append("'").append(masterVo.getPatientId()).append("'"); - } - } - } - //赋值签收情况 - List selectList = new ArrayList<>(); - try{ - selectList = selectOracleGetSignList(patientIdStr, selectList); - for (Archive_Master_Vo masterVo : list) { - if(null == archiveMasterVo.getIsSign()) { - masterVo.setRemark("未签收"); - //赋值 - if (!CollectionUtils.isEmpty(selectList)) { - String patientId = masterVo.getPatientId(); - if (StringUtils.isNotBlank(patientId)) { - for (String str : selectList) { - if (str.equals(patientId)) { - masterVo.setRemark("已签收"); - break; - } - } - } - } - } - } - }catch (Exception e){ - e.printStackTrace(); - ExceptionPrintUtil.printException(e); } } return list; @@ -1194,6 +1105,11 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { } return selectList; } + + /*@Override + public String selectLockInfoByMasterId(String archiveDetailId) { + return null; + }*/ } diff --git a/src/main/java/com/emr/util/Jpg2PdfUtil.java b/src/main/java/com/emr/util/Jpg2PdfUtil.java index abbfd4c..26758f2 100644 --- a/src/main/java/com/emr/util/Jpg2PdfUtil.java +++ b/src/main/java/com/emr/util/Jpg2PdfUtil.java @@ -82,7 +82,6 @@ public class Jpg2PdfUtil { if (!CollectionUtils.isEmpty(list)) { // pdf合并工具类 Document document = null; - ByteArrayOutputStream bos = new ByteArrayOutputStream(); PdfCopy copy = null; try { response.reset(); @@ -90,24 +89,34 @@ public class Jpg2PdfUtil { copy = new PdfCopy(document, response.getOutputStream()); document.open(); for (PdfReader reader : list) { - bos.flush(); + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + PdfReader pdfReader = null; //判断是否加水印 if (StringUtils.isNotBlank(waterMarkName)) { setWatermark(bos, reader, waterMarkName, null); - reader = new PdfReader(bos.toByteArray()); + pdfReader = new PdfReader(bos.toByteArray()); } int n = reader.getNumberOfPages(); for (int j = 1; j <= n; j++) { document.newPage(); PdfImportedPage page = null; if (StringUtils.isNotBlank(waterMarkName)) { - page = copy.getImportedPage(reader, j); + page = copy.getImportedPage(pdfReader, j); } else { page = copy.getImportedPage(reader, j); } copy.addPage(page); } + if(null != pdfReader){ + pdfReader.close(); + } reader.close(); + try { + bos.flush(); + bos.close(); + }catch (Exception e){ + //e.printStackTrace(); + } } } catch (Exception e) { //e.printStackTrace(); @@ -115,12 +124,6 @@ public class Jpg2PdfUtil { if (null != copy) { copy.close(); } - try { - bos.flush(); - bos.close(); - } catch (Exception e) { - //e.printStackTrace(); - } if (null != document) { document.close(); } @@ -150,15 +153,27 @@ public class Jpg2PdfUtil { content.setColorFill(Color.LIGHT_GRAY); content.setFontAndSize(base, 50); content.setTextMatrix(70, 200); + String[] waterMarks = waterMarkName.split("&"); //v:距左 v1:距下 v2: - content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 300, 600, 40); - content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 300, 200, 40); - content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 800, 600, 40); - content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 800, 200, 40); - content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 300, 1100, 40); - content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 300, 1500, 40); - content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 800, 1100, 40); - content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 800, 1500, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 250, 600, 40); + /*content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 250, 200, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 800, 600, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 800, 200, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 250, 1100, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 250, 1500, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 800, 1100, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 800, 1500, 40);*/ + if(waterMarks.length > 1){ + //v:距左 v1:距下 v2: + content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 310, 400, 40); + /* content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 310, 150, 40);*/ + /*content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 860, 550, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 860, 150, 40);*/ + /* content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 300, 900, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 300, 1300, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 800, 900, 40); + content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 800, 1300, 40);*/ + } content.endText(); } if (StringUtils.isNotBlank(imgPath)) { diff --git a/src/main/resources/config/config.properties b/src/main/resources/config/config.properties index bf4f0c0..35b108a 100644 --- a/src/main/resources/config/config.properties +++ b/src/main/resources/config/config.properties @@ -39,7 +39,7 @@ STR_SPLIT = *^:|,. recallReason=\u533B\u9662\u9700\u8981\u8FD9\u4EFD\u6587\u6863 #pdf\u6C34\u5370 -pdfWater = \u4F5B\u5C71\u5E02\u9AD8\u660E\u4EBA\u6C11\u533B\u9662 +pdfWater = \u4F5B\u5C71\u5E02\u9AD8\u660E\u4EBA\u6C11\u533B\u9662&\u62CD\u7167\u65E0\u6548,\u9700\u8981\u590D\u5370\u8BF7\u627E\u75C5\u6848\u5BA4 #\u672C\u5730\u56FE\u7247\u5730\u5740 pictureUrl=D:\\JiaShiPic\\ diff --git a/src/main/resources/mapper/Archive_MasterMapper.xml b/src/main/resources/mapper/Archive_MasterMapper.xml index b1da1ae..ee6ffe3 100644 --- a/src/main/resources/mapper/Archive_MasterMapper.xml +++ b/src/main/resources/mapper/Archive_MasterMapper.xml @@ -646,7 +646,12 @@ CASE WHEN MasterID IS NULL THEN '否' ELSE '是' - END checkName + END checkName, + CASE + WHEN T1 IS NOT NULL + AND YEAR ( T1 ) != '1801' THEN + '已签收' ELSE '未签收' + END remark from archive_master m LEFT JOIN ( SELECT MasterID FROM archive_detail INNER JOIN archive_master ON archive_detail.MasterID = archive_master.id WHERE Source = '扫描上传' GROUP BY MasterID ) archive_detail ON m.id = archive_detail.MasterID @@ -662,26 +667,15 @@ - - and patient_id - - - in + + AND (T1 IS NULL OR YEAR(T1) = '1801') - - not in - - - ( - - - #{item} + + AND (T1 IS NOT NULL AND YEAR(T1) != '1801') - '无效' - ) and m.id = #{id,jdbcType=NVARCHAR} diff --git a/src/main/resources/mapper/EmrPaperPositionInfoMapper.xml b/src/main/resources/mapper/EmrPaperPositionInfoMapper.xml index d09a13f..f322d6b 100644 --- a/src/main/resources/mapper/EmrPaperPositionInfoMapper.xml +++ b/src/main/resources/mapper/EmrPaperPositionInfoMapper.xml @@ -52,6 +52,9 @@ insert into emr_paper_position_info + + id, + patient_id, @@ -102,6 +105,9 @@ + + #{id,jdbcType=BIGINT}, + #{patientId,jdbcType=NVARCHAR},