diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java index 46218b91a..695e8d8f2 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java @@ -4,6 +4,7 @@ package com.fr.start.module; import com.fr.base.OptimizeUtil; import com.fr.concurrent.NamedThreadFactory; import com.fr.config.dao.DaoSelectorFactory; +import com.fr.config.dao.PropertiesConstants; import com.fr.decision.webservice.v10.encryption.EncryptionConstants; import com.fr.design.DesignerEnvManager; import com.fr.design.RestartHelper; @@ -157,15 +158,28 @@ public class DesignerStartup extends Activator { if (info.getType() == DesignerWorkspaceType.Remote) { DaoSelectorFactory.registerDaoSelector(() -> false); } else { - String dbConfigPath = StableUtils.pathJoin(WorkspaceUtils.getWorkspaceInfo().getPath(), ProjectConstants.CONFIG_DIRECTORY, + String webInfPath = WorkspaceUtils.getWorkspaceInfo().getPath(); + String dbConfigPath = StableUtils.pathJoin(webInfPath, ProjectConstants.CONFIG_DIRECTORY, EncryptionConstants.PROPERTY_NAME); - // + String entityPath = generatePath(webInfPath, PropertiesConstants.ENTITY_PROP); + String xmlEntityPath = generatePath(webInfPath, PropertiesConstants.XML_ENTITY_PROP); + String classNamePath = generatePath(webInfPath, PropertiesConstants.CLASS_NAME_PROP); + // 校验 平台迁移文件/缓存文件 + boolean existPropCache = new File(entityPath).exists() && new File(xmlEntityPath).exists() && new File(classNamePath).exists(); DaoSelectorFactory.registerDaoSelector(() -> DesignerEnvManager.getEnvManager().isPropertiesUsable() && OptimizeUtil.isOpen() + && existPropCache && !new File(dbConfigPath).exists()); + } } + private String generatePath(String webInfPath, String name) { + return StableUtils.pathJoin(webInfPath, ProjectConstants.EMBED_DB_DIRECTORY, + ProjectConstants.PROPERTIES_CACHE_FOR_CONFIG, name); + } + + @Override public void stop() { // void