Commit 77c65dca authored by 高滢's avatar 高滢

Merge branch 'dev' of http://gitlab.91isoft.com:90/wangfei/vehicle-quality-review into gaoying

# Conflicts:
#	quality-review/src/main/java/com/ruoyi/service/impl/ReviewEnterpriseArchiveServiceImpl.java
parents 17d6fbfe c8d44fa5
......@@ -6,4 +6,8 @@ import lombok.Data;
public class DictDataVO {
private Long dictCode;
private String dictValue;
private String dictLabel;
}
......@@ -246,6 +246,13 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
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);
// 最后结尾签字
......
......@@ -29,6 +29,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.*;
import static com.ruoyi.common.utils.DateUtils.getNowDate;
......@@ -63,18 +64,74 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
List<ReviewEnterpriseArchiveViewVO> resultList = new ArrayList<>();
resultList.addAll(
// 原始数据originalList
List<ReviewEnterpriseArchiveViewVO> originalList = new ArrayList<>();
if (task.getSystemReviewTaskId() != null) {
originalList.addAll(
buildReviewEnterpriseArchiveViewVO(archives, reviewEnterpriseArchiveMapper.findViewItemVOByTaskId(task.getSystemReviewTaskId()))
);
}
resultList.addAll(
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;
}
/**
* 合并具有相同文件名的对象
* @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
public Long addEnterpriseArchive(ReviewEnterpriseArchive reviewEnterpriseArchive) {
......
......@@ -10,7 +10,8 @@
<result property="dictCode" column="dict_code" jdbcType="BIGINT"/>
</resultMap>
<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}
</select>
<select id="getListByStandard" resultType="com.ruoyi.domain.StandardInspectionItemRelation">
......
......@@ -205,7 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="loginDate != null">login_date = #{loginDate},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</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()
</set>
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