Commit 9e562e11 authored by 盖献康's avatar 盖献康

原始记录PDF完成

parent dbb425eb
...@@ -61,4 +61,10 @@ public interface SampleManagementMapper extends BaseMapper<Sample> { ...@@ -61,4 +61,10 @@ public interface SampleManagementMapper extends BaseMapper<Sample> {
List<Sample> findByIdList(@Param("relationList") List<TaskSampleRelation> relationList,@Param("id") Long id); 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> { ...@@ -13,4 +13,11 @@ public interface TestRecordsMapper extends BaseMapper<TestRecords> {
List<TestRecords> findByTaskId(@Param("id") String id); List<TestRecords> findByTaskId(@Param("id") String id);
Long countResult(@Param("projectId") String projectId); 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" ...@@ -184,4 +184,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
ORDER BY ts.id ORDER BY ts.id
</select> </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> </mapper>
...@@ -29,5 +29,23 @@ ...@@ -29,5 +29,23 @@
GROUP BY project_id GROUP BY project_id
</select> </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> </mapper>
...@@ -320,7 +320,7 @@ public class PdfBaseWriter extends Document{ ...@@ -320,7 +320,7 @@ public class PdfBaseWriter extends Document{
* @param fitHeight 高度自适应 * @param fitHeight 高度自适应
* @return 单元格 {@link PdfPCell} * @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(); PdfPCell cell = new PdfPCell();
cell.setUseAscender(Boolean.TRUE); cell.setUseAscender(Boolean.TRUE);
cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE);
...@@ -330,7 +330,9 @@ public class PdfBaseWriter extends Document{ ...@@ -330,7 +330,9 @@ public class PdfBaseWriter extends Document{
cell.setColspan(colspan); cell.setColspan(colspan);
cell.setRowspan(rowspan); cell.setRowspan(rowspan);
image.scaleToFit(fitWidth, fitHeight); image.scaleToFit(fitWidth, fitHeight);
image.setAlignment(Image.ALIGN_CENTER);
cell.addElement(image); cell.addElement(image);
table.addCell(cell);
return 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