|
|
@ -7,6 +7,7 @@ import com.fr.chartx.config.info.constant.ConfigType; |
|
|
|
import com.fr.design.mainframe.burying.point.AbstractPointCollector; |
|
|
|
import com.fr.design.mainframe.burying.point.AbstractPointCollector; |
|
|
|
import com.fr.design.mainframe.template.info.TemplateProcessInfo; |
|
|
|
import com.fr.design.mainframe.template.info.TemplateProcessInfo; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.xml.XMLPrintWriter; |
|
|
|
import com.fr.stable.xml.XMLPrintWriter; |
|
|
|
import com.fr.stable.xml.XMLableReader; |
|
|
|
import com.fr.stable.xml.XMLableReader; |
|
|
@ -184,6 +185,8 @@ public class ChartInfoCollector extends AbstractPointCollector<ChartInfo> { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void collectInfo(String templateId, String originID, TemplateProcessInfo processInfo, int timeConsume) { |
|
|
|
public void collectInfo(String templateId, String originID, TemplateProcessInfo processInfo, int timeConsume) { |
|
|
|
|
|
|
|
// 捕获RuntimeException,不中断保存模板核心逻辑,避免出现保存失败弹窗
|
|
|
|
|
|
|
|
try { |
|
|
|
if (!shouldCollectInfo()) { |
|
|
|
if (!shouldCollectInfo()) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -193,24 +196,33 @@ public class ChartInfoCollector extends AbstractPointCollector<ChartInfo> { |
|
|
|
boolean testTemplate = isTestTemplate(processInfo); |
|
|
|
boolean testTemplate = isTestTemplate(processInfo); |
|
|
|
|
|
|
|
|
|
|
|
for (ChartInfo chartInfo : pointInfoMap.values()) { |
|
|
|
for (ChartInfo chartInfo : pointInfoMap.values()) { |
|
|
|
if (originID.equals(chartInfo.getTemplateId())) { |
|
|
|
if (chartInfo != null && originID.equals(chartInfo.getTemplateId())) { |
|
|
|
chartInfo.setTemplateId(templateId); |
|
|
|
chartInfo.setTemplateId(templateId); |
|
|
|
chartInfo.setTestTemplate(testTemplate); |
|
|
|
chartInfo.setTestTemplate(testTemplate); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (ChartInfo chartInfo : chartInfoCacheMap.values()) { |
|
|
|
for (ChartInfo chartInfo : chartInfoCacheMap.values()) { |
|
|
|
|
|
|
|
if (chartInfo == null) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
BaseBook book = chartInfo.getBook(); |
|
|
|
BaseBook book = chartInfo.getBook(); |
|
|
|
if ((book != null && templateId.equals(book.getTemplateID())) || |
|
|
|
if (accept(templateId, originID, chartInfo, book)) { |
|
|
|
originID.equals(chartInfo.getTemplateId())) { |
|
|
|
|
|
|
|
chartInfo.setTemplateId(templateId); |
|
|
|
chartInfo.setTemplateId(templateId); |
|
|
|
chartInfo.setTestTemplate(testTemplate); |
|
|
|
chartInfo.setTestTemplate(testTemplate); |
|
|
|
pointInfoMap.put(chartInfo.getChartId(), chartInfo); |
|
|
|
pointInfoMap.put(chartInfo.getChartId(), chartInfo); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 每次更新之后,都同步到暂存文件中
|
|
|
|
// 每次更新之后,都同步到暂存文件中
|
|
|
|
saveInfo(); |
|
|
|
saveInfo(); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static boolean accept(String templateId, String originID, ChartInfo chartInfo, BaseBook book) { |
|
|
|
|
|
|
|
return (book != null && templateId.equals(book.getTemplateID())) || |
|
|
|
|
|
|
|
originID.equals(chartInfo.getTemplateId()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private boolean isTestTemplate(TemplateProcessInfo processInfo) { |
|
|
|
private boolean isTestTemplate(TemplateProcessInfo processInfo) { |
|
|
|