xuhy
2026-01-19 bb54438eb900f1889e0df63a64bf7e59d2c67fc3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TSysInspectionController.java
@@ -102,8 +102,10 @@
            prescriptionNumber = prescriptionNumber.substring(prescriptionNumber.length() - 6);
            prescriptionNumber = String.format("%06d", Integer.parseInt(prescriptionNumber) + 1);
            dto.setPrescriptionNumber(prescriptionNumber);
            dto.setHospitalizationNumber(prescriptionNumber);
        }else{
            dto.setPrescriptionNumber("000001");
            dto.setHospitalizationNumber("000001");
        }
        dto.setInspectionType(1);
        return R.ok(sysInspectionService.save(dto));
@@ -153,6 +155,9 @@
    @GetMapping(value = "/exportInspection")
    public R<String> exportInspection(@RequestParam String id) {
        TSysInspection sysInspection = sysInspectionService.getById(id);
        if(StringUtils.hasLength(sysInspection.getDetectionPdf())){
            return R.ok(sysInspection.getDetectionPdf());
        }
        // 查询诊所信息
        TCrmClinic crmClinic = crmClinicService.getById(sysInspection.getClinicId());
        if(Objects.isNull(crmClinic)){
@@ -224,6 +229,10 @@
        if(StringUtils.hasLength(sysInspection.getPastMedicalHistory())){
            fill(templateParam, "pastMedicalHistory", sysInspection.getPastMedicalHistory());
        }
        // 个人史
        if(StringUtils.hasLength(sysInspection.getPersonalHistory())){
            fill(templateParam, "personalHistory", sysInspection.getPersonalHistory());
        }
        // 月经史
        if(StringUtils.hasLength(sysInspection.getMenstrualHistory())){
            fill(templateParam, "menstrualHistory", sysInspection.getMenstrualHistory());
@@ -270,6 +279,8 @@
//                templateParam,
//                "病历-样例-temp",
//                "E:\\WXWork\\1688857451467088\\Cache\\File\\2026-01\\");
        sysInspection.setDetectionPdf(url);
        sysInspectionService.updateById(sysInspection);
        return R.ok(url);
    }
@@ -278,6 +289,9 @@
    @GetMapping(value = "/exportPrescription")
    public R<String> exportPrescription(@RequestParam String id) {
        TSysInspection sysInspection = sysInspectionService.getById(id);
        if(StringUtils.hasLength(sysInspection.getPrescriptionPdf())){
            return R.ok(sysInspection.getPrescriptionPdf());
        }
        // 查询诊所信息
        TCrmClinic crmClinic = crmClinicService.getById(sysInspection.getClinicId());
        if(Objects.isNull(crmClinic)){
@@ -347,6 +361,8 @@
//                templateParam,
//                "处方单-"+sysInspection.getNickName(),
//                "E:\\WXWork\\1688857451467088\\Cache\\File\\2026-01\\");
        sysInspection.setPrescriptionPdf(url);
        sysInspectionService.updateById(sysInspection);
        return R.ok(url);
    }