diff --git a/src/main/java/com/emr/controller/FontShowRecordController.java b/src/main/java/com/emr/controller/FontShowRecordController.java index a578a2a..e920e7b 100644 --- a/src/main/java/com/emr/controller/FontShowRecordController.java +++ b/src/main/java/com/emr/controller/FontShowRecordController.java @@ -93,17 +93,60 @@ public class FontShowRecordController { * @Version: 1.0 */ @RequestMapping(value = "recordList") - public String showRecord(String inpatientNo,String idCard,Model model, HttpServletRequest request) { - try{ + public String showRecord(String inpatientNo, String idCard, Model model, HttpServletRequest request) { + try { + //根据病案号查看病案是否存在 + if (StringUtils.isNotBlank(inpatientNo) || StringUtils.isNotBlank(idCard)) { + int commom = commomMapper.isExistInpatientOrAdmissIdOridCard(inpatientNo, idCard, null, null); + if (commom == 0) { + model.addAttribute("msg", "病案不存在!"); + return "font/msg"; + } + } else { + model.addAttribute("msg", "参数病案号与参数身份证号不能全部为空!"); + return "font/msg"; + } + //虚假登陆 + //验证shiro(有shiro才此操作) + Power_User user = new Power_User(); + user.setUserName("第三方"); + user.setUserId(-999); + user.setRoleId(-999); + Set menu = new TreeSet<>(); + user.setMenus(menu); + UsernamePasswordToken userToken = new UsernamePasswordToken(user.getUserName(), "123456"); + Subject subject = SecurityUtils.getSubject(); + subject.login(userToken); + request.getSession().setAttribute("CURRENT_USER", user); + model.addAttribute("inpatientNo", inpatientNo); + model.addAttribute("idCard", idCard); + } catch (Exception e) { + ExceptionPrintUtil.printException(e); + e.printStackTrace(); + } + return "font/recordList"; + } + + /** + * @description: + * @params: + * @return: + * @author linjj + * @date: 2023/7/31 8:53 + */ + @RequestMapping(value = "showRecordList") + public String showRecordList(String inpatientNo, String idCard, Model model, HttpServletRequest request) { + try { //根据病案号查看病案是否存在 - if(StringUtils.isNotBlank(inpatientNo)||StringUtils.isNotBlank(idCard)){ - int commom = commomMapper.isExistInpatientOrAdmissIdOridCard(inpatientNo,idCard, null, null); - if(commom == 0){ - model.addAttribute("msg","病案不存在!"); + if (StringUtils.isNotBlank(inpatientNo) || StringUtils.isNotBlank(idCard)) { + int commomMaster = commomMapper.selectAllMaster(inpatientNo, idCard); + int commom = commomMapper.isExistInpatientOrAdmissIdOridCard(inpatientNo, idCard, null, null); + if (commom == 0 && commomMaster==0) { + model.addAttribute("msg", "病案不存在!"); return "font/msg"; } - }else{ - model.addAttribute("msg","参数病案号与参数身份证号不能全部为空!"); + } else { + model.addAttribute("msg", "参数病案号与参数身份证号不能全部为空!"); return "font/msg"; } //虚假登陆 @@ -118,9 +161,9 @@ public class FontShowRecordController { Subject subject = SecurityUtils.getSubject(); subject.login(userToken); request.getSession().setAttribute("CURRENT_USER", user); - model.addAttribute("inpatientNo",inpatientNo); - model.addAttribute("idCard",idCard); - }catch (Exception e){ + model.addAttribute("inpatientNo", inpatientNo); + model.addAttribute("idCard", idCard); + } catch (Exception e) { ExceptionPrintUtil.printException(e); e.printStackTrace(); } @@ -129,6 +172,7 @@ public class FontShowRecordController { /** * 南方医院接口方法 + * * @param inpatientNo * @param userName * @param model @@ -137,16 +181,16 @@ public class FontShowRecordController { */ @RequestMapping(value = "recordListSouth") public String showRecordSouth(String inpatientNo, String userName, String deptName, Model model, HttpServletRequest request) { - try{ + try { //根据病案号查看病案是否存在 - if(StringUtils.isNotBlank(inpatientNo)){ + if (StringUtils.isNotBlank(inpatientNo)) { int commom = commomMapper.isExistInpatientOrAdmissId(inpatientNo, null, null); - if(commom == 0){ - model.addAttribute("msg","病案不存在!"); + if (commom == 0) { + model.addAttribute("msg", "病案不存在!"); return "font/msg"; } - }else{ - model.addAttribute("msg","参数病案号不能为空!"); + } else { + model.addAttribute("msg", "参数病案号不能为空!"); return "font/msg"; } //虚假登陆 @@ -164,12 +208,12 @@ public class FontShowRecordController { request.getSession().setAttribute("CURRENT_USER", user); request.getSession().setAttribute("userName", userName); request.getSession().setAttribute("deptName", deptName); - model.addAttribute("inpatientNo",inpatientNo); + model.addAttribute("inpatientNo", inpatientNo); Emr_Log emrLog = new Emr_Log(); emrLog.setLogTitle("接口查看"); emrLog.setLogContent("接口查询页面"); logService.insertInterface(emrLog, userName); - }catch (Exception e){ + } catch (Exception e) { ExceptionPrintUtil.printException(e); e.printStackTrace(); } @@ -178,6 +222,7 @@ public class FontShowRecordController { /** * 南方医院接口 + * * @param page * @param limit * @param inpatientNo @@ -186,15 +231,15 @@ public class FontShowRecordController { */ @RequestMapping("getRecordListByInpatientNoSouth") @ResponseBody - public String getRecordListByInpatientNoSouth(Integer page, Integer limit,String inpatientNo, HttpServletRequest request){ - if(null != page && null != limit){ + public String getRecordListByInpatientNoSouth(Integer page, Integer limit, String inpatientNo, HttpServletRequest request) { + if (null != page && null != limit) { PageHelper.startPage(page, limit); } - try{ + try { List list = commomMapper.selectCommomByInpatientNo(inpatientNo); PageInfo pageInfo = new PageInfo<>(list); return JSON.toJSONString(pageInfo); - }catch (Exception e){ + } catch (Exception e) { ExceptionPrintUtil.printException(e); e.printStackTrace(); return null; @@ -203,13 +248,14 @@ public class FontShowRecordController { /** * 南方医院接口无登录访问 + * * @param userName * @param deptName * @param request * @return */ @RequestMapping(value = "commomListSouth") - public String commomListSouth(String userName, String deptName, Model model, HttpServletRequest request){ + public String commomListSouth(String userName, String deptName, Model model, HttpServletRequest request) { //验证shiro(有shiro才此操作) UsernamePasswordToken userToken = new UsernamePasswordToken(userName, "123456"); Subject subject = SecurityUtils.getSubject(); @@ -225,6 +271,7 @@ public class FontShowRecordController { /** * 接口保存借阅申请 + * * @param applyApprove * @param patientIds * @param request @@ -233,39 +280,39 @@ public class FontShowRecordController { */ @RequestMapping("addApplyApprove") @ResponseBody - @OptionalLog(module = "接口保存",methods = "接口查询页面保存借阅申请") - public ResultUtil addApplyApprove(Emr_Apply_Approve applyApprove, String patientIds,HttpServletRequest request) throws Exception { + @OptionalLog(module = "接口保存", methods = "接口查询页面保存借阅申请") + public ResultUtil addApplyApprove(Emr_Apply_Approve applyApprove, String patientIds, HttpServletRequest request) throws Exception { boolean flag = FormTokenFlagUtil.isFlag(request); if (!flag) { return ResultUtil.error("请不要重复提交!"); } - List commomtables = commomMapper.selectAllByPatients(patientIds.substring(0, patientIds.length()-1)); - if(null != commomtables && !commomtables.isEmpty()) { + List commomtables = commomMapper.selectAllByPatients(patientIds.substring(0, patientIds.length() - 1)); + if (null != commomtables && !commomtables.isEmpty()) { SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String userName = (String)request.getSession().getAttribute("cuserName"); + String userName = (String) request.getSession().getAttribute("cuserName"); applyApprove.setApplyer(userName); applyApprove.setApplyTime(fmt.format(new Date())); List list = new ArrayList<>(); ///查询表列数 int colCount = commomMapper.selectColByTableName("emr_apply_approve"); - int simpleInsertCount = 2100/colCount; + int simpleInsertCount = 2100 / colCount; for (int i = 0; i < commomtables.size(); i++) { //处理批量添加sql太长问题,设定个数为180 - if(i > 0 && list.size()%simpleInsertCount == 0){ + if (i > 0 && list.size() % simpleInsertCount == 0) { list.clear(); } Emr_Apply_Approve applyApproveInsert = new Emr_Apply_Approve(); BeanUtils.copyProperties(applyApprove, applyApproveInsert); BeanUtils.copyProperties(commomtables.get(i), applyApproveInsert); - if(StringUtils.isNotBlank(commomtables.get(i).getDisDate())){ + if (StringUtils.isNotBlank(commomtables.get(i).getDisDate())) { applyApproveInsert.setDisDate(DateUtils.strToDateLong(commomtables.get(i).getDisDate())); } list.add(applyApproveInsert); - if(list.size() == 1 && list.get(0).getId() != null){ + if (list.size() == 1 && list.get(0).getId() != null) { applyApproveService.updateEmrApplyApprove(list.get(0)); - }else{ + } else { //是180的倍数或最后一个 - if((list.size()%simpleInsertCount == 0 || i == commomtables.size() - 1)){ + if ((list.size() % simpleInsertCount == 0 || i == commomtables.size() - 1)) { applyApproveService.SimpleInsert(list); } } @@ -277,33 +324,38 @@ public class FontShowRecordController { } //推送给权限系统下发审批人通知 - private void sendPowerApproveInterface(String applyType,Integer count) throws Exception{ + private void sendPowerApproveInterface(String applyType, Integer count) throws Exception { //查询申请类型 List dictionaryList = dictionaryMapper.selectDictionaryByTypeCode("apply_type"); String applyTypeName = ""; - if(null != dictionaryList && !dictionaryList.isEmpty()){ - for(Emr_Dictionary dictionary : dictionaryList){ - if(dictionary.getCode().equals(applyType)){ + if (null != dictionaryList && !dictionaryList.isEmpty()) { + for (Emr_Dictionary dictionary : dictionaryList) { + if (dictionary.getCode().equals(applyType)) { applyTypeName = dictionary.getName(); break; } } } //发送通知 - applyApproveService.sendNotice(applyTypeName,count); + applyApproveService.sendNotice(applyTypeName, count); } @RequestMapping("getRecordListByInpatientNo") @ResponseBody - public String getRecordListByInpatientNo(Integer page, Integer limit,String inpatientNo,String idCard){ - if(null != page && null != limit){ + public String getRecordListByInpatientNo(Integer page, Integer limit, String inpatientNo, String idCard) { + if (null != page && null != limit) { PageHelper.startPage(page, limit); } - try{ - List list = commomMapper.selectCommomByInpatientNo2(inpatientNo,idCard); - PageInfo pageInfo = new PageInfo<>(list); + PageInfo pageInfo; + try { + List list = commomMapper.selectCommomByInpatientNo2(inpatientNo, idCard); + pageInfo = new PageInfo<>(list); + if (list.size() == 0) { + List commomVos = commomMapper.selectMasterByInpatientNo(inpatientNo, idCard); + pageInfo = new PageInfo<>(commomVos); + } return JSON.toJSONString(pageInfo); - }catch (Exception e){ + } catch (Exception e) { ExceptionPrintUtil.printException(e); e.printStackTrace(); return null; @@ -312,20 +364,21 @@ public class FontShowRecordController { /** * 病案主键为空,通过病案号或与住院次数组合查询对应的病案主键 + * * @param patientId * @param inpatientNo * @param admissTimes * @return */ - private String getPatientIdByInpatientNoAndAdmissTimes(String patientId,String inpatientNo,Short admissTimes,Model model){ - if(StringUtils.isBlank(patientId)){ + private String getPatientIdByInpatientNoAndAdmissTimes(String patientId, String inpatientNo, Short admissTimes, Model model) { + if (StringUtils.isBlank(patientId)) { List patientIdList = commomMapper.selectPatientIdByAdmissTimesAndInpatientNoAndName(admissTimes, inpatientNo, null, null, null); - if(!CollectionUtils.isEmpty(patientIdList)){ - if(patientIdList.size() > 1){ + if (!CollectionUtils.isEmpty(patientIdList)) { + if (patientIdList.size() > 1) { return "查询到数据不只一个"; } patientId = patientIdList.get(0); - }else{ + } else { return "查询不到该数据"; } } @@ -333,7 +386,9 @@ public class FontShowRecordController { return null; } - /**接口 + /** + * 接口 + * * @MethodName: showRecordFont * @Description: 跳转到档案预览 * @Param String patientId:patientId @@ -346,10 +401,10 @@ public class FontShowRecordController { * @Version: 1.0 */ @RequestMapping("showRecordFont") - public String showRecordFont(String patientId,String inpatientNo,Short admissTimes, Model model, HttpServletRequest request) { + public String showRecordFont(String patientId, String inpatientNo, Short admissTimes, Model model, HttpServletRequest request) { //病案主键为空,通过病案号或与住院次数组合查询对应的病案主键 - String msg = getPatientIdByInpatientNoAndAdmissTimes(patientId, inpatientNo, admissTimes,model); - if(StringUtils.isNotBlank(msg)){ + String msg = getPatientIdByInpatientNoAndAdmissTimes(patientId, inpatientNo, admissTimes, model); + if (StringUtils.isNotBlank(msg)) { return msg; } //加载登陆者 @@ -372,16 +427,17 @@ public class FontShowRecordController { /** * 南方医院接口 + * * @param patientId * @param model * @param request * @return */ @RequestMapping("showRecordFontSouth") - public String showRecordFontSouth(String patientId,String inpatientNo,Short admissTimes, Model model, HttpServletRequest request) { + public String showRecordFontSouth(String patientId, String inpatientNo, Short admissTimes, Model model, HttpServletRequest request) { //病案主键为空,通过病案号或与住院次数组合查询对应的病案主键 - String msg = getPatientIdByInpatientNoAndAdmissTimes(patientId, inpatientNo, admissTimes,model); - if(StringUtils.isNotBlank(msg)){ + String msg = getPatientIdByInpatientNoAndAdmissTimes(patientId, inpatientNo, admissTimes, model); + if (StringUtils.isNotBlank(msg)) { return msg; } try { @@ -389,7 +445,7 @@ public class FontShowRecordController { if (null != printCount && !printCount.isEmpty()) { model.addAttribute("printCount", 1); } - String userName = (String)request.getSession().getAttribute("userName"); + String userName = (String) request.getSession().getAttribute("userName"); Emr_Log emrLog = new Emr_Log(); emrLog.setLogTitle("接口查看"); emrLog.setLogContent("接口预览页面"); @@ -630,7 +686,6 @@ public class FontShowRecordController { } - @RequestMapping(value = "selectPrintPic", method = RequestMethod.POST) @ResponseBody public ResultUtil selectPrintPic(HttpServletResponse response, String patientId, String rootPaths, String names, String sources, HttpServletRequest request) throws Exception { @@ -648,14 +703,14 @@ public class FontShowRecordController { try { Map cacheMap = commomService.CACHE_MAP; String mapKey = "admin" + "_" + patientId; - List scanPages = (List) cacheMap.get(mapKey); + List scanPages = (List) cacheMap.get(mapKey); if (!CollectionUtils.isEmpty(scanPages)) { String pdfName = "档案管理PDF"; //根据图片路径转换pdf EmrPdfWaterSet emrPdfWaterSet = pdfWaterSetMapper.selectByPrimaryKey(1); //UserEffective为1是开启用户信息水印 Short userEffective = emrPdfWaterSet.getUserEffective(); - if (userEffective==1) { + if (userEffective == 1) { img2PdfUtil.imageToPdfUserEffective(response, scanPages, pdfName, emrPdfWaterSet); } //移除缓存 @@ -670,11 +725,11 @@ public class FontShowRecordController { String pdfWater = ""; String mapKey = "admin" + "_" + patientId; //获取图片路径集合 - List filePaths = (List) cacheMap.get(mapKey); + List filePaths = (List) cacheMap.get(mapKey); if (!CollectionUtils.isEmpty(filePaths)) { //根据图片路径转换pdf EmrPdfWaterSet emrPdfWaterSet = pdfWaterSetMapper.selectByPrimaryKey(1); - Jpg2PdfUtil.mulFile2One2(response, filePaths, pdfWater,emrPdfWaterSet); + Jpg2PdfUtil.mulFile2One2(response, filePaths, pdfWater, emrPdfWaterSet); //移除缓存 commomService.CACHE_MAP.clear(); } @@ -704,12 +759,13 @@ public class FontShowRecordController { /** * 跳转查看pdfiframe页 + * * @param patientId * @param model * @return */ @RequestMapping("showRecordIframeBloodFont") - public String showRecordIframeBloodFont(String patientId,String flag,Model model) { + public String showRecordIframeBloodFont(String patientId, String flag, Model model) { model.addAttribute("patientId", patientId); //查询是否有打印权限 int printFlag = 0; @@ -720,27 +776,28 @@ public class FontShowRecordController { @RequestMapping("showRecordIframeFontSouth") - public String showRecordIframeFontSouth(String patientId, String flag,Model model, HttpServletRequest request) { + public String showRecordIframeFontSouth(String patientId, String flag, Model model, HttpServletRequest request) { model.addAttribute("patientId", patientId); //查询是否有打印权限 int printFlag = 0; model.addAttribute("printFlag", printFlag); model.addAttribute("flag", flag); - model.addAttribute("userName", (String)request.getSession().getAttribute("userName")); - model.addAttribute("deptName", (String)request.getSession().getAttribute("deptName")); + model.addAttribute("userName", (String) request.getSession().getAttribute("userName")); + model.addAttribute("deptName", (String) request.getSession().getAttribute("deptName")); return "font/showRecordIframeFontSouth"; } /** * 脐血、祈福分类树 + * * @param patientId * @param request * @return */ @RequestMapping(value = "getFontBloodRecordTree", produces = {"text/json;charset=UTF-8"}) @ResponseBody - public String getFontBloodRecordTree(String patientId,HttpServletRequest request) { - List> treeList = new ArrayList<>(); + public String getFontBloodRecordTree(String patientId, HttpServletRequest request) { + List> treeList = new ArrayList<>(); //查询该有的权限分类 try { Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); @@ -752,13 +809,13 @@ public class FontShowRecordController { } //按打印分类id查询归属分类集合 //第一级:全部影像资料 - Map map1 = new HashMap<>(); - map1.put("text","全部影像资料"); - Map tempMap = new HashMap<>(); - tempMap.put("opened",true); - tempMap.put("checked",true); - map1.put("state",tempMap); - List> children1 = new LinkedList<>(); + Map map1 = new HashMap<>(); + map1.put("text", "全部影像资料"); + Map tempMap = new HashMap<>(); + tempMap.put("opened", true); + tempMap.put("checked", true); + map1.put("state", tempMap); + List> children1 = new LinkedList<>(); if (null != commomVos && !commomVos.isEmpty()) { //去重,取出不重复的分类集合 Map assortMap = new LinkedHashMap<>(); @@ -767,12 +824,12 @@ public class FontShowRecordController { } for (Map.Entry map : assortMap.entrySet()) { String assortId = map.getValue().getAssortId(); - Map children1Map = new HashMap<>(); - children1Map.put("assortId",map.getValue().getAssortId()); - Map tempMapChildren1 = new HashMap<>(); - tempMapChildren1.put("checked",true); - children1Map.put("state",tempMapChildren1); - List> children2 = new LinkedList<>(); + Map children1Map = new HashMap<>(); + children1Map.put("assortId", map.getValue().getAssortId()); + Map tempMapChildren1 = new HashMap<>(); + tempMapChildren1.put("checked", true); + children1Map.put("state", tempMapChildren1); + List> children2 = new LinkedList<>(); //定义该类影像图片数量 int scanPathCount = 0; //第二层 图片 @@ -796,12 +853,12 @@ public class FontShowRecordController { children2.add(children2Map); } } - children1Map.put("text",map.getValue().getAssortName() + "(" + scanPathCount + ")"); - children1Map.put("children",children2); + children1Map.put("text", map.getValue().getAssortName() + "(" + scanPathCount + ")"); + children1Map.put("children", children2); children1.add(children1Map); } } - map1.put("children",children1); + map1.put("children", children1); //判断分类是否全选,全选,父类跟着全选 treeList.add(map1); return JSON.toJSONString(treeList); @@ -814,38 +871,40 @@ public class FontShowRecordController { /** * 脐血库、祈福查看pdf + * * @param patientId * @param scanPages * @param sources * @param flag */ @RequestMapping(value = "showRecordContentBloodFont") - public String showRecordContentBloodFont(String patientId, String scanPages, String sources, String flag,Model model){ + public String showRecordContentBloodFont(String patientId, String scanPages, String sources, String flag, Model model) { String pdfTempRoot = "pdfTemp"; //临时保存pdf的文件目录 String fileOutRoot = WATERPICPATH + pdfTempRoot; //目录不存在则创建 - if(!new File(fileOutRoot).isDirectory()){ + if (!new File(fileOutRoot).isDirectory()) { new File(fileOutRoot).mkdirs(); } //文件相对路径 String filePath = pdfTempRoot + "\\" + UUID.randomUUID() + ".pdf"; //组织暂存pdf文件路径 - String fileOutPath = WATERPICPATH + filePath; + String fileOutPath = WATERPICPATH + filePath; //组织前台访问临时pdf路径 - String httpFilePath = EMRRECORDJSP + "\\reload\\" + filePath; + String httpFilePath = EMRRECORDJSP + "\\reload\\" + filePath; try { - commomService.showRecordContentBloodFont(patientId,scanPages,sources,flag,fileOutPath); + commomService.showRecordContentBloodFont(patientId, scanPages, sources, flag, fileOutPath); } catch (Exception e) { ExceptionPrintUtil.printException(e); e.printStackTrace(); } - model.addAttribute("httpFilePath",httpFilePath); + model.addAttribute("httpFilePath", httpFilePath); return "font/showPdfFrameFont"; } /** * 南方医院查看PDF + * * @param patientId * @param scanPages * @param sources @@ -855,29 +914,29 @@ public class FontShowRecordController { * @return */ @RequestMapping(value = "showRecordContentSouthFont") - public String showRecordContentSouthFont(String patientId, String scanPages, String sources, String flag,Model model, HttpServletRequest request){ + public String showRecordContentSouthFont(String patientId, String scanPages, String sources, String flag, Model model, HttpServletRequest request) { String pdfTempRoot = "pdfTemp"; //临时保存pdf的文件目录 String fileOutRoot = WATERPICPATH + pdfTempRoot; //目录不存在则创建 - if(!new File(fileOutRoot).isDirectory()){ + if (!new File(fileOutRoot).isDirectory()) { new File(fileOutRoot).mkdirs(); } //文件相对路径 String filePath = pdfTempRoot + "\\" + UUID.randomUUID() + ".pdf"; //组织暂存pdf文件路径 - String fileOutPath = WATERPICPATH + filePath; + String fileOutPath = WATERPICPATH + filePath; //组织前台访问临时pdf路径 - String httpFilePath = EMRRECORDJSP + "\\reload\\" + filePath; - String userName = (String)request.getSession().getAttribute("userName"); - String deptName = (String)request.getSession().getAttribute("deptName"); + String httpFilePath = EMRRECORDJSP + "\\reload\\" + filePath; + String userName = (String) request.getSession().getAttribute("userName"); + String deptName = (String) request.getSession().getAttribute("deptName"); try { - commomService.showRecordContentSouthFont(patientId,userName,deptName,scanPages,sources,flag,fileOutPath); + commomService.showRecordContentSouthFont(patientId, userName, deptName, scanPages, sources, flag, fileOutPath); } catch (Exception e) { ExceptionPrintUtil.printException(e); e.printStackTrace(); } - model.addAttribute("httpFilePath",httpFilePath); + model.addAttribute("httpFilePath", httpFilePath); return "font/showPdfFrameFont"; } @@ -895,9 +954,9 @@ public class FontShowRecordController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequestMapping(value="emrReordLoginByToken",method = RequestMethod.POST) + @RequestMapping(value = "emrReordLoginByToken", method = RequestMethod.POST) @ResponseBody - public ResultUtil emrReordLoginByToken(String token,String userName, HttpServletRequest request) throws Exception{ + public ResultUtil emrReordLoginByToken(String token, String userName, HttpServletRequest request) throws Exception { if (StringUtils.isNoneBlank(token)) { //创建连接工厂 JAXDynamicClientFactory dcf = JAXDynamicClientFactory.newInstance(); @@ -954,9 +1013,9 @@ public class FontShowRecordController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequestMapping(value="emrReordLogin") + @RequestMapping(value = "emrReordLogin") @ResponseBody - public ResultUtil emrReordLogin(String userName, HttpServletRequest request) throws Exception{ + public ResultUtil emrReordLogin(String userName, HttpServletRequest request) throws Exception { ResultUtil resultUtil = powerLogin(userName); String token = resultUtil.getMsg(); return emrReordLoginByToken(token, userName, request); @@ -976,19 +1035,19 @@ public class FontShowRecordController { * @UpdateRemark: 更新说明 * @Version: 1.0 */ - @RequestMapping(value="powerLogin",method = RequestMethod.POST) + @RequestMapping(value = "powerLogin", method = RequestMethod.POST) @ResponseBody - public ResultUtil powerLogin(String userName) throws Exception{ - if(StringUtils.isBlank(userName)){ + public ResultUtil powerLogin(String userName) throws Exception { + if (StringUtils.isBlank(userName)) { return ResultUtil.error("用户名不能为空"); } //请求权限系统登录 - Map map = new HashMap<>(); + Map map = new HashMap<>(); String url = POWER_URLHEAD + "/font/getToken1"; - map.put("userName",userName); + map.put("userName", userName); String resultString = HttpClientUtils.doPost(url, map); // 判断返回状态是否为200 - if(StringUtils.isNoneBlank(resultString)) { + if (StringUtils.isNoneBlank(resultString)) { JSONObject jsonObject = JSON.parseObject(resultString); String extend = jsonObject.getString("extend"); JSONObject extendObject = JSONObject.parseObject(extend); @@ -1013,18 +1072,18 @@ public class FontShowRecordController { * @Version: 1.0 */ @RequestMapping("showRecord") - public String showRecord174(String patientId,String userName, Model model, HttpServletRequest request) throws Exception{ + public String showRecord174(String patientId, String userName, Model model, HttpServletRequest request) throws Exception { model.addAttribute("patientId", patientId); //加载登陆者 Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); if (null == user) { - emrReordLogin(userName,request); + emrReordLogin(userName, request); } return "font/showRecord3To2"; } @RequestMapping("showRecordPage") - public String showRecordPage(String patientId,Model model, HttpServletRequest request) throws Exception{ + public String showRecordPage(String patientId, Model model, HttpServletRequest request) throws Exception { model.addAttribute("patientId", patientId); //加载登陆者 Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); diff --git a/src/main/java/com/emr/controller/commomSearch/CommomSearchController.java b/src/main/java/com/emr/controller/commomSearch/CommomSearchController.java index f771055..9415024 100644 --- a/src/main/java/com/emr/controller/commomSearch/CommomSearchController.java +++ b/src/main/java/com/emr/controller/commomSearch/CommomSearchController.java @@ -367,10 +367,14 @@ public class CommomSearchController { @RequestMapping("getRecord") @ResponseBody public String getRecord(String patientId, String flag) { + List commomVos; if (StringUtils.isNoneBlank(patientId)) { try { //根据patientId查询包含其他诊断的基本信息 - List commomVos = commomMapper.selectOtherDiagByPatientId(patientId, flag); + commomVos = commomMapper.selectOtherDiagByPatientId(patientId, flag); + if (commomVos.size()==0){ + commomVos = commomMapper.selectMasterByPatientId(patientId); + } return JSON.toJSONString(commomVos.get(0)); } catch (Exception e) { ExceptionPrintUtil.printException(e); diff --git a/src/main/java/com/emr/controller/templateSearch/TemplateSearchController.java b/src/main/java/com/emr/controller/templateSearch/TemplateSearchController.java index 5a46d99..087769c 100644 --- a/src/main/java/com/emr/controller/templateSearch/TemplateSearchController.java +++ b/src/main/java/com/emr/controller/templateSearch/TemplateSearchController.java @@ -1322,6 +1322,7 @@ public class TemplateSearchController { } } + /** /** * @MethodName: getPatientIdsBySql * @Description: 根据patientId集合下载PDF @@ -1340,10 +1341,7 @@ public class TemplateSearchController { if (StringUtils.isNoneBlank(sql)) { try { StringBuilder json = new StringBuilder(); - long start = System.currentTimeMillis(); List list = commomMapper.selectAll(sql); - long end = System.currentTimeMillis(); - //System.out.println("查询patiendId集合时间"+(end - start)/1000.0+"s"); if (null != list && !list.isEmpty()) { for (CommomVo commomVo : list) { json.append("'").append(commomVo.getPatientId()).append("',"); diff --git a/src/main/java/com/emr/dao/CommomMapper.java b/src/main/java/com/emr/dao/CommomMapper.java index 22e7466..c446bc3 100644 --- a/src/main/java/com/emr/dao/CommomMapper.java +++ b/src/main/java/com/emr/dao/CommomMapper.java @@ -98,6 +98,10 @@ public interface CommomMapper { * */ List selectCommomByInpatientNo2(@Param("inpatientNo")String inpatientNo,@Param("idCard")String idCard); + List selectMasterByInpatientNo(@Param("inpatientNo")String inpatientNo,@Param("idCard")String idCard); + + List selectMasterByPatientId(@Param("patientId")String patientId); + /** * 查询病案信息的病案号和病人名称 * @return @@ -132,4 +136,8 @@ public interface CommomMapper { * @date: 2023/7/5 17:42 */ List selectPathLIst(@Param("patientId")String patientId); + + + int selectAllMaster(@Param("inpatientNo")String inpatientNo,@Param("idCard")String idCar); + } \ No newline at end of file diff --git a/src/main/java/com/emr/service/CommomService.java b/src/main/java/com/emr/service/CommomService.java index f29cab7..e63c7e7 100644 --- a/src/main/java/com/emr/service/CommomService.java +++ b/src/main/java/com/emr/service/CommomService.java @@ -79,7 +79,7 @@ public class CommomService { private EmrPdfWaterSetMapper pdfWaterSetMapper; @Autowired private Archive_DetailMapper archiveDetailMapper; - public static final Map CACHE_MAP =new ConcurrentHashMap<>(); + public static final Map CACHE_MAP = new ConcurrentHashMap<>(); //获取所属医院用户名集合 public static StringBuilder creaters(HttpServletRequest request) { @@ -211,8 +211,6 @@ public class CommomService { } - - //脐血库显示pdf public void showRecordContentBloodFont(String patientId, String scanPages, String sources, String flag, HttpServletResponse response, HttpServletRequest request) throws Exception { if (StringUtils.isNotBlank(patientId)) { @@ -220,45 +218,47 @@ public class CommomService { //查询 if (StringUtils.isNotBlank(flag)) { CommomVo commomVo = commomMapper.selectByPrimaryKey(patientId); - if (StringUtils.isNotBlank(commomVo.getFilePath())) { - //flag = home_addr取home_addr字段,path_file取home_addr字段 - String root1 = ""; - if ("home_addr".equals(flag)) { - root1 = commomVo.getHomeAddr(); - } else if ("file_path".equals(flag)) { - root1 = commomVo.getFilePath(); - } - String root2 = commomVo.getNewPath(); - //组织src - List src = new LinkedList<>(); - String[] scanPageArr = scanPages.split(","); - String[] sourceArr = sources.split(","); - for (int i = 0; i < scanPageArr.length; i++) { - String srcStr = ""; - if (StringUtils.isNotBlank(scanPageArr[i])) { - srcStr = root1 + File.separator + scanPageArr[i]; + if (commomVo != null) { + if (StringUtils.isNotBlank(commomVo.getFilePath())) { + //flag = home_addr取home_addr字段,path_file取home_addr字段 + String root1 = ""; + if ("home_addr".equals(flag)) { + root1 = commomVo.getHomeAddr(); + } else if ("file_path".equals(flag)) { + root1 = commomVo.getFilePath(); } - src.add(srcStr); - } - List filePaths = new LinkedList<>(); - for (String srcs : src) { - File file = new File(srcs); - if (file.isFile()) { - filePaths.add(srcs); + String root2 = commomVo.getNewPath(); + //组织src + List src = new LinkedList<>(); + String[] scanPageArr = scanPages.split(","); + String[] sourceArr = sources.split(","); + for (int i = 0; i < scanPageArr.length; i++) { + String srcStr = ""; + if (StringUtils.isNotBlank(scanPageArr[i])) { + srcStr = root1 + File.separator + scanPageArr[i]; + } + src.add(srcStr); + } + List filePaths = new LinkedList<>(); + for (String srcs : src) { + File file = new File(srcs); + if (file.isFile()) { + filePaths.add(srcs); + } + } + if (!filePaths.isEmpty()) { + String mapKey = "admin" + "_" + patientId; + CACHE_MAP.put(mapKey, filePaths); } - } - if (!filePaths.isEmpty()) { - String mapKey = "admin" + "_" + patientId; - CACHE_MAP.put(mapKey, filePaths); } } else { - List commomTrees = archiveDetailMapper.getPDFRATH(patientId,scanPages); + List commomTrees = archiveDetailMapper.getPDFRATH(patientId, scanPages); if (!commomTrees.isEmpty()) { String mapKey = "admin" + "_" + patientId; CACHE_MAP.put(mapKey, commomTrees); + } } - } } } @@ -279,11 +279,9 @@ public class CommomService { } else if ("file_path".equals(flag)) { root1 = commomVo.getFilePath(); } - String root2 = commomVo.getNewPath(); //组织src List src = new LinkedList<>(); String[] scanPageArr = scanPages.split(","); - String[] sourceArr = sources.split(","); for (int i = 0; i < scanPageArr.length; i++) { String srcStr = ""; if (StringUtils.isNotBlank(scanPageArr[i])) { @@ -304,7 +302,7 @@ public class CommomService { request.getSession().setAttribute(mapKey, filePaths); } } else { - List commomTrees = archiveDetailMapper.getPDFRATH(patientId,scanPages); + List commomTrees = archiveDetailMapper.getPDFRATH(patientId, scanPages); if (!commomTrees.isEmpty()) { Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); String mapKey = user.getUserName() + "_" + patientId; @@ -651,15 +649,15 @@ public class CommomService { if (!new File(waterPicPath).exists()) { //定义第二文本水印 姓名 + 科室 + ip EmrPdfWaterSet emrPdfWaterSet1 = getEmrPdfWaterSet(emrPdfWaterSet); - if (userEffective==1){ + if (userEffective == 1) { img2PdfUtil.addWatermarkPic1(new File(srcPath), emrPdfWaterSet, waterPicPath, emrPdfWaterSet1); - }else { + } else { img2PdfUtil.addWatermarkPic2(new File(srcPath), emrPdfWaterSet, waterPicPath); } } //组织输出地址 String root = selectRootByNotWater(WATERPICPATH); - outSrc = EMRRECORDJSP + File.separator + root+ "/jiashi/reload/"+ patientId + File.separator + sourceList[i] + File.separator + nameList[i]; + outSrc = EMRRECORDJSP + File.separator + root + "/jiashi/reload/" + patientId + File.separator + sourceList[i] + File.separator + nameList[i]; } } else { //不需要水印 diff --git a/src/main/resources/config/config.properties b/src/main/resources/config/config.properties index d8650cc..a35dfac 100644 --- a/src/main/resources/config/config.properties +++ b/src/main/resources/config/config.properties @@ -1,12 +1,12 @@ #power\u6743\u9650\u7CFB\u7EDF\u7684\u670D\u52A1\u5668\u5730\u5740\u5934 -POWER_IP =localhost -POWER_URLHEAD = http://localhost:8081/power +POWER_IP =172.16.11.90 +POWER_URLHEAD = http://172.16.11.90:8081/power -POWER_JSPHEAD = localhost -POWER_JSP = http://localhost:8081/power +POWER_JSPHEAD = 172.16.11.90 +POWER_JSP = http://172.16.11.90:8081/power #\u672C\u8EAB\u7CFB\u7EDF\u7684\u670D\u52A1\u5668\u5730\u5740\u5934 -EMR_RECORD_JSP = http://localhost:8083/emr_record +EMR_RECORD_JSP = http://172.16.11.90:8081/emr_record #webSocket\u670D\u52A1\u5668\u5730\u5740 @@ -17,6 +17,8 @@ STR_SPLIT = *^:|,. #\u65E5\u5FD7\u4FDD\u7559\u5929\u6570 log.days = 180 +pdfWater = \u6F6E\u5DDE\u5E02\u4EBA\u6C11\u533B\u9662 + #session\u8FC7\u671F\u65F6\u95F4ms TOKEN_EXPIRE_TIME = 3600000 @@ -39,4 +41,13 @@ printPrice = 0.3 applyApproveFlag =0 #//????? -initialization =0 \ No newline at end of file +initialization =0 + + +#\u67E5\u8BE2\u5168\u6587\u68C0\u7D22\u7684\u5730\u5740 +fullTextSearchUrl = http://172.16.11.90:57777/AppEngine3?wsdl +#fullTextSearchUrl = http://localhost:57777/AppEngine3?wsdl +#\u67E5\u8BE2\u5168\u6587\u68C0\u7D22\u7684\u65B9\u6CD5\u540D +fullTextSearchMethod = SearchFulltext +#\u5168\u6587\u68C0\u7D22\u5173\u952E\u5B57\u4FDD\u7559\u5929\u6570 +fullTextDays = 90 diff --git a/src/main/resources/config/jdbc.properties b/src/main/resources/config/jdbc.properties index 8dc7c8e..25afaa6 100644 --- a/src/main/resources/config/jdbc.properties +++ b/src/main/resources/config/jdbc.properties @@ -3,9 +3,9 @@ jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver #jdbc.username=sa #jdbc.password=docus@702 -jdbc.url=jdbc\:sqlserver\://localhost:1433;databaseName=qf_record +jdbc.url=jdbc\:sqlserver\://localhost:1433;databaseName=emr_record jdbc.username=sa -jdbc.password=admin123 +jdbc.password=docus@702 #dataSource2 jdbc.url2=jdbc\:sqlserver\://localhost:1433;databaseName=blgd_java diff --git a/src/main/resources/mapper/CommomMapper.xml b/src/main/resources/mapper/CommomMapper.xml index 47d0e53..0e75635 100644 --- a/src/main/resources/mapper/CommomMapper.xml +++ b/src/main/resources/mapper/CommomMapper.xml @@ -1296,7 +1296,7 @@ + + + update commomtable diff --git a/src/main/webapp/static/js/font/recordList.js b/src/main/webapp/static/js/font/recordList.js index 1e6f656..87b2bf8 100644 --- a/src/main/webapp/static/js/font/recordList.js +++ b/src/main/webapp/static/js/font/recordList.js @@ -1,6 +1,5 @@ //加载数据表格 $('#mytab').bootstrapTable({ - height:7000, toolbar: '#toolbar', //工具按钮用哪个容器 striped: true, //是否显示行间隔色 cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) @@ -11,7 +10,6 @@ $('#mytab').bootstrapTable({ pageNumber: 1, //初始化加载第一页,默认第一页 pageSize: 10, //每页的记录行数(*) pageList: [10,15,20,30,50],//可供选择的每页的行数(*) - height: 320, //行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度 columns:[ { title:'全选', @@ -50,22 +48,11 @@ $('#mytab').bootstrapTable({ { title:'出院日期', field:'disDate', - formatter: function (value) { - if(value != '' && value.length == 21) { - return value.substring(0, value.length - 2); - } - } }, { title:'出院科室', field:'disDept', }, - { - title:'扫描状态', - formatter: function(){ - return '已扫描' - } - }, { title:'操作', formatter: function(value,row){ diff --git a/src/main/webapp/static/js/recordManage/commomSearch/showRecordIframeBlood.js b/src/main/webapp/static/js/recordManage/commomSearch/showRecordIframeBlood.js index 9c4c764..e903d36 100644 --- a/src/main/webapp/static/js/recordManage/commomSearch/showRecordIframeBlood.js +++ b/src/main/webapp/static/js/recordManage/commomSearch/showRecordIframeBlood.js @@ -449,7 +449,7 @@ function search() { if (null != admissTimes && "" != admissTimes) { sql += " and admiss_times like '%" + admissTimes + "%'"; } - if (null != name && "" != name) {4 + if (null != name && "" != name) { sql += " and name like '%" + name + "%'"; } $("#mytab").bootstrapTable('destroy'); diff --git a/src/main/webapp/static/js/recordManage/templateSearch/searchCommomMethodqf.js b/src/main/webapp/static/js/recordManage/templateSearch/searchCommomMethodqf.js index 3ac526e..d36b4e2 100644 --- a/src/main/webapp/static/js/recordManage/templateSearch/searchCommomMethodqf.js +++ b/src/main/webapp/static/js/recordManage/templateSearch/searchCommomMethodqf.js @@ -189,9 +189,6 @@ function freshTable(){ locale:'zh-CN',//中文支持, url:path+'/template/cutomSearchTable',//排序方式 queryParams: function (params) { - debugger - console.log(params) - const param = { selectSql:$("#englishFields").val(), fromTableSql:$("#fromTableSql").val(),