Selaa lähdekoodia

查询建筑时接口报错问题修复

linhuili 3 vuotta sitten
vanhempi
commit
5b37a99af5

+ 5 - 3
src/main/java/com/persagy/proxy/adm/controller/AdmDictController.java

@@ -3,6 +3,7 @@ package com.persagy.proxy.adm.controller;
 import cn.hutool.core.collection.CollUtil;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmDictConstant;
+import com.persagy.proxy.adm.constant.enums.AdmDictCategoryEnum;
 import com.persagy.proxy.adm.model.*;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
@@ -159,7 +160,7 @@ public class AdmDictController {
     }
 
     /**
-     * 查询项目下已有的设备类型带系统(废弃:数据中心无此接口)
+     * 查询项目下已有的设备类型带系统
      * @param projectId
      * @param request
      * @return
@@ -168,10 +169,11 @@ public class AdmDictController {
     @PostMapping("/system/equip/category")
     @Deprecated
     public AdmResponse querySystemEquipCategory(@QueryParam("projectId") String projectId,
-                                 @RequestBody AdmDictQueryCriteria request) throws Exception {
+                                 @RequestBody AdmDict request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        return AdmResponse.success(new ArrayList<>());
+        request.setType(AdmDictCategoryEnum.SYSTEM_EQUIP.getValue());
+        return service.queryCategory(context,request,AdmObjectType.class);
     }
 
     /**

+ 6 - 2
src/main/java/com/persagy/proxy/adm/controller/ComponentBuildingController.java

@@ -115,8 +115,9 @@ public class ComponentBuildingController {
 			result.put("objectType", master.getObjType());
 			result.put("projectId", master.getProjectId());
 			result.put("infos", master.getInfos());
-			result.put("createTime", master.getCreationTime() == null ? null : master.getCreationTime().toString("yyyy-DD-MM 24HH:mm:ss"));
-			result.put("lastUpdate", master.getModifiedTime() == null ? null : master.getModifiedTime().toString("yyyy-DD-MM 24HH:mm:ss"));
+
+			result.put("createTime", master.getCreationTime() == null ? null : master.getCreationTime().toString("yyyy-MM-dd HH:mm:ss"));
+			result.put("lastUpdate", master.getModifiedTime() == null ? null : master.getModifiedTime().toString("yyyy-MM-dd HH:mm:ss"));
 			result.put("statistics", new JSONObject());
 			
 			List<ObjectDigital> slaveObjs = master.getRelObjs();
@@ -124,6 +125,9 @@ public class ComponentBuildingController {
 				// 遍历所有的从对象
 				for (ObjectDigital slave : slaveObjs) {
 					ObjectNode infos = slave.getInfos();
+					if(infos == null){
+						continue;
+					}
 					String outline = infos.get("outline") == null ? null : infos.get("outline").asText();
 					String modelFile = infos.get("modelFile") == null ? null : infos.get("modelFile").asText();
 					if (StrUtil.isEmpty(outline) && StrUtil.isNotBlank(modelFile)) {