Commit 60d9bea7 authored by 韩桐桐's avatar 韩桐桐

fix(jg):导入管道历史设备状态修改

parent 2dbd6189
...@@ -2459,15 +2459,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2459,15 +2459,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
} }
// 填充投用年月 // 填充投用年月
String useDateValue = (String) jsonObject.get("useDate"); String useDateValue = (String) jsonObject.get("useDate");
if(CollectionUtils.isNotEmpty(equipmentLists)){ if (CollectionUtils.isNotEmpty(equipmentLists)) {
for (int i = 0; i < equipmentLists.size(); i++) { equipmentLists = equipmentLists.stream()
JSONObject equipmentItem = equipmentLists.getJSONObject(i); .map(obj -> (JSONObject) obj)
equipmentItem.put("useDate", timeToMonths(useDateValue)); .peek(equipmentItem -> equipmentItem.put("useDate", timeToMonths(useDateValue)))
// 过滤出目前在用的设备 .filter(equipmentItem -> this.checkEquStatusInUse(equipmentItem.getString("record")))
if(!this.checkEquStatusInUse(equipmentItem.getString("record"))){ .collect(Collectors.toCollection(JSONArray::new));
equipmentLists.remove(i);
}
}
allEquipment.addAll(equipmentLists); allEquipment.addAll(equipmentLists);
} }
}); });
......
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