fix(测试计划): 修复手动生成报告问题

This commit is contained in:
song-cc-rock 2024-07-09 14:55:06 +08:00 committed by 刘瑞斌
parent 026b8a9786
commit 53293f50e6
2 changed files with 5 additions and 5 deletions

View File

@ -256,6 +256,7 @@ public class TestPlanReportService {
TestPlanReport record = new TestPlanReport();
record.setId(genReportId);
record.setDefaultLayout(false);
record.setName(request.getReportName());
testPlanReportMapper.updateByPrimaryKeySelective(record);
// 处理富文本文件
transferRichTextTmpFile(genReportId, request.getProjectId(), request.getRichTextTmpFileIds(), currentUser, TestPlanReportAttachmentSourceType.RICH_TEXT.name());
@ -602,7 +603,7 @@ public class TestPlanReportService {
public List<TestPlanReportComponent> getLayout(String reportId) {
TestPlanReportComponentExample example = new TestPlanReportComponentExample();
example.createCriteria().andTestPlanReportIdEqualTo(reportId);
return componentMapper.selectByExample(example);
return componentMapper.selectByExampleWithBLOBs(example);
}
/**
@ -622,11 +623,10 @@ public class TestPlanReportService {
testPlanReportSummaryMapper.updateByExampleSelective(reportSummary, example);
} else {
// 手动生成的布局, 只更新富文本组件的内容
TestPlanReportComponentExample componentExample = new TestPlanReportComponentExample();
componentExample.createCriteria().andIdEqualTo(request.getComponentId());
TestPlanReportComponent record = new TestPlanReportComponent();
record.setId(request.getComponentId());
record.setValue(request.getComponentValue());
componentMapper.updateByExample(record, componentExample);
componentMapper.updateByPrimaryKeySelective(record);
}
// 处理富文本文件
transferRichTextTmpFile(request.getId(), planReport.getProjectId(), request.getRichTextTmpFileIds(), currentUser, TestPlanReportAttachmentSourceType.RICH_TEXT.name());

View File

@ -575,7 +575,7 @@
try {
const params: UpdateReportDetailParams = {
id: detail.value.id,
componentId: currentItem.type,
componentId: currentItem.id,
componentValue: currentItem.content,
richTextTmpFileIds: currentItem.richTextTmpFileIds,
};