xuhy
2026-01-19 cb6975effb2165769b92a3204533f30ff4a6cd97
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TSysInspectionController.java
@@ -78,7 +78,7 @@
    @Log(title = "用户检测信息管理信息-新增用户检测信息管理", businessType = BusinessType.INSERT)
    @ApiOperation(value = "添加用户检测信息管理")
    @PostMapping(value = "/add")
    public R<Boolean> add(@Validated @RequestBody TSysInspection dto) {
    public R<String> add(@Validated @RequestBody TSysInspection dto) {
        dto.setIsPay(1);
        String checkTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
        dto.setCheckTime(checkTime);
@@ -102,11 +102,14 @@
            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));
        sysInspectionService.save(dto);
        return R.ok(dto.getId());
    }
    /**
@@ -153,6 +156,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 +230,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());
@@ -261,15 +271,17 @@
                "/usr/local/project/template/",
                "病历-样例.docx",
                templateParam,
                "病历-"+sysInspection.getNickName(),
                "病历-模板",
                "/usr/local/project/template/");
        // windows
//        String url = wordUtil.generatePdf(
//                "E:\\WXWork\\1688857451467088\\Cache\\File\\2026-01\\",
//                "病历-样例.docx",
//                templateParam,
//                "病历-样例-temp",
//                "病历-模板",
//                "E:\\WXWork\\1688857451467088\\Cache\\File\\2026-01\\");
        sysInspection.setDetectionPdf(url);
        sysInspectionService.updateById(sysInspection);
        return R.ok(url);
    }
@@ -278,6 +290,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)){
@@ -338,15 +353,17 @@
                "/usr/local/project/template/",
                "处方单-样例.docx",
                templateParam,
                "处方单-"+sysInspection.getNickName(),
                "处方单-模板",
                "/usr/local/project/template/");
        // windows
//        String url = wordUtil.generatePdf(
//                "E:\\WXWork\\1688857451467088\\Cache\\File\\2026-01\\",
//                "处方单-样例.docx",
//                templateParam,
//                "处方单-"+sysInspection.getNickName(),
//                "处方单-模板",
//                "E:\\WXWork\\1688857451467088\\Cache\\File\\2026-01\\");
        sysInspection.setPrescriptionPdf(url);
        sysInspectionService.updateById(sysInspection);
        return R.ok(url);
    }