Commit 2385740f authored by chenzhao's avatar chenzhao

修改使用登记表bug

parent 9a092c40
......@@ -2280,7 +2280,7 @@ public class CommonServiceImpl implements ICommonService {
formData.put("productName", formData.getString("projectContraption"));
}
//单位模版 部分字段需从设备列表中获取
if (formData.containsKey("equipmentLists") && manageType.equals(UNIT) ){
if (formData.containsKey("equipmentLists") ){
JSONArray equipmentLists = formData.getJSONArray("equipmentLists");
List<Map<String, Object>> equips = equipmentLists.stream()
.filter(obj -> obj instanceof Map)
......@@ -2290,7 +2290,27 @@ public class CommonServiceImpl implements ICommonService {
formData.put("equNum",equipmentLists.size());
//设备品种
formData.put("equDefine",equips.get(0).get("equDefineName"));
}else if (manageType.equals(UNIT) && !CollectionUtils.isEmpty(equips)){
Set<String> productNameSet = equips.stream()
.filter(Objects::nonNull) // 过滤掉equip为null的情况
.map(e -> e.get("productName")) // 获取productName
.filter(Objects::nonNull) // 过滤掉productName为null的情况
.map(Object::toString) // 转换为String类型
.collect(Collectors.toSet()); // 收集到Set中
// 将set转成字符串逗号拼接
String productName="";
List<String> sortedProductNameList = new
ArrayList<>(productNameSet);
if (sortedProductNameList.size() > 3
) {
productName = String.join(",", sortedProductNameList.subList(0, 3)) + ",...";
} else
{
productName = String.join(",", sortedProductNameList);
}
formData.put("productName",equips.get(0).get("productName"));
}else if (manageType.equals(VEHICLE) && !CollectionUtils.isEmpty(equips)){
//气瓶数量
formData.put("gasNum",equips.size());
//设备品种
......
......@@ -2191,7 +2191,7 @@
<w:spacing w:val="-1"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr>
<w:t>${(resultNo)!''}</w:t>
<w:t>${(inspectReportNo)!''}</w:t>
</w:r>
</w:p>
</w:tc>
......
......@@ -543,7 +543,7 @@
<w:sz w:val="21"/>
<w:sz-cs w:val="21"/>
</w:rPr>
<w:t>${(registrationType)!''}</w:t>
<w:t>${(registrationType)!'新设备首次启用'}</w:t>
</w:r>
</w:p>
<w:p>
......
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