Commit d50b63b3 authored by 盖献康's avatar 盖献康

Merge branch 'gaixiankang' into 'dev'

原始记录PDF完成

See merge request !291
parents 3f19553f e7443402
......@@ -61,4 +61,10 @@ public interface SampleManagementMapper extends BaseMapper<Sample> {
List<Sample> findByIdList(@Param("relationList") List<TaskSampleRelation> relationList,@Param("id") Long id);
/**
* 通过总任务ID获取与之有关的样品的车型第一个
* @param id
* @return
*/
Sample selectSampleByTaskId(@Param("id") Long id);
}
......@@ -13,4 +13,11 @@ public interface TestRecordsMapper extends BaseMapper<TestRecords> {
List<TestRecords> findByTaskId(@Param("id") String id);
Long countResult(@Param("projectId") String projectId);
/**
* 通过总任务ID查询List
* @param id
* @return
*/
List<TestRecords> selectListByGeneralTaskId(@Param("id") Long id);
}
......@@ -184,4 +184,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
ORDER BY ts.id
</select>
<select id="selectSampleByTaskId" parameterType="java.lang.Long" resultType="com.ruoyi.domain.Sample">
select
s.sample_name,
s.manufacturing_enterprise,
s.sample_number,
s.number_of_samples,
s.trademark,
s.remark
from
t_sample s
left join t_task_sample_relation ts on s.id = ts.sample_id
left join t_task t on ts.task_id = t.id
where
t.id = #{id}
and s.deleted = 0
and ts.flag = '0'
order by s.id
limit 1;
</select>
</mapper>
......@@ -29,5 +29,23 @@
GROUP BY project_id
</select>
<select id="selectListByGeneralTaskId" parameterType="java.lang.Long" resultType="com.ruoyi.domain.TestRecords">
select
tr.usecase,
tr.usecase_id,
tr.test_time,
tr.description,
tr.risk_level,
tr.test_method,
tr.test_result,
tr.remediation,
tr.test_details
from
t_test_records tr
left join t_task t on tr.task_id = t.model_test_task_id
where
t.id = #{id}
</select>
</mapper>
......@@ -320,7 +320,7 @@ public class PdfBaseWriter extends Document{
* @param fitHeight 高度自适应
* @return 单元格 {@link PdfPCell}
*/
public PdfPCell newPdfPCellOfImage(int colspan, int rowspan, Image image, float fitWidth, float fitHeight) {
public PdfPCell newPdfPCellOfImage(int colspan, int rowspan, Image image, float fitWidth, float fitHeight, PdfPTable table) {
PdfPCell cell = new PdfPCell();
cell.setUseAscender(Boolean.TRUE);
cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE);
......@@ -330,7 +330,9 @@ public class PdfBaseWriter extends Document{
cell.setColspan(colspan);
cell.setRowspan(rowspan);
image.scaleToFit(fitWidth, fitHeight);
image.setAlignment(Image.ALIGN_CENTER);
cell.addElement(image);
table.addCell(cell);
return cell;
}
......
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