fix:报告预报url优化

This commit is contained in:
FCL
2025-12-29 09:56:06 +08:00
parent e7a844cc8f
commit 96e3e9567e
2 changed files with 17 additions and 21 deletions

View File

@@ -1,5 +1,7 @@
package com.zt.plat.module.qms.business.reportdoc.controller.admin;
import com.zt.plat.module.infra.api.file.FileApi;
import com.zt.plat.module.infra.api.file.dto.FileRespDTO;
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFilePageReqVO;
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileRespVO;
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileSaveReqVO;
@@ -53,6 +55,7 @@ public class ReportDocumentFileController extends AbstractFileUploadController i
@Resource private ReportDocumentFileService reportDocumentFileService;
@Resource private ReportDocumentMainService reportDocumentMainService;
@Resource private FileApi fileApi;
@PostMapping("/create")
@Operation(summary = "创建检测报告附件")
@@ -107,6 +110,12 @@ public class ReportDocumentFileController extends AbstractFileUploadController i
version = mainDO.getDocumentVersion();
}
ReportDocumentFileDO entity = reportDocumentFileService.getByMainIdAndVersion(mainId, version);
Long fileId = entity.getFileId();
CommonResult<FileRespDTO> fileRet = fileApi.getFile(fileId);
FileRespDTO file = fileRet.getData();
if(fileRet.isSuccess() && file != null)
entity.setUrl(file.getUrl());
if(entity == null){
return CommonResult.success(null);
}

View File

@@ -3,7 +3,7 @@
<mapper namespace="com.zt.plat.module.qms.resource.device.dal.mapper.DeviceMaintainMapper">
<resultMap id="DeviceMaintainVO" type="com.zt.plat.module.qms.resource.device.controller.vo.DeviceMaintainVO">
<id property="id" column="ID"/>
<result property="deviceName" column="DEV_NAME"/>
<result property="alias" column="ALS"/>
<result property="deviceCode" column="DEV_CD"/>
@@ -25,9 +25,7 @@
</resultMap>
<select id="queryMaintainVoById" resultMap="DeviceMaintainVO">
select m.*,
d.ID,
<sql id="fieldDAndP">
d.DEV_NAME,
d.ALS,
d.DEV_CD,
@@ -44,6 +42,11 @@
p.MFR,
p.SPEC,
p.MDL_NO
</sql>
<select id="queryMaintainVoById" resultMap="DeviceMaintainVO">
select m.*,
<include refid="fieldDAndP"/>
from T_DEV_MATN m
left join T_DEV_INF d on m.DEV_ID = d.id
left join T_DEV_PDT p on d.PDT_ID = p.id
@@ -55,23 +58,7 @@
<select id="queryPageListWithCount" resultMap="DeviceMaintainVO">
select
d.ID,
d.DEV_NAME,
d.ALS,
d.DEV_CD,
d.FACT_CD,
d.DEPT_NAME,
d.RPR_FLG,
d.DMOT_FLG,
d.SCR_FLG,
d.DSBL_FLG,
d.LND_FLG,
d.IN_USE_FLG,
d.ACPT_FLG,
p.ID as PRODUCT_ID,
p.MFR,
p.SPEC,
p.MDL_NO,
<include refid="fieldDAndP"/>
(
select count(*) from T_DEV_MATN m
where m.DAT_TP = #{param.dataType}