diff --git a/src/main/java/com/emr/controller/FontController.java b/src/main/java/com/emr/controller/FontController.java index a7b11ad2..62cbb57c 100644 --- a/src/main/java/com/emr/controller/FontController.java +++ b/src/main/java/com/emr/controller/FontController.java @@ -48,41 +48,41 @@ public class FontController { @Autowired private Zd_AssortService assortService; - /***************************提供第三方按多个分段id和记账号查询病历pdf***********************************/ + /***************************鎻愪緵绗笁鏂规寜澶氫釜鍒嗘id鍜岃璐﹀彿鏌ヨ鐥呭巻pdf***********************************/ /** - * 提供第三方按多个分段id和记账号查询病历pdf + * 鎻愪緵绗笁鏂规寜澶氫釜鍒嗘id鍜岃璐﹀彿鏌ヨ鐥呭巻pdf * */ @RequestMapping("showRecordByPatientId") public String showRecordByPatientId( HttpServletResponse response, String assortIds, String patientId, String visitId, Model model){ response.setCharacterEncoding("utf-8"); System.out.println(System.getProperty("file.encoding"));//褰撳墠鏂囦欢鐨勭紪鐮佹柟寮 if(StringUtils.isBlank(assortIds)){ - return retrunErrorPage(model,"病案分类Id不能为空!"); + return retrunErrorPage(model,"鐥呮鍒嗙被Id涓嶈兘涓虹┖!"); } if(StringUtils.isBlank(patientId)){ - return retrunErrorPage(model,"记账号不能为空!"); + return retrunErrorPage(model,"璁拌处鍙蜂笉鑳戒负绌!"); } if(StringUtils.isBlank(visitId)){ - return retrunErrorPage(model,"住院次数不能为空!"); + return retrunErrorPage(model,"浣忛櫌娆℃暟涓嶈兘涓虹┖!"); } List list = new ArrayList<>(); - //判断工号是否存在 + //鍒ゆ柇宸ュ彿鏄惁瀛樺湪 try { /* String checkUserName = checkUserName(userName); if(StringUtils.isNotBlank(checkUserName)){ return retrunErrorPage(model,checkUserName); }*/ - //判断分类id是否存在,协商assortIds = "00000000"为查询全部 + //鍒ゆ柇鍒嗙被id鏄惁瀛樺湪,鍗忓晢assortIds = "00000000"涓烘煡璇㈠叏閮 if(!allAddortIds.equals(assortIds)) { String checkAssortIds = checkAssortIds(assortIds); if (StringUtils.isNotBlank(checkAssortIds)) { return retrunErrorPage(model, checkAssortIds); } } - //判断记账号是否存在 + //鍒ゆ柇璁拌处鍙锋槸鍚﹀瓨鍦 list = archiveMasterService.selectByObject(patientId,visitId); if(null == list || list.isEmpty()){ - return retrunErrorPage(model,"病历不存在!"); + return retrunErrorPage(model,"鐥呭巻涓嶅瓨鍦!"); } } catch (Exception e) { ExceptionPrintUtil.printException(e); @@ -95,19 +95,19 @@ public class FontController { } /** - * 返回错误页面 + * 杩斿洖閿欒椤甸潰 * */ private String retrunErrorPage(Model model, String errorMsg){ - System.out.println(System.getProperty("file.encoding"));//褰撳墠鏂囦欢鐨勭紪鐮佹柟寮 + // System.out.println(System.getProperty("file.encoding"));//褰撳墠鏂囦欢鐨勭紪鐮佹柟寮 model.addAttribute("errorMsg",errorMsg); return "font/error"; } /** - * 判断分类id是否存在 + * 鍒ゆ柇鍒嗙被id鏄惁瀛樺湪 * */ private String checkAssortIds(String assortIds){ - System.out.println(System.getProperty("file.encoding"));//褰撳墠鏂囦欢鐨勭紪鐮佹柟寮 + // System.out.println(System.getProperty("file.encoding"));//褰撳墠鏂囦欢鐨勭紪鐮佹柟寮 Zd_Assort assort = new Zd_Assort(); assort.setPrintFlag("0"); List assortList = null; @@ -120,7 +120,7 @@ public class FontController { if(null != assortList && !assortList.isEmpty()){ String[] split = assortIds.split(","); for (String s : split) { - //定义分类存在 + //瀹氫箟鍒嗙被瀛樺湪 boolean exist = false; if (StringUtils.isNotBlank(s)) { for (Zd_Assort assort1 : assortList) { @@ -131,17 +131,17 @@ public class FontController { } } if (!exist) { - return "病案分类Id有误!"; + return "鐥呮鍒嗙被Id鏈夎!"; } } }else{ - return "病案分类Id有误!"; + return "鐥呮鍒嗙被Id鏈夎!"; } return null; } /** - * 根据主键查询病案详情 + * 鏍规嵁涓婚敭鏌ヨ鐥呮璇︽儏 * @param masterId * @return */ @@ -150,7 +150,7 @@ public class FontController { public String getPdfToPdf(String masterId){ try { Archive_Master archiveMaster = archiveMasterService.selectById(masterId); - //转换科室数据字典 + //杞崲绉戝鏁版嵁瀛楀吀 if(StringUtils.isNotBlank(archiveMaster.getDeptName())){ Emr_Dictionary dictionary = new Emr_Dictionary(); dictionary.setCode(archiveMaster.getDeptName()); @@ -159,7 +159,7 @@ public class FontController { if(null != dictionaries && !dictionaries.isEmpty()){ archiveMaster.setDeptName(dictionaries.get(0).getName()); } - //判断出院日期 + //鍒ゆ柇鍑洪櫌鏃ユ湡 String dischargeDateTime = archiveMaster.getDischargeDateTime(); if(StringUtils.isNotBlank(dischargeDateTime)){ SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); @@ -178,7 +178,7 @@ public class FontController { } /** - * 跳转到showRecordIframe页面 + * 璺宠浆鍒皊howRecordIframe椤甸潰 * */ /*@RequestMapping("showRecordIframe") public String showRecordIframe(){ @@ -186,7 +186,7 @@ public class FontController { }*/ /** - * 根据master表的记账号和分类id集合组织分类树 + * 鏍规嵁master琛ㄧ殑璁拌处鍙峰拰鍒嗙被id闆嗗悎缁勭粐鍒嗙被鏍 * @return * @throws Exception */ @@ -194,23 +194,23 @@ public class FontController { @RequestMapping(value = "/getRecordTypeTree") public String getRecordTypeTree(HttpServletResponse response,String patientId,String assortIds){ response.setCharacterEncoding("utf-8"); - System.out.println(System.getProperty("file.encoding"));//褰撳墠鏂囦欢鐨勭紪鐮佹柟寮 + // System.out.println(System.getProperty("file.encoding"));//褰撳墠鏂囦欢鐨勭紪鐮佹柟寮 List treeList = new ArrayList<>(); if(StringUtils.isNotBlank(patientId) && StringUtils.isNotBlank(assortIds)){ List list = new ArrayList<>(); - //assortIds等于协商的全查的分类id,全查 + //assortIds绛変簬鍗忓晢鐨勫叏鏌ョ殑鍒嗙被id锛屽叏鏌 try { if(allAddortIds.equals(assortIds)){ list = archiveDetailService.selectTypeTreeByPatientIdAndAssortIds(patientId, null); }else{ - //否则按条件查 - //分类id分别以单引号隔开 + //鍚﹀垯鎸夋潯浠舵煡 + //鍒嗙被id鍒嗗埆浠ュ崟寮曞彿闅斿紑 StringBuilder assortIdStr = new StringBuilder(); String[] split = assortIds.split(","); for (String s : split) { assortIdStr.append("'").append(s).append("',"); } - //去掉最后一个逗号 + //鍘绘帀鏈鍚庝竴涓楀彿 assortIdStr = new StringBuilder(assortIdStr.substring(0, assortIdStr.length() - 1)); list = archiveDetailService.selectTypeTreeByPatientIdAndAssortIds(patientId, assortIdStr.toString()); } @@ -220,18 +220,18 @@ public class FontController { } if(null != list && !list.isEmpty()){ Set assortList = new LinkedHashSet<>(); - //抽取首次病程记录 - String strTemp = "首次病程"; + //鎶藉彇棣栨鐥呯▼璁板綍 + String strTemp = "棣栨鐥呯▼"; String assortId = "11"; - //定义护理记录里的首次护理记录排前头 - String nurseTemp = "首次护理"; + //瀹氫箟鎶ょ悊璁板綍閲岀殑棣栨鎶ょ悊璁板綍鎺掑墠澶 + String nurseTemp = "棣栨鎶ょ悊"; String nurseAssortId = "7"; Archive_Detail detailTemp = new Archive_Detail(); Archive_Detail nurseDetailVoTemp = new Archive_Detail(); - //分类去重 + //鍒嗙被鍘婚噸 for(Archive_Detail detail : list){ assortList.add(detail.getSubassort()); - //获取title + //鑾峰彇title String title = detail.getTitle(); if(StringUtils.isNotBlank(title) && detail.getTitle().contains(strTemp)){ detailTemp = detail; @@ -240,41 +240,41 @@ public class FontController { nurseDetailVoTemp = detail; } } - //组织树 + //缁勭粐鏍 int id = 1; - //定义第一层的id为第二层父id + //瀹氫箟绗竴灞傜殑id涓虹浜屽眰鐖秈d int oneParentId = 0; - //定义第二层的id为第三层父id + //瀹氫箟绗簩灞傜殑id涓虹涓夊眰鐖秈d int twoParentId = 0; AssortTypeTree tree = new AssortTypeTree(); - //第一层,根目录全部影像资料 + //绗竴灞,鏍圭洰褰曞叏閮ㄥ奖鍍忚祫鏂 tree.setId(id); tree.setParentId(0); - tree.setName("全部影像资料"); + tree.setName("鍏ㄩ儴褰卞儚璧勬枡"); tree.setChecked("true"); treeList.add(tree); oneParentId = id; id++; for(String assortName : assortList){ AssortTypeTree tree1 = new AssortTypeTree(); - //第二层,分类名称 + //绗簩灞,鍒嗙被鍚嶇О tree1.setId(id); tree1.setParentId(oneParentId); twoParentId = id; id++; - //定义该类的数量 + //瀹氫箟璇ョ被鐨勬暟閲 int count = 0; - //定义是否添加了首次病程 + //瀹氫箟鏄惁娣诲姞浜嗛娆$梾绋 boolean flag = false; boolean nurseflag = false; for(Archive_Detail detail : list){ if(StringUtils.isNoneBlank(detail.getSubassort()) && assortName.equals(detail.getSubassort())){ String assortid = detail.getAssortid(); if(StringUtils.isNotBlank(assortid) && assortid.equals(assortId)){ - //是病程记录 + //鏄梾绋嬭褰 if(!flag && StringUtils.isNotBlank(detailTemp.getTitle())){ AssortTypeTree tree2 = new AssortTypeTree(); - //第三层,资料名称 + //绗笁灞,璧勬枡鍚嶇О count++; tree2.setId(id); tree2.setParentId(twoParentId); @@ -287,10 +287,10 @@ public class FontController { } } if(StringUtils.isNotBlank(assortid) && assortid.equals(nurseAssortId)){ - //是护理记录 + //鏄姢鐞嗚褰 if(!nurseflag && StringUtils.isNotBlank(nurseDetailVoTemp.getTitle())){ AssortTypeTree tree2 = new AssortTypeTree(); - //第三层,资料名称 + //绗笁灞,璧勬枡鍚嶇О count++; tree2.setId(id); tree2.setParentId(twoParentId); @@ -304,7 +304,7 @@ public class FontController { } if(!detail.equals(detailTemp) && !detail.equals(nurseDetailVoTemp)) { AssortTypeTree tree2 = new AssortTypeTree(); - //第三层,资料名称 + //绗笁灞,璧勬枡鍚嶇О count++; tree2.setId(id); tree2.setParentId(twoParentId); @@ -326,7 +326,7 @@ public class FontController { } /** - * 根据病案号或类别或图片id获取图片列表,并生成PDF并返回pdf文件名 + * 鏍规嵁鐥呮鍙锋垨绫诲埆鎴栧浘鐗噄d鑾峰彇鍥剧墖鍒楄〃锛屽苟鐢熸垚PDF骞惰繑鍥瀙df鏂囦欢鍚 * @param response * @param detailIds * @return @@ -342,13 +342,13 @@ public class FontController { detail.setTitle(detailIds); archiveDetailService.selectByIdStrFont(response,session,detail); }else{ - //存至session + //瀛樿嚦session session.setAttribute("showRecord",null); } return Msg.success(); } catch (Exception e) { ExceptionPrintUtil.printException(e); - return Msg.fail("查看出错了,请联系系统管理员"); + return Msg.fail("鏌ョ湅鍑洪敊浜,璇疯仈绯荤郴缁熺鐞嗗憳"); //e.printStackTrace(); } }