Browse Source

设备台账->部件不展示问题修复

linhuili 3 years ago
parent
commit
f58ad2fc72

+ 7 - 0
src/main/java/com/persagy/proxy/report/controller/AdmReportEquipController.java

@@ -87,6 +87,7 @@ public class AdmReportEquipController {
         cascade.add(cascadeSys);
         request.setCascade(cascade);
         AdmResponse admResponse = equipmentService.query(request);
+        Boolean showComponentFlag = false;
         List<AdmEquipment> equipmentList = (List<AdmEquipment>) admResponse.getContent();
         if(CollUtil.isNotEmpty(equipmentList)){
             equipmentList.stream().forEach(equip -> {
@@ -116,6 +117,9 @@ public class AdmReportEquipController {
             AdmResponse defRes = dictService.doQueryObjectType(AdmContextUtil.toDmpContext(), defineCriteria, AdmObjectType.class);
             if (CollUtil.isNotEmpty(defRes.getContent())) {
                 List<AdmObjectType> componentCategory = (List<AdmObjectType>) defRes.getContent();
+                if(CollUtil.isNotEmpty(componentCategory)){
+                    showComponentFlag = true;
+                }
                 admEquipment.setComponentCategory(componentCategory);
                 equipmentList.set(0, admEquipment);
             }
@@ -124,6 +128,9 @@ public class AdmReportEquipController {
         }
         AdmResponse response = AdmResponse.success(equipmentList, request);
         response.setTotal(admResponse.getTotal());
+        if(showComponentFlag){
+            response.setMessage("1");
+        }
         return response;
     }