Commit fb900c25 by 杨卫

feat:检测逻辑修改:检测项值比对valueKey的null与空串等同,h5输入null,pc输入空串导致两边值不对等

1 parent f0daa6a6
...@@ -335,11 +335,11 @@ public class InspectionEditLogService { ...@@ -335,11 +335,11 @@ public class InspectionEditLogService {
List<InspectionResultSnapshotVO.ValueItem> oldValueList = oldEntry.getValues() != null ? oldEntry.getValues() : Collections.emptyList(); List<InspectionResultSnapshotVO.ValueItem> oldValueList = oldEntry.getValues() != null ? oldEntry.getValues() : Collections.emptyList();
List<InspectionResultSnapshotVO.ValueItem> newValueList = newEntry.getValues() != null ? newEntry.getValues() : Collections.emptyList(); List<InspectionResultSnapshotVO.ValueItem> newValueList = newEntry.getValues() != null ? newEntry.getValues() : Collections.emptyList();
Map<String, String> oldValues = oldValueList.stream().collect(Collectors.toMap( Map<String, String> oldValues = oldValueList.stream().collect(Collectors.toMap(
v -> v.getValueKey() + SymbolConsts.SHARP + v.getValueSeq(), v -> StrUtil.nullToEmpty(v.getValueKey()) + SymbolConsts.SHARP + v.getValueSeq(),
v -> StrUtil.nullToEmpty(v.getValueText()), v -> StrUtil.nullToEmpty(v.getValueText()),
(pre, next) -> pre)); (pre, next) -> pre));
Map<String, String> newValues = newValueList.stream().collect(Collectors.toMap( Map<String, String> newValues = newValueList.stream().collect(Collectors.toMap(
v -> v.getValueKey() + SymbolConsts.SHARP + v.getValueSeq(), v -> StrUtil.nullToEmpty(v.getValueKey()) + SymbolConsts.SHARP + v.getValueSeq(),
v -> StrUtil.nullToEmpty(v.getValueText()), v -> StrUtil.nullToEmpty(v.getValueText()),
(pre, next) -> pre)); (pre, next) -> pre));
return !oldValues.equals(newValues); return !oldValues.equals(newValues);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!