|
@@ -148,15 +148,20 @@ public class AdmReportEquipController {
|
|
|
if(JSONUtil.isNull(criteria)){
|
|
|
return AdmResponse.failure("请求参数错误");
|
|
|
}
|
|
|
- JsonNode euipId = criteria.get("id");
|
|
|
+ final String KEY="id";
|
|
|
+ if (!criteria.has(KEY)
|
|
|
+ || !criteria.get(KEY).isTextual()){
|
|
|
+ return AdmResponse.success();
|
|
|
+ }
|
|
|
RequestData requestData = new RequestData();
|
|
|
- requestData.setEquipmentId(String.valueOf(euipId));
|
|
|
- List result = DigitalObjectSimpleFacade.queryComponentsCountByEquipId(AdmContextUtil.toDmpContext().getGroupCode(), AdmContextUtil.toDmpContext().getProjectId(), AdmContextUtil.toDmpContext().getAppId(),null,requestData);
|
|
|
- if(CollUtil.isNotEmpty(result)){
|
|
|
- return AdmResponse.success(result);
|
|
|
- }else{
|
|
|
+ requestData.setEquipmentId(criteria.get(KEY).asText());
|
|
|
+ InstanceUrlParam context = AdmContextUtil.toDmpContext();
|
|
|
+ List<Map<String, Object>> result = DigitalObjectSimpleFacade.queryComponentsCountByEquipId(context.getGroupCode(),
|
|
|
+ context.getProjectId(), context.getAppId(),null,requestData);
|
|
|
+ if(CollUtil.isEmpty(result)){
|
|
|
return AdmResponse.success();
|
|
|
}
|
|
|
+ return AdmResponse.success(result);
|
|
|
}
|
|
|
|
|
|
|