Commit 1dfdfbd4 authored by wdy's avatar wdy

Merge branch 'dev' into 'master'

dev - master 12

See merge request !331
parents 1a28f043 c8d44fa5
...@@ -6,4 +6,8 @@ import lombok.Data; ...@@ -6,4 +6,8 @@ import lombok.Data;
public class DictDataVO { public class DictDataVO {
private Long dictCode; private Long dictCode;
private String dictValue;
private String dictLabel;
} }
...@@ -246,6 +246,13 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe ...@@ -246,6 +246,13 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
document.writeCell(item.getKeyPoint(), Element.ALIGN_LEFT, 1, 1, table); document.writeCell(item.getKeyPoint(), Element.ALIGN_LEFT, 1, 1, table);
}); });
} }
if (view.getItems().size() == 0) {
document.writeCell(view.getFileName(), Element.ALIGN_LEFT, 1, 1, table);
document.writeCell(" ", Element.ALIGN_LEFT, 1, 1, table);
document.writeCell(" ", Element.ALIGN_LEFT, 1, 1, table);
document.writeCell(" ", Element.ALIGN_LEFT, 1, 1, table);
document.writeCell(" ", Element.ALIGN_LEFT, 1, 1, table);
}
} }
document.addContent(table); document.addContent(table);
// 最后结尾签字 // 最后结尾签字
......
...@@ -21,10 +21,7 @@ import com.ruoyi.web.request.ReviewEnterpriseArchiveGetInfoRequest; ...@@ -21,10 +21,7 @@ import com.ruoyi.web.request.ReviewEnterpriseArchiveGetInfoRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/** /**
* @author wangfei * @author wangfei
...@@ -57,18 +54,74 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp ...@@ -57,18 +54,74 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
List<ReviewEnterpriseArchiveViewVO> resultList = new ArrayList<>(); List<ReviewEnterpriseArchiveViewVO> resultList = new ArrayList<>();
resultList.addAll( // 原始数据originalList
buildReviewEnterpriseArchiveViewVO(archives, reviewEnterpriseArchiveMapper.findViewItemVOByTaskId(task.getSystemReviewTaskId())) List<ReviewEnterpriseArchiveViewVO> originalList = new ArrayList<>();
);
resultList.addAll( if (task.getSystemReviewTaskId() != null) {
buildReviewEnterpriseArchiveViewVO(archives, reviewEnterpriseArchiveMapper.findViewItemVOByTaskId(task.getCarReviewTaskId())) originalList.addAll(
buildReviewEnterpriseArchiveViewVO(archives, reviewEnterpriseArchiveMapper.findViewItemVOByTaskId(task.getSystemReviewTaskId()))
);
}
if (task.getCarReviewTaskId() != null) {
originalList.addAll(
buildReviewEnterpriseArchiveViewVO(archives, reviewEnterpriseArchiveMapper.findViewItemVOByTaskId(task.getCarReviewTaskId()))
);
}
// 创建一个映射,将文件名作为键,将具有相同文件名的对象列表作为值
Map<String, List<ReviewEnterpriseArchiveViewVO>> map = new HashMap<>();
); // 遍历原始列表,将对象合并到相应的文件名键所对应的值列表中
for (ReviewEnterpriseArchiveViewVO item : originalList) {
String fileName = item.getFileName();
if (!map.containsKey(fileName)) {
map.put(fileName, new ArrayList<>());
}
map.get(fileName).add(item);
}
// 遍历映射中的值列表,将对象合并到结果列表中
for (List<ReviewEnterpriseArchiveViewVO> itemList : map.values()) {
// 如果有多个对象,合并它们
if (itemList.size() > 1) {
ReviewEnterpriseArchiveViewVO mergedItem = mergeItems(itemList);
resultList.add(mergedItem);
} else {
resultList.addAll(itemList);
}
}
return resultList; return resultList;
} }
/**
* 合并具有相同文件名的对象
* @param itemList
* @return
*/
private static ReviewEnterpriseArchiveViewVO mergeItems(List<ReviewEnterpriseArchiveViewVO> itemList) {
// 创建一个新的 ReviewEnterpriseArchiveViewVO 对象来保存合并后的结果
ReviewEnterpriseArchiveViewVO mergedItem = new ReviewEnterpriseArchiveViewVO();
// 由于这里 items 列表需要合并,因此需要创建一个新的列表来保存合并后的结果
List<ReviewEnterpriseArchiveViewItemVO> mergedItemList = new ArrayList<>();
// 遍历 itemList 列表,将所有的 items 合并到 mergedItemList 中
for (ReviewEnterpriseArchiveViewVO item : itemList) {
mergedItemList.addAll(item.getItems());
}
// 将合并后的 items 设置到 mergedItem 中
mergedItem.setItems(mergedItemList);
// 对于其他属性,这里简单地选择第一个对象中的值作为合并后的结果
mergedItem.setId(itemList.get(0).getId());
mergedItem.setFileName(itemList.get(0).getFileName());
return mergedItem;
}
@Override @Override
public Long addEnterpriseArchive(ReviewEnterpriseArchive reviewEnterpriseArchive) { public Long addEnterpriseArchive(ReviewEnterpriseArchive reviewEnterpriseArchive) {
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
<result property="dictCode" column="dict_code" jdbcType="BIGINT"/> <result property="dictCode" column="dict_code" jdbcType="BIGINT"/>
</resultMap> </resultMap>
<select id="getListByStandardId" resultType="com.ruoyi.domain.vo.DictDataVO"> <select id="getListByStandardId" resultType="com.ruoyi.domain.vo.DictDataVO">
SELECT dict_code FROM t_standard_inspection_item_relation SELECT sir.dict_code, dict_value as dictValue, dict_label as dictLabel FROM t_standard_inspection_item_relation sir
LEFT JOIN sys_dict_data sdt on sdt.dict_code = sir.dict_code
WHERE standard_id = #{standardId} WHERE standard_id = #{standardId}
</select> </select>
<select id="getListByStandard" resultType="com.ruoyi.domain.StandardInspectionItemRelation"> <select id="getListByStandard" resultType="com.ruoyi.domain.StandardInspectionItemRelation">
......
...@@ -205,7 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -205,7 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="loginDate != null">login_date = #{loginDate},</if> <if test="loginDate != null">login_date = #{loginDate},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="signaturePicture != null">signature_picture = #{signaturePicture},</if> <if test="signaturePicture != null and signaturePicture != ''">signature_picture = #{signaturePicture},</if>
update_time = sysdate() update_time = sysdate()
</set> </set>
where user_id = #{userId} where user_id = #{userId}
......
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