zjh
2025-04-24 672ce84d5ce6545a0e81709ea736c69cbbef8c1a
ltkj-admin/src/main/java/com/ltkj/web/controller/app/ReportController.java
@@ -19,6 +19,7 @@
import com.ltkj.hosp.sqlDomain.LtkjExamJcsqd;
import com.ltkj.hosp.sqlDomain.LtkjHybgd;
import com.ltkj.hosp.sqlDomain.LtkjHysqd;
import com.ltkj.hosp.vodomain.ShenGaoTiZhongVo;
import com.ltkj.mall.mallOrderUtils.TjConstants;
import com.ltkj.web.config.pdfutils.PDFBinaryUtil;
import io.swagger.annotations.Api;
@@ -281,9 +282,13 @@
                                if (jyjgval.compareTo(min) < 0) {
                                    // jyjg 小于范围最小值,添加下箭头
                                    jyjg = jyjg + "   ↓";
                                    hybgd.setYcbz("1");
                                } else if (jyjgval.compareTo(max) > 0) {
                                    // jyjg 大于范围最大值,添加上箭头
                                    jyjg = jyjg + "   ↑";
                                    hybgd.setYcbz("1");
                                }else {
                                    hybgd.setYcbz("0");
                                }
                                hybgd.setJyjg(jyjg);
                            } catch (Exception ignored) {}
@@ -334,8 +339,7 @@
    @GetMapping("/getShenGaoTiZhong")
    @ApiOperation(value = "小程序-体检报告查询详情")
    public AjaxResult getShenGaoTiZhong(@RequestParam @ApiParam(value = "体检号") String tjNumber) {
        Map<String, Object> objectMap = new HashMap<>();
        List<Map<String, Object>> list = new ArrayList<>();
//        Map<String, Object> objectMap = new HashMap<>();
        LambdaQueryWrapper<TjOrder> wq1 = new LambdaQueryWrapper<>();
        wq1.eq(TjOrder::getTjNumber, tjNumber);
        wq1.eq(TjOrder::getCheckStatus, 1);
@@ -344,62 +348,38 @@
            return AjaxResult.success("体检暂未完成!!");
        }
        LambdaQueryWrapper<TjOrderDetail> wq = new LambdaQueryWrapper<>();
        wq.eq(TjOrderDetail::getOrderId, one.getOrderId());
        wq.in(TjOrderDetail::getProId, "1633660948860522524");
        final TjOrderDetail one1 = detailService.getOne(wq);
        if (one1 == null) {
            objectMap.put("shenggao", "无");
        } else {
            objectMap.put("shenggao", one1.getProResult());
        }
        LambdaQueryWrapper<TjOrderDetail> wq2 = new LambdaQueryWrapper<>();
        wq2.eq(TjOrderDetail::getOrderId, one.getOrderId());
        wq2.in(TjOrderDetail::getProId, "1633660948860522525");
        final TjOrderDetail one2 = detailService.getOne(wq2);
        if (one2 == null) {
            objectMap.put("tizhong", "无");
        } else {
            objectMap.put("tizhong", one2.getProResult());
        }
        LambdaQueryWrapper<TjOrderDetail> wq3 = new LambdaQueryWrapper<>();
        wq3.eq(TjOrderDetail::getOrderId, one.getOrderId());
        wq3.in(TjOrderDetail::getProId, "1633660948860522526");
        final TjOrderDetail one3 = detailService.getOne(wq3);
        if (one3 == null) {
            objectMap.put("tizhongzhishu", "无");
        } else {
            objectMap.put("tizhongzhishu", one3.getProResult());
        }
        LambdaQueryWrapper<TjOrderDetail> wq4 = new LambdaQueryWrapper<>();
        wq4.eq(TjOrderDetail::getOrderId, one.getOrderId());
        wq4.in(TjOrderDetail::getProId, "1633660948860522527");
        final TjOrderDetail one4 = detailService.getOne(wq4);
        if (one4 == null) {
            objectMap.put("shousuoya", "无");
        } else {
            objectMap.put("shousuoya", one4.getProResult());
        }
        LambdaQueryWrapper<TjOrderDetail> wq5 = new LambdaQueryWrapper<>();
        wq5.eq(TjOrderDetail::getOrderId, one.getOrderId());
        wq5.in(TjOrderDetail::getProId, "1633660948860522528");
        final TjOrderDetail one5 = detailService.getOne(wq5);
        if (one5 == null) {
            objectMap.put("shuzhangya", "无");
        } else {
            objectMap.put("shuzhangya", one5.getProResult());
        }
        return AjaxResult.success(objectMap);
        List<ShenGaoTiZhongVo> maps = detailService.getShenGaoTiZhongList(one.getTjNumber());
//        if(null !=maps && maps.size()>0){
//            for (Map<String, Object> map : maps) {
//                if (map.get("") == null) {
//                    objectMap.put("shenggao", "无");
//                } else {
//                    objectMap.put("shenggao", one1.getProResult());
//                }
//                if (one2 == null) {
//                    objectMap.put("tizhong", "无");
//                } else {
//                    objectMap.put("tizhong", one2.getProResult());
//                }
//                if (one3 == null) {
//                    objectMap.put("tizhongzhishu", "无");
//                } else {
//                    objectMap.put("tizhongzhishu", one3.getProResult());
//                }
//                if (one4 == null) {
//                    objectMap.put("shousuoya", "无");
//                } else {
//                    objectMap.put("shousuoya", one4.getProResult());
//                }
//                if (one5 == null) {
//                    objectMap.put("shuzhangya", "无");
//                } else {
//                    objectMap.put("shuzhangya", one5.getProResult());
//                }
//            }
//        }
        log.info("ltkj {}的体检报告查询详情"+maps,tjNumber);
        return AjaxResult.success(maps);
    }
@@ -462,9 +442,9 @@
        final String substring = uuid.toString().substring(0, 5);
//        String userId = SecurityUtils.getLoginUser().getUsername();
        PDFBinaryUtil.base64StringToPDF(one.getReport(), FileUtil.mkdir(value).getPath() + "\\" + substring + tjNumber + tjCustomer.getCusName() + "_体检报告.pdf");
        PDFBinaryUtil.base64StringToPDF(one.getReport(), FileUtil.mkdir(value).getPath() + File.separator + substring + tjNumber + tjCustomer.getCusName() + "_体检报告.pdf");
        //String filePath = one.getPath();
        String filePath = value + "\\" + substring + tjNumber + tjCustomer.getCusName() + "_体检报告.pdf";
        String filePath = value + File.separator + substring + tjNumber + tjCustomer.getCusName() + "_体检报告.pdf";
        File f = new File(filePath);
        if (filePath.isEmpty()) {
            System.out.println("文件不存在!");