Explorar o código

Merge branch 'develop' of http://39.106.8.246:3003/BDTP/digital-delivery

 Conflicts:
	adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/style/BaseStyle.java
zhaoyk %!s(int64=2) %!d(string=hai) anos
pai
achega
4debb31ae0
Modificáronse 27 ficheiros con 377 adicións e 215 borrados
  1. 11 0
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/controller/DiagramController.java
  2. 8 0
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/DataStrategy.java
  3. 17 0
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/impl/DataStrategyImpl.java
  4. 1 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/style/BaseStyle.java
  5. 8 0
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/dao/DiagramMapper.java
  6. 5 0
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/demo/DemoDataStrategy.java
  7. 7 0
      adm-business/adm-diagram/src/main/resources/mapper/Diagram.xml
  8. 10 13
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/service/impl/AdmDictServiceImpl.java
  9. 1 0
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/constant/MigrationConstant.java
  10. 27 65
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/DefineInfoMigration.java
  11. 12 34
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/DefineTypeMigration.java
  12. 14 1
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/MigrationAbstractServiceImpl.java
  13. 13 18
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/ObjectDigitalMigration.java
  14. 44 63
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/ObjectRelationMigration.java
  15. 4 0
      adm-business/adm-server/pom.xml
  16. 2 2
      adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/constant/AdmServerConstant.java
  17. 39 0
      adm-business/adm-server/src/main/java/com/persagy/adm/server/backstage/jobhandler/CommonTimeRuleJob.java
  18. 6 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/AdmFileController.java
  19. 7 10
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/AppController.java
  20. 1 0
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/CadFileInfo.java
  21. 12 2
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/interceptor/AppContextConfig.java
  22. 39 0
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/interceptor/TokenInterceptor.java
  23. 23 0
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/interceptor/TraceIdInterceptor.java
  24. 3 5
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/SyncAppImpl.java
  25. 35 0
      adm-comp/adm-steward-starter/src/main/java/com/persagy/adm/steward/client/BossStewardClient.java
  26. 23 0
      adm-comp/adm-steward-starter/src/main/java/com/persagy/adm/steward/client/BossStewardFacade.java
  27. 5 0
      docker/k8sfiles/adm-server-standard.yml

+ 11 - 0
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/controller/DiagramController.java

@@ -303,4 +303,15 @@ public class DiagramController {
     public CommonResult<Map<String, Boolean>> querySystemInstanceDiagramList() {
         return ResultHelper.single(dataStrategy.querySystemInstanceDiagramList());
     }
+
+    /**
+     * 判断系统图名称是否重复  true:重复,false:不重复
+     *
+     * @return 是否成功
+     */
+    @ApiOperation("判断系统图名称是否重复")
+    @PostMapping("/judge/name/duplicate")
+    public CommonResult<Boolean> judgeNameDuplicate(@RequestBody Map<String, String> params) {
+        return ResultHelper.single(dataStrategy.judgeNameDuplicate(params.get("name")));
+    }
 }

+ 8 - 0
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/DataStrategy.java

@@ -248,4 +248,12 @@ public interface DataStrategy {
      * @return 是否成功
      */
     boolean updateName(String name, String id);
+
+    /**
+     * 判断系统图名称是否重复
+     *
+     * @param name 系统图名称
+     * @return 是否重复
+     */
+    boolean judgeNameDuplicate(String name);
 }

+ 17 - 0
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/impl/DataStrategyImpl.java

@@ -715,4 +715,21 @@ public class DataStrategyImpl implements DataStrategy {
         diagramMapper.updateById(entity);
         return true;
     }
+
+    /**
+     * 判断系统图名称是否重复
+     *
+     * @param name 系统图名称
+     * @return 是否重复
+     */
+    @Override
+    public boolean judgeNameDuplicate(String name) {
+        if (StrUtil.isBlank(name)) {
+            throw new BusinessException(ResponseCode.A0400.getCode(), "名称参数为空");
+        }
+        BdtpRequest req = BdtpRequest.getCurrent();
+        String projectId = req.getProjectId();
+        List<DiagramEntity> diagramEntities = diagramMapper.selectByName(projectId, name);
+        return CollectionUtil.isNotEmpty(diagramEntities);
+    }
 }

+ 1 - 1
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/style/BaseStyle.java

@@ -30,7 +30,7 @@ public class BaseStyle {
 	 * 字体粗细
 	 */
 	@Expose
-	protected int fontWeight = 500;
+	protected int fontWeight = 600;
 
 	/**
 	 * 字体名称

+ 8 - 0
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/dao/DiagramMapper.java

@@ -64,4 +64,12 @@ public interface DiagramMapper extends BaseMapper<DiagramEntity> {
      */
     DiagramEntity getDiagram(String diagramId);
 
+    /**
+     * 判断系统图名称是否重复
+     *
+     * @param projectId 项目id
+     * @param name      系统图名称
+     * @return 是否重复
+     */
+    List<DiagramEntity> selectByName( String projectId, String name);
 }

+ 5 - 0
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/demo/DemoDataStrategy.java

@@ -423,4 +423,9 @@ public class DemoDataStrategy implements DataStrategy {
     public boolean updateName(String name, String id) {
         return false;
     }
+
+    @Override
+    public boolean judgeNameDuplicate(String name) {
+        return false;
+    }
 }

+ 7 - 0
adm-business/adm-diagram/src/main/resources/mapper/Diagram.xml

@@ -87,6 +87,13 @@
         </if>
     </select>
 
+    <select id="selectByName" resultMap="diagramBaseMap">
+        SELECT
+        <include refid="baseSql"/>
+        FROM diagram
+        WHERE project_id=#{projectId} AND name=#{name} AND valid = 1
+    </select>
+
 </mapper>
 
 

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

@@ -404,11 +404,6 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
         //查询类型下的所有信息点信息
         AdmResponse admResponse = doQueryObjectInfo(context, request, AdmDictConstant.CLASS_CODE, clazz);
         List<AdmObjectInfo> admObjectInfos = (List<AdmObjectInfo>) admResponse.getContent();
-        //项目信息点 进行定制过滤
-        if(request.getType().equals(AdmProject.OBJ_TYPE)){
-            admObjectInfos = filterInfosForProject(admObjectInfos);
-            admResponse.setTotal(admObjectInfos.size()*1L);
-        }
         admObjectInfos = sortFuncidForEdit(admObjectInfos);
         //查询平台级信息点采集信息
         List<ObjectInfoCollect> commonObjectInfoCollect = queryObjectInfoCollect(context, "common", request.getType(), clazz);
@@ -451,6 +446,11 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
         }else{
             setOnlyQueryObjectInfoVisiable(admObjectInfos,commonObjectInfoCollectMap,dictType);
         }
+        //项目信息点 进行定制过滤
+        if(request.getType().equals(AdmProject.OBJ_TYPE)){
+            admObjectInfos = filterInfosForProject(admObjectInfos);
+            admResponse.setTotal(admObjectInfos.size()*1L);
+        }
         admResponse.setContent(admObjectInfos);
         return admResponse;
     }
@@ -522,9 +522,10 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
                     admObjectInfo.setKeyWord(collect.getKeyWord());
                 }
             }
-            if(visiable == null && ("localId".equals(admObjectInfo.getCode()) || "localName".equals(admObjectInfo.getCode()))){
+            //无默认展示字段,严格按照交付范围展示
+            /*if(visiable == null && ("localId".equals(admObjectInfo.getCode()) || "localName".equals(admObjectInfo.getCode()))){
                 visiable = true;
-            }
+            }*/
             if(visiable == null){
                 visiable = false;
             }
@@ -606,9 +607,9 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
         if("common".equals(dictType)){
             criteria.setFilters("groupCode = '0' and projectId = '0'");
         }else{
-            //criteria.setFilters("groupCode = '"+context.getGroupCode()+"' and projectId = '"+context.getProjectId()+"'");
             criteria.setFilters(" projectId = '"+context.getProjectId()+"'");
         }
+        criteria.addFilters(" deliveryType = 0 and is_delivery = 1");
         criteria.setName(classCode);
         AdmResponse admResponse = doQueryObjectInfoCollect(context, criteria, "classCode", clazz);
         return (List<ObjectInfoCollect>) admResponse.getContent();
@@ -635,10 +636,6 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
         if(CollUtil.isEmpty(list)){
             return Collections.emptyList();
         }
-        List<String> projectCodes = Arrays.asList("businessOpeningTime","owner","property","designer","constructor","contractor","longitude",
-                "latitude","sFI","address","projUnderfloorNum","fireResistanceLev","projNeighborLocationMap","projLogo","projIntro",
-                "projHeight","projFuncType","projCoverArea","projCityLocationMap","projArea","assetManager");
-
         list.forEach(code -> {
             if(code.getCode().equals("constructor")){
                 code.setCode("contractor");
@@ -646,7 +643,7 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
                 code.setPath("infos.contractor");
             }
         });
-        return list.stream().filter(info -> projectCodes.contains(info.getCode())).collect(Collectors.toList());
+        return list.stream().filter(info -> info.getVisible()==true).collect(Collectors.toList());
     }
     /**
      * 统计类型下的非静态信息点

+ 1 - 0
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/constant/MigrationConstant.java

@@ -11,6 +11,7 @@ public class MigrationConstant {
     public final static String ERROR = "目标地址错误不能正常访问!";
 
     public final static int BATCH_SUBMIT_DATA_COUNT = 5000;
+    public final static long BATCH_SQL_DATA_COUNT = 5000L;
 
     /** 数据拼接 用于list->map 时key和value拼接 **/
     public final static String SPLITER = "_";

+ 27 - 65
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/DefineInfoMigration.java

@@ -22,7 +22,6 @@ import com.persagy.proxy.migration.model.MigrationInfo;
 import com.persagy.proxy.migration.service.IDataMigration;
 import com.persagy.proxy.migration.service.IDataMigrationProcess;
 import com.persagy.proxy.migration.service.IDefineDataMigration;
-import com.persagy.proxy.migration.service.Impl.MigrationAbstractServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
@@ -144,79 +143,42 @@ public class DefineInfoMigration extends MigrationAbstractServiceImpl<ObjectInfo
             return "";
         }
         StringBuffer sqls = new StringBuffer(" \n -- 数据迁移  dt_define_info ------ \n");
+        sqls.append(" delete from dt_define_info where project_id='"+context.getProjectId()+"' or group_code='"+context.getGroupCode()+"'; \n ");
         sqls.append(MigrationConstant.DEF_FUNCID_SQL_PRE);
         admDefineList.forEach(infoDefine -> {
+
             sqls.append("(");
             sqls.append("'").append(infoDefine.getId()).append("',");
-            sqls.append("'").append(infoDefine.getCode()).append("',");
-            sqls.append("'").append(infoDefine.getName()).append("',");
-            sqls.append("'").append(infoDefine.getAliasCode()).append("',");
-            sqls.append("'").append(infoDefine.getAliasName()).append("',");
-            sqls.append("'").append(infoDefine.getClassCode()).append("',");
-            sqls.append("'").append(infoDefine.getGroupCode()).append("',");
-            sqls.append("'").append(infoDefine.getProjectId()).append("',");
-            sqls.append("'").append(infoDefine.getCategory()).append("',");
-            sqls.append("'").append(infoDefine.getFirstTag()).append("',");
-            if (infoDefine.getSecondTag() == null) {
-                sqls.append(infoDefine.getSecondTag()).append(",");
-            } else {
-                sqls.append("'").append(infoDefine.getSecondTag()).append("',");
-            }
-
-            sqls.append("'").append(infoDefine.getPriority()).append("',");
-            sqls.append("'").append(infoDefine.getInputMode()).append("',");
-
-            if (infoDefine.getUnit() == null) {
-                sqls.append(infoDefine.getUnit()).append(",");
-            } else {
-                sqls.append("'").append(infoDefine.getUnit()).append("',");
-            }
+            super.processNull(sqls, infoDefine.getCode());
+            super.processNull(sqls, infoDefine.getName());
+            super.processNull(sqls, infoDefine.getAliasCode());
+            super.processNull(sqls, infoDefine.getAliasName());
+            super.processNull(sqls, infoDefine.getClassCode());
+            super.processNull(sqls, infoDefine.getGroupCode());
+            super.processNull(sqls, infoDefine.getProjectId());
+
+            super.processNull(sqls, infoDefine.getCategory());
+            super.processNull(sqls, infoDefine.getFirstTag());
+            super.processNull(sqls, infoDefine.getSecondTag());
+            super.processNull(sqls, infoDefine.getPriority());
+            super.processNull(sqls, infoDefine.getInputMode());
+            super.processNull(sqls, infoDefine.getUnit());
+            super.processNull(sqls, infoDefine.getDataType());
 
-            sqls.append("'").append(infoDefine.getDataType()).append("',");
             sqls.append(infoDefine.getIsMultiple()?1:0).append(",");
             sqls.append(infoDefine.getIsRegion()?1:0).append(",");
-
-            if (infoDefine.getFormater() == null) {
-                sqls.append(infoDefine.getFormater()).append(",");
-            } else {
-                sqls.append("'").append(infoDefine.getFormater()).append("',");
-            }
-
-            if (infoDefine.getDataSource() == null) {
-                sqls.append(infoDefine.getDataSource()).append(",");
-            } else {
-                sqls.append("'").append(infoDefine.getDataSource()).append("',");
-            }
-
-            if (infoDefine.getRemark() == null) {
-                sqls.append(infoDefine.getRemark()).append(",");
-            } else {
-                sqls.append("'").append(infoDefine.getRemark()).append("',");
-            }
+            super.processNull(sqls, infoDefine.getFormater());
+            super.processNull(sqls, infoDefine.getDataSource());
+            super.processNull(sqls, infoDefine.getRemark());
             sqls.append(infoDefine.getSubFlag()?1:0).append(",");
             sqls.append(infoDefine.getWeakPoint()?1:0).append(",");
-            sqls.append(infoDefine.getShowOrder()).append(",");
-
-            if (infoDefine.getVersion() == null) {
-                sqls.append(infoDefine.getVersion()).append(",");
-            } else {
-                sqls.append("'").append(infoDefine.getVersion()).append("',");
-            }
-
-            sqls.append(infoDefine.getSourceFrom()).append(",");
-            sqls.append("'").append(infoDefine.getCreator()).append("',");
-            sqls.append("'").append(infoDefine.getCreationTime()).append("',");
-            if (infoDefine.getModifier() == null) {
-                sqls.append(infoDefine.getModifier()).append(",");
-            } else {
-                sqls.append("'").append(infoDefine.getModifier()).append("',");
-            }
-
-            if (infoDefine.getModifiedTime() == null) {
-                sqls.append(infoDefine.getModifiedTime()).append(",");
-            } else {
-                sqls.append("'").append(infoDefine.getModifiedTime()).append("',");
-            }
+            super.processNull(sqls, infoDefine.getShowOrder());
+            super.processNull(sqls, infoDefine.getVersion());
+            super.processNull(sqls, infoDefine.getSourceFrom());
+            super.processNull(sqls, infoDefine.getCreator());
+            super.processNull(sqls, infoDefine.getCreationTime());
+            super.processNull(sqls, infoDefine.getModifier());
+            super.processNull(sqls, infoDefine.getModifiedTime());
             sqls.append(infoDefine.getValid());
             sqls.append(")\n ,");
         });

+ 12 - 34
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/DefineTypeMigration.java

@@ -9,7 +9,6 @@ import com.persagy.dmp.basic.utils.JsonNodeUtils;
 import com.persagy.dmp.common.constant.ResponseCode;
 import com.persagy.dmp.common.model.entity.BaseEntity;
 import com.persagy.dmp.define.client.DigitalDefineFacade;
-import com.persagy.dmp.define.entity.ObjectInfoDefine;
 import com.persagy.dmp.define.entity.ObjectTypeDefine;
 import com.persagy.dmp.rwd.migrate.entity.SyncData;
 import com.persagy.proxy.adm.request.AdmResponse;
@@ -23,7 +22,6 @@ import com.persagy.proxy.migration.model.MigrationInfo;
 import com.persagy.proxy.migration.service.IDataMigration;
 import com.persagy.proxy.migration.service.IDataMigrationProcess;
 import com.persagy.proxy.migration.service.IDefineDataMigration;
-import com.persagy.proxy.migration.service.Impl.MigrationAbstractServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
@@ -147,7 +145,9 @@ public class DefineTypeMigration extends MigrationAbstractServiceImpl<ObjectType
             return "";
         }
         StringBuffer sqls = new StringBuffer(" \n -- 数据迁移  dt_define_type ------ \n");
+        sqls.append(" delete from dt_define_type where project_id='"+context.getProjectId()+"' or group_code='"+context.getGroupCode()+"'; \n ");
         sqls.append(MigrationConstant.DEF_CLASS_SQL_PRE);
+
         admDefineList.forEach(typeDefine ->{
             sqls.append("(");
             sqls.append("'").append(typeDefine.getId()).append("',");
@@ -159,38 +159,16 @@ public class DefineTypeMigration extends MigrationAbstractServiceImpl<ObjectType
             sqls.append("'").append(typeDefine.getGroupCode()).append("',");
             sqls.append("'").append(typeDefine.getProjectId()).append("',");
 
-            if (typeDefine.getMajorCode() == null) {
-                sqls.append(typeDefine.getMajorCode()).append(",");
-            } else {
-                sqls.append("'").append(typeDefine.getMajorCode()).append("',");
-            }
-
-            sqls.append("'").append(typeDefine.getSystemCode()).append("',");
-
-            if (typeDefine.getEquipmentCode() == null) {
-                sqls.append(typeDefine.getEquipmentCode()).append(",");
-            } else {
-                sqls.append("'").append(typeDefine.getEquipmentCode()).append("',");
-            }
-
-            sqls.append("'").append(typeDefine.getParentCode()).append("',");
-            sqls.append("'").append(typeDefine.getVersion()).append("',");
-            sqls.append(typeDefine.getSourceFrom()).append(",");
-            sqls.append("'").append(typeDefine.getCreator()).append("',");
-            sqls.append("'").append(typeDefine.getCreationTime()).append("',");
-
-            if (typeDefine.getModifier() == null) {
-                sqls.append(typeDefine.getModifier()).append(",");
-            } else {
-                sqls.append("'").append(typeDefine.getModifier()).append("',");
-            }
-
-            if (typeDefine.getModifiedTime() == null) {
-                sqls.append(typeDefine.getModifiedTime()).append(",");
-            } else {
-                sqls.append("'").append(typeDefine.getModifiedTime()).append("',");
-            }
-
+            super.processNull(sqls, typeDefine.getMajorCode());
+            super.processNull(sqls, typeDefine.getSystemCode());
+            super.processNull(sqls, typeDefine.getEquipmentCode());
+            super.processNull(sqls, typeDefine.getParentCode());
+            super.processNull(sqls, typeDefine.getVersion());
+            super.processNull(sqls, typeDefine.getSourceFrom());
+            super.processNull(sqls, typeDefine.getCreator());
+            super.processNull(sqls, typeDefine.getCreationTime());
+            super.processNull(sqls, typeDefine.getModifier());
+            super.processNull(sqls, typeDefine.getModifiedTime());
             sqls.append(typeDefine.getValid());
             sqls.append(")\n ,");
         });

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

@@ -472,7 +472,7 @@ public class MigrationAbstractServiceImpl<T> implements IMigrationAbstractServic
         return targetsMap;
     }
 
-
+    /** 查询对象类型 **/
     public List<String> getObjTypes(InstanceUrlParam context){
         QueryCriteria queryCriteria = new QueryCriteria();
         ObjectNode criteria = JsonNodeFactory.instance.objectNode();
@@ -485,4 +485,17 @@ public class MigrationAbstractServiceImpl<T> implements IMigrationAbstractServic
         Map<String,List<ObjectTypeDefine>> objType = types.stream().collect(Collectors.groupingBy(ObjectTypeDefine::getObjType));
         return objType.keySet().stream().collect(Collectors.toList());
     }
+
+    /**
+     * 处理空字段
+     * @param sqls
+     * @param targerStr
+     */
+    public void processNull(StringBuffer sqls ,Object targerStr){
+        if(targerStr == null){
+            sqls.append(targerStr).append(",");
+        }else{
+            sqls.append("'").append(targerStr).append("',");
+        }
+    }
 }

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

@@ -99,12 +99,13 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
     @Override
     public String migrateForSql(InstanceUrlParam context) {
         //获取已经采集的数据
-        String sqls_temp = "\n -- 数据迁移  dt_object ------ \n  ";
+        String sqls_temp = "\n -- 数据迁移  dt_object ------ \n"
+                            + "delete from dt_object where project_id='"+context.getProjectId()+"' and group_code='"+context.getGroupCode()+"';";
         List<String> objTypes = getObjTypes(context);
         //List<String> objTypes = Arrays.asList("equipment");
         for(String objType : objTypes){
             QueryCriteria queryCriteria = getQueryCriteria(objType);
-            queryCriteria.setSize(1000L);
+            queryCriteria.setSize(MigrationConstant.BATCH_SQL_DATA_COUNT);
             CommonResult<List<ObjectNode>> result = getAdmDataPage(context,queryCriteria);
             if(result == null){
                 continue;
@@ -115,8 +116,8 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
             }
             sqls_temp += processSqlStr(appendValues(admData).toString());
 
-            if(result.getCount() > 1000){
-                long page = result.getCount() / 1000 + 1;
+            if(result.getCount() > MigrationConstant.BATCH_SQL_DATA_COUNT){
+                long page = result.getCount() / MigrationConstant.BATCH_SQL_DATA_COUNT + 1;
                 for(long i = 2; i<=page; i++){
                     queryCriteria.setPage(i);
                     result = getAdmDataPage(context,queryCriteria);
@@ -151,6 +152,7 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
             ObjectDigital objectDigital = JsonNodeUtils.toEntity(obj, ObjectDigital.class, "infos");
             sqls.append("(");
             sqls.append("'").append(objectDigital.getId()).append("',");
+
             if (objectDigital.getName() == null) {
                 sqls.append(objectDigital.getName()).append(",");
             } else {
@@ -184,20 +186,13 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
                 objectDigital.getVirtualCodes().forEach(str -> temp.append("\"").append(str).append("\"").append(","));
                 sqls.append("'[").append(StrUtil.sub(temp.toString(),0,-1)).append("]',");
             }
-            if (objectDigital.getCreateApp() == null) {
-                sqls.append(objectDigital.getCreateApp()).append(",");
-            } else {
-                sqls.append("'").append(objectDigital.getCreateApp()).append("',");
-            }
-            if (objectDigital.getUpdateApp() == null) {
-                sqls.append(objectDigital.getUpdateApp()).append(",");
-            } else {
-                sqls.append("'").append(objectDigital.getUpdateApp()).append("',");
-            }
-            sqls.append("'").append(objectDigital.getCreator()).append("',");
-            sqls.append("'").append(objectDigital.getCreationTime()).append("',");
-            sqls.append("'").append(objectDigital.getModifier()).append("',");
-            sqls.append("'").append(objectDigital.getModifiedTime()).append("',");
+            super.processNull(sqls, objectDigital.getCreateApp());
+            super.processNull(sqls, objectDigital.getUpdateApp());
+            super.processNull(sqls, objectDigital.getCreator());
+            super.processNull(sqls, objectDigital.getCreationTime());
+            super.processNull(sqls, objectDigital.getModifier());
+            super.processNull(sqls, objectDigital.getModifiedTime());
+
             sqls.append(objectDigital.getValid());
             String sql = sqls.toString().replaceAll("\\\\n","\\\\\\\\n");
             sqlsAll.append(sql).append(")\n ,");

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

@@ -125,32 +125,40 @@ public class ObjectRelationMigration extends MigrationAbstractServiceImpl<Object
     @Override
     public String migrateForSql(InstanceUrlParam context) {
         StringBuffer sqls = new StringBuffer(" \n -- 数据迁移  dt_relation ------ \n");
+        sqls.append(" delete from dt_relation where project_id='"+context.getProjectId()+"' and group_code='"+context.getGroupCode()+"'; \n ");
         //获取已经采集的数据
         String sqls_temp = "";
         ExecutorService service = getExcecutor();
-        List<Future<StringBuffer>> futureList = new ArrayList<>();
+        List<Future<String>> futureList = new ArrayList<>();
         for (MiGrationRelCode miGrationRelCode: MiGrationRelCode.values()){
             QueryCriteria queryCriteria = getQueryCriteria(miGrationRelCode.getCode());
-            queryCriteria.setSize(10000L);
-            CommonResult<List<ObjectRelation>> admDatas = getAdmDataPage(context,queryCriteria);
-            if (admDatas.getResult().equals(DmpResult.SUCCESS) && admDatas.getCount() > queryCriteria.getSize()) {
-                long pages = admDatas.getCount() / queryCriteria.getSize() + 1;
-                for(long i = 2;i < pages; i++){
+            queryCriteria.setSize(MigrationConstant.BATCH_SQL_DATA_COUNT);
+            CommonResult<List<ObjectRelation>> result = getAdmDataPage(context,queryCriteria);
+            if(result == null){
+                continue;
+            }
+            List<ObjectRelation> admData = result.getData();
+            if(CollUtil.isEmpty(admData)){
+                continue;
+            }
+            // 拼接sql
+            appendValuesBefore(service,admData,futureList);
+            // 分页处理sql
+            if (result.getCount() > MigrationConstant.BATCH_SQL_DATA_COUNT) {
+                long pages = result.getCount() / queryCriteria.getSize() + 1;
+                for(long i = 2;i <= pages; i++){
                     queryCriteria.setPage(i);
-                    List<ObjectRelation> admData = getAdmData(context,queryCriteria);
+                    admData = getAdmData(context,queryCriteria);
                     appendValuesBefore(service,admData,futureList);
                 }
-            }else{
-                List<ObjectRelation> admData = admDatas.getData();
-                appendValuesBefore(service,admData,futureList);
             }
         }
         service.shutdown();
-        for (Future<StringBuffer> future : futureList) {
+        for (Future<String> future : futureList) {
             try {
-                StringBuffer stringBuffer = future.get();
-                if(StrUtil.isNotEmpty(stringBuffer)){
-                    sqls_temp += stringBuffer.toString();
+                String string = future.get();
+                if(StrUtil.isNotEmpty(string)){
+                    sqls_temp += string;
                 }
             } catch (InterruptedException e) {
                 e.printStackTrace();
@@ -164,22 +172,18 @@ public class ObjectRelationMigration extends MigrationAbstractServiceImpl<Object
         if(sqls_temp.length() == 0){
             return "";
         }
-        sqls.append(MigrationConstant.DT_RELATION_SQL_PRE);
         sqls.append(sqls_temp);
-        String sql = sqls.toString();
-        sql = sql.substring(0, sql.lastIndexOf(","));
-        sql +=";";
-        return sql;
+        return sqls.toString();
     }
 
-    private void appendValuesBefore(ExecutorService service, List<ObjectRelation> admData, List<Future<StringBuffer>> futureList){
+    private void appendValuesBefore(ExecutorService service, List<ObjectRelation> admData, List<Future<String>> futureList){
         if(CollUtil.isEmpty(admData)){
             return;
         }
         StringBuffer sqls_temp = new StringBuffer();
-        Future<StringBuffer> future = service.submit(new Callable<StringBuffer>(){
+        Future<String> future = service.submit(new Callable<String>(){
             @Override
-            public StringBuffer call() throws Exception {
+            public String call() throws Exception {
                 return appendValues(admData, sqls_temp);
             }
         });
@@ -192,56 +196,33 @@ public class ObjectRelationMigration extends MigrationAbstractServiceImpl<Object
      * @param sqls
      * @return
      */
-    private StringBuffer appendValues(List<ObjectRelation> admData, StringBuffer sqls){
+    private String appendValues(List<ObjectRelation> admData, StringBuffer sqls){
         admData.forEach(relation -> {
             sqls.append("(");
             sqls.append("'").append(relation.getId()).append("',");
             sqls.append("'").append(relation.getGroupCode()).append("',");
             sqls.append("'").append(relation.getProjectId()).append("',");
-            if (relation.getGraphId() == null) {
-                sqls.append(relation.getGraphId()).append(",");
-            } else {
-                sqls.append("'").append(relation.getGraphId()).append("',");
-            }
-            sqls.append("'").append(relation.getGraphCode()).append("',");
-            sqls.append("'").append(relation.getRelCode()).append("',");
-
-            if (relation.getRelValue() == null) {
-                sqls.append(relation.getRelValue()).append(",");
-            } else {
-                sqls.append("'").append(relation.getRelValue()).append("',");
-            }
+            super.processNull(sqls, relation.getGraphId());
+            super.processNull(sqls, relation.getGraphCode());
+            super.processNull(sqls, relation.getRelCode());
+            super.processNull(sqls, relation.getRelValue());
+            super.processNull(sqls, relation.getObjFrom());
+            super.processNull(sqls, relation.getObjTo());
+            super.processNull(sqls, relation.getCreateApp());
+            super.processNull(sqls, relation.getUpdateApp());
+            super.processNull(sqls, relation.getCreator());
+            super.processNull(sqls, relation.getCreationTime());
+            super.processNull(sqls, relation.getModifier());
+            super.processNull(sqls, relation.getModifiedTime());
 
-            if (relation.getObjFrom() == null) {
-                sqls.append(relation.getObjFrom()).append(",");
-            } else {
-                sqls.append("'").append(relation.getObjFrom()).append("',");
-            }
-
-            if (relation.getObjTo() == null) {
-                sqls.append(relation.getObjTo()).append(",");
-            } else {
-                sqls.append("'").append(relation.getObjTo()).append("',");
-            }
-
-            if (relation.getCreateApp() == null) {
-                sqls.append(relation.getCreateApp()).append(",");
-            } else {
-                sqls.append("'").append(relation.getCreateApp()).append("',");
-            }
-            if (relation.getUpdateApp() == null) {
-                sqls.append(relation.getUpdateApp()).append(",");
-            } else {
-                sqls.append("'").append(relation.getUpdateApp()).append("',");
-            }
-            sqls.append("'").append(relation.getCreator()).append("',");
-            sqls.append("'").append(relation.getCreationTime()).append("',");
-            sqls.append("'").append(relation.getModifier()).append("',");
-            sqls.append("'").append(relation.getModifiedTime()).append("',");
             sqls.append(relation.getValid());
             sqls.append(")\n ,");
         });
-        return sqls;
+        String sql = "";
+        if(sqls.length() > 0){
+            sql = MigrationConstant.DT_RELATION_SQL_PRE + StrUtil.sub(sqls.toString(), 0 , -1) + "; \n ";
+        }
+        return sql;
     }
     private ExecutorService getExcecutor(){
         ExecutorService service = new ThreadPoolExecutor(10, 15, 0L, TimeUnit.MILLISECONDS,

+ 4 - 0
adm-business/adm-server/pom.xml

@@ -38,6 +38,10 @@
             <artifactId>dmp-amqp-starter</artifactId>
         </dependency>
         <dependency>
+            <groupId>com.persagy</groupId>
+            <artifactId>dmp-job-executor-starter</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.locationtech.jts</groupId>
             <artifactId>jts-core</artifactId>
             <version>1.16.1</version>

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/adm/server/algorithm/constant/AdmServerConstant.java

@@ -33,6 +33,6 @@ public interface AdmServerConstant {
     String CAD_ID="cADID";
     /**floorId*/
     String FLOOR_ID="floorId";
-
-
+    /***/
+    String MODEL_ANALYSIS_TIME_RULE_JOB = "modelAnalysisTimeRuleJob";
 }

+ 39 - 0
adm-business/adm-server/src/main/java/com/persagy/adm/server/backstage/jobhandler/CommonTimeRuleJob.java

@@ -0,0 +1,39 @@
+package com.persagy.adm.server.backstage.jobhandler;
+
+import com.persagy.adm.server.algorithm.constant.AdmServerConstant;
+import com.persagy.adm.server.backstage.service.impl.AdmAnalysisFacade;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+/**
+ * 执行器类
+ * @author : lijie
+ * Update By 2022/1/24 20:32
+ */
+@Slf4j
+@Component
+public class CommonTimeRuleJob {
+	/**
+	 * 模型解析任务
+	 * return : void
+	 * @author : lijie
+	 * Update By 2022/1/25 13:52
+	 */
+    @XxlJob(AdmServerConstant.MODEL_ANALYSIS_TIME_RULE_JOB)
+    public void modelAnalysisJobHandler() throws Exception {
+        XxlJobHelper.log("modelAnalysisTimeRuleJob start ...");
+        log.info("modelAnalysisTimeRuleJob start ...");
+        try {
+			AdmAnalysisFacade.analysisAdmModelFile();
+			XxlJobHelper.handleSuccess();
+		} catch (Exception e) {
+			log.error("模型解析定时任务执行失败", e);
+			XxlJobHelper.handleFail(e.getMessage());
+		} finally {
+			log.info("modelAnalysisTimeRuleJob end ... ");
+		}
+    }
+
+}

+ 6 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/AdmFileController.java

@@ -7,6 +7,7 @@ import com.persagy.adm.server.custom.dto.CadFiles;
 import com.persagy.adm.server.custom.entity.CadFileQueryParam;
 import com.persagy.adm.server.custom.entity.db.AdmCad;
 import com.persagy.adm.server.custom.enums.MajorEnum;
+import com.persagy.adm.server.custom.interceptor.TokenInterceptor;
 import com.persagy.adm.server.custom.service.IAdmCadService;
 import com.persagy.dmp.common.context.AppContext;
 import com.persagy.dmp.common.model.response.CommonResult;
@@ -39,7 +40,7 @@ public class AdmFileController {
     public CommonResult<List<AdmCad>> queryCadFiles(@RequestBody CadFileQueryParam queryParam){
         AppContext context = AppContext.getContext();
         Wrapper<AdmCad> eq = new LambdaQueryWrapper<AdmCad>()
-                .eq(StringUtils.isNotBlank(context.getGroupCode()), AdmCad::getGroupCode, context.getProjectId())
+                .eq(StringUtils.isNotBlank(context.getGroupCode()), AdmCad::getGroupCode, context.getGroupCode())
                 .eq(StringUtils.isNotBlank(context.getProjectId()), AdmCad::getProjectId, context.getProjectId())
                 .eq(StringUtils.isNotBlank(queryParam.getBuildingId()),AdmCad::getBuildingId,queryParam.getBuildingId())
                 .eq(StringUtils.isNotBlank(queryParam.getFloorId()),AdmCad::getFloorId,queryParam.getFloorId())
@@ -57,6 +58,9 @@ public class AdmFileController {
         AppContext context = AppContext.getContext();
         cadFiles.getFiles().forEach(file -> {
             AdmCad admCad = new AdmCad();
+            if (StringUtils.isNotBlank(file.getId())){
+                admCad.setId(file.getId());
+            }
             admCad.setGroupCode(context.getGroupCode());
             admCad.setProjectId(context.getProjectId());
             admCad.setBuildingId(cadFiles.getBuildingId());
@@ -66,6 +70,7 @@ public class AdmFileController {
             admCad.setCheckStatus(false);
             admCad.setFileKey(file.getFileKey());
             admCad.setFileName(file.getFileName());
+            admCad.setCreator(TokenInterceptor.bossAuthUserThreadLocal.get().getName());
             admFiles.add(admCad);
         });
         iAdmCadService.saveOrUpdateBatch(admFiles);

+ 7 - 10
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/AppController.java

@@ -1,7 +1,6 @@
 package com.persagy.adm.server.custom.controller;
 
 import cn.hutool.core.util.StrUtil;
-import com.persagy.adm.server.auth.service.AdmAuthService;
 import com.persagy.adm.server.custom.common.AdmRequest;
 import com.persagy.adm.server.custom.datatx.DataTxHandler;
 import com.persagy.adm.server.custom.dto.HasUpdateReq;
@@ -9,6 +8,7 @@ import com.persagy.adm.server.custom.entity.ConfigData;
 import com.persagy.adm.server.custom.entity.Dict;
 import com.persagy.adm.server.custom.entity.DownLoadData;
 import com.persagy.adm.server.custom.entity.UploadRtn;
+import com.persagy.adm.server.custom.interceptor.TokenInterceptor;
 import com.persagy.adm.server.custom.service.ISyncApp;
 import com.persagy.adm.server.custom.service.ServiceUtil;
 import com.persagy.dmp.auth.domain.BossAuthUser;
@@ -43,9 +43,6 @@ public class AppController {
 	@Autowired
 	private DataTxHandler dataTxHandler;
 
-	@Autowired
-	private AdmAuthService admAuthService;
-
 	@RequestMapping("/clientId")
 	public CommonResult<Map<String, Object>> clientId(@RequestBody AdmRequest req){
 		HashMap<String, Object> rtn = new HashMap<>();
@@ -55,25 +52,25 @@ public class AppController {
 
 	@RequestMapping("/dict")
 	public CommonResult<Dict> dict(@RequestBody AdmRequest req){
-		req.setUserId(admAuthService.loginInfo().getId());
+		req.setUserId(TokenInterceptor.bossAuthUserThreadLocal.get().getId());
 		return ResultHelper.single(syncApp.downloadDict(req.getGroupCode(), req.getProjectId(), req.getUserId()));
 	}
 
 	@RequestMapping("/config")
 	public CommonResult<ConfigData> config(@RequestBody AdmRequest req){
-		req.setUserId(admAuthService.loginInfo().getId());
+		req.setUserId(TokenInterceptor.bossAuthUserThreadLocal.get().getId());
 		return ResultHelper.single(syncApp.downloadConfig(req.getGroupCode(), req.getProjectId(), req.getUserId()));
 	}
 
 	@RequestMapping("/frame")
 	public CommonResult<Map<String, Object>> frame(@RequestBody AdmRequest req){
-		req.setUserId(admAuthService.loginInfo().getId());
+		req.setUserId(TokenInterceptor.bossAuthUserThreadLocal.get().getId());
 		return ResultHelper.single(syncApp.downloadFrameData(req.getGroupCode(), req.getProjectId(), req.getUserId()));
 	}
 
 	@RequestMapping("/download")
 	public CommonResult<DownLoadData> download(@RequestBody AdmRequest req){
-		req.setUserId(admAuthService.loginInfo().getId());
+		req.setUserId(TokenInterceptor.bossAuthUserThreadLocal.get().getId());
 		DownLoadData data;
 		if(StrUtil.isNotBlank(req.getBuildingId())) {
 			data = syncApp.downloadBuildingData(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getClientId(), req.getBuildingId(), req.getBdtpDownloadTs(), req.getAdmDownloadTs());
@@ -88,7 +85,7 @@ public class AppController {
 	 */
 	@RequestMapping("/downloadObjRel")
 	public CommonResult<DownLoadData> downloadObjRel(@RequestBody AdmRequest req){
-		req.setUserId(admAuthService.loginInfo().getId());
+		req.setUserId(TokenInterceptor.bossAuthUserThreadLocal.get().getId());
 		return ResultHelper.single(syncApp.downloadProjectData(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getClientId(), req.getBdtpDownloadTs(), req.getAdmDownloadTs()));
 	}
 
@@ -100,7 +97,7 @@ public class AppController {
 	@RequestMapping("/upload")
 	public CommonResult<UploadRtn> upload(HttpServletRequest request){
 		AdmRequest admRequest = dataTxHandler.handleRequest(request);
-		BossAuthUser bossAuthUser = admAuthService.loginInfo();
+		BossAuthUser bossAuthUser = TokenInterceptor.bossAuthUserThreadLocal.get();
 		log.info("用户:{},上传数据:{}",bossAuthUser,admRequest);
 		return ResultHelper.single(syncApp.uploadData(admRequest.getUploadData(), admRequest.getGroupCode(), admRequest.getProjectId(), admRequest.getUserId(), admRequest.getClientId()));
 	}

+ 1 - 0
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/CadFileInfo.java

@@ -6,6 +6,7 @@ import javax.validation.constraints.NotBlank;
 
 @Data
 public class CadFileInfo {
+    private String id;
     @NotBlank(message = "fileKey不能为空")
     private String fileKey;
     @NotBlank(message = "fileName不能为空")

+ 12 - 2
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/interceptor/AppContextConfig.java

@@ -1,16 +1,26 @@
 package com.persagy.adm.server.custom.interceptor;
 
-import org.springframework.context.annotation.Configuration;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
 import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
 import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
-@Configuration
+@Component
 public class AppContextConfig implements WebMvcConfigurer {
 
+    @Autowired
+    TokenInterceptor tokenInterceptor;
+
     @Override
     public void addInterceptors(InterceptorRegistry registry) {
         InterceptorRegistration registration = registry.addInterceptor(new AppContextInterceptor());
         registration.addPathPatterns("/adm/adm-file/**");
+
+        InterceptorRegistration registration1 = registry.addInterceptor(new TraceIdInterceptor());
+        registration1.addPathPatterns("/**");
+
+        registry.addInterceptor(tokenInterceptor).order(Integer.MAX_VALUE).addPathPatterns("/adm/**").excludePathPatterns("/adm/getUserInfo");
+
     }
 }

+ 39 - 0
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/interceptor/TokenInterceptor.java

@@ -0,0 +1,39 @@
+package com.persagy.adm.server.custom.interceptor;
+
+import com.persagy.adm.server.auth.service.AdmAuthService;
+import com.persagy.dmp.auth.domain.BossAuthUser;
+import com.persagy.dmp.common.constant.ResponseCode;
+import com.persagy.dmp.common.exception.BusinessException;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@Component
+@Slf4j
+public class TokenInterceptor extends HandlerInterceptorAdapter {
+    public static ThreadLocal<BossAuthUser> bossAuthUserThreadLocal = new ThreadLocal<>();
+
+    @Autowired
+    private AdmAuthService admAuthService;
+    @Override
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+        String token = request.getHeader("token");
+        if (StringUtils.isBlank(token)){
+            throw new BusinessException(ResponseCode.A0220.getCode(),ResponseCode.A0220.getDesc());
+        }
+
+        try {
+            BossAuthUser bossAuthUser = admAuthService.loginInfo();
+            bossAuthUserThreadLocal.set(bossAuthUser);
+        }catch (Exception e){
+            log.error("获取用户信息失败",e);
+            throw new BusinessException(ResponseCode.A0311.getCode(),ResponseCode.A0311.getDesc());
+        }
+        return super.preHandle(request, response, handler);
+    }
+}

+ 23 - 0
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/interceptor/TraceIdInterceptor.java

@@ -0,0 +1,23 @@
+package com.persagy.adm.server.custom.interceptor;
+
+import org.slf4j.MDC;
+import org.springframework.stereotype.Component;
+import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Objects;
+import java.util.UUID;
+
+@Component
+public class TraceIdInterceptor extends HandlerInterceptorAdapter {
+    @Override
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+        String traceId = request.getHeader("traceId");
+        if (!Objects.nonNull(traceId)){
+            traceId = UUID.randomUUID().toString();
+        }
+        MDC.put("traceId",traceId);
+        return super.preHandle(request, response, handler);
+    }
+}

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

@@ -26,6 +26,7 @@ import com.persagy.adm.server.custom.dto.RelationDefineCollectDTO;
 import com.persagy.adm.server.custom.entity.*;
 import com.persagy.adm.server.custom.entity.db.*;
 import com.persagy.adm.server.custom.enums.DeliveryTypeEnum;
+import com.persagy.adm.server.custom.interceptor.TokenInterceptor;
 import com.persagy.adm.server.custom.service.*;
 import com.persagy.adm.server.custom.service.impl.check_update.CheckUpdateChain;
 import com.persagy.adm.server.custom.service.impl.check_update.CheckUpdateContext;
@@ -107,9 +108,6 @@ public class SyncAppImpl implements ISyncApp {
 	AdmDefineProblemInfoMapper admDefineProblemInfoMapper;
 
 	@Autowired
-	private AdmAuthService admAuthService;
-
-	@Autowired
 	public SyncAppImpl(ObjectMapper4Tx mapper4Tx) {
 		this.mapper4Tx = mapper4Tx;
 	}
@@ -287,7 +285,7 @@ public class SyncAppImpl implements ISyncApp {
 		List<AdmProblem> problems = problemMapper.selectList(buildDownloadQueryWrapper(new QueryWrapper<>(),projectId,buildingId,operator,admDownloadTs));
 
 		// 下载ADM图纸
-		List<AdmCad> admCads = admCadMapper.selectList(new LambdaQueryWrapper<AdmCad>().eq(AdmCad::getProjectId,projectId).eq(AdmCad::getBuildingId,buildingId).gt(AdmCad::getTs,admDownloadTs));
+		List<AdmCad> admCads = admCadMapper.selectList(new LambdaQueryWrapper<AdmCad>().eq(AdmCad::getProjectId,projectId).eq(AdmCad::getBuildingId,buildingId).gt(admDownloadTs != null && admDownloadTs != 0,AdmCad::getTs,admDownloadTs));
 
 		List<AdmFile> file = fileMapper.selectList(buildDownloadQueryWrapper(new QueryWrapper<AdmFile>(), projectId, buildingId, operator, admDownloadTs));
 		List<AdmQrCode> qrCode = qrCodeMapper.selectList(buildDownloadQueryWrapper(new QueryWrapper<AdmQrCode>(), projectId, buildingId, operator, admDownloadTs));
@@ -453,7 +451,7 @@ public class SyncAppImpl implements ISyncApp {
 	public boolean hasUpdate(HasUpdateReq hasUpdateReq) {
 		CheckUpdateContext context = new CheckUpdateContext();
 		BeanUtil.copyProperties(hasUpdateReq,context);
-		BossAuthUser bossAuthUser = admAuthService.loginInfo();
+		BossAuthUser bossAuthUser = TokenInterceptor.bossAuthUserThreadLocal.get();
 		log.info("获取到用户信息:{}",bossAuthUser);
 		context.setUserId(bossAuthUser.getId());
 		return checkUpdateChain.doCheck(context);

+ 35 - 0
adm-comp/adm-steward-starter/src/main/java/com/persagy/adm/steward/client/BossStewardClient.java

@@ -0,0 +1,35 @@
+package com.persagy.adm.steward.client;
+
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.adm.steward.basic.config.StewardFeignConfig;
+import com.persagy.adm.steward.basic.model.response.BossResponse;
+import com.persagy.dmp.common.model.response.CommonResult;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+import java.util.Set;
+
+/***
+ * Description:对象管理Client
+ * @author : lijie
+ * @date :2021/8/19 17:38
+ * Update By lijie 2021/8/19 17:38
+ */
+@FeignClient(name = "boss-steward", configuration = StewardFeignConfig.class,
+        url = "${persagy.boss.steward.service:}",path = "/")
+public interface BossStewardClient {
+
+    /**
+     * 根据项目id批量查询项目信息
+     * @param projectIds: 项目id数组
+     * @return 对象数组
+     */
+    @PostMapping("test")
+    BossResponse<Void> test(@RequestHeader(value = "encryption-rsa", required = false,defaultValue = "true") Boolean rsaFlag,
+                            @RequestBody Set<String> projectIds);
+}

+ 23 - 0
adm-comp/adm-steward-starter/src/main/java/com/persagy/adm/steward/client/BossStewardFacade.java

@@ -0,0 +1,23 @@
+package com.persagy.adm.steward.client;
+
+import cn.hutool.extra.spring.SpringUtil;
+import java.util.Set;
+
+/**
+ * 物理世界对象Client门面
+ * @author Charlie Yu
+ * @date 2021-05-15
+ */
+public class BossStewardFacade {
+
+    private static BossStewardClient client = SpringUtil.getBean(BossStewardClient.class);
+
+    /**
+     * 根据项目id批量查询项目信息
+     * @param projectIds: 项目id数组
+     * @return 对象数组
+     */
+    public static void test(Set<String> projectIds) {
+        client.test(Boolean.TRUE,projectIds);
+    }
+}

+ 5 - 0
docker/k8sfiles/adm-server-standard.yml

@@ -12,6 +12,9 @@ spec:
   - port: 8080
     targetPort: 8080
     name: server-port
+  - port: 8081
+    targetPort: 8081
+    name: job-port
 
 ---
 apiVersion: apps/v1
@@ -35,6 +38,8 @@ spec:
         ports:
         - containerPort: 8080
           name: server-port
+        - containerPort: 8081
+          name: job-port
         env:
         - name: TZ
           value: Asia/Shanghai