| | |
| | | import com.ltkj.system.service.ISysUserService; |
| | | import com.ltkj.web.config.pdfutils.PdfUtils; |
| | | import com.ltkj.web.controller.system.SysDeptController; |
| | | import jodd.util.StringUtil; |
| | | import lombok.SneakyThrows; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import net.sf.ehcache.search.aggregator.Count; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | // List<Map<String, Object>> jiancha = new ArrayList<>(); |
| | | |
| | | |
| | | paragraph = PdfUtils.setParagraph(defaultTitleFont, "检查综述:"); |
| | | paragraph.setSpacingBefore(3f); |
| | | paragraph.setSpacingAfter(2f); |
| | | document2.add(paragraph); |
| | | |
| | | int xmXh = 1; |
| | | |
| | | Map<Long, List<TjOrderDetail>> collect = orderDetails.stream().collect(Collectors.groupingBy(TjOrderDetail::getProId)); |
| | | LambdaQueryWrapper<TjOrderYcxm> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderYcxm::getTjh, tjOrder.getTjNumber()); |
| | | List<TjOrderYcxm> ycxms = ycxmService.list(wq); |
| | | boolean isBr = false; |
| | | if (null != ycxms && !ycxms.isEmpty()) { |
| | | |
| | | paragraph = PdfUtils.setParagraph(defaultTitleFont, "检查综述:"); |
| | | paragraph.setSpacingBefore(3f); |
| | | paragraph.setSpacingAfter(2f); |
| | | document2.add(paragraph); |
| | | isBr = true; |
| | | |
| | | Map<String, List<TjOrderYcxm>> stringListMap = ycxms.stream().collect(Collectors.groupingBy(TjOrderYcxm::getParentName)); |
| | | |
| | | for (Map.Entry<String, List<TjOrderYcxm>> entry : stringListMap.entrySet()) { |
| | | List<TjOrderYcxm> details = entry.getValue(); |
| | | String xmmc = entry.getKey(); |
| | | // String xmmc = details.get(0).getProName(); |
| | | boolean isXmWrite = false; |
| | | int index = 1; |
| | | for (TjOrderYcxm detail : details) { |
| | | // if (!entry.getKey().equals(detail.getProId())) continue; |
| | | if (!isXmWrite) { |
| | | paragraph = new Paragraph(xmXh + ". " + xmmc, defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | |
| | | result = result.replaceAll("本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查", ""); |
| | | StringBuilder builder = new StringBuilder(); |
| | | if (StrUtil.isBlank(result.replaceAll("\n", "").trim())) continue; |
| | | |
| | | builder.append(" (").append(index).append(")").append(detail.getJcxm()).append(": ").append(result).append("\n"); |
| | | index++; |
| | | |
| | |
| | | xmXh++; |
| | | } |
| | | } |
| | | }else { |
| | | } |
| | | /* else { |
| | | |
| | | if (!collect.isEmpty() || !map.isEmpty()){ |
| | | paragraph = PdfUtils.setParagraph(defaultTitleFont, "检查综述:"); |
| | | paragraph.setSpacingBefore(3f); |
| | | paragraph.setSpacingAfter(2f); |
| | | document2.add(paragraph); |
| | | isBr = true; |
| | | } |
| | | |
| | | for (Map.Entry<String, List<CsProVo>> deptEntry : listMap.entrySet()) { |
| | | List<CsProVo> proVos = deptEntry.getValue(); |
| | | if (proVos.size() > 1) { |
| | |
| | | } |
| | | } |
| | | } |
| | | } */ |
| | | |
| | | |
| | | |
| | | if(isBr) { |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | | paragraph.setLeading(0f); |
| | | paragraph.setSpacingBefore(10f); |
| | | paragraph.setSpacingAfter(10f); |
| | | document2.add(paragraph); |
| | | } |
| | | |
| | | |
| | | |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | | paragraph.setLeading(0f); |
| | | paragraph.setSpacingBefore(10f); |
| | | paragraph.setSpacingAfter(10f); |
| | | document2.add(paragraph); |
| | | paragraph = PdfUtils.setParagraph(defaultTitleFont, "医生建议:"); |
| | | paragraph.setSpacingBefore(3f); |
| | | paragraph.setSpacingAfter(2f); |
| | | document2.add(paragraph); |
| | | xmXh = 0; |
| | | if (null != ycxms && !ycxms.isEmpty()) { |
| | | |
| | | paragraph = PdfUtils.setParagraph(defaultTitleFont, "医生建议:"); |
| | | paragraph.setSpacingBefore(3f); |
| | | paragraph.setSpacingAfter(2f); |
| | | document2.add(paragraph); |
| | | |
| | | Map<String, List<TjOrderYcxm>> stringListMap = ycxms.stream().collect(Collectors.groupingBy(TjOrderYcxm::getParentName)); |
| | | |
| | |
| | | } |
| | | } |
| | | }*/ |
| | | } else { |
| | | } |
| | | /* else { |
| | | |
| | | if (!collect.isEmpty() || !map.isEmpty()){ |
| | | paragraph = PdfUtils.setParagraph(defaultTitleFont, "医生建议:"); |
| | | paragraph.setSpacingBefore(3f); |
| | | paragraph.setSpacingAfter(2f); |
| | | document2.add(paragraph); |
| | | } |
| | | |
| | | for (Map.Entry<String, List<CsProVo>> deptEntry : listMap.entrySet()) { |
| | | List<CsProVo> proVos = deptEntry.getValue(); |
| | | if (proVos.size() > 1) { |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } */ |
| | | |
| | | for (int i = 0; i < 1; i++) { |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | } |
| | | } else { |
| | | } |
| | | // 碳14 |
| | | // else if (value.get(0).getPid().equals("1870371396991955967")){ |
| | | // Font remarkFonts = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | // Paragraph ppp = new Paragraph("阳性参考值(Delta Over Baseline(DPM)):", remarkFonts); |
| | | // paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | // paragraph.setLeading(5f); |
| | | // document1.add(ppp); |
| | | // |
| | | // LineSeparator objectName = new LineSeparator(); |
| | | // objectName.setOffset(-5); |
| | | // document1.add(objectName); |
| | | // |
| | | // ppp = new Paragraph("DPM值: > 149 阳性", remarkFonts); |
| | | // paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | // paragraph.setLeading(5f); |
| | | // document1.add(ppp); |
| | | // |
| | | // ppp = new Paragraph(" ⩽ 99 阴性", remarkFonts); |
| | | // paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | // paragraph.setLeading(5f); |
| | | // document1.add(ppp); |
| | | // |
| | | // objectName.setOffset(-5); |
| | | // document1.add(objectName); |
| | | // |
| | | // |
| | | // int result = Integer.parseInt(value.get(0).getProResult()); |
| | | // String after = ""; |
| | | // if (result > 149){ |
| | | // after = "阳性"; |
| | | // }else { |
| | | // after = "阴性"; |
| | | // } |
| | | // ppp = new Paragraph("检测结果: DPM=" + result, remarkFonts); |
| | | // paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | // paragraph.setLeading(5f); |
| | | // document1.add(ppp); |
| | | // |
| | | // ppp = new Paragraph("", remarkFonts); |
| | | // paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | // paragraph.setLeading(5f); |
| | | // document1.add(ppp); |
| | | // ppp = new Paragraph("", remarkFonts); |
| | | // paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | // paragraph.setLeading(5f); |
| | | // document1.add(ppp); |
| | | // if (StrUtil.isNotBlank(entry.getKey().getRemark())) { |
| | | // ppp = new Paragraph("结论:" + entry.getKey().getRemark(), remarkFonts); |
| | | // paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | // paragraph.setLeading(5f); |
| | | // document1.add(ppp); |
| | | // } |
| | | // } |
| | | else { |
| | | String[] titles = {"体检项目", "体检结果", "单位"}; |
| | | Font headFont = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | Font textFont = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | |
| | | List<LtkjHysqd> list = ltkjHysqdService.list(ltkjHysqdLambdaQueryWrapper); |
| | | HashMap<String, Object> data = new HashMap<>(); |
| | | for (LtkjHysqd hysqd : list) { |
| | | LambdaQueryWrapper<LtkjHybgd> ltkjHybgdLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | ltkjHybgdLambdaQueryWrapper.eq(LtkjHybgd::getTmh, hysqd.getTmh()); |
| | | List<LtkjHybgd> hybgds = ltkjHybgdService.list(ltkjHybgdLambdaQueryWrapper); |
| | | // LambdaQueryWrapper<LtkjHybgd> ltkjHybgdLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | // ltkjHybgdLambdaQueryWrapper.eq(LtkjHybgd::getTmh, hysqd.getTmh()); |
| | | // List<LtkjHybgd> hybgds = ltkjHybgdService.list(ltkjHybgdLambdaQueryWrapper); |
| | | List<LtkjHybgd> hybgds = ltkjHybgdService.getReportJianYanBaoGaoDanList(hysqd.getTmh()); |
| | | if(null !=hybgds && !hybgds.isEmpty()){ |
| | | // hybgds = hybgds.stream().distinct().collect(Collectors.toList()); |
| | | hybgds = new ArrayList<>(hybgds.stream() |
| | | .collect(Collectors.toMap(LtkjHybgd::getJcxm, p -> p, (existing, replacement) -> existing)) |
| | | .values()); |
| | | |
| | | |
| | | |
| | | // hybgds=hybgds.stream().sorted(Comparator.comparing(LtkjHybgd::getJcxm, Collator.getInstance(Locale.CHINA))).collect(Collectors.toList()); |
| | | // hybgds = hybgds.stream() |
| | | // .sorted(Comparator.comparingInt( |