Commit a09a4a7e authored by 刘林's avatar 刘林

fix(JG):设备移交详情Bug修改

parent 58fa46ac
...@@ -471,12 +471,29 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto, ...@@ -471,12 +471,29 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
if (Objects.isNull(equipTransfer)) if (Objects.isNull(equipTransfer))
return null; return null;
return Stream.concat(createEquipTransferInfo(equipTransfer).entrySet().stream(),
baseMapper.queryEquipInformation(sequenceNbr).get(0).entrySet().stream()) String[] fields = {"productPhoto", "designDoc", "designStandard", "factoryStandard",
"productQualityYieldProve", "insUseMaintainExplain", "inspectReport",
"proxyStatementAttachment", "installContractAttachment"};
List<Map<String, Object>> equipmentInfos = this.baseMapper.queryEquipInformation(sequenceNbr);
Map<String, Object> equipTransferInfo = createEquipTransferInfo(equipTransfer);
handleJsonArrayFields(equipTransferInfo, fields);
handleJsonArrayFields(equipmentInfos.get(0), fields);
return Stream.concat(equipTransferInfo.entrySet().stream(),
equipmentInfos.get(0).entrySet().stream())
.filter(entry -> entry.getValue() != null) .filter(entry -> entry.getValue() != null)
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (existing, replacement) -> existing)); .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (existing, replacement) -> existing));
} }
private void handleJsonArrayFields(Map<String, Object> map, String[] fields) {
for (String field : fields) {
map.computeIfPresent(field, (key, value) -> JSON.parseArray(value.toString()));
}
}
/** /**
* 插入代办 * 插入代办
*/ */
......
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