Browse Source

open

master
pioneer 2 years ago
commit
720f55cc0f
  1. 6
      README.md
  2. BIN
      doc/.~D-9974配置使用文档.docx
  3. BIN
      doc/JSD-9974-需求确认书.docx
  4. BIN
      doc/JSD-9974配置使用文档.docx
  5. 409
      doc/定制报表头处理.cpt
  6. BIN
      lib/finekit-10.0.jar
  7. 33
      plugin.xml
  8. 27
      src/main/java/com/fr/plugin/isgd/Constants.java
  9. 31
      src/main/java/com/fr/plugin/isgd/LocaleFinder.java
  10. 172
      src/main/java/com/fr/plugin/isgd/bean/ParamColumn.java
  11. 43
      src/main/java/com/fr/plugin/isgd/dao/ReportIndexInfoDao.java
  12. 107
      src/main/java/com/fr/plugin/isgd/entity/ReportIndexInfoEntity.java
  13. 60
      src/main/java/com/fr/plugin/isgd/menu/ParamAction.java
  14. 89
      src/main/java/com/fr/plugin/isgd/menu/ParamConfig.java
  15. 79
      src/main/java/com/fr/plugin/isgd/menu/ParamConfigPane.java
  16. 55
      src/main/java/com/fr/plugin/isgd/menu/ParamMenuHandler.java
  17. 82
      src/main/java/com/fr/plugin/isgd/provider/ProcessDBAccess.java
  18. 113
      src/main/java/com/fr/plugin/isgd/service/ReportRowHandler.java
  19. 34
      src/main/java/com/fr/plugin/isgd/service/ReportRowHandlerProvider.java
  20. 77
      src/main/java/com/fr/plugin/isgd/toolbar/ColumnExtensionButton.java
  21. 40
      src/main/java/com/fr/plugin/isgd/toolbar/ColumnToolbarUI.java
  22. 34
      src/main/java/com/fr/plugin/isgd/utils/FuncUtils.java
  23. 12
      src/main/java/com/fr/plugin/isgd/web/CssFile.java
  24. 45
      src/main/java/com/fr/plugin/isgd/web/JavaScriptFile.java
  25. BIN
      src/main/resources/com/fr/plugin/isgd/images/column16.png
  26. 9
      src/main/resources/com/fr/plugin/isgd/locale/lang.properties
  27. 9
      src/main/resources/com/fr/plugin/isgd/locale/lang_zh_CN.properties
  28. 25
      src/main/resources/com/fr/plugin/isgd/web/isgd.css
  29. 22
      src/main/resources/com/fr/plugin/isgd/web/isgd.js

6
README.md

@ -0,0 +1,6 @@
# open-JSD-9974
JSD-9974 报表可以自动解析出表头信息并存入数据库\
免责说明:该源码为第三方爱好者提供,不保证源码和方案的可靠性,也不提供任何形式的源码教学指导和协助!\
仅作为开发者学习参考使用!禁止用于任何商业用途!\
为保护开发者隐私,开发者信息已隐去!若原开发者希望公开自己的信息,可联系【pioneer】处理。

BIN
doc/.~D-9974配置使用文档.docx

Binary file not shown.

BIN
doc/JSD-9974-需求确认书.docx

Binary file not shown.

BIN
doc/JSD-9974配置使用文档.docx

Binary file not shown.

409
doc/定制报表头处理.cpt

@ -0,0 +1,409 @@
<?xml version="1.0" encoding="UTF-8"?>
<WorkBook xmlVersion="20211223" releaseVersion="10.0.0">
<TableDataMap>
<TableData name="ds1" class="com.fr.data.impl.DBTableData">
<Parameters/>
<Attributes maxMemRowCount="-1"/>
<Connection class="com.fr.data.impl.NameDatabaseConnection">
<DatabaseName>
<![CDATA[finedb]]></DatabaseName>
</Connection>
<Query>
<![CDATA[select * from PUBLIC.FINE_REPORT_INDEX_INFO order by REPORT_CODE, TABLE_CODE,INDEX_CODE;]]></Query>
<PageQuery>
<![CDATA[]]></PageQuery>
</TableData>
</TableDataMap>
<ReportWebAttr>
<ServerPrinter/>
<WebPageContent>
<ToolBars>
<ToolBarManager>
<Location>
<Embed position="1"/>
</Location>
<ToolBar>
<Widget class="com.fr.report.web.button.page.First">
<WidgetAttr aspectRatioLocked="false" aspectRatioBackup="0.0" description="">
<MobileBookMark useBookMark="false" bookMarkName="" frozen="false"/>
<PrivilegeControl/>
</WidgetAttr>
<Text>
<![CDATA[${i18n('Fine-Engine_Report_ReportServerP_First')}]]></Text>
<Hotkeys>
<![CDATA[]]></Hotkeys>
<IconName>
<![CDATA[first]]></IconName>
</Widget>
<Widget class="com.fr.report.web.button.page.Previous">
<WidgetAttr aspectRatioLocked="false" aspectRatioBackup="0.0" description="">
<MobileBookMark useBookMark="false" bookMarkName="" frozen="false"/>
<PrivilegeControl/>
</WidgetAttr>
<Text>
<![CDATA[${i18n('Fine-Engine_Report_ReportServerP_Previous')}]]></Text>
<Hotkeys>
<![CDATA[]]></Hotkeys>
<IconName>
<![CDATA[previous]]></IconName>
</Widget>
<Widget class="com.fr.report.web.button.page.PageNavi">
<WidgetAttr aspectRatioLocked="false" aspectRatioBackup="0.0" description="">
<MobileBookMark useBookMark="false" bookMarkName="" frozen="false"/>
<PrivilegeControl/>
</WidgetAttr>
</Widget>
<Widget class="com.fr.report.web.button.page.Next">
<WidgetAttr aspectRatioLocked="false" aspectRatioBackup="0.0" description="">
<MobileBookMark useBookMark="false" bookMarkName="" frozen="false"/>
<PrivilegeControl/>
</WidgetAttr>
<Text>
<![CDATA[${i18n('Fine-Engine_ReportServerP_Next')}]]></Text>
<Hotkeys>
<![CDATA[]]></Hotkeys>
<IconName>
<![CDATA[next]]></IconName>
</Widget>
<Widget class="com.fr.report.web.button.page.Last">
<WidgetAttr aspectRatioLocked="false" aspectRatioBackup="0.0" description="">
<MobileBookMark useBookMark="false" bookMarkName="" frozen="false"/>
<PrivilegeControl/>
</WidgetAttr>
<Text>
<![CDATA[${i18n('Fine-Engine_Report_ReportServerP_Last')}]]></Text>
<Hotkeys>
<![CDATA[]]></Hotkeys>
<IconName>
<![CDATA[last]]></IconName>
</Widget>
<Widget class="com.fr.report.web.button.NewPrint">
<WidgetAttr aspectRatioLocked="false" aspectRatioBackup="0.0" description="">
<MobileBookMark useBookMark="false" bookMarkName="" frozen="false"/>
<PrivilegeControl/>
</WidgetAttr>
<Text>
<![CDATA[${i18n('Fine-Engine_Print')}]]></Text>
<Hotkeys>
<![CDATA[]]></Hotkeys>
<IconName>
<![CDATA[print]]></IconName>
</Widget>
<Widget class="com.fr.report.web.button.Export">
<WidgetAttr aspectRatioLocked="false" aspectRatioBackup="0.0" description="">
<MobileBookMark useBookMark="false" bookMarkName="" frozen="false"/>
<PrivilegeControl/>
</WidgetAttr>
<Text>
<![CDATA[${i18n('Export')}]]></Text>
<Hotkeys>
<![CDATA[]]></Hotkeys>
<IconName>
<![CDATA[export]]></IconName>
<Buttons pdf="true" excelP="true" excelO="true" excelS="true" word="true" image="true" html="true"/>
</Widget>
<Widget class="com.fr.report.web.button.Email">
<WidgetAttr aspectRatioLocked="false" aspectRatioBackup="0.0" description="">
<MobileBookMark useBookMark="false" bookMarkName="" frozen="false"/>
<PrivilegeControl/>
</WidgetAttr>
<Text>
<![CDATA[${i18n('Fine-Engine_Report_Email')}]]></Text>
<Hotkeys>
<![CDATA[]]></Hotkeys>
<IconName>
<![CDATA[email]]></IconName>
<EmailButton customConsignee="true" consigneeByDepartment="false" consigneeByRole="false"/>
</Widget>
<Widget class="com.fr.plugin.isgd.toolbar.ColumnExtensionButton" pluginID="com.fr.plugin.isgd.v10" plugin-version="1.0">
<WidgetAttr aspectRatioLocked="false" aspectRatioBackup="-1.0" description="">
<MobileBookMark useBookMark="false" bookMarkName="" frozen="false"/>
<PrivilegeControl/>
</WidgetAttr>
<Text>
<![CDATA[表头行处理定制]]></Text>
<Hotkeys>
<![CDATA[]]></Hotkeys>
<IconName>
<![CDATA[isgd]]></IconName>
</Widget>
</ToolBar>
</ToolBarManager>
</ToolBars>
<WebPage isPage="false" showAsImage="false" autoScale="false" tdHeavy="false"/>
</WebPageContent>
<WebViewContent>
<ToolBars>
<ToolBarManager>
<Location>
<Embed position="1"/>
</Location>
<ToolBar>
<Widget class="com.fr.report.web.button.PageSetup">
<WidgetAttr aspectRatioLocked="false" aspectRatioBackup="0.0" description="">
<MobileBookMark useBookMark="false" bookMarkName="" frozen="false"/>
<PrivilegeControl/>
</WidgetAttr>
<Text>
<![CDATA[${i18n('Fine-Engine_Report_Page_Setup')}]]></Text>
<Hotkeys>
<![CDATA[]]></Hotkeys>
<IconName>
<![CDATA[pagesetup]]></IconName>
</Widget>
<Widget class="com.fr.report.web.button.PrintPreview">
<WidgetAttr aspectRatioLocked="false" aspectRatioBackup="0.0" description="">
<MobileBookMark useBookMark="false" bookMarkName="" frozen="false"/>
<PrivilegeControl/>
</WidgetAttr>
<Text>
<![CDATA[${i18n('Fine-Engine_Report_PrintP_Print_Preview')}]]></Text>
<Hotkeys>
<![CDATA[]]></Hotkeys>
<IconName>
<![CDATA[preview]]></IconName>
</Widget>
<Widget class="com.fr.report.web.button.NewPrint">
<WidgetAttr aspectRatioLocked="false" aspectRatioBackup="0.0" description="">
<MobileBookMark useBookMark="false" bookMarkName="" frozen="false"/>
<PrivilegeControl/>
</WidgetAttr>
<Text>
<![CDATA[${i18n('Fine-Engine_Print')}]]></Text>
<Hotkeys>
<![CDATA[]]></Hotkeys>
<IconName>
<![CDATA[print]]></IconName>
</Widget>
<Widget class="com.fr.report.web.button.Export">
<WidgetAttr aspectRatioLocked="false" aspectRatioBackup="0.0" description="">
<MobileBookMark useBookMark="false" bookMarkName="" frozen="false"/>
<PrivilegeControl/>
</WidgetAttr>
<Text>
<![CDATA[${i18n('Export')}]]></Text>
<Hotkeys>
<![CDATA[]]></Hotkeys>
<IconName>
<![CDATA[export]]></IconName>
<Buttons pdf="true" excelP="true" excelO="true" excelS="true" word="true" image="true" html="true"/>
</Widget>
<Widget class="com.fr.report.web.button.Email">
<WidgetAttr aspectRatioLocked="false" aspectRatioBackup="0.0" description="">
<MobileBookMark useBookMark="false" bookMarkName="" frozen="false"/>
<PrivilegeControl/>
</WidgetAttr>
<Text>
<![CDATA[${i18n('Fine-Engine_Report_Email')}]]></Text>
<Hotkeys>
<![CDATA[]]></Hotkeys>
<IconName>
<![CDATA[email]]></IconName>
<EmailButton customConsignee="true" consigneeByDepartment="false" consigneeByRole="false"/>
</Widget>
</ToolBar>
</ToolBarManager>
</ToolBars>
<SortFuncCheck check="true"/>
<ConditionFuncCheck check="true"/>
<ListFuncCheck check="true"/>
</WebViewContent>
</ReportWebAttr>
<ReportFitAttr fitStateInPC="1" fitFont="false"/>
<ElementCaseMobileAttr>
<ElementCaseMobileAttrProvider horizontal="1" vertical="1" zoom="true" refresh="false" isUseHTML="false" isMobileCanvasSize="false" appearRefresh="false" allowFullScreen="false" allowDoubleClickOrZoom="true" functionalWhenUnactivated="false"/>
</ElementCaseMobileAttr>
<Report class="com.fr.report.worksheet.WorkSheet" name="sheet1">
<ReportPageAttr>
<HR/>
<FR/>
<HC/>
<FC/>
</ReportPageAttr>
<ColumnPrivilegeControl>
<PrivilegeControl/>
</ColumnPrivilegeControl>
<RowPrivilegeControl/>
<RowHeight defaultValue="723900">
<![CDATA[792480,723900,723900,723900,723900,723900,723900,723900,723900,723900,723900]]></RowHeight>
<ColumnWidth defaultValue="2743200">
<![CDATA[2743200,2743200,2743200,2407920,2743200,2743200,2743200,2743200,2743200,2743200,2743200]]></ColumnWidth>
<CellElementList>
<C c="0" r="0" s="0">
<O>
<![CDATA[测试A]]></O>
<PrivilegeControl/>
<Expand/>
</C>
<C c="1" r="0" s="1">
<O>
<![CDATA[测试B]]></O>
<PrivilegeControl/>
<CellGUIAttr showAsHTML="true"/>
<CellPageAttr/>
<Expand/>
</C>
<C c="2" r="0" s="1">
<O>
<![CDATA[测试C]]></O>
<PrivilegeControl/>
<CellGUIAttr showAsHTML="true"/>
<CellPageAttr/>
<Expand/>
</C>
<C c="3" r="0" s="1">
<O>
<![CDATA[测试D]]></O>
<PrivilegeControl/>
<CellGUIAttr showAsHTML="true"/>
<CellPageAttr/>
<Expand/>
</C>
<C c="4" r="0" s="2">
<O>
<![CDATA[测试E]]></O>
<PrivilegeControl/>
<Expand/>
</C>
<C c="5" r="0" s="2">
<O>
<![CDATA[测试F]]></O>
<PrivilegeControl/>
<Expand/>
</C>
<C c="6" r="0" s="2">
<O>
<![CDATA[测试G]]></O>
<PrivilegeControl/>
<Expand/>
</C>
<C c="7" r="0" s="2">
<O>
<![CDATA[测试H]]></O>
<PrivilegeControl/>
<Expand/>
</C>
<C c="8" r="0" s="2">
<O>
<![CDATA[测试I]]></O>
<PrivilegeControl/>
<Expand/>
</C>
<C c="0" r="1">
<O>
<![CDATA[A]]></O>
<PrivilegeControl/>
<Expand/>
</C>
<C c="1" r="1">
<O>
<![CDATA[B]]></O>
<PrivilegeControl/>
<Expand/>
</C>
<C c="2" r="1" s="3">
<O>
<![CDATA[C]]></O>
<PrivilegeControl/>
<Expand/>
</C>
<C c="3" r="1">
<O>
<![CDATA[D]]></O>
<PrivilegeControl/>
<Expand/>
</C>
<C c="4" r="1">
<O t="XMLable" class="com.fr.base.Formula">
<Attributes>
<![CDATA[=D2]]></Attributes>
</O>
<PrivilegeControl/>
<Expand/>
</C>
<C c="5" r="1">
<O>
<![CDATA[F]]></O>
<PrivilegeControl/>
<Expand/>
</C>
<C c="6" r="1">
<O t="XMLable" class="com.fr.base.Formula">
<Attributes>
<![CDATA[=F2]]></Attributes>
</O>
<PrivilegeControl/>
<Expand/>
</C>
</CellElementList>
<ReportAttrSet>
<ReportSettings headerHeight="0" footerHeight="0">
<PaperSetting/>
<Background name="ColorBackground" color="-1"/>
</ReportSettings>
<Header reportPageType="0">
<Background name="NullBackground"/>
<LeftList/>
<CenterList/>
<RightList/>
</Header>
<Footer reportPageType="0">
<Background name="NullBackground"/>
<LeftList/>
<CenterList/>
<RightList/>
</Footer>
</ReportAttrSet>
<PrivilegeControl/>
</Report>
<ReportParameterAttr>
<Attributes showWindow="true" delayPlaying="true" windowPosition="1" align="0" useParamsTemplate="true" currentIndex="0"/>
<PWTitle>
<![CDATA[参数]]></PWTitle>
</ReportParameterAttr>
<StyleList>
<Style imageLayout="1">
<FRFont name="SimSun" style="0" size="72"/>
<Background name="NullBackground"/>
<Border>
<Top style="5"/>
<Bottom style="5"/>
<Left style="5"/>
</Border>
</Style>
<Style imageLayout="1">
<FRFont name="SimSun" style="0" size="72" foreground="-12632257"/>
<Background name="ColorBackground" color="-1"/>
<Border>
<Top style="1" color="-16777216"/>
<Bottom style="1" color="-16777216"/>
<Left style="1" color="-16777216"/>
<Right style="1" color="-16777216"/>
</Border>
</Style>
<Style imageLayout="1">
<FRFont name="SimSun" style="0" size="72"/>
<Background name="NullBackground"/>
<Border>
<Top style="5"/>
<Bottom style="5"/>
</Border>
</Style>
<Style imageLayout="1">
<FRFont name="SimSun" style="0" size="72"/>
<Background name="ColorBackground" color="-1"/>
<Border/>
</Style>
</StyleList>
<DesignerVersion DesignerVersion="KAA"/>
<PreviewType PreviewType="0"/>
<CustomColumnConfig class="com.fr.plugin.isgd.menu.ParamConfig" pluginID="com.fr.plugin.isgd.v10" plugin-version="1.0">
<Attr headerRow="1,2"/>
</CustomColumnConfig>
<TemplateIdAttMark class="com.fr.base.iofile.attr.TemplateIdAttrMark">
<TemplateIdAttMark TemplateId="0ca3278d-67f8-4dbd-a6c1-caa5f4b1ab7c"/>
</TemplateIdAttMark>
<TemplateCloudInfoAttrMark class="com.fr.plugin.cloud.analytics.attr.TemplateInfoAttrMark" pluginID="com.fr.plugin.cloud.analytics.v10" plugin-version="2.6.1.20220408">
<TemplateCloudInfoAttrMark createTime="1650381971588"/>
</TemplateCloudInfoAttrMark>
</WorkBook>

BIN
lib/finekit-10.0.jar

Binary file not shown.

33
plugin.xml

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<id>com.fr.plugin.isgd.v10</id>
<name><![CDATA[表头行处理定制]]></name>
<active>yes</active>
<version>1.0</version>
<env-version>10.0</env-version>
<jartime>2018-07-31</jartime>
<vendor>fr.open</vendor>
<description><![CDATA[预览报表可以自动解析出表头信息,并实现保存数据库。]]></description>
<change-notes><![CDATA[
预览报表可以自动解析出表头信息,并实现保存数据库。<br/>
]]></change-notes>
<main-package>com.fr.plugin.isgd</main-package>
<extra-core>
<IOFileAttrMark class="com.fr.plugin.isgd.menu.ParamConfig"/>
<LocaleFinder class="com.fr.plugin.isgd.LocaleFinder"/>
<DBAccessProvider class="com.fr.plugin.isgd.provider.ProcessDBAccess"/>
</extra-core>
<extra-report>
<ExtensionButtonProvider class="com.fr.plugin.isgd.toolbar.ColumnExtensionButton"/>
<JavaScriptFileHandler class="com.fr.plugin.isgd.web.JavaScriptFile"/>
<CssFileHandler class="com.fr.plugin.isgd.web.CssFile"/>
</extra-report>
<extra-decision>
<HttpHandlerProvider class="com.fr.plugin.isgd.service.ReportRowHandlerProvider"/>
</extra-decision>
<extra-designer>
<ToolbarItemProvider class="com.fr.plugin.isgd.toolbar.ColumnToolbarUI"/>
<MenuHandler class="com.fr.plugin.isgd.menu.ParamMenuHandler"/>
</extra-designer>
<function-recorder class="com.fr.plugin.isgd.web.JavaScriptFile"/>
</plugin>

27
src/main/java/com/fr/plugin/isgd/Constants.java

@ -0,0 +1,27 @@
/*
* Copyright (C), 2015-2019
* FileName: Constants
* Author: xx
* Date: 2019/9/4 16:09
* Description: Constants
* History:
* <author> <time> <version> <desc>
*/
package com.fr.plugin.isgd;
import com.fanruan.api.i18n.I18nKit;
/**
* <Function Description><br>
* <Constants>
*
* @author xx
* @since 1.0.0
*/
public class Constants {
public static final String PLUGIN_ID = "com.fr.plugin.isgd.v10";
public static final String ICON_PATH = "/com/fr/plugin/isgd/images/column16.png";
public static final String ACTION_NAME = I18nKit.getLocText("Plugin-isgd_Action_Name");
public static final String PARAM_CUSTOM_COLUMN = "isgd";
public static final String REPORT_NAME = "REPORTNAME";
}

31
src/main/java/com/fr/plugin/isgd/LocaleFinder.java

@ -0,0 +1,31 @@
/*
* Copyright (C), 2015-2019
* FileName: LocaleFinder
* Author: xx
* Date: 2019/9/4 16:20
* Description: LocaleFinder
* History:
* <author> <time> <version> <desc>
*/
package com.fr.plugin.isgd;
import com.fr.stable.fun.impl.AbstractLocaleFinder;
/**
* <Function Description><br>
* <LocaleFinder>
*
* @author xx
* @since 1.0.0
*/
public class LocaleFinder extends AbstractLocaleFinder {
@Override
public String find() {
return "com/fr/plugin/isgd/locale/lang";
}
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
}

172
src/main/java/com/fr/plugin/isgd/bean/ParamColumn.java

@ -0,0 +1,172 @@
/*
* Copyright (C), 2018-2020
* Project: starter
* FileName: ParamColumn
* Author: xx
* Date: 2020/12/8 11:27
*/
package com.fr.plugin.isgd.bean;
import com.fanruan.api.i18n.I18nKit;
import com.fanruan.api.util.GeneralKit;
import com.fanruan.api.util.StringKit;
import com.fr.base.Formula;
import com.fr.base.Style;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.ChartPainter;
import com.fr.general.DateUtils;
import com.fr.general.ImageWithSuffix;
import com.fr.json.JSONArray;
import com.fr.main.impl.LinkWorkBookTemplate;
import com.fr.plugin.isgd.entity.ReportIndexInfoEntity;
import com.fr.plugin.isgd.menu.ParamConfig;
import com.fr.report.cell.ResultCellElement;
import com.fr.report.cell.cellattr.core.ResultSubReport;
import com.fr.report.cell.cellattr.core.RichText;
import com.fr.report.cell.cellattr.core.SubReport;
import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.cell.painter.BiasTextPainter;
import com.fr.report.report.ECReport;
import com.fr.stable.StableUtils;
import org.jetbrains.annotations.NotNull;
import java.util.*;
/**
* <Function Description><br>
* <自定义列参数bean>
*
* @author xx
* @since 1.0.0
*/
public class ParamColumn {
public static final String REGEX_HTML1 = "\\&[a-zA-Z]{1,10};";
public static final String REGEX_HTML2 = "<[^>]*>";
public static final String REGEX_HTML3 = "[(/>)<]";
private String reportName;
private int[] headerRows;
private JSONArray columnArray;
public ParamColumn() {
}
/**
* 单元格结果值转为字符串
*
* @param resultCellElement
* @return
*/
@NotNull
private String getCellText(ResultCellElement resultCellElement) {
String cellText;
Object value = this.getCellValue(resultCellElement);
Style style = resultCellElement.getStyle();
if (style != null) {
cellText = Style.valueToText(value, style.getFormat());
} else {
cellText = GeneralKit.objectToString(value);
}
cellText = cellText.replaceAll(REGEX_HTML1, StringKit.EMPTY)
.replaceAll(REGEX_HTML2, StringKit.EMPTY).replaceAll(REGEX_HTML3, StringKit.EMPTY);
return cellText;
}
/**
* 获得展示列值
*
* @param ecReport
* @return
*/
public List<ReportIndexInfoEntity> getReportIndexInfoEntities(ECReport ecReport, String reportCode, String currentUserName) {
List<ReportIndexInfoEntity> result = new ArrayList<>();
ReportIndexInfoEntity entity;
ResultCellElement resultCellElement;
for (int headerRow : headerRows) {
Iterator iterator = ecReport.getRow(headerRow - 1);
String cellText;
while (iterator.hasNext()) {
resultCellElement = (ResultCellElement) iterator.next();
cellText = getCellText(resultCellElement);
entity = new ReportIndexInfoEntity();
entity.setId(UUID.randomUUID().toString());
entity.setReportCode(reportCode);
entity.setTableCode(headerRow);
entity.setIndexCode(StableUtils.convertIntToABC(resultCellElement.getColumn() + 1));
entity.setIndexName(cellText);
entity.setCreateDate(DateUtils.getDate2LStr(new Date()));
entity.setUpdateDate(DateUtils.getDate2LStr(new Date()));
entity.setOpUsername(currentUserName);
result.add(entity);
}
}
return result;
}
/**
* 读取cell值
*
* @param cell
* @return
*/
private Object getCellValue(ResultCellElement cell) {
if (cell == null) {
return StringKit.EMPTY;
}
Object value = cell.getShowValue();
if (value instanceof Formula) {
value = ((Formula) value).getPureContent();
} else if (value instanceof BiasTextPainter) {
value = ((BiasTextPainter) value).getText();
} else if (value instanceof DSColumn) {
value = ((DSColumn) value).getDSName();
} else if (value instanceof SubReport) {
value = ((LinkWorkBookTemplate) ((SubReport) value).getPackee()).getTemplatePath();
} else if (value instanceof ResultSubReport) {
value = I18nKit.getLocText("Plugin-isgd_SubReport_Column");
} else if (value instanceof ChartCollection) {
value = ((ChartCollection) value).getChartName(0);
} else if (value instanceof ChartPainter) {
value = ((ChartPainter) value).getGlyphName(0);
} else if (value instanceof RichText) {
value = ((RichText) value).getContent();
} else if (value instanceof ImageWithSuffix) {
value = I18nKit.getLocText("Plugin-isgd_Image_Column");
}
return value == null ? StringKit.EMPTY : value;
}
public String getReportName() {
return reportName;
}
public void setReportName(String reportName) {
this.reportName = reportName;
}
public JSONArray getColumnArray() {
return columnArray;
}
public void setColumnArray(JSONArray columnArray) {
this.columnArray = columnArray;
}
public int[] getHeaderRows() {
return headerRows;
}
/**
* 设置表头列值所在行码
*
* @param paramConfig
* @return
*/
public void setHeaderRows(ParamConfig paramConfig) {
int[] headerRows = paramConfig != null ? paramConfig.getHeaderRowInts() : new int[]{0};
this.setHeaderRows(headerRows);
}
public void setHeaderRows(int[] headerRow) {
this.headerRows = headerRow;
}
}

43
src/main/java/com/fr/plugin/isgd/dao/ReportIndexInfoDao.java

@ -0,0 +1,43 @@
/*
* Copyright (C), 2018-2021
* Project: starter
* FileName: ReportIndexInfoDao
* Author: xx
* Date: 2021/9/15 10:12
*/
package com.fr.plugin.isgd.dao;
import com.fr.plugin.isgd.entity.ReportIndexInfoEntity;
import com.fr.stable.db.dao.BaseDAO;
import com.fr.stable.db.dao.DAOProvider;
import com.fr.stable.db.session.DAOSession;
/**
* <Function Description><br>
* <ReportIndexInfoDao>
*
* @author xx
* @since 1.0.0
*/
public class ReportIndexInfoDao extends BaseDAO<ReportIndexInfoEntity> {
public final static DAOProvider<ReportIndexInfoEntity> DAO = new DAOProvider<ReportIndexInfoEntity>() {
@Override
public Class<ReportIndexInfoEntity> getEntityClass() {
return ReportIndexInfoEntity.class;
}
@Override
public Class<? extends BaseDAO<ReportIndexInfoEntity>> getDAOClass() {
return ReportIndexInfoDao.class;
}
};
public ReportIndexInfoDao(DAOSession daoSession) {
super(daoSession);
}
@Override
protected Class<ReportIndexInfoEntity> getEntityClass() {
return ReportIndexInfoEntity.class;
}
}

107
src/main/java/com/fr/plugin/isgd/entity/ReportIndexInfoEntity.java

@ -0,0 +1,107 @@
/*
* Copyright (C), 2018-2021
* Project: starter
* FileName: ReportIndexInfoEntity
* Author: xx
* Date: 2021/9/15 10:08
*/
package com.fr.plugin.isgd.entity;
import com.fr.stable.db.entity.BaseEntity;
import com.fr.third.javax.persistence.Column;
import com.fr.third.javax.persistence.Entity;
import com.fr.third.javax.persistence.Table;
/**
* <Function Description><br>
* <fine_report_index_info>
*
* @author xx
* @since 1.0.0
*/
@Entity
@Table(name = "fine_report_index_info")
public class ReportIndexInfoEntity extends BaseEntity {
public static final String REPORT_CODE = "REPORT_CODE";
public static final String TABLE_CODE = "TABLE_CODE";
public static final String INDEX_CODE = "INDEX_CODE";
public static final String INDEX_NAME = "INDEX_NAME";
public static final String CREATE_DATE = "CREATE_DATE";
public static final String UPDATE_DATE = "UPDATE_DATE";
public static final String OP_USERNAME = "OP_USERNAME";
private static final long serialVersionUID = -7911976863964679579L;
@Column(name = REPORT_CODE)
private String reportCode;
@Column(name = TABLE_CODE)
private int tableCode;
@Column(name = INDEX_CODE)
private String indexCode;
@Column(name = INDEX_NAME)
private String indexName;
@Column(name = CREATE_DATE)
private String createDate;
@Column(name = UPDATE_DATE)
private String updateDate;
@Column(name = OP_USERNAME)
private String opUsername;
public ReportIndexInfoEntity() {
}
public String getReportCode() {
return reportCode;
}
public void setReportCode(String reportCode) {
this.reportCode = reportCode;
}
public int getTableCode() {
return tableCode;
}
public void setTableCode(int tableCode) {
this.tableCode = tableCode;
}
public String getIndexCode() {
return indexCode;
}
public void setIndexCode(String indexCode) {
this.indexCode = indexCode;
}
public String getIndexName() {
return indexName;
}
public void setIndexName(String indexName) {
this.indexName = indexName;
}
public String getCreateDate() {
return createDate;
}
public void setCreateDate(String createDate) {
this.createDate = createDate;
}
public String getUpdateDate() {
return updateDate;
}
public void setUpdateDate(String updateDate) {
this.updateDate = updateDate;
}
public String getOpUsername() {
return opUsername;
}
public void setOpUsername(String opUsername) {
this.opUsername = opUsername;
}
}

60
src/main/java/com/fr/plugin/isgd/menu/ParamAction.java

@ -0,0 +1,60 @@
/*
* Copyright (C), 2015-2019
* FileName: ParamAction
* Author: xx
* Date: 2019/09/09
* Description: ParamAction
* History:
* <author> <time> <version> <desc>
* 作者姓名 修改时间 版本号 描述
*/
package com.fr.plugin.isgd.menu;
import com.fanruan.api.design.DesignKit;
import com.fanruan.api.design.ui.container.BasicDialog;
import com.fanruan.api.util.IOKit;
import com.fr.design.actions.JWorkBookAction;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.JWorkBook;
import com.fr.main.impl.WorkBook;
import java.awt.event.ActionEvent;
import static com.fr.plugin.isgd.Constants.ACTION_NAME;
import static com.fr.plugin.isgd.Constants.ICON_PATH;
/**
* <功能简述><br>
* <ParamAction>
*
* @author xx
* @create 2019/09/09
* @since 1.0.0
*/
public class ParamAction extends JWorkBookAction {
public ParamAction(JWorkBook jWorkBook) {
super(jWorkBook);
this.setSmallIcon(IOKit.readIcon(ICON_PATH));
setName(ACTION_NAME);
}
@Override
public void actionPerformed(ActionEvent actionEvent) {
final JWorkBook jwb = getEditingComponent();
if (jwb == null) {
return;
}
final WorkBook wb = jwb.getTarget();
final ParamConfigPane configPane = new ParamConfigPane();
configPane.populate(wb);
BasicDialog dialog = configPane.showWindow(DesignKit.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
ParamConfig config = configPane.update();
wb.addAttrMark(config);
jwb.fireTargetModified();
}
});
dialog.setVisible(true);
}
}

89
src/main/java/com/fr/plugin/isgd/menu/ParamConfig.java

@ -0,0 +1,89 @@
/*
* Copyright (C), 2015-2019
* FileName: ParamConfig
* Author: xx
* Date: 2019/09/09
* Description: ParamConfig
* History:
* <author> <time> <version> <desc>
* 作者姓名 修改时间 版本号 描述
*/
package com.fr.plugin.isgd.menu;
import com.fanruan.api.err.JSONException;
import com.fanruan.api.json.JSONKit;
import com.fr.json.JSONObject;
import com.fr.stable.fun.impl.AbstractIOFileAttrMark;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader;
/**
* <功能简述><br>
* <ParamConfig>
*
* @author xx
* @create 2019/09/09
* @since 1.0.0
*/
public class ParamConfig extends AbstractIOFileAttrMark {
public static final String XML_TAG = "CustomColumnConfig";
private String headerRow;
public ParamConfig() {
}
@Override
public void readXML(XMLableReader xmLableReader) {
if (xmLableReader.isChildNode()) {
String tagName = xmLableReader.getTagName();
if ("Attr".equals(tagName)) {
setHeaderRow(xmLableReader.getAttrAsString("headerRow", "1"));
}
}
}
@Override
public void writeXML(XMLPrintWriter xmlPrintWriter) {
xmlPrintWriter.startTAG("Attr");
xmlPrintWriter.attr("headerRow", headerRow);
xmlPrintWriter.end();
}
@Override
public ParamConfig clone() {
ParamConfig cloned = (ParamConfig) super.clone();
cloned.headerRow = headerRow;
return cloned;
}
@Override
public JSONObject createJSONConfig() throws JSONException {
JSONObject paramJSON = JSONKit.create();
paramJSON.put("headerRow", headerRow);
return paramJSON;
}
@Override
public String xmlTag() {
return XML_TAG;
}
public String getHeaderRow() {
return headerRow;
}
public void setHeaderRow(String headerRow) {
this.headerRow = headerRow;
}
public int[] getHeaderRowInts() {
String[] headerArray = this.headerRow.split(",");
int[] headers = new int[headerArray.length];
for (int i = 0; i < headerArray.length; i++) {
headers[i] = Integer.parseInt(headerArray[i]);
}
return headers;
}
}

79
src/main/java/com/fr/plugin/isgd/menu/ParamConfigPane.java

@ -0,0 +1,79 @@
/*
* Copyright (C), 2015-2019
* FileName: ParamConfigPane
* Author: xx
* Date: 2019/09/09
* Description: ParamConfigPane
* History:
* <author> <time> <version> <desc>
* 作者姓名 修改时间 版本号 描述
*/
package com.fr.plugin.isgd.menu;
import com.fanruan.api.design.ui.component.UILabel;
import com.fanruan.api.design.ui.component.UITextField;
import com.fanruan.api.design.ui.container.BasicPane;
import com.fanruan.api.design.ui.layout.TableLayoutKit;
import com.fanruan.api.i18n.I18nKit;
import com.fr.main.impl.WorkBook;
import javax.swing.*;
import java.awt.*;
import static com.fr.plugin.isgd.Constants.ACTION_NAME;
/**
* <功能简述><br>
* <ParamConfigPane>
*
* @author xx
* @create 2019/09/09
* @since 1.0.0
*/
public class ParamConfigPane extends BasicPane {
private UITextField headerTextField;
public ParamConfigPane() {
UILabel headerLabel = new UILabel(I18nKit.getLocText("Plugin-isgd_Header_Row"));
headerTextField = new UITextField();
double p = TableLayoutKit.PREFERRED;
double f = TableLayoutKit.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p};
Component[][] components = new Component[][]{
new Component[]{headerLabel, headerTextField},
};
JPanel centerPane = TableLayoutKit.createTableLayoutPane(components, rowSize, columnSize);
JPanel pane = new JPanel();
pane.setLayout(new BorderLayout());
pane.add(centerPane, BorderLayout.NORTH);
setLayout(new BorderLayout());
add(pane, BorderLayout.CENTER);
}
public void populate(WorkBook workBook) {
if (workBook == null) {
return;
}
ParamConfig paramConfig = workBook.getAttrMark(ParamConfig.XML_TAG);
if (paramConfig != null) {
headerTextField.setText(paramConfig.getHeaderRow());
}
}
public ParamConfig update() {
ParamConfig paramConfig = new ParamConfig();
paramConfig.setHeaderRow(headerTextField.getText());
return paramConfig;
}
@Override
protected String title4PopupWindow() {
return ACTION_NAME;
}
}

55
src/main/java/com/fr/plugin/isgd/menu/ParamMenuHandler.java

@ -0,0 +1,55 @@
/*
* Copyright (C), 2015-2019
* FileName: ParamMenuHandler
* Author: xx
* Date: 2019/09/09
* Description: ParamMenuHandler
* History:
* <author> <time> <version> <desc>
* 作者姓名 修改时间 版本号 描述
*/
package com.fr.plugin.isgd.menu;
import com.fr.design.fun.MenuHandler;
import com.fr.design.fun.impl.AbstractMenuHandler;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.menu.ShortCut;
/**
* <功能简述><br>
* <ParamMenuHandler>
*
* @author xx
* @create 2019/09/09
* @since 1.0.0
*/
public class ParamMenuHandler extends AbstractMenuHandler {
@Override
public ShortCut shortcut(ToolBarMenuDockPlus toolBarMenuDockPlus) {
if (toolBarMenuDockPlus instanceof JWorkBook) {
return new ParamAction((JWorkBook) toolBarMenuDockPlus);
}
return null;
}
@Override
public int insertPosition(int i) {
return LAST;
}
@Override
public boolean insertSeparatorBefore() {
return false;
}
@Override
public boolean insertSeparatorAfter() {
return false;
}
@Override
public String category() {
return MenuHandler.TEMPLATE;
}
}

82
src/main/java/com/fr/plugin/isgd/provider/ProcessDBAccess.java

@ -0,0 +1,82 @@
/*
* Copyright (C), 2018-2020
* Project: starter
* FileName: ProcessDBAccess
* Author: xx
* Date: 2020/6/4 11:48
*/
package com.fr.plugin.isgd.provider;
import com.fanruan.api.log.LogKit;
import com.fr.plugin.db.AbstractDBAccessProvider;
import com.fr.plugin.isgd.dao.ReportIndexInfoDao;
import com.fr.plugin.isgd.entity.ReportIndexInfoEntity;
import com.fr.stable.db.accessor.DBAccessor;
import com.fr.stable.db.action.DBAction;
import com.fr.stable.db.dao.DAOContext;
import com.fr.stable.db.dao.DAOProvider;
import java.util.List;
/**
* Function Description<br>
* ProcessDBAccess
*
* @author xx
* @since 1.0.0
*/
public class ProcessDBAccess extends AbstractDBAccessProvider {
private static DBAccessor accessor;
public ProcessDBAccess() {
}
public static DBAccessor getAccessor() {
return accessor;
}
public static void saveAll(List<ReportIndexInfoEntity> entities) {
try {
ProcessDBAccess.getAccessor().runDMLAction(new DBAction<Boolean>() {
@Override
public Boolean run(DAOContext daoContext) throws Exception {
for (ReportIndexInfoEntity entity : entities) {
(daoContext.getDAO(ReportIndexInfoDao.class)).addOrUpdate(entity);
}
return true;
}
});
} catch (Exception e) {
LogKit.error(e.getMessage(), e);
}
}
/**
* @param entity
*/
public static void save(final ReportIndexInfoEntity entity) {
try {
getAccessor().runDMLAction(new DBAction<Boolean>() {
@Override
public Boolean run(DAOContext context) throws Exception {
(context.getDAO(ReportIndexInfoDao.class)).addOrUpdate(entity);
return true;
}
});
} catch (Exception e) {
LogKit.error(e.getMessage(), e);
}
}
@Override
public DAOProvider<?>[] registerDAO() {
return new DAOProvider[]{
ReportIndexInfoDao.DAO
};
}
@Override
public void onDBAvailable(DBAccessor dbAccessor) {
accessor = dbAccessor;
}
}

113
src/main/java/com/fr/plugin/isgd/service/ReportRowHandler.java

@ -0,0 +1,113 @@
/*
* Copyright (C), 2018-2020
* Project: starter
* FileName: ReportRowHandler
* Author: xx
* Date: 2020/11/26 21:35
*/
package com.fr.plugin.isgd.service;
import com.fanruan.api.i18n.I18nKit;
import com.fanruan.api.log.LogKit;
import com.fanruan.api.util.StringKit;
import com.fr.decision.fun.impl.BaseHttpHandler;
import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import com.fr.main.workbook.ResultWorkBook;
import com.fr.plugin.context.PluginContexts;
import com.fr.plugin.isgd.bean.ParamColumn;
import com.fr.plugin.isgd.entity.ReportIndexInfoEntity;
import com.fr.plugin.isgd.menu.ParamConfig;
import com.fr.plugin.isgd.provider.ProcessDBAccess;
import com.fr.report.report.ECReport;
import com.fr.third.springframework.web.bind.annotation.RequestMethod;
import com.fr.web.core.ReportSessionIDInfor;
import com.fr.web.core.SessionPoolManager;
import com.fr.web.utils.WebUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* <Function Description><br>
* <ReportRowHandler>
*
* @author xx
* @since 1.0.0
*/
public class ReportRowHandler extends BaseHttpHandler {
public ReportRowHandler() {
}
@Override
public RequestMethod getMethod() {
return RequestMethod.GET;
}
@Override
public String getPath() {
return "/isgd";
}
@Override
public boolean isPublic() {
return true;
}
@Override
public void handle(HttpServletRequest request, HttpServletResponse response) throws Exception {
if (PluginContexts.currentContext() == null || !PluginContexts.currentContext().isAvailable()) {
LogKit.error(I18nKit.getLocText("Plugin-isgd_Licence_Expired"));
WebUtils.flushSuccessMessageAutoClose(request, response, createNoChangedResponseJSONObject());
return;
}
String sessionID = WebUtils.getHTTPRequestParameter(request, "sessionID");
ReportSessionIDInfor sessionIDInfo = SessionPoolManager.getSessionIDInfor(sessionID, ReportSessionIDInfor.class);
ResultWorkBook resultWorkBook = sessionIDInfo.getExistWorkBook2Show();
ParamConfig paramConfig = resultWorkBook.getAttrMark(ParamConfig.XML_TAG);
if (paramConfig == null) {
WebUtils.flushSuccessMessageAutoClose(request, response, createNoChangedResponseJSONObject());
return;
}
ParamColumn paramColumn = new ParamColumn();
paramColumn.setHeaderRows(paramConfig);
ECReport ecReport = resultWorkBook.getElementCaseReport(0);
List<ReportIndexInfoEntity> reportIndexInfoEntities = paramColumn.getReportIndexInfoEntities(ecReport, sessionIDInfo.getRelativePath(), getUsername(resultWorkBook));
ProcessDBAccess.saveAll(reportIndexInfoEntities);
WebUtils.flushSuccessMessageAutoClose(request, response, createSuccessResponseJSONObject());
}
/**
* 取参数FR_USERNAME或者FINE_USERNAME
*
* @param resultWorkBook
* @return
*/
private String getUsername(ResultWorkBook resultWorkBook) {
Map<String, Object> parameters = resultWorkBook.getExecuteParameters();
if (parameters.containsKey("FR_USERNAME")) {
return String.valueOf(parameters.get("FR_USERNAME"));
}
if (parameters.containsKey("FINE_USERNAME")) {
return String.valueOf(parameters.get("FINE_USERNAME"));
}
return StringKit.EMPTY;
}
private JSONObject createSuccessResponseJSONObject() throws JSONException {
JSONObject successJSON = JSONObject.create();
successJSON.put("errorCode", 0);
successJSON.put("status", "success");
return successJSON;
}
private JSONObject createNoChangedResponseJSONObject() throws JSONException {
JSONObject successJSON = JSONObject.create();
successJSON.put("errorCode", 1);
successJSON.put("status", "noChanged");
return successJSON;
}
}

34
src/main/java/com/fr/plugin/isgd/service/ReportRowHandlerProvider.java

@ -0,0 +1,34 @@
/*
* Copyright (C), 2018-2020
* Project: starter
* FileName: ReportRowHandlerProvider
* Author: xx
* Date: 2020/11/26 21:34
*/
package com.fr.plugin.isgd.service;
import com.fr.decision.fun.impl.AbstractHttpHandlerProvider;
import com.fr.decision.fun.impl.BaseHttpHandler;
import com.fr.stable.fun.Authorize;
import static com.fr.plugin.isgd.Constants.PLUGIN_ID;
/**
* <Function Description><br>
* <ReportRowHandlerProvider>
*
* @author xx
* @since 1.0.0
*/
@Authorize(callSignKey = PLUGIN_ID)
public class ReportRowHandlerProvider extends AbstractHttpHandlerProvider {
public ReportRowHandlerProvider() {
}
@Override
public BaseHttpHandler[] registerHandlers() {
return new BaseHttpHandler[]{
new ReportRowHandler()
};
}
}

77
src/main/java/com/fr/plugin/isgd/toolbar/ColumnExtensionButton.java

@ -0,0 +1,77 @@
/*
* Copyright (C), 2015-2019
* FileName: ColumnExtensionButton
* Author: xx
* Date: 2019/9/4 17:16
* Description: ColumnExtensionButton
* History:
* <author> <time> <version> <desc>
*/
package com.fr.plugin.isgd.toolbar;
import com.fanruan.api.i18n.I18nKit;
import com.fr.form.ui.Widget;
import com.fr.js.JavaScriptImpl;
import com.fr.plugin.isgd.utils.FuncUtils;
import com.fr.report.fun.impl.AbstractExtensionButton;
import com.fr.stable.web.Repository;
/**
* <Function Description><br>
* <ColumnExtensionButton>
*
* @author xx
* @since 1.0.0
*/
public class ColumnExtensionButton extends AbstractExtensionButton {
public static final String PARAM_COLUMN = "column";
public static final String PARAM_TEXT = "text";
public static final String PARAM_SELECTED = "selected";
public ColumnExtensionButton() {
super(I18nKit.getLocText("Plugin-isgd_Button"), FuncUtils.loadIcon());
}
public ColumnExtensionButton(String text) {
super(text);
}
public ColumnExtensionButton(String text, String iconName) {
super(text, iconName);
}
@Override
public Class<? extends Widget> classForDirectoryButton() {
return this.getClass();
}
@Override
public String getParentDirectory() {
return null;
}
@Override
public String getType() {
return null;
}
@Override
public String getRelatedCheckBoxTitle() {
return null;
}
@Override
public boolean isSelected() {
return false;
}
@Override
public void setSelected(boolean b) {
}
@Override
protected JavaScriptImpl clickAction(Repository repository) {
return new JavaScriptImpl("FR.saveReportRows()");
}
}

40
src/main/java/com/fr/plugin/isgd/toolbar/ColumnToolbarUI.java

@ -0,0 +1,40 @@
/*
* Copyright (C), 2015-2019
* FileName: JSONExportToolbarUI
* Author: xx
* Date: 2019/9/4 16:15
* Description: JSONExportToolbarUI
* History:
* <author> <time> <version> <desc>
*/
package com.fr.plugin.isgd.toolbar;
import com.fanruan.api.i18n.I18nKit;
import com.fr.design.fun.impl.AbstractToolbarItem;
import com.fr.form.ui.Widget;
import static com.fr.plugin.isgd.Constants.ICON_PATH;
/**
* <Function Description><br>
* <JSONExportToolbarUI>
*
* @author xx
* @since 1.0.0
*/
public class ColumnToolbarUI extends AbstractToolbarItem {
@Override
public Class<? extends Widget> classForWidget() {
return ColumnExtensionButton.class;
}
@Override
public String iconPathForWidget() {
return ICON_PATH;
}
@Override
public String nameForWidget() {
return I18nKit.getLocText("Plugin-isgd_Export");
}
}

34
src/main/java/com/fr/plugin/isgd/utils/FuncUtils.java

@ -0,0 +1,34 @@
/*
* Copyright (C), 2015-2019
* FileName: FuncUtils
* Author: xx
* Date: 2019/9/4 15:05
* Description: FuncUtils
* History:
* <author> <time> <version> <desc>
*/
package com.fr.plugin.isgd.utils;
import com.fanruan.api.util.IOKit;
import com.fr.base.Icon;
import com.fr.base.IconManager;
import static com.fr.plugin.isgd.Constants.ICON_PATH;
/**
* <Function Description><br>
* <FuncUtils>
*
* @author xx
* @since 1.0.0
*/
public class FuncUtils {
public static String loadIcon() {
Icon icon = new Icon("isgd", IOKit.readImage(ICON_PATH));
IconManager.getIconManager().addIcon(icon, true);
return icon.getName();
}
public static void main(String[] args) {
}
}

12
src/main/java/com/fr/plugin/isgd/web/CssFile.java

@ -0,0 +1,12 @@
package com.fr.plugin.isgd.web;
import com.fr.stable.fun.impl.AbstractCssFileHandler;
public class CssFile extends AbstractCssFileHandler {
@Override
public String[] pathsForFiles() {
return new String[]{
"/com/fr/plugin/isgd/web/isgd.css"
};
}
}

45
src/main/java/com/fr/plugin/isgd/web/JavaScriptFile.java

@ -0,0 +1,45 @@
/*
* Copyright (C), 2015-2019
* FileName: JavaScriptFile
* Author: xx
* Date: 2019/9/4 16:33
* Description: JavaScriptFile
* History:
* <author> <time> <version> <desc>
*/
package com.fr.plugin.isgd.web;
import com.fanruan.api.i18n.I18nKit;
import com.fanruan.api.log.LogKit;
import com.fr.intelli.record.Focus;
import com.fr.intelli.record.Original;
import com.fr.plugin.context.PluginContexts;
import com.fr.record.analyzer.EnableMetrics;
import com.fr.stable.fun.Authorize;
import com.fr.stable.fun.impl.AbstractJavaScriptFileHandler;
import static com.fr.plugin.isgd.Constants.PLUGIN_ID;
/**
* <Function Description><br>
* <JavaScriptFile>
*
* @author xx
* @since 1.0.0
*/
@EnableMetrics
@Authorize(callSignKey = PLUGIN_ID)
public class JavaScriptFile extends AbstractJavaScriptFileHandler {
@Override
@Focus(id = PLUGIN_ID, text = "Plugin-isgd", source = Original.PLUGIN)
public String[] pathsForFiles() {
if (PluginContexts.currentContext().isAvailable()) {
return new String[]{
"/com/fr/plugin/isgd/web/isgd.js"
};
} else {
LogKit.error(I18nKit.getLocText("Plugin-isgd_Licence_Expired"));
return new String[]{};
}
}
}

BIN
src/main/resources/com/fr/plugin/isgd/images/column16.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

9
src/main/resources/com/fr/plugin/isgd/locale/lang.properties

@ -0,0 +1,9 @@
Plugin-isgd=Report Row Custom
Plugin-isgd_Export=Report Row Custom
Plugin-isgd_Button=Report Row Hide
Plugin-isgd_Action_Name=Custom Report Row Panel Properties
Plugin-isgd_Header_Row=Header Row Number:
Plugin-isgd_Column=Column
Plugin-isgd_Image_Column=Image Column
Plugin-isgd_SubReport_Column=SubReport Column
Plugin-isgd_Licence_Expired=Column Custom Licence Expired

9
src/main/resources/com/fr/plugin/isgd/locale/lang_zh_CN.properties

@ -0,0 +1,9 @@
Plugin-isgd=\u8868\u5934\u884C\u5904\u7406\u5B9A\u5236
Plugin-isgd_Export=\u8868\u5934\u884C\u5904\u7406\u5B9A\u5236
Plugin-isgd_Button=\u8868\u5934\u884C\u5904\u7406
Plugin-isgd_Action_Name=\u8868\u5934\u884C\u5C5E\u6027
Plugin-isgd_Header_Row=\u8868\u5934\u884C\u53F7\uFF1A
Plugin-isgd_Column=\u5217
Plugin-isgd_Image_Column=\u56FE\u7247\u5217
Plugin-isgd_SubReport_Column=\u5B50\u62A5\u8868\u5217
Plugin-isgd_Licence_Expired=\u8868\u5934\u884C\u5904\u7406\u5B9A\u5236\u63D2\u4EF6\u8BB8\u53EF\u8FC7\u671F

25
src/main/resources/com/fr/plugin/isgd/web/isgd.css

@ -0,0 +1,25 @@
#columnList{
width:150px;
z-index: 99;
padding-top:0px;
padding-left:0px;
padding-bottom:0px;
position:absolute;
border: 1px solid #ccc;
background: #f0f0f0 url(/webroot/decision/view/report?op=resource&resource=/com/fr/web/images/menu/menu.gif) repeat-y;
}
#columnList ul{
margin-top:0px;
margin-bottom:0px;
padding-left:0px;
list-style:none;
}
#columnList ul li{
padding-left:0px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#columnList ul li input{
margin-left:15px;
}

22
src/main/resources/com/fr/plugin/isgd/web/isgd.js

@ -0,0 +1,22 @@
(function ($) {
$.extend(FR, {
saveReportRows: function () {
FR.ajax({
url: FR.fineServletURL + "/plugin/public/com.fr.plugin.isgd.v10/isgd",
async: true,
type: 'GET',
data: {
sessionID: FR.SessionMgr.getSessionID()
},
complete: function (res) {
var result = FR.jsonDecode(res.responseText);
if (FR.equals(result.errorCode, 0)) {
FR.Msg.toast("表头行数据保存成功!");
} else {
FR.Msg.toast("表头行数据保存失败!");
}
}
});
}
});
})(jQuery);
Loading…
Cancel
Save