| | |
| | | @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); |
| | |
| | | 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()); |
| | | } |
| | | |
| | | /** |
| | |
| | | @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)){ |
| | |
| | | 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()); |
| | |
| | | "/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); |
| | | } |
| | | |
| | |
| | | @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)){ |
| | |
| | | "/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); |
| | | } |
| | | |