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

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

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