From a8296ef06369452e9151624b6ac4e7cb12a394e3 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期三, 21 一月 2026 16:06:18 +0800
Subject: [PATCH] 导入数据模板下载
---
fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutHand.view.xml | 132 +++++++++++++++++++++++--------------------
fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutList.view.xml | 11 +++
fzzy-igdss-web/src/main/java/com/fzzy/common/ExportController.java | 11 +++
fzzy-igdss-web/src/main/java/com/fzzy/common/manager/ExportManager.java | 19 ++++++
4 files changed, 111 insertions(+), 62 deletions(-)
diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutHand.view.xml b/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutHand.view.xml
index ff21b6a..ed73b78 100644
--- a/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutHand.view.xml
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutHand.view.xml
@@ -440,7 +440,7 @@
<Children>
<AutoForm>
<Property name="dataSet">dsMain</Property>
- <Property name="cols">*,*,*</Property>
+ <Property name="cols">*,*,*,*</Property>
<Property name="labelAlign">right</Property>
<Property name="labelSeparator">锛�</Property>
<Property name="labelWidth">100</Property>
@@ -458,10 +458,25 @@
<Property name="property">plateNum</Property>
<Editor/>
</AutoFormElement>
+ <AutoFormElement layoutConstraint="colSpan:2">
+ <Property name="name">deptId</Property>
+ <Property name="property">deptId</Property>
+ <Property name="readOnly">true</Property>
+ <Editor>
+ <TextEditor>
+ <Property name="blankText">-- 绯荤粺鑷姩甯﹀叆 --</Property>
+ </TextEditor>
+ </Editor>
+ </AutoFormElement>
<AutoFormElement>
<Property name="name">depotId</Property>
<Property name="property">depotId</Property>
<Property name="label">瑁呭嵏浠撳簱</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <Property name="name">foodVariety</Property>
+ <Property name="property">foodVariety</Property>
<Editor/>
</AutoFormElement>
<AutoFormElement>
@@ -475,29 +490,8 @@
<Editor/>
</AutoFormElement>
<AutoFormElement>
- <Property name="name">foodVariety</Property>
- <Property name="property">foodVariety</Property>
- <Editor/>
- </AutoFormElement>
- <AutoFormElement>
- <Property name="name">perWet</Property>
- <Property name="property">perWet</Property>
- <Editor/>
- </AutoFormElement>
- <AutoFormElement>
- <Property name="name">userContact</Property>
- <Property name="property">userContact</Property>
- <Property name="label">鑱旂郴鐢佃瘽</Property>
- <Editor/>
- </AutoFormElement>
- <AutoFormElement>
<Property name="name">foodLevel</Property>
<Property name="property">foodLevel</Property>
- <Editor/>
- </AutoFormElement>
- <AutoFormElement>
- <Property name="name">perImpurity</Property>
- <Property name="property">perImpurity</Property>
<Editor/>
</AutoFormElement>
<AutoFormElement>
@@ -513,15 +507,31 @@
<Editor/>
</AutoFormElement>
<AutoFormElement>
+ <Property name="name">userContact</Property>
+ <Property name="property">userContact</Property>
+ <Property name="label">鑱旂郴鐢佃瘽</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
<Property name="label">瀹㈡埛鍚嶇О</Property>
<Property name="property">customerName</Property>
<Property name="editable">false</Property>
<Property name="trigger">ddNotice</Property>
<Editor/>
</AutoFormElement>
- <AutoFormElement layoutConstraint="colSpan:2">
+ <AutoFormElement>
<Property name="name">noticeId</Property>
<Property name="property">noticeId</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <Property name="name">perWet</Property>
+ <Property name="property">perWet</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <Property name="name">perImpurity</Property>
+ <Property name="property">perImpurity</Property>
<Editor/>
</AutoFormElement>
</AutoForm>
@@ -533,76 +543,76 @@
<Children>
<AutoForm>
<Property name="dataSet">dsMain</Property>
- <Property name="cols">*,50,*,50,*,50</Property>
+ <Property name="cols">*,*,*,*</Property>
<Property name="labelAlign">right</Property>
<Property name="labelWidth">100</Property>
<Property name="labelSeparator">锛�</Property>
- <AutoFormElement layoutConstraint="colSpan:2">
- <ClientEvent name="onBlur">deAutoByWeight();</ClientEvent>
- <Property name="name">fullWeight</Property>
- <Property name="property">fullWeight</Property>
- <Editor/>
- </AutoFormElement>
- <AutoFormElement layoutConstraint="colSpan:2">
+ <AutoFormElement>
<Property name="name">fullWeightTime</Property>
<Property name="property">fullWeightTime</Property>
<Editor/>
</AutoFormElement>
- <AutoFormElement layoutConstraint="colSpan:2">
+ <AutoFormElement>
<Property name="name">fullWeightUser</Property>
<Property name="property">fullWeightUser</Property>
<Property name="label">婊¤溅绉伴噸浜�</Property>
<Editor/>
</AutoFormElement>
- <AutoFormElement layoutConstraint="colSpan:2">
+ <AutoFormElement>
<ClientEvent name="onBlur">deAutoByWeight();</ClientEvent>
- <Property name="name">emptyWeight</Property>
- <Property name="property">emptyWeight</Property>
+ <Property name="name">fullWeight</Property>
+ <Property name="property">fullWeight</Property>
<Editor/>
</AutoFormElement>
- <AutoFormElement layoutConstraint="colSpan:2">
- <Property name="name">emptyWeightTime</Property>
- <Property name="property">emptyWeightTime</Property>
- <Editor/>
- </AutoFormElement>
- <AutoFormElement layoutConstraint="colSpan:2">
- <Property name="name">emptyWeightUser</Property>
- <Property name="property">emptyWeightUser</Property>
- <Property name="label">绌鸿溅绉伴噸浜�</Property>
- <Editor/>
- </AutoFormElement>
- <AutoFormElement layoutConstraint="colSpan:2">
- <Property name="name">netWeight</Property>
- <Property name="property">netWeight</Property>
- <Property name="readOnly">true</Property>
- <Editor/>
- </AutoFormElement>
- <AutoFormElement layoutConstraint="colSpan:2">
+ <AutoFormElement>
<ClientEvent name="onBlur">deAutoByWeight();</ClientEvent>
<Property name="name">deOther</Property>
<Property name="property">deOther</Property>
<Editor/>
</AutoFormElement>
- <AutoFormElement layoutConstraint="colSpan:2">
+ <AutoFormElement>
+ <Property name="name">emptyWeightTime</Property>
+ <Property name="property">emptyWeightTime</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <Property name="name">emptyWeightUser</Property>
+ <Property name="property">emptyWeightUser</Property>
+ <Property name="label">绌鸿溅绉伴噸浜�</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <ClientEvent name="onBlur">deAutoByWeight();</ClientEvent>
+ <Property name="name">emptyWeight</Property>
+ <Property name="property">emptyWeight</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <Property name="name">netWeight</Property>
+ <Property name="property">netWeight</Property>
+ <Property name="readOnly">true</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
<Property name="name">registerTime</Property>
<Property name="property">registerTime</Property>
<Editor/>
</AutoFormElement>
- <AutoFormElement layoutConstraint="colSpan:2">
+ <AutoFormElement>
+ <Property name="name">completeTime</Property>
+ <Property name="property">completeTime</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
<Property name="name">settleWeight</Property>
<Property name="property">settleWeight</Property>
<Property name="readOnly">true</Property>
<Editor/>
</AutoFormElement>
- <AutoFormElement layoutConstraint="colSpan:2">
+ <AutoFormElement>
<Property name="name">recordWeight</Property>
<Property name="property">recordWeight</Property>
<Property name="readOnly">true</Property>
- <Editor/>
- </AutoFormElement>
- <AutoFormElement layoutConstraint="colSpan:2">
- <Property name="name">completeTime</Property>
- <Property name="property">completeTime</Property>
<Editor/>
</AutoFormElement>
</AutoForm>
diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutList.view.xml b/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutList.view.xml
index d3e6642..17d2574 100644
--- a/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutList.view.xml
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutList.view.xml
@@ -612,11 +612,20 @@
</ToolBarButton>
<ToolBarButton>
<Property name="caption">瀵煎叆EXCEL</Property>
- <Property name="exClassName">btn1</Property>
+ <Property name="exClassName">btn2</Property>
<Property name="iconClass">fa fa-file-excel-o</Property>
<Property name="action">uploadExcel</Property>
<Property name="width">120</Property>
</ToolBarButton>
+ <ToolBarButton>
+ <ClientEvent name="onClick">
+var url = "/export/download-inout-excel";
+window.open(url);
</ClientEvent>
+ <Property name="caption">妯℃澘涓嬭浇</Property>
+ <Property name="exClassName">btn1</Property>
+ <Property name="iconClass">fa fa-cloud-download</Property>
+ <Property name="width">120</Property>
+ </ToolBarButton>
</ToolBar>
<DataGrid id="dataGridMain" layoutConstraint="padding:8">
<ClientEvent name="onDataRowClick">view.get("#dataGridMain").set("selection",arg.data);</ClientEvent>
diff --git a/fzzy-igdss-web/src/main/java/com/fzzy/common/ExportController.java b/fzzy-igdss-web/src/main/java/com/fzzy/common/ExportController.java
index ac171c2..1f8ed16 100644
--- a/fzzy-igdss-web/src/main/java/com/fzzy/common/ExportController.java
+++ b/fzzy-igdss-web/src/main/java/com/fzzy/common/ExportController.java
@@ -69,6 +69,17 @@
}
/**
+ * 瀵煎嚭word骞朵笅杞�
+ *
+ * @param response
+ */
+ @RequestMapping("/download-inout-excel")
+ public void downloadInoutExcel(HttpServletResponse response) {
+
+ exportManager.downloadInoutExcel(response);
+ }
+
+ /**
* PDF鍦ㄧ嚎棰勮
*
* @param response
diff --git a/fzzy-igdss-web/src/main/java/com/fzzy/common/manager/ExportManager.java b/fzzy-igdss-web/src/main/java/com/fzzy/common/manager/ExportManager.java
index 3159036..c1e523a 100644
--- a/fzzy-igdss-web/src/main/java/com/fzzy/common/manager/ExportManager.java
+++ b/fzzy-igdss-web/src/main/java/com/fzzy/common/manager/ExportManager.java
@@ -91,4 +91,23 @@
}
}
+ /**
+ * 娓叉煋妯℃澘淇濆瓨骞朵笅杞�
+ *
+ * @param response
+ */
+ public void downloadInoutExcel(HttpServletResponse response) {
+ try {
+
+ String savePath = fileService.getFileSavePath("TEMPLATE");
+ String templateName = "鍑哄叆搴撴暟鎹ā鏉�.xlsx";
+
+ //涓嬭浇鏂囨。
+ WordUtil.download(savePath, templateName, response);
+
+ } catch (Exception e) {
+ log.error("涓嬭浇鏂囦欢澶辫触", e);
+ }
+ }
+
}
--
Gitblit v1.9.3