Commit 46e23921 authored by wdy's avatar wdy

Merge branch 'dev' into 'master'

dev - master 33

See merge request !389
parents 45cb346e 83370fcb
......@@ -56,4 +56,10 @@ public class TestRecords {
@ApiModelProperty("测试详情")
private String testDetails;
@ApiModelProperty("附件id")
private String attachmentId;
@ApiModelProperty("附件名称")
private String attachmentName;
}
package com.ruoyi.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "AttachmentVO", description = "步骤附件列表VO")
@Data
public class AttachmentVO {
@ApiModelProperty("附件id")
private String id;
@ApiModelProperty("附件名称")
private String name;
@ApiModelProperty("附件url")
private String url;
}
......@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@ApiModel(value = "StepResultVO", description = "用例步骤结果VO")
@Data
public class StepResultVO {
......@@ -16,4 +18,7 @@ public class StepResultVO {
@ApiModelProperty("步骤名称")
private String name;
@ApiModelProperty("步骤附件列表")
List<AttachmentVO> attachment_list;
}
......@@ -22,7 +22,7 @@ public interface UserPhotoStorageService extends IService<UserPhotoStorage>
* @param request 用户照片存储
* @return 用户照片存储集合
*/
public List<PhotoStorageVO> selectUserPhotoStorageList(UserPhotoStorageListRequest request);
public List<PhotoStorageVO> selectUserPhotoStorageList();
/**
* 新增用户照片存储
......
......@@ -307,7 +307,7 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
currentDoc.close();
templateReader.close();
copy.close();
return uploadMinio(arrayOutputStream, "车型审查原始记录-" + getReportName());
return uploadMinio(arrayOutputStream, "车辆试验原始记录-" + getReportName());
}
/**
......
......@@ -894,7 +894,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
// 将 BufferedImage 转换为 ByteArrayOutputStream
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
ImageIO.write(image, "jpg", outputStream);
pictureUrl += uploadMinio(outputStream,"车型审查原始记录_" + i + getReportName() + ".jpg") + ",";
pictureUrl += uploadMinio(outputStream,"车辆试验原始记录_" + i + getReportName() + ".jpg") + ",";
}
// 关闭文档
......
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.domain.TestRecords;
import com.ruoyi.domain.vo.AttachmentVO;
import com.ruoyi.domain.vo.CaseResultVO;
import com.ruoyi.domain.vo.StepResultVO;
import com.ruoyi.mapper.TestRecordsMapper;
......@@ -102,7 +103,7 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
List<String> stepList = new ArrayList<>();
List<String> testDetailsList = new ArrayList<>();
int index = 1; // 序号从1开始
String testDetailsVO = "";
StringBuilder testDetailsVO = new StringBuilder();
for (StepResultVO stepResultVO :stepResultVOS) {
// 测试方法
String stepName = stepResultVO.getName();
......@@ -118,11 +119,30 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
if (testDetails != null) {
testDetails = convertMarkdownToHtml(testDetails);
}
testDetailsVO += testDetails + "<br> ";
testDetailsVO.append(testDetails).append("<br> ");
// 步骤附件列表
List<AttachmentVO> attachmentVOS = stepResultVO.getAttachment_list();
if (attachmentVOS != null && attachmentVOS.size() != 0) {
// 附件id
StringBuilder attachmentId = new StringBuilder();
// 附件名称
StringBuilder attachmentName = new StringBuilder();
for (AttachmentVO vo : attachmentVOS) {
attachmentId.append(vo.getId()).append("、");
attachmentName.append(vo.getName()).append("、");
}
attachmentId = new StringBuilder(attachmentId.substring(0, attachmentId.length() - 1));
attachmentName = new StringBuilder(attachmentName.substring(0, attachmentName.length() - 1));
testRecords.setAttachmentId(attachmentId.toString());
testRecords.setAttachmentName(attachmentName.toString());
}
}
testDetailsVO = testDetailsVO.substring(0, testDetailsVO.length() - 1);
testDetailsVO = new StringBuilder(testDetailsVO.substring(0, testDetailsVO.length() - 1));
testRecords.setTestMethod(StringUtils.join(stepList,"\n"));
testRecords.setTestDetails(testDetailsVO);
testRecords.setTestDetails(testDetailsVO.toString());
}
list.add(testRecords);
......@@ -188,7 +208,7 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
List<String> stepList = new ArrayList<>();
List<String> testDetailsList = new ArrayList<>();
int index = 1; // 序号从1开始
String testDetailsVO = "";
StringBuilder testDetailsVO = new StringBuilder();
for (StepResultVO stepResultVO :stepResultVOS) {
// 测试方法
String stepName = stepResultVO.getName();
......@@ -204,11 +224,30 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
if (testDetails != null) {
testDetails = convertMarkdownToHtml(testDetails);
}
testDetailsVO += testDetails + "<br> ";
testDetailsVO.append(testDetails).append("<br> ");
// 步骤附件列表
List<AttachmentVO> attachmentVOS = stepResultVO.getAttachment_list();
if (attachmentVOS != null && attachmentVOS.size() != 0) {
// 附件id
StringBuilder attachmentId = new StringBuilder();
// 附件名称
StringBuilder attachmentName = new StringBuilder();
for (AttachmentVO vo : attachmentVOS) {
attachmentId.append(vo.getId()).append("、");
attachmentName.append(vo.getName()).append("、");
}
attachmentId = new StringBuilder(attachmentId.substring(0, attachmentId.length() - 1));
attachmentName = new StringBuilder(attachmentName.substring(0, attachmentName.length() - 1));
testRecords.setAttachmentId(attachmentId.toString());
testRecords.setAttachmentName(attachmentName.toString());
}
}
testDetailsVO = testDetailsVO.substring(0, testDetailsVO.length() - 1);
testDetailsVO = new StringBuilder(testDetailsVO.substring(0, testDetailsVO.length() - 1));
testRecords.setTestMethod(StringUtils.join(stepList,"\n"));
testRecords.setTestDetails(testDetailsVO);
testRecords.setTestDetails(testDetailsVO.toString());
}
list.add(testRecords);
......
......@@ -34,12 +34,15 @@ public class UserPhotoStorageServiceImpl extends ServiceImpl<UserPhotoStorageMap
/**
* 查询用户照片存储列表
*
* @param request 用户照片存储
* @return 用户照片存储
*/
@Override
public List<PhotoStorageVO> selectUserPhotoStorageList(UserPhotoStorageListRequest request)
public List<PhotoStorageVO> selectUserPhotoStorageList()
{
// 构建登录用户
LoginUser loginUser = SecurityUtils.getLoginUser();
UserPhotoStorageListRequest request = new UserPhotoStorageListRequest();
request.setUserId(loginUser.getUserId());
List<UserPhotoStorage> userPhotoStorages = userPhotoStorageMapper.selectUserPhotoStorageList(request);
// 创建一个VOList,用于返回数据
List<PhotoStorageVO> photoStorageVOList = new ArrayList<>();
......
......@@ -48,7 +48,7 @@ public class UserPhotoStorageController extends BaseController
public TableDataInfo<PhotoStorageVO> list(@Validated @RequestBody UserPhotoStorageListRequest request)
{
// startPage();
List<PhotoStorageVO> list = userPhotoStorageService.selectUserPhotoStorageList(request);
List<PhotoStorageVO> list = userPhotoStorageService.selectUserPhotoStorageList();
return getDataTable(list);
}
......
......@@ -18,9 +18,11 @@
<result property="testResult" column="test_result" jdbcType="VARCHAR"/>
<result property="remediation" column="remediation" jdbcType="LONGNVARCHAR"/>
<result property="testDetails" column="test_details" jdbcType="LONGNVARCHAR"/>
<result property="attachmentId" column="attachment_id" jdbcType="LONGNVARCHAR"/>
<result property="attachmentName" column="attachment_name" jdbcType="LONGNVARCHAR"/>
</resultMap>
<select id="findByTaskId" resultType="com.ruoyi.domain.TestRecords">
SELECT id, project_id, task_id, usecase, usecase_no, usecase_id, test_time, description, risk_level, test_method, test_result, remediation, test_details
SELECT id, project_id, task_id, usecase, usecase_no, usecase_id, test_time, description, risk_level, test_method, test_result, remediation, test_details, attachment_id, attachment_name
FROM t_test_records
WHERE project_id = #{id}
</select>
......@@ -41,7 +43,9 @@
tr.test_result,
tr.remediation,
tr.test_details,
tr.usecase_no
tr.usecase_no,
tr.attachment_name,
tr.attachment_id
from
t_test_records tr
left join t_task t on tr.task_id = t.model_test_task_id
......
......@@ -64,7 +64,7 @@ public class TestPdfBox {
// 将 BufferedImage 转换为 ByteArrayOutputStream
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
ImageIO.write(image, "jpg", outputStream);
pictureUrl += uploadMinio(outputStream,"车型审查原始记录_" + i + getReportName() + ".jpg") + ",";
pictureUrl += uploadMinio(outputStream,"车辆试验原始记录_" + i + getReportName() + ".jpg") + ",";
}
// 关闭文档
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment