diff --git a/JSD-9034配置使用文档.docx b/JSD-9034配置使用文档.docx
new file mode 100644
index 0000000..f93c6b0
Binary files /dev/null and b/JSD-9034配置使用文档.docx differ
diff --git a/JSD-9034需求确认书.docx b/JSD-9034需求确认书.docx
new file mode 100644
index 0000000..49a8a86
Binary files /dev/null and b/JSD-9034需求确认书.docx differ
diff --git a/README.md b/README.md
index ad3ebf9..4a885a7 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,6 @@
# open-JSD-9034
-JSD-9034 报表导出到服务器
\ No newline at end of file
+JSD-9034 报表导出到服务器\
+免责说明:该源码为第三方爱好者提供,不保证源码和方案的可靠性,也不提供任何形式的源码教学指导和协助!\
+仅作为开发者学习参考使用!禁止用于任何商业用途!\
+为保护开发者隐私,开发者信息已隐去!若原开发者希望公开自己的信息,可联系hugh处理。
\ No newline at end of file
diff --git a/lib/hutool-all-5.7.9.jar b/lib/hutool-all-5.7.9.jar
new file mode 100644
index 0000000..48a68d0
Binary files /dev/null and b/lib/hutool-all-5.7.9.jar differ
diff --git a/plugin.xml b/plugin.xml
new file mode 100644
index 0000000..466aeff
--- /dev/null
+++ b/plugin.xml
@@ -0,0 +1,30 @@
+
+
+ com.fr.plugin.xxxx.ndsd.export
+
+ yes
+ 1.7
+ 10.0
+ 2018-07-31
+ fr.open
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/fr/plugin/holger/ndsd/export/conf/ExcelExportConfig.java b/src/main/java/com/fr/plugin/holger/ndsd/export/conf/ExcelExportConfig.java
new file mode 100644
index 0000000..54c1347
--- /dev/null
+++ b/src/main/java/com/fr/plugin/holger/ndsd/export/conf/ExcelExportConfig.java
@@ -0,0 +1,64 @@
+package com.fr.plugin.xxxx.ndsd.export.conf;
+
+import com.fr.config.*;
+import com.fr.config.xxxx.Conf;
+import com.fr.config.xxxx.factory.Holders;
+import com.fr.intelli.record.Focus;
+import com.fr.intelli.record.Original;
+import com.fr.record.analyzer.EnableMetrics;
+
+
+/**
+ * 2 * @Author: fr.open
+ * 3 * @Date: 2020/12/07 15:06
+ * 4
+ */
+@Visualization(category = "EXCEL导出配置")
+@EnableMetrics
+public class ExcelExportConfig extends DefaultConfiguration {
+
+ private static volatile ExcelExportConfig config = null;
+
+ @Focus(id="com.fr.plugin.xxxx.ndsd.export", text = "EXCEL导出配置", source = Original.PLUGIN)
+ public static ExcelExportConfig getInstance() {
+ if (config == null) {
+ config = ConfigContext.getConfigInstance(ExcelExportConfig.class);
+ }
+ return config;
+ }
+
+ @Identifier(value = "debugSwitch", name = "插件调试开关", description = "日志调试模式", status = Status.SHOW)
+ private Conf debugSwitch = Holders.simple(true);
+ public Boolean getdebugSwitch() { return debugSwitch.get(); }
+ public void setdebugSwitch(Boolean debugSwitch) { this.debugSwitch.set(debugSwitch); }
+
+ @Identifier(value = "api_process", name = "工序上传接口", description = "数据连接名称", status = Status.SHOW)
+ private Conf api_process = Holders.simple("http://xxxx/{organizationId}/rda-cell-file/process/file/upload");
+ public String getapi_process() {
+ return api_process.get();
+ }
+ public void setapi_process(String api_process) {
+ this.api_process.set(api_process);
+ }
+
+ @Identifier(value = "api_testItem", name = "测试项上传接口", description = "数据连接名称", status = Status.SHOW)
+ private Conf api_testItem = Holders.simple("http://xxxx/{organizationId}/rda-cell-file/test/item/file/upload");
+ public String getapi_testItem() {
+ return api_testItem.get();
+ }
+ public void setapi_testItem(String api_testItem) {
+ this.api_testItem.set(api_testItem);
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ ExcelExportConfig cloned = (ExcelExportConfig) super.clone();
+
+ cloned.debugSwitch = (Conf) debugSwitch.clone();
+ cloned.api_process = (Conf) api_process.clone();
+ cloned.api_testItem = (Conf) api_testItem.clone();
+ return cloned;
+ }
+
+
+}
diff --git a/src/main/java/com/fr/plugin/holger/ndsd/export/handler/ExcelExportHandler.java b/src/main/java/com/fr/plugin/holger/ndsd/export/handler/ExcelExportHandler.java
new file mode 100644
index 0000000..8df37b5
--- /dev/null
+++ b/src/main/java/com/fr/plugin/holger/ndsd/export/handler/ExcelExportHandler.java
@@ -0,0 +1,181 @@
+package com.fr.plugin.xxxx.ndsd.export.handler;
+
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.http.HttpRequest;
+import com.fr.decision.fun.impl.BaseHttpHandler;
+import com.fr.io.TemplateWorkBookIO;
+import com.fr.io.exporter.excel.stream.StreamExcel2007Exporter;
+import com.fr.json.JSONObject;
+import com.fr.main.impl.WorkBook;
+import com.fr.plugin.xxxx.ndsd.export.conf.ExcelExportConfig;
+import com.fr.plugin.xxxx.ndsd.export.utils.LogUtils;
+import com.fr.plugin.transform.FunctionRecorder;
+import com.fr.stable.PageActor;
+import com.fr.stable.StringUtils;
+import com.fr.third.org.apache.commons.io.FilenameUtils;
+import com.fr.third.springframework.web.bind.annotation.RequestMethod;
+import com.fr.web.utils.WebUtils;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.time.Instant;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.regex.Pattern;
+
+
+@FunctionRecorder
+public class ExcelExportHandler extends BaseHttpHandler {
+ @Override
+ public RequestMethod getMethod() {
+ return RequestMethod.GET;
+ }
+
+ @Override
+ public String getPath() {
+ return "/export";
+ }
+
+ @Override
+ public boolean isPublic() {
+ return true;
+ }
+
+ @Override
+ public void handle(HttpServletRequest req, HttpServletResponse res) throws Exception {
+ String cptName = req.getParameter("cptName");
+ String type = req.getParameter("type");
+ String organizationId = req.getParameter("organizationId");
+ String token = req.getParameter("token");
+ LogUtils.debug4plugin("参数[cptName]值为[{}]", cptName);
+ LogUtils.debug4plugin("参数[type]值为[{}]]", type);
+ LogUtils.debug4plugin("参数[organizationId]值为[{}]]", organizationId);
+ LogUtils.debug4plugin("参数[token]值为[{}]]", token);
+
+
+ if (StringUtils.isBlank(cptName)) {
+ LogUtils.error("参数[cptName]值为空");
+ WebUtils.printAsJSON(res, getResultJson("error", "参数[cptName]值为空"));
+ return;
+ }
+ if (StringUtils.isBlank(type) || !PATTERN_TYPE.matcher(type).matches()) {
+ LogUtils.error("参数[type]值为空或不合法");
+ WebUtils.printAsJSON(res, getResultJson("error", "参数[type]值为空或不合法"));
+ return;
+ }
+ if (StringUtils.isBlank(organizationId)) {
+ LogUtils.error("参数[organizationId]值为空或不合法");
+ WebUtils.printAsJSON(res, getResultJson("error", "参数[organizationId]值为空"));
+ return;
+ }
+ if (StringUtils.isBlank(token)) {
+ LogUtils.error("参数[token]值为空或不合法");
+ WebUtils.printAsJSON(res, getResultJson("error", "参数[token]值为空"));
+ return;
+ }
+
+ String output = getOutputAddress(cptName);
+ LogUtils.debug4plugin("输出临时文件地址[{}]", output);
+
+ Map params = getParams(req);
+ params.forEach((k, v) -> LogUtils.debug4plugin("其它参数[{}]:[{}]", k, v));
+
+ try (FileOutputStream os = new FileOutputStream(output)) {
+ WorkBook wb = (WorkBook) TemplateWorkBookIO.readTemplateWorkBook(cptName);
+ StreamExcel2007Exporter