| | |
| | | import com.ltkj.common.core.domain.entity.SysDictData; |
| | | import com.ltkj.common.core.domain.entity.SysUser; |
| | | import com.ltkj.common.utils.DateUtils; |
| | | import com.ltkj.common.utils.SecurityUtils; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.mapper.DictUserInfoMapper; |
| | |
| | | if (StrUtil.isNotBlank(result)) { |
| | | int index = 1; |
| | | result = result.replaceAll("本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查", ""); |
| | | // result = result.replaceAll("", ""); |
| | | String[] split = result.split("\n"); |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (String s : split) { |
| | |
| | | // result = "\n " + result.replaceAll("\n", "\n "); |
| | | int index1 = 1; |
| | | String[] split = result.split("\n"); |
| | | boolean contains = result.contains("本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查"); |
| | | // boolean contains = result.contains("本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查"); |
| | | boolean contains = result.contains(" "); |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (String s : split) { |
| | | if (StrUtil.isBlank(s.replaceAll("\n","").trim())) continue; |
| | |
| | | index1++; |
| | | } |
| | | if (!contains) builder.append(" (").append(index1).append(")").append("本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查"); |
| | | // if (!contains) builder.append(" (").append(index1).append(")").append(" "); |
| | | else builder.substring(0,builder.length() - 1); |
| | | result = builder.toString(); |
| | | } |
| | |
| | | } |
| | | String str = " "; |
| | | List<Map<String, Object>> maps = tjRulesService.getyichangxiangmujianyiguize(entry.getKey().toString(),"","",tjOrder.getTjNumber()); |
| | | for (Map<String, Object> objectMap : maps) { |
| | | if(detail.getDeptId().equals("2")){ |
| | | String[] split = result.split("。"); |
| | | for (String s : split) { |
| | | Map<String,Object> mapss= tjRulesService.getyichangxiangmujianyiguizeJianCha(s); |
| | | Object bt = mapss.get("bt"); |
| | | Object nr = mapss.get("nr"); |
| | | if(null !=bt && null !=nr) maps.add(mapss); |
| | | } |
| | | } |
| | | List<Map<String, Object>> collect1 = maps.stream().distinct().collect(Collectors.toList()); |
| | | |
| | | for (Map<String, Object> objectMap : collect1) { |
| | | String content = str + objectMap.get("bt").toString() + objectMap.get("nr").toString(); |
| | | if (StrUtil.isBlank(content)) content = " 本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查"; |
| | | // if (StrUtil.isBlank(content)) content = " 本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查"; |
| | | if (StrUtil.isBlank(content)) content = " "; |
| | | paragraph = new Paragraph(content,defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | |
| | | // document2.add(paragraph); |
| | | |
| | | String content1 = str + objectMap.get("bt").toString() + objectMap.get("nr").toString().trim(); |
| | | if (StrUtil.isBlank(content)) content1 = " 本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查"; |
| | | // if (StrUtil.isBlank(content)) content1 = " 本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查"; |
| | | if (StrUtil.isBlank(content)) content1 = " "; |
| | | paragraph = new Paragraph(content1,defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | |
| | | paragraph = PdfUtils.setParagraph(defaultFont, "无"); |
| | | document2.add(paragraph); |
| | | } else { |
| | | paragraph = PdfUtils.setParagraph(defaultFont, tjOrder.getCheckAdvice()); |
| | | document2.add(paragraph); |
| | | Paragraph paragraphs = new Paragraph(tjOrder.getCheckAdvice(),defaultFont); |
| | | //设置文字居中 |
| | | paragraphs.setAlignment(Element.ALIGN_LEFT); |
| | | //行间距 |
| | | // paragraphs.setLeading(5f); |
| | | //设置段落上空白 |
| | | paragraphs.setSpacingBefore(10f); |
| | | //设置段落下空白 |
| | | paragraphs.setSpacingAfter(10f); |
| | | // paragraph = PdfUtils.setParagraph(defaultFont, tjOrder.getCheckAdvice()); |
| | | document2.add(paragraphs); |
| | | } |
| | | |
| | | |
| | |
| | | cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | if (zongJianYiShiQianMing == null) { |
| | | cell.setPhrase(new Phrase(sysConfigService.selectConfigByKey("pdf_report_zongjianysname"), zongJianFont)); |
| | | String zongjianysname = sysConfigService.selectConfigByKey("pdf_report_zongjianysname"); |
| | | if (zongJianYiShiQianMing == null && StrUtil.isNotBlank(zongjianysname) && !zongjianysname.equals("无")) { |
| | | cell.setPhrase(new Phrase(zongjianysname, zongJianFont)); |
| | | tableQz.addCell(cell); |
| | | }else { |
| | | }else if(zongJianYiShiQianMing == null && zongjianysname.equals("无")){ |
| | | String nickName = SecurityUtils.getLoginUser().getUser().getNickName(); |
| | | cell.setPhrase(new Phrase(nickName, zongJianFont)); |
| | | tableQz.addCell(cell); |
| | | } else { |
| | | byte[] bytes = Base64.getDecoder().decode(zongJianYiShiQianMing.getTemplate()); |
| | | Image image = Image.getInstance(bytes); |
| | | image.scaleToFit(100, 100); |
| | |
| | | tjtype = "个人"; |
| | | hashMap.put("tjtype", tjtype); |
| | | } |
| | | if (StrUtil.isNotBlank(customer.getCompName())){ |
| | | hashMap.put("work", customer.getCompName()); |
| | | if (StrUtil.isNotBlank(tjOrder.getFirmName())){ |
| | | hashMap.put("work", tjOrder.getFirmName()); |
| | | }else { |
| | | // LambdaQueryWrapper<DictComp> wq111 = new LambdaQueryWrapper<>(); |
| | | // wq111.eq(DictComp::getDrugManufacturerId, tjOrder.getFirmId()); |
| | |
| | | } else { |
| | | hashMap.put("work", tjOrder.getFirmName()); |
| | | } |
| | | } |
| | | if (StrUtil.isBlank(tjOrder.getFirmDeptName())) { |
| | | hashMap.put("bumen", "无"); |
| | | } else { |
| | | hashMap.put("bumen",tjOrder.getFirmDeptName()); |
| | | } |
| | | hashMap.put("sex", sex); |
| | | hashMap.put("tjnumber", tjNumber); |
| | |
| | | LambdaQueryWrapper<LtkjExamJcbgd> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(LtkjExamJcbgd::getTjh,tjNumber); |
| | | wrapper.like(LtkjExamJcbgd::getXmdm,String.valueOf(tjOrderDetail.getProject().getProParentId())); |
| | | LtkjExamJcbgd jcbgd = jcbgdService.getOne(wrapper); |
| | | if (jcbgd != null){ |
| | | tjPdfVO.setTs(jcbgd.getYxbx()); |
| | | tjPdfVO.setSj(jcbgd.getBgNr()); |
| | | tjPdfVO.setShys(jcbgd.getShysxm()); |
| | | tjPdfVO.setProName(jcbgd.getXmmc()); |
| | | ids+="|"+jcbgd.getXmdm(); |
| | | wrapper.orderByDesc(LtkjExamJcbgd::getZdsj); |
| | | List<LtkjExamJcbgd> list = jcbgdService.list(wrapper); |
| | | if(null !=list && !list.isEmpty()){ |
| | | LtkjExamJcbgd jcbgd = list.get(0); |
| | | if (jcbgd != null){ |
| | | tjPdfVO.setTs(jcbgd.getYxbx()); |
| | | tjPdfVO.setSj(jcbgd.getBgNr()); |
| | | tjPdfVO.setShys(jcbgd.getShysxm()); |
| | | tjPdfVO.setProName(jcbgd.getXmmc()); |
| | | ids+="|"+jcbgd.getXmdm(); |
| | | } |
| | | } |
| | | tjPdfVOS.add(tjPdfVO); |
| | | } |