|
@@ -86,25 +86,29 @@ public class AdmReportEquipController {
|
|
request.setCascade(cascade);
|
|
request.setCascade(cascade);
|
|
AdmResponse admResponse = equipmentService.doQuery(AdmContextUtil.toDmpContext(), request, AdmEquipment.class);
|
|
AdmResponse admResponse = equipmentService.doQuery(AdmContextUtil.toDmpContext(), request, AdmEquipment.class);
|
|
List<AdmEquipment> equipmentList = (List<AdmEquipment>) admResponse.getContent();
|
|
List<AdmEquipment> equipmentList = (List<AdmEquipment>) admResponse.getContent();
|
|
- equipmentList.stream().forEach(equip -> {
|
|
|
|
- if (CollUtil.isNotEmpty(equip.getComponent())) {
|
|
|
|
- equip.setCount(equip.getComponent().size());
|
|
|
|
- equip.setComponent(null);
|
|
|
|
- } else {
|
|
|
|
- equip.setCount(0);
|
|
|
|
|
|
+ if(CollUtil.isNotEmpty(equipmentList)){
|
|
|
|
+ equipmentList.stream().forEach(equip -> {
|
|
|
|
+ if (CollUtil.isNotEmpty(equip.getComponent())) {
|
|
|
|
+ equip.setCount(equip.getComponent().size());
|
|
|
|
+ equip.setComponent(null);
|
|
|
|
+ } else {
|
|
|
|
+ equip.setCount(0);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ //查询设备的类型信息,取list中的第一个数据
|
|
|
|
+ AdmEquipment admEquipment = equipmentList.get(0);
|
|
|
|
+ QueryCriteria defineCriteria = new QueryCriteria();
|
|
|
|
+ ObjectNode criteria = JsonNodeFactory.instance.objectNode();
|
|
|
|
+ criteria.put("code", admEquipment.getClassCode());
|
|
|
|
+ defineCriteria.setCriteria(criteria);
|
|
|
|
+ AdmResponse defRes = dictService.doQueryObjectType(AdmContextUtil.toDmpContext(), defineCriteria, AdmObjectType.class);
|
|
|
|
+ if (CollUtil.isNotEmpty(defRes.getContent())) {
|
|
|
|
+ List<AdmObjectType> componentCategory = (List<AdmObjectType>) defRes.getContent();
|
|
|
|
+ admEquipment.setComponentCategory(componentCategory);
|
|
|
|
+ equipmentList.set(0, admEquipment);
|
|
}
|
|
}
|
|
- });
|
|
|
|
- //查询设备的类型信息,取list中的第一个数据
|
|
|
|
- AdmEquipment admEquipment = equipmentList.get(0);
|
|
|
|
- QueryCriteria defineCriteria = new QueryCriteria();
|
|
|
|
- ObjectNode criteria = JsonNodeFactory.instance.objectNode();
|
|
|
|
- criteria.put("code", admEquipment.getClassCode());
|
|
|
|
- defineCriteria.setCriteria(criteria);
|
|
|
|
- AdmResponse defRes = dictService.doQueryObjectType(AdmContextUtil.toDmpContext(), defineCriteria, AdmObjectType.class);
|
|
|
|
- if (CollUtil.isNotEmpty(defRes.getContent())) {
|
|
|
|
- List<AdmObjectType> componentCategory = (List<AdmObjectType>) defRes.getContent();
|
|
|
|
- admEquipment.setComponentCategory(componentCategory);
|
|
|
|
- equipmentList.set(0, admEquipment);
|
|
|
|
|
|
+ }else{
|
|
|
|
+ equipmentList = new ArrayList<>();
|
|
}
|
|
}
|
|
return AdmResponse.success(equipmentList);
|
|
return AdmResponse.success(equipmentList);
|
|
}
|
|
}
|