Browse Source

Merge remote-tracking branch 'origin/develop' into develop

liyang 2 years ago
parent
commit
ff98130634
17 changed files with 119 additions and 150 deletions
  1. 1 1
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/controller/AdmDictController.java
  2. 1 1
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/service/impl/AbstractAdmDictBaseServiceImpl.java
  3. 4 11
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/service/impl/AdmDictServiceImpl.java
  4. 26 10
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/MigrationAbstractServiceImpl.java
  5. 16 10
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/ObjectDigitalMigration.java
  6. 8 6
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/ObjectRelationMigration.java
  7. 9 8
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/object/controller/AdmSpaceController.java
  8. 0 36
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/common/AdmResult.java
  9. 8 7
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/AdmFileController.java
  10. 14 20
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/AppController.java
  11. 4 3
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/ManageController.java
  12. 18 17
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/ToolController.java
  13. 4 4
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/db/AdmCad.java
  14. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/db/AdmProblem.java
  15. 4 4
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/CallException.java
  16. 1 2
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/ServiceUtil.java
  17. 0 9
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/SyncAppImpl.java

+ 1 - 1
adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/controller/AdmDictController.java

@@ -1,7 +1,7 @@
 package com.persagy.proxy.dictionary.controller;
 
 import cn.hutool.core.collection.CollUtil;
-import com.persagy.dmp.define.entity.ObjectInfoCollect;
+import com.persagy.dmp.delivery.entity.ObjectInfoCollect;
 import com.persagy.proxy.adm.constant.AdmDictCategoryEnum;
 import com.persagy.proxy.adm.constant.AdmDictConstant;
 import com.persagy.proxy.adm.request.AdmCreateRequest;

+ 1 - 1
adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/service/impl/AbstractAdmDictBaseServiceImpl.java

@@ -11,7 +11,7 @@ import com.persagy.dmp.basic.utils.JsonNodeUtils;
 import com.persagy.dmp.common.constant.ValidEnum;
 import com.persagy.dmp.common.context.AppContext;
 import com.persagy.dmp.common.utils.JsonHelper;
-import com.persagy.dmp.define.entity.ObjectInfoCollect;
+import com.persagy.dmp.delivery.entity.ObjectInfoCollect;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmDictConstant;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;

+ 4 - 11
adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/service/impl/AdmDictServiceImpl.java

@@ -6,11 +6,9 @@ import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.define.entity.ObjectInfoCollect;
-import com.persagy.proxy.adm.constant.AdmCommonConstant;
+import com.persagy.dmp.delivery.entity.ObjectInfoCollect;
 import com.persagy.proxy.adm.constant.AdmDictConstant;
 import com.persagy.proxy.adm.constant.AdmDictCategoryEnum;
-import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
 import com.persagy.proxy.adm.request.AdmDictQueryCriteria;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
@@ -19,14 +17,9 @@ import com.persagy.proxy.dictionary.model.*;
 import com.persagy.proxy.dictionary.service.IAdmDictService;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
 import com.persagy.proxy.object.model.*;
-import com.persagy.proxy.object.service.IAdmEquipmentService;
-import com.persagy.proxy.object.service.IAdmShaftService;
-import com.persagy.proxy.object.service.IAdmSpaceService;
-import com.persagy.proxy.object.service.IAdmSystemService;
 import lombok.EqualsAndHashCode;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.*;
@@ -307,7 +300,7 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
             infoCollect.setDefineInfoId(funcIdGather.getId());
             infoCollect.setClassCode(funcIdGather.getClassCode());
             infoCollect.setCode(funcIdGather.getCode());
-            infoCollect.setVisiable(funcIdGather.getVisible());
+            infoCollect.setIsDelivery(funcIdGather.getVisible());
             infoCollect.setKeyWord(funcIdGather.getKeyWord());
             list.add((T) infoCollect);
         }
@@ -457,7 +450,7 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
             if(CollUtil.isNotEmpty(objectInfoCollectMap)){
                 ObjectInfoCollect collect = objectInfoCollectMap.get(id);
                 if(collect != null){
-                    visiable = collect.getVisiable();
+                    visiable = collect.getIsDelivery();
                     admObjectInfo.setKeyWord(collect.getKeyWord());
                 }
             }
@@ -497,7 +490,7 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
             if(CollUtil.isNotEmpty(objectInfoCollectMap)){
                 ObjectInfoCollect collect = objectInfoCollectMap.get(id);
                 if(collect!=null){
-                    visiable = collect.getVisiable();
+                    visiable = collect.getIsDelivery();
                     admObjectInfo.setKeyWord(collect.getKeyWord());
                 }
             }

+ 26 - 10
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/MigrationAbstractServiceImpl.java

@@ -242,6 +242,9 @@ public class MigrationAbstractServiceImpl<T> implements IMigrationAbstractServic
                         || fieldKey.equals(AuditableEntity.DO_PROP_MODIFIEDTIME)
                         || fieldKey.equals(AuditableEntity.PROP_MODIFIER)
                         || fieldKey.equals(BaseEntity.PROP_TS)
+                        || fieldKey.equals("createApp")
+                        || fieldKey.equals("updateApp")
+                        || fieldKey.equals(BaseEntity.PROP_TS)
                         || fieldKey.equals("dataSource")
                 ){
                     continue;
@@ -295,7 +298,7 @@ public class MigrationAbstractServiceImpl<T> implements IMigrationAbstractServic
         }else{
             int count= vos.size() / MigrationConstant.BATCH_SUBMIT_DATA_COUNT;
             for(int k = 0; k< count + 1 ;k++){
-                int end = (k+1)  * MigrationConstant.BATCH_SUBMIT_DATA_COUNT - 1;
+                int end = (k+1)  * MigrationConstant.BATCH_SUBMIT_DATA_COUNT;
                 if(end > vos.size()){
                     end = vos.size();
                 }
@@ -349,11 +352,6 @@ public class MigrationAbstractServiceImpl<T> implements IMigrationAbstractServic
         if(CollUtil.isEmpty(difference)){
             return null;
         }
-        /*difference.forEach(set1 -> System.out.println(set1));
-        System.out.println("-------------------------------------------------------------------------");
-        Sets.SetView<String> difference2 = Sets.difference(toSets, formSets);
-        difference2.forEach(set2 -> System.out.println(set2));*/
-
         Set<String> diff = difference.stream().map(entity -> StrUtil.subBefore(entity, MigrationConstant.SPLITER_UNION, true)).collect(Collectors.toSet());
         Map<String, Object> results = getValueForMapByKeys(diff, from);
         return results;
@@ -391,16 +389,34 @@ public class MigrationAbstractServiceImpl<T> implements IMigrationAbstractServic
         return syncDataList;
     }
 
+    /**
+     * 调用中台接口,保存迁移日志
+     * 日志量 > MigrationConstant.BATCH_SUBMIT_DATA_COUNT 使用分页插入
+     *
+     * @param context
+     * @param syncDataList
+     * @return
+     */
     @Override
     public List<SyncData> addSynLog(InstanceUrlParam context, List<SyncData> syncDataList) {
         if(CollUtil.isEmpty(syncDataList)){
             return Collections.emptyList();
         }
+        //List<SyncData> syncDatasResult = new ArrayList<>(syncDataList.size());
         // 调用中台新增
-        List<SyncData> syncDatas = DigitalMigrateLogFacade.create(context.getGroupCode(),context.getProjectId(),context.getAppId(), context.getUserId(), syncDataList);
-
-        if(CollUtil.isEmpty(syncDatas)) {
-            throw new RuntimeException("调用中台更新迁移日志出错");
+        if(syncDataList.size() - MigrationConstant.BATCH_SUBMIT_DATA_COUNT < 0){
+            DigitalMigrateLogFacade.create(context.getGroupCode(),context.getProjectId(),context.getAppId(), context.getUserId(), syncDataList);
+        }else{
+            int count= syncDataList.size() / MigrationConstant.BATCH_SUBMIT_DATA_COUNT;
+            for(int k = 0; k < count + 1 ;k++){
+                int end = (k+1)  * MigrationConstant.BATCH_SUBMIT_DATA_COUNT;
+                if(end > syncDataList.size()){
+                    end = syncDataList.size();
+                }
+                List syncData = syncDataList.subList(k * MigrationConstant.BATCH_SUBMIT_DATA_COUNT, end);
+                //syncDatasResult.addAll(DigitalMigrateLogFacade.create(context.getGroupCode(),context.getProjectId(),context.getAppId(), context.getUserId(), syncData));
+                DigitalMigrateLogFacade.create(context.getGroupCode(),context.getProjectId(),context.getAppId(), context.getUserId(), syncData);
+            }
         }
         return syncDataList;
     }

+ 16 - 10
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/ObjectDigitalMigration.java

@@ -191,6 +191,7 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
      *
      */
     private void startMigrateForLog(InstanceUrlParam context, MigrationInfo migrationInfo, QueryCriteria queryCriteria) {
+        List<SyncData> syncDataList = new ArrayList<>();
         List<ObjectNode> admData = getAdmData(context,queryCriteria);
 
         String queryUrl = requestUrl(context, migrationInfo, MigrationType.QUERY.getCode());
@@ -201,12 +202,17 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
             log.error(" ######################### dt_object adm已交付:"+ ResponseCode.C0320.getDesc() +" 同步结束 #########################");
         }
 
+        //因获取的数据均有主键 使用更新
         String insertUrl = requestUrl(context, migrationInfo, MigrationType.CREATE.getCode());
         if(CollUtil.isEmpty(projObjectNodeList)){
-            DataMigrationResponse dataMigrationResponse = insertBatch(admData, ObjectDigital.class, insertUrl);
-            List<SyncData> syncDataList = processDataForLog(dataMigrationResponse, MigrationType.CREATE.getCode());
+            //调用中台验证待新增的数据
+            List<ObjectDigital> digitalList = validateInfoCode(admData, context);
             //处理并保存日志
-            super.addSynLog(context, syncDataList);
+            syncDataList.addAll(processDataForLog(DataMigrationResponse.success(digitalList), MigrationType.CREATE.getCode()));
+
+            DataMigrationResponse dataMigrationResponse = insertBatch(admData, ObjectDigital.class, insertUrl);
+            syncDataList.addAll(processDataForLog(dataMigrationResponse, MigrationType.CREATE.getCode()));
+
         }
         Map<String,Object> projectMap = toEntityMap(projObjectNodeList, ObjectDigital.class);
         Map<String,Object> admMap = toEntityMap(admData, ObjectDigital.class);
@@ -217,13 +223,12 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
             //调用中台验证待新增的数据
             List<ObjectDigital> digitalList = validateInfoCode(insertData, context);
             //将验证结果放到日志
-            //处理并保存日志
-            super.addSynLog(context,processDataForLog(DataMigrationResponse.success(digitalList), MigrationType.CREATE.getCode()));
+            syncDataList.addAll(processDataForLog(DataMigrationResponse.success(digitalList), MigrationType.CREATE.getCode()));
 
             //插入数据
             DataMigrationResponse dataMigrationResponse = insertBatch(insertData, ObjectDigital.class, insertUrl);
             //处理并保存日志
-            super.addSynLog(context,processDataForLog(dataMigrationResponse, MigrationType.CREATE.getCode()));
+            syncDataList.addAll(processDataForLog(dataMigrationResponse, MigrationType.CREATE.getCode()));
         }
 
         //差集 删除
@@ -237,7 +242,7 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
             List<ObjectNode> delObjs = toListByIds(successIds, projObjectNodeList);
             dataMigrationResponse.setData(delObjs);
             //处理并保存日志
-            super.addSynLog(context,processDataForLog(dataMigrationResponse, MigrationType.DELETE.getCode()));
+            syncDataList.addAll(processDataForLog(dataMigrationResponse, MigrationType.DELETE.getCode()));
         }
 
         //交集更新
@@ -251,15 +256,17 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
                 //调用中台验证待更新的数据
                 List<ObjectDigital> digitalList = validateInfoCode(updateData, context);
                 //将验证结果放到日志并保存
-                super.addSynLog(context,processDataForLog(DataMigrationResponse.success(digitalList), MigrationType.UPDATE.getCode()));
+                syncDataList.addAll(processDataForLog(DataMigrationResponse.success(digitalList), MigrationType.UPDATE.getCode()));
 
                 //更新
                 String updateUrl = requestUrl(context, migrationInfo, MigrationType.UPDATE.getCode());
                 DataMigrationResponse dataMigrationResponse = updateBatch(updateData, ObjectDigital.class, updateUrl);
                 //处理并保存日志
-                super.addSynLog(context,processDataForLog(dataMigrationResponse, MigrationType.UPDATE.getCode()));
+                syncDataList.addAll(processDataForLog(dataMigrationResponse, MigrationType.UPDATE.getCode()));
             }
         }
+        //处理并保存日志
+        super.addSynLog(context, syncDataList);
     }
 
     /**
@@ -275,7 +282,6 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
         List<ObjectNode> objectNodeList = JsonNodeUtils.toListNode(projectData, null, null);
 
         if(CollUtil.isEmpty(admData)){
-            log.error(" ######################### dt_object adm已交付:"+ ResponseCode.C0320.getDesc() +" 同步结束 #########################");
             return Collections.emptyList();
         }
 

+ 8 - 6
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/ObjectRelationMigration.java

@@ -319,6 +319,7 @@ public class ObjectRelationMigration extends MigrationAbstractServiceImpl<Object
     }
 
     private void startMigrateForLog(InstanceUrlParam context, MigrationInfo migrationInfo, String code){
+        List<SyncData> syncDataList = new ArrayList<>();
         QueryCriteria queryCriteria = getQueryCriteria(code);
         List<ObjectRelation> admRelations = getAdmData(context, queryCriteria);
 
@@ -331,9 +332,8 @@ public class ObjectRelationMigration extends MigrationAbstractServiceImpl<Object
         String insertUrl = requestUrl(context, migrationInfo, MigrationType.CREATE.getCode());
         if(CollUtil.isEmpty(projectRelations)){
             DataMigrationResponse dataMigrationResponse = insertBatch(admRelations, ObjectRelation.class, insertUrl);
-            List<SyncData> syncDataList = processDataForLog(dataMigrationResponse, MigrationType.CREATE.getCode());
-            //处理并保存日志
-            super.addSynLog(context,syncDataList);
+            syncDataList = processDataForLog(dataMigrationResponse, MigrationType.CREATE.getCode());
+
         }
         List<ObjectNode> objectNodeListPro = JsonNodeUtils.toListNode(projectRelations, null, null);
         Map<String,Object> projectDefineMap = toEntityMap(objectNodeListPro, ObjectRelation.class);
@@ -346,7 +346,7 @@ public class ObjectRelationMigration extends MigrationAbstractServiceImpl<Object
             List<ObjectRelation> insertData = toList(doSubtractFromInsert, admRelations);
             DataMigrationResponse dataMigrationResponse = insertBatch(insertData, ObjectRelation.class, insertUrl);
             //处理并保存日志
-            super.addSynLog(context,processDataForLog(dataMigrationResponse, MigrationType.CREATE.getCode()));
+            syncDataList.addAll(processDataForLog(dataMigrationResponse, MigrationType.CREATE.getCode()));
         }
 
         //差集 删除
@@ -357,7 +357,7 @@ public class ObjectRelationMigration extends MigrationAbstractServiceImpl<Object
             //处理删除的数据
             DataMigrationResponse dataMigrationResponse = deleteBatch(deleteIds, delUrl);
             //处理并保存日志
-            super.addSynLog(context,processDataForLog(dataMigrationResponse, MigrationType.DELETE.getCode()));
+            syncDataList.addAll(processDataForLog(dataMigrationResponse, MigrationType.DELETE.getCode()));
         }
 
         //交集更新
@@ -370,9 +370,11 @@ public class ObjectRelationMigration extends MigrationAbstractServiceImpl<Object
                 String updateUrl = requestUrl(context, migrationInfo, MigrationType.UPDATE.getCode());
                 DataMigrationResponse dataMigrationResponse = updateBatch(updateData, ObjectRelation.class, updateUrl);
                 //处理并保存日志
-                super.addSynLog(context,processDataForLog(dataMigrationResponse, MigrationType.UPDATE.getCode()));
+                syncDataList.addAll(processDataForLog(dataMigrationResponse, MigrationType.UPDATE.getCode()));
             }
         }
+        //处理并保存日志
+        super.addSynLog(context,syncDataList);
     }
 
 

+ 9 - 8
adm-business/adm-middleware/src/main/java/com/persagy/proxy/object/controller/AdmSpaceController.java

@@ -18,6 +18,7 @@ import com.persagy.proxy.adm.request.*;
 import com.persagy.proxy.adm.service.IAdmRelationService;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
 import com.persagy.proxy.adm.utils.ObjectNameUtil;
+import com.persagy.proxy.common.entity.DmpResult;
 import com.persagy.proxy.common.entity.RelationDTO;
 import com.persagy.proxy.object.model.AdmBuilding;
 import com.persagy.proxy.object.model.AdmFloor;
@@ -200,11 +201,6 @@ public class AdmSpaceController {
         AdmQueryCriteria criteriaFloor = new AdmQueryCriteria();
         criteriaFloor.setName(AdmFloor.OBJ_TYPE);
 
-        AdmQueryCriteria criteriaSpace = new AdmQueryCriteria();
-        criteriaSpace.setName("spaceList");
-        criteriaSpace.setFilters("state = 1");
-
-        criteriaFloor.setCascade(CollUtil.newArrayList(criteriaSpace));
         criteriaFloor.setOrders("floorSequenceID desc");
         request.setCascade(CollUtil.newArrayList(criteriaFloor));
         AdmResponse response = buildingService.doQueryBuildingFloor(AdmContextUtil.toDmpContext(), request);
@@ -213,9 +209,14 @@ public class AdmSpaceController {
             if(CollUtil.isNotEmpty(building.getFloor())){
                 List<AdmFloor> floors = building.getFloor();
                 floors.forEach(floor -> {
-                    if(CollUtil.isNotEmpty(floor.getSpaceList())){
-                        floor.setCount(floor.getSpaceList().size());
-                        floor.setSpaceList(null);
+                    AdmQueryCriteria criteriaSpace = new AdmQueryCriteria();
+                    criteriaSpace.setName(AdmSpace.OBJ_TYPE);
+                    criteriaSpace.setFilters("state = 1");
+                    criteriaSpace.addFilters("floorId = '" + floor.getId()+"'");
+                    criteriaSpace.setOnlyCount(true);
+                    AdmResponse admResponseSpace = service.query(criteriaSpace);
+                    if(admResponseSpace.getResult().equals(DmpResult.SUCCESS) && admResponseSpace.getCount() > 0){
+                        floor.setCount(admResponseSpace.getCount().intValue());
                     }else{
                         floor.setCount(0);
                     }

+ 0 - 36
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/common/AdmResult.java

@@ -1,36 +0,0 @@
-package com.persagy.adm.server.custom.common;
-
-import com.persagy.dmp.common.constant.ResponseCode;
-import com.persagy.dmp.common.model.response.CommonResult;
-import lombok.Data;
-
-@Data
-public class AdmResult<T> {
-
-	private String code;
-
-	private String message;
-
-	private T data;
-
-	public AdmResult(String code, String message) {
-		this(code, message, null);
-	}
-
-	public AdmResult(String code, String message, T data) {
-		this.code = code;
-		this.message = message;
-		this.data = data;
-	}
-
-	public AdmResult(CommonResult<T> commonResult) {
-		this.code = commonResult.getResult();
-		this.message = commonResult.getMessage();
-		this.data = commonResult.getData();
-	}
-
-	public static <T> AdmResult<T> success(T data){
-		return new AdmResult<>(ResponseCode.A00000.getCode(), null, data);
-	}
-
-}

+ 8 - 7
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/AdmFileController.java

@@ -3,10 +3,11 @@ package com.persagy.adm.server.custom.controller;
 
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.persagy.adm.server.custom.common.AdmResult;
 import com.persagy.adm.server.custom.entity.CadFileQueryParam;
 import com.persagy.adm.server.custom.entity.db.AdmCad;
 import com.persagy.adm.server.custom.service.IAdmCadService;
+import com.persagy.dmp.common.model.response.CommonResult;
+import com.persagy.dmp.common.utils.ResultHelper;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -30,23 +31,23 @@ public class AdmFileController {
      */
 
     @PostMapping("/queryCadFiles")
-    public AdmResult<List<AdmCad>> queryCadFiles(@RequestBody CadFileQueryParam queryParam){
+    public CommonResult<List<AdmCad>> queryCadFiles(@RequestBody CadFileQueryParam queryParam){
         Wrapper<AdmCad> eq = new LambdaQueryWrapper<AdmCad>()
                 .eq(StringUtils.isNotBlank(queryParam.getProjectId()), AdmCad::getProjectId, queryParam.getProjectId())
                 .eq(StringUtils.isNotBlank(queryParam.getBuildingId()),AdmCad::getBuildingId,queryParam.getBuildingId())
                 .eq(StringUtils.isNotBlank(queryParam.getFloorId()),AdmCad::getFloorId,queryParam.getFloorId())
                 .eq(StringUtils.isNotBlank(queryParam.getFileKey()),AdmCad::getFileKey,queryParam.getFileKey())
                 .eq(StringUtils.isNotBlank(queryParam.getMajorCode()),AdmCad::getMajorCode,queryParam.getMajorCode());
-        return AdmResult.success(iAdmCadService.list(eq));
+        return ResultHelper.multi(iAdmCadService.list(eq));
     }
 
     /**
      * 保存CAD文件信息
      */
     @PostMapping("/saveCadFileInfo")
-    public AdmResult<Void> saveCadFileInfo(@RequestBody List<AdmCad> admFiles){
+    public CommonResult<Void> saveCadFileInfo(@RequestBody List<AdmCad> admFiles){
         iAdmCadService.saveOrUpdateBatch(admFiles);
-        return AdmResult.success(null);
+        return ResultHelper.success();
     }
 
     /**
@@ -54,8 +55,8 @@ public class AdmFileController {
      * @param id 文件信息表主键ID
      */
     @PostMapping("/delete")
-    public AdmResult<Void> delete(@RequestParam("id") String id){
+    public CommonResult<Void> delete(@RequestParam("id") String id){
         iAdmCadService.removeById(id);
-        return AdmResult.success(null);
+        return ResultHelper.success();
     }
 }

+ 14 - 20
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/AppController.java

@@ -1,9 +1,7 @@
 package com.persagy.adm.server.custom.controller;
 
 import cn.hutool.core.util.StrUtil;
-import com.persagy.adm.server.custom.client.ImageServiceClient;
 import com.persagy.adm.server.custom.common.AdmRequest;
-import com.persagy.adm.server.custom.common.AdmResult;
 import com.persagy.adm.server.custom.datatx.DataTxHandler;
 import com.persagy.adm.server.custom.entity.ConfigData;
 import com.persagy.adm.server.custom.entity.Dict;
@@ -11,17 +9,13 @@ import com.persagy.adm.server.custom.entity.DownLoadData;
 import com.persagy.adm.server.custom.entity.UploadRtn;
 import com.persagy.adm.server.custom.service.ISyncApp;
 import com.persagy.adm.server.custom.service.ServiceUtil;
-import feign.Response;
+import com.persagy.dmp.common.model.response.CommonResult;
+import com.persagy.dmp.common.utils.ResultHelper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -40,42 +34,42 @@ public class AppController {
 	private DataTxHandler dataTxHandler;
 
 	@RequestMapping("/clientId")
-	public AdmResult<Map<String, Object>> clientId(@RequestBody AdmRequest req){
+	public CommonResult<Map<String, Object>> clientId(@RequestBody AdmRequest req){
 		HashMap<String, Object> rtn = new HashMap<>();
 		rtn.put("clientId", syncApp.getClientId(req.getUserId()));
-		return AdmResult.success(rtn);
+		return ResultHelper.single(rtn);
 	}
 
 	@RequestMapping("/dict")
-	public AdmResult<Dict> dict(@RequestBody AdmRequest req){
-		return AdmResult.success(syncApp.downloadDict(req.getGroupCode(), req.getProjectId(), req.getUserId()));
+	public CommonResult<Dict> dict(@RequestBody AdmRequest req){
+		return ResultHelper.single(syncApp.downloadDict(req.getGroupCode(), req.getProjectId(), req.getUserId()));
 	}
 
 	@RequestMapping("/config")
-	public AdmResult<ConfigData> config(@RequestBody AdmRequest req){
-		return AdmResult.success(syncApp.downloadConfig(req.getGroupCode(), req.getProjectId(), req.getUserId()));
+	public CommonResult<ConfigData> config(@RequestBody AdmRequest req){
+		return ResultHelper.single(syncApp.downloadConfig(req.getGroupCode(), req.getProjectId(), req.getUserId()));
 	}
 
 	@RequestMapping("/frame")
-	public AdmResult<Map<String, Object>> frame(@RequestBody AdmRequest req){
-		return AdmResult.success(syncApp.downloadFrameData(req.getGroupCode(), req.getProjectId(), req.getUserId()));
+	public CommonResult<Map<String, Object>> frame(@RequestBody AdmRequest req){
+		return ResultHelper.single(syncApp.downloadFrameData(req.getGroupCode(), req.getProjectId(), req.getUserId()));
 	}
 
 	@RequestMapping("/download")
-	public AdmResult<DownLoadData> download(@RequestBody AdmRequest req){
+	public CommonResult<DownLoadData> download(@RequestBody AdmRequest req){
 		DownLoadData data;
 		if(StrUtil.isNotBlank(req.getBuildingId())) {
 			data = syncApp.downloadBuildingData(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getClientId(), req.getBuildingId(), req.getBdtpDownloadTs(), req.getAdmDownloadTs());
 		} else
 			data = syncApp.downloadProjectData(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getClientId(), req.getBdtpDownloadTs(), req.getAdmDownloadTs());
-		return AdmResult.success(data);
+		return ResultHelper.single(data);
 	}
 
 
 	@RequestMapping("/upload")
-	public AdmResult<UploadRtn> upload(HttpServletRequest request){
+	public CommonResult<UploadRtn> upload(HttpServletRequest request){
 		AdmRequest admRequest = dataTxHandler.handleRequest(request);
-		return AdmResult.success(syncApp.uploadData(admRequest.getUploadData(), admRequest.getGroupCode(), admRequest.getProjectId(), admRequest.getUserId(), admRequest.getClientId()));
+		return ResultHelper.single(syncApp.uploadData(admRequest.getUploadData(), admRequest.getGroupCode(), admRequest.getProjectId(), admRequest.getUserId(), admRequest.getClientId()));
 	}
 
 }

+ 4 - 3
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/ManageController.java

@@ -1,8 +1,9 @@
 package com.persagy.adm.server.custom.controller;
 
 import com.persagy.adm.server.custom.common.AdmRequest;
-import com.persagy.adm.server.custom.common.AdmResult;
 import com.persagy.adm.server.custom.service.ISyncSpace;
+import com.persagy.dmp.common.model.response.CommonResult;
+import com.persagy.dmp.common.utils.ResultHelper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -18,9 +19,9 @@ public class ManageController {
 	@Autowired
 	private ISyncSpace syncSpace;
 	@RequestMapping("/syncSpace")
-	public AdmResult<Object> syncSpace(@RequestBody AdmRequest req){
+	public CommonResult<Object> syncSpace(@RequestBody AdmRequest req){
 		Map<String, Object> syncResult = syncSpace.sync(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getFloorId(), "GeneralZone");
-		return AdmResult.success(syncResult);
+		return ResultHelper.single(syncResult);
 	}
 
 }

+ 18 - 17
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/ToolController.java

@@ -11,7 +11,6 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.adm.server.custom.client.RwdClient;
 import com.persagy.adm.server.custom.common.AdmConst;
 import com.persagy.adm.server.custom.common.AdmRequest;
-import com.persagy.adm.server.custom.common.AdmResult;
 import com.persagy.adm.server.custom.dao.*;
 import com.persagy.adm.server.custom.entity.Dict;
 import com.persagy.adm.server.custom.entity.InfoDef;
@@ -23,6 +22,8 @@ import com.persagy.adm.server.custom.service.ServiceUtil;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.common.constant.ResponseCode;
 import com.persagy.dmp.common.exception.BusinessException;
+import com.persagy.dmp.common.model.response.CommonResult;
+import com.persagy.dmp.common.utils.ResultHelper;
 import com.persagy.dmp.define.entity.GraphDefine;
 import com.persagy.dmp.define.entity.RelationDefine;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -54,12 +55,12 @@ public class ToolController {
 	private AdmM2dEquipMapper m2dEquipMapper;
 
 	@GetMapping("/hello")
-	public AdmResult<Integer> hello(){
-		return AdmResult.success(configService.queryCommonConfig(null).size());
+	public CommonResult<Integer> hello(){
+		return ResultHelper.single(configService.queryCommonConfig(null).size());
 	}
 
 	@RequestMapping("/dict")
-	public AdmResult<Dict> dict(@RequestBody AdmRequest req, @RequestParam(required = false) String module){
+	public CommonResult<Dict> dict(@RequestBody AdmRequest req, @RequestParam(required = false) String module){
 		Dict map = syncApp.queryDict(req.getGroupCode(), req.getProjectId(), req.getUserId(), !"infos".equals(module), false);
 
 		List<Map<String, Object>> majorList = map.getMajor();
@@ -119,7 +120,7 @@ public class ToolController {
 			map.setRelation(rels);
 		}
 
-		return AdmResult.success(map);
+		return ResultHelper.single(map);
 	}
 
 	private <T> void distinct(List<T> list){
@@ -154,7 +155,7 @@ public class ToolController {
 	}
 
 	@RequestMapping("/cfgs")
-	public AdmResult<Object> cfgs(@RequestBody AdmRequest req, @RequestParam(required = false) String module){
+	public CommonResult<Object> cfgs(@RequestBody AdmRequest req, @RequestParam(required = false) String module){
 		String projectId = req.getProjectId();
 		HashMap<String, Object> data = new HashMap<>();
 
@@ -172,11 +173,11 @@ public class ToolController {
 			data.put("containerConfig", containerConfig);
 		}
 
-		return AdmResult.success(data);
+		return ResultHelper.single(data);
 	}
 
 	@RequestMapping("/typeInfos")
-	public AdmResult<Object> typeInfos(@RequestBody AdmRequest req, @RequestParam String typeCode){
+	public CommonResult<Object> typeInfos(@RequestBody AdmRequest req, @RequestParam String typeCode){
 		QueryCriteria criteria = new QueryCriteria();
 		ObjectNode node = objectMapper.createObjectNode();
 		node.put("classCode", typeCode);
@@ -192,7 +193,7 @@ public class ToolController {
 			buildInfosTree(roots, infoDef);
 		}
 
-		return AdmResult.success(roots);
+		return ResultHelper.single(roots);
 	}
 
 	private void buildInfosTree(List<Object> roots, InfoDef infoDef){
@@ -234,7 +235,7 @@ public class ToolController {
 	private AdmContainerConfigMapper containerConfigMapper;
 
 	@PostMapping("/updateCfgItem")
-	public AdmResult<Object> updateCfgItem(@RequestBody Map<String, Object> content) {
+	public CommonResult<Object> updateCfgItem(@RequestBody Map<String, Object> content) {
 		String type = (String) content.get("type");
 		Map<String, Object> itemMap = (Map<String, Object>) content.get("item");
 		String delId = (String) content.get("delId");
@@ -253,7 +254,7 @@ public class ToolController {
 			doUpdateItem(delId, itemMap, create, AdmContainerConfig.class, containerConfigMapper);
 		}
 
-		return AdmResult.success(newId);
+		return ResultHelper.single(newId);
 	}
 	
 	private <T extends BaseAdmEntity> void doUpdateItem(String delId, Map<String, Object> itemMap, boolean create, Class<T> cls, BaseMapper<T> mapper){
@@ -282,7 +283,7 @@ public class ToolController {
 	private AdmInfosConfigMapper infosConfigMapper;
 
 	@PostMapping("/updateInfos")
-	public AdmResult<Object> updateInfos(@RequestBody AdmInfosConfig cfg) {
+	public CommonResult<Object> updateInfos(@RequestBody AdmInfosConfig cfg) {
 		String newId = null;
 		if(StrUtil.isBlank(cfg.getId())){
 			newId = IdUtil.fastSimpleUUID();
@@ -302,11 +303,11 @@ public class ToolController {
 		else
 			infosConfigMapper.updateById(cfg);
 
-		return AdmResult.success(newId);
+		return ResultHelper.single(newId);
 	}
 
 	@PostMapping("/updateM2d")
-	public AdmResult<Object> updateM2d(@RequestBody Map<String, Object> cfg){
+	public CommonResult<Object> updateM2d(@RequestBody Map<String, Object> cfg){
 		String code = (String) cfg.get("code");
 		boolean m2d = (Boolean)cfg.get("m2d");
 		AdmM2dEquip item = m2dEquipMapper.selectOne(new QueryWrapper<AdmM2dEquip>().eq("class_code", code));
@@ -321,11 +322,11 @@ public class ToolController {
 			if(item != null)
 				m2dEquipMapper.deleteById(item.getId());
 		}
-		return AdmResult.success(null);
+		return ResultHelper.success();
 	}
 
 	@PostMapping("/bdAndFls")
-	public AdmResult<List<ObjectNode>> bdAndFls(@RequestBody AdmRequest req){
+	public CommonResult<List<ObjectNode>> bdAndFls(@RequestBody AdmRequest req){
 		Map<String, Object> data = syncApp.downloadFrameData(req.getGroupCode(), req.getProjectId(), req.getUserId());
 		List<ObjectNode> bdAndFls = (List<ObjectNode>)data.get("buildingsAndFloors");
 
@@ -355,7 +356,7 @@ public class ToolController {
 			}
 		}
 
-		return AdmResult.success(bds);
+		return ResultHelper.single(bds);
 	}
 
 }

+ 4 - 4
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/db/AdmCad.java

@@ -1,12 +1,12 @@
 package com.persagy.adm.server.custom.entity.db;
 
 import com.baomidou.mybatisplus.annotation.TableField;
-import java.io.Serializable;
-
-import com.persagy.adm.server.custom.entity.db.BaseAdmDataEntity;
+import com.persagy.dmp.common.model.entity.AuditableEntity;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.io.Serializable;
+
 /**
  * <p>
  * CAD图纸信息表
@@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode;
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
-public class AdmCad extends BaseAdmDataEntity implements Serializable {
+public class AdmCad extends AuditableEntity<AdmCad> implements Serializable {
 
     /**
      * 存储系统的key

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/db/AdmProblem.java

@@ -47,7 +47,7 @@ public class AdmProblem extends BaseAdmDataEntity implements Serializable {
      * 1 空间 2对象
      */
     @TableField("check_type")
-    private String checkType;
+    private Integer checkType;
 
     /**
      * 问题对象类型

+ 4 - 4
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/CallException.java

@@ -1,17 +1,17 @@
 package com.persagy.adm.server.custom.service;
 
 
-import com.persagy.adm.server.custom.common.AdmResult;
+import com.persagy.dmp.common.model.response.CommonResult;
 
 public class CallException extends RuntimeException {
 
-	private AdmResult<Object> errorResult;
+	private CommonResult<Object> errorResult;
 
-	public CallException(AdmResult<Object> errorResult) {
+	public CallException(CommonResult<Object> errorResult) {
 		this.errorResult = errorResult;
 	}
 
-	public  AdmResult<Object> getErrorResult() {
+	public  CommonResult<Object> getErrorResult() {
 		return errorResult;
 	}
 

+ 1 - 2
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/ServiceUtil.java

@@ -3,7 +3,6 @@ package com.persagy.adm.server.custom.service;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.persagy.adm.server.custom.common.AdmResult;
 import com.persagy.adm.server.custom.entity.Pagination;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.common.model.response.CommonResult;
@@ -45,7 +44,7 @@ public class ServiceUtil {
 				pagination.setTotal(result.getCount().intValue());
 			return result.getData();
 		}
-		throw new CallException(new AdmResult<>(result.getResult(), result.getMessage()));
+		throw new CallException(new CommonResult<>(result.getResult(), result.getMessage()));
 	}
 
 	public static <T> List<T> queryAllPage(Supplier<CommonResult<List<T>>> action, QueryCriteria criteria, Pagination pagination){

+ 0 - 9
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/SyncAppImpl.java

@@ -19,11 +19,8 @@ import com.persagy.adm.server.custom.dao.*;
 import com.persagy.adm.server.custom.datatx.ObjectMapper4Tx;
 import com.persagy.adm.server.custom.entity.*;
 import com.persagy.adm.server.custom.entity.db.*;
-import com.persagy.adm.server.custom.entity.db.AdmDefineProblemType;
 import com.persagy.adm.server.custom.service.*;
 import com.persagy.adm.server.custom.util.DataExtrasUtil;
-import com.persagy.adm.server.custom.dao.AdmDefineProblemInfoMapper;
-import com.persagy.adm.server.custom.entity.db.AdmDefineProblemInfo;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.common.constant.ValidEnum;
 import com.persagy.dmp.define.entity.RelationDefine;
@@ -192,17 +189,11 @@ public class SyncAppImpl implements ISyncApp {
 
 	@Override
 	public Map<String, Object> downloadFrameData(String groupCode, String projectId, String userId) {
-		//TODO 项目修改为从运维平台查询
-		QueryCriteria criteria = ServiceUtil.getQueryCriteria(objectMapper, AdmConst.OBJ_TYPE_PROJECT);
-		List<ObjectNode> prjList = ServiceUtil.call(() -> objectClient.query(groupCode, null, AdmConst.APP_ID, userId, criteria));
-		packInfos(prjList);
-
 		QueryCriteria criteria2 = ServiceUtil.getQueryCriteria(objectMapper, AdmConst.OBJ_TYPE_BUILDING, AdmConst.OBJ_TYPE_FLOOR);
 		List<ObjectNode> bdAndFl = ServiceUtil.call(() -> objectClient.query(groupCode, projectId, AdmConst.APP_ID, userId, criteria2));
 		packInfos(bdAndFl);
 
 		HashMap<String, Object> data = new HashMap<>();
-		data.put("projects", prjList);
 		data.put("buildingsAndFloors", bdAndFl);
 
 		return data;