update
This commit is contained in:
@@ -499,12 +499,16 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
|||||||
List<JSONObject> jsonArray = JSON.parseArray(testEquipment, JSONObject.class);
|
List<JSONObject> jsonArray = JSON.parseArray(testEquipment, JSONObject.class);
|
||||||
for (int i = 0; i < jsonArray.size(); i++) {
|
for (int i = 0; i < jsonArray.size(); i++) {
|
||||||
JSONObject o = jsonArray.get(i);
|
JSONObject o = jsonArray.get(i);
|
||||||
strings.add(new String[] {(strings.size()) + "", Optional.ofNullable(
|
String equipmentId = Optional.ofNullable(o.getString("managementNo")).orElse("");
|
||||||
o.getString("equipment_name")).orElse(""),
|
if (StringUtils.isBlank(equipmentId)) {
|
||||||
Optional.ofNullable(o.getString("managementNo")).orElse(""), Optional.ofNullable(
|
continue;
|
||||||
o.getString("lifespan")).orElse(""), Optional.ofNullable(
|
}
|
||||||
o.getString("roomNo")).orElse(
|
Equipment equipment = equipmentService.getById(equipmentId);
|
||||||
""),});
|
if (Objects.isNull(equipment)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
strings.add(new String[] {(strings.size()) + "", equipment.getName(),
|
||||||
|
equipment.getManagementNo(), equipment.getExpireDate(), equipment.getRoomNo(),});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -583,14 +587,20 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
|||||||
for (int i = 0; i < jsonArray.size(); i++) {
|
for (int i = 0; i < jsonArray.size(); i++) {
|
||||||
JSONObject o = jsonArray.get(i);
|
JSONObject o = jsonArray.get(i);
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
|
String equipmentId = Optional.ofNullable(o.getString("managementNo")).orElse("");
|
||||||
|
if (StringUtils.isBlank(equipmentId)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Equipment equipment = equipmentService.getById(equipmentId);
|
||||||
|
if (Objects.isNull(equipment)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
params.put("index", (list.size()) + "");
|
params.put("index", (list.size()) + "");
|
||||||
params.put("设备名称", Optional.ofNullable(
|
params.put("设备名称", equipment.getName());
|
||||||
o.getString("equipment_name")).orElse(""));
|
params.put("管理编号", equipment.getManagementNo());
|
||||||
params.put("管理编号", Optional.ofNullable(o.getString("managementNo")).orElse(""));
|
|
||||||
params.put("使用日期", experiment.getStartDate());
|
params.put("使用日期", experiment.getStartDate());
|
||||||
params.put("归还日期", experiment.getEndDate());
|
params.put("归还日期", experiment.getEndDate());
|
||||||
params.put("计量有效期", Optional.ofNullable(
|
params.put("计量有效期", equipment.getExpireDate());
|
||||||
o.getString("lifespan")).orElse(""));
|
|
||||||
params.put("异常记录", "");
|
params.put("异常记录", "");
|
||||||
list.add(params);
|
list.add(params);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user