| | |
| | | |
| | | int xmXh = 1; |
| | | |
| | | // orderDetails=orderDetails.stream().sorted(Comparator.comparing(TjOrderDetail::getProName, Collator.getInstance(Locale.CHINA))).collect(Collectors.toList()); |
| | | // orderDetails = orderDetails.stream() |
| | | // .sorted(Comparator.comparingInt( |
| | | // tjPdfVO -> tjPdfVO.getProName().length() // 根据名字的长度排序 |
| | | // )) |
| | | // .collect(Collectors.toList()); |
| | | |
| | | Map<Long, List<TjOrderDetail>> collect = orderDetails.stream().collect(Collectors.groupingBy(TjOrderDetail::getProId)); |
| | | for (Map.Entry<String, List<CsProVo>> deptEntry : listMap.entrySet()) { |
| | | List<CsProVo> proVos = deptEntry.getValue(); |
| | |
| | | for (Map.Entry<Long, List<TjOrderDetail>> entry : collect.entrySet()) { |
| | | if (!entry.getKey().equals(proVo.getProId())) continue; |
| | | List<TjOrderDetail> details = entry.getValue(); |
| | | String xmmc = details.get(0).getProName(); |
| | | String xmmc = proVo.getProName(); |
| | | // String xmmc = details.get(0).getProName(); |
| | | boolean isXmWrite = false; |
| | | |
| | | // details=details.stream().sorted(Comparator.comparing(TjOrderDetail::getProName, Collator.getInstance(Locale.CHINA))).collect(Collectors.toList()); |
| | | // details = details.stream() |
| | | // .sorted(Comparator.comparingInt( |
| | | // tjPdfVO -> tjPdfVO.getProName().length() // 根据名字的长度排序 |
| | | // )) |
| | | // .collect(Collectors.toList()); |
| | | int index = 1; |
| | | for (TjOrderDetail detail : details) { |
| | | // if (!entry.getKey().equals(detail.getProId())) continue; |
| | | if (!isXmWrite) { |
| | | paragraph = new Paragraph(xmXh + ". " + xmmc, defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | |
| | | } |
| | | String result = detail.getProResult(); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | int index = 1; |
| | | result = result.replaceAll("本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查", ""); |
| | | // result = result.replaceAll("", ""); |
| | | String[] split = result.split("\n"); |
| | | // String[] split = result.split("\n"); |
| | | // StringBuilder builder = new StringBuilder(); |
| | | // for (String s : split) { |
| | | // if (StrUtil.isBlank(s.replaceAll("\n", "").trim())) continue; |
| | | // builder.append(" (").append(index).append(")").append(s).append("\n"); |
| | | // index++; |
| | | // } |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (String s : split) { |
| | | if (StrUtil.isBlank(s.replaceAll("\n", "").trim())) continue; |
| | | builder.append(" (").append(index).append(")").append(s).append("\n"); |
| | | if (StrUtil.isBlank(result.replaceAll("\n", "").trim())) continue; |
| | | builder.append(" (").append(index).append(")").append(detail.getProName()).append(": ").append(result).append("\n"); |
| | | index++; |
| | | } |
| | | |
| | | result = builder.toString(); |
| | | } |
| | | paragraph = new Paragraph(result, defaultFont); |
| | |
| | | int index = 1; |
| | | int index1 = 1; |
| | | for (TjOrderDetail detail : details) { |
| | | String xmmc = detail.getProName(); |
| | | String xmmc = proVo.getProName(); |
| | | // String xmmc = detail.getProName(); |
| | | if (!isXmWrite) { |
| | | xmXh++; |
| | | paragraph = new Paragraph("【" + xmXh + "." + xmmc + "】", defaultFont); |
| | |
| | | } |
| | | String result = detail.getProResult(); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | String[] split = result.split("\n"); |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (String s : split) { |
| | | if (StrUtil.isBlank(s.replaceAll("\n", "").trim())) continue; |
| | | builder.append(" (").append(index1).append(")").append(s).append("\n"); |
| | | // String[] split = result.split("\n"); |
| | | // for (String s : split) { |
| | | // if (StrUtil.isBlank(s.replaceAll("\n", "").trim())) continue; |
| | | // builder.append(" (").append(index1).append(")").append(s).append("\n"); |
| | | // index1++; |
| | | // } |
| | | |
| | | if (StrUtil.isBlank(result.replaceAll("\n", "").trim())) continue; |
| | | builder.append(" (").append(index1).append(")").append(detail.getProName()).append(": ").append(result).append("\n"); |
| | | index1++; |
| | | } |
| | | |
| | | result = builder.toString(); |
| | | } |
| | | if (StrUtil.isNotBlank(result)) { |
| | |
| | | |
| | | LambdaQueryWrapper<TjOrderYcxm> ycwq=new LambdaQueryWrapper<>(); |
| | | ycwq.eq(TjOrderYcxm::getTjh,tjOrder.getTjNumber()); |
| | | ycwq.eq(TjOrderYcxm::getJcxm,xmmc); |
| | | ycwq.eq(TjOrderYcxm::getJcxm,detail.getProName()); |
| | | TjOrderYcxm ycxm = ycxmService.getOne(ycwq); |
| | | if(null !=ycxm){ |
| | | String jynr = ycxm.getJynr(); |
| | |
| | | } |
| | | } |
| | | } |
| | | // if(!tjPdfVOS.isEmpty()){ |
| | | // tjPdfVOS=tjPdfVOS.stream().sorted(Comparator.comparing(TjPdfVO::getProName, Collator.getInstance(Locale.CHINA))).collect(Collectors.toList()); |
| | | // tjPdfVOS = tjPdfVOS.stream() |
| | | // .sorted(Comparator.comparingInt( |
| | | // tjPdfVO -> tjPdfVO.getProName().length() // 根据名字的长度排序 |
| | | // )) |
| | | // .collect(Collectors.toList()); |
| | | // } |
| | | if(!tjPdfVOS.isEmpty()){ |
| | | tjPdfVOS=tjPdfVOS.stream().sorted(Comparator.comparing(TjPdfVO::getProName, Collator.getInstance(Locale.CHINA))).collect(Collectors.toList()); |
| | | tjPdfVOS = tjPdfVOS.stream() |
| | | .sorted(Comparator.comparingInt( |
| | | tjPdfVO -> tjPdfVO.getProName().length() // 根据名字的长度排序 |
| | | )) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | printReport.put(entry.getKey(), tjPdfVOS); |
| | | } |
| | | } |