Browse Source

Pull request #14199: REPORT-114392 FR-FBP版本本地设计适配 修复部分开测bug

Merge in DESIGN/design from ~DESTINY.LIN/design:mss/2.0 to mss/2.0

* commit 'b903330360acffe2c0c7cc6faa6207415f056c7b':
  REPORT-126500 fbp设计器——取色器概率卡死
  REPORT-126873 FBP适配测试——国际化异常
  REPORT-126951 【仅FBP有问题】-设计器菜单栏-文件-选项-高级-log导出配置
mss/2.0
Destiny.Lin-林锦龙 5 months ago
parent
commit
7371f5ea4a
  1. 7
      designer-base/src/main/java/com/fr/design/ConfigHelper.java
  2. 3
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  3. 17
      designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java
  4. 24
      designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java

7
designer-base/src/main/java/com/fr/design/ConfigHelper.java

@ -77,15 +77,16 @@ public class ConfigHelper {
private static Properties getProperties(String path, Properties defaultValue){
Properties properties = new Properties();
if (defaultValue != null) {
properties.putAll(defaultValue);
}
try {
File file = new File(path);
if (!file.exists()) {
createFile(file);
}
properties.load(new BufferedReader(new FileReader(path)));
// 底层的环境信息,比如国际化什么的,不应该跟环境有关,要覆盖过来
if (defaultValue != null) {
properties.putAll(defaultValue);
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e, e.getMessage());
}

3
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -3,6 +3,7 @@
*/
package com.fr.design;
import com.fanruan.carina.Carina;
import com.fr.base.BaseXMLUtils;
import com.fr.base.OptimizeUtil;
import com.fr.base.Utils;
@ -51,6 +52,7 @@ import com.fr.general.xml.async.XmlException;
import com.fr.general.xml.async.XmlInitialFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.log.LogHandler;
import com.fr.platform.scaffold.provider.config.LanguageConfigProvider;
import com.fr.stable.CommonUtils;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
@ -1714,6 +1716,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter, AsyncXmlReada
}
}
}
Carina.config(LanguageConfigProvider.class).setLocale(CommonUtils.localeToString(designerEnvManager.getLanguage()));
}

17
designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java

@ -87,14 +87,15 @@ public class ColorPicker extends JDialog implements ActionListener {
}
public void updateLocation() {
mousePos = MouseInfo.getPointerInfo().getLocation();
updateCoordinate();
setLocation(setCoordinateX, setCoordinateY);
updateMousePos();
updateCoordinate();
colorPickerPanel.setMagnifierLocation(setCoordinateX,
setCoordinateY);
if (MouseInfo.getPointerInfo() != null) {
mousePos = MouseInfo.getPointerInfo().getLocation();
updateCoordinate();
setLocation(setCoordinateX, setCoordinateY);
updateMousePos();
updateCoordinate();
colorPickerPanel.setMagnifierLocation(setCoordinateX,
setCoordinateY);
}
}
private void updateCoordinate() {

24
designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java vendored

@ -31,6 +31,7 @@ import com.fr.cluster.ClusterBridge;
import com.fr.cluster.lock.ClusterLock;
import com.fr.config.BaseDBEnv;
import com.fr.config.ConfigEvent;
import com.fr.config.Configuration;
import com.fr.config.FinalPreferenceConfig;
import com.fr.config.dao.DaoContext;
import com.fr.config.dao.impl.BatchSubmitClassHelperDao;
@ -42,6 +43,8 @@ import com.fr.config.dao.impl.hibernate.HibernateXmlEnityDao;
import com.fr.config.dao.impl.remote.RemoteClassHelperDao;
import com.fr.config.dao.impl.remote.RemoteEntityDao;
import com.fr.config.dao.impl.remote.RemoteXmlEntityDao;
import com.fr.config.holder.ConfigChangeListener;
import com.fr.config.holder.ValidateConfigManger;
import com.fr.config.impl.ConfConfigProviderImpl;
import com.fr.config.impl.ConfigInsecurityElementProviderImpl;
import com.fr.decision.service.context.ServiceContext;
@ -54,6 +57,7 @@ import com.fr.design.backup.EnvBackupHelper;
import com.fr.env.detect.EnvDetectorCenter;
import com.fr.event.EventDispatcher;
import com.fr.general.FRLogger;
import com.fr.general.log.Log4jConfig;
import com.fr.general.log.Log4jUtils;
import com.fr.intelli.metrics.Compute;
import com.fr.intelli.metrics.DBMonitorInterceptor;
@ -86,6 +90,7 @@ import com.fr.stable.db.session.DBSession;
import com.fr.stable.project.ProjectConstants;
import com.fr.tenant.context.TenantContext;
import com.fr.tenant.context.provider.CurrentTenantKey;
import com.fr.third.apache.logging.log4j.core.config.Configurator;
import com.fr.third.net.bytebuddy.implementation.MethodDelegation;
import com.fr.third.net.bytebuddy.matcher.ElementMatchers;
import com.fr.third.org.hibernate.jdbc.AbstractWork;
@ -235,6 +240,25 @@ public class DesignEnvComponent {
String realPath = Carina.properties(LoggerProperties.class).getXml();
URI uri = Log4jUtils.buildUserConfigURI(realPath);
FRLogger.getLogger().config(uri);
// 日志配置更新的监听在FRLogger里面,fbp去掉了但是设计器本地还是需要这个监听的,初始化的时候监听一下
listenConfig();
}
private void listenConfig() {
ValidateConfigManger.getInstance().registerListener(new ConfigChangeListener() {
@Override
public boolean accept(Class<? extends Configuration> configClass) {
return configClass.equals(Log4jConfig.class);
}
@Override
public void change() {
// The root logger is the topmost logger with a name of "" (the empty string).
Configurator.setAllLevels("", Log4jConfig.getInstance().getRootLevel());
}
});
}
private void stopLogger() {

Loading…
Cancel
Save