From 8aa63aa8217650db291358b5a3ea939ce6bb484f Mon Sep 17 00:00:00 2001
From: sgj <1442489573@qq.com>
Date: 星期二, 30 十二月 2025 18:03:25 +0800
Subject: [PATCH] 出入库修改提交

---
 fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportOutDetailPR.java               |    2 
 fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportInDetailPR.java                |    2 
 fzzy-igdss-view/src/main/java/com/fzzy/igds/export/ReportController.java         |  176 ++++++++++++++++++---
 fzzy-igdss-core/src/main/java/com/fzzy/igds/data/InoutRecordDetailInExport.java  |   45 +++++
 fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportInDetail.view.xml              |   43 +++++
 fzzy-igdss-core/src/main/java/com/fzzy/igds/data/InoutRecordDetailOutExport.java |   45 +++++
 fzzy-igdss-core/src/main/java/com/fzzy/igds/data/InoutRecordOutExport.java       |   52 ++++++
 fzzy-igdss-core/src/main/java/com/fzzy/igds/data/InoutRecordInExport.java        |   52 ++++++
 fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportOutDetail.view.xml             |   42 ++++
 9 files changed, 423 insertions(+), 36 deletions(-)

diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/data/InoutRecordDetailInExport.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/data/InoutRecordDetailInExport.java
new file mode 100644
index 0000000..1b013e4
--- /dev/null
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/data/InoutRecordDetailInExport.java
@@ -0,0 +1,45 @@
+package com.fzzy.igds.data;
+
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 鍑哄簱鏄庣粏鎶ヨ〃銆佸叆搴撴槑缁嗘姤琛ㄥ鍑哄疄浣撶被
+ *
+ * @author sgj
+ * @date 2025/12/30
+
+ */
+@Data
+public class InoutRecordDetailInExport implements Serializable {
+
+    @Excel(name = "鏀跺偍鍏徃",sort = 1)
+    private String companyId; //鏀跺偍鍏徃
+
+    @Excel(name = "搴撳尯鍚嶇О",sort = 2)
+    private String deptId;
+
+    @Excel(name = "鍗曟嵁鍙�",sort = 3)
+    private String id;
+
+    @Excel(name = "杞︾墝鍙�",sort = 4)
+    private String plateNum;
+
+    @Excel(name = "浠撳簱",sort = 5)
+    private String depotId;
+
+    @Excel(name = "绮鍝佺",sort = 6)
+    private String foodVariety;
+
+    @Excel(name = "缁撶畻閲嶉噺",sort = 7)
+    private Double settleWeight = 0.0;
+
+    @Excel(name = "鍏ュ簱閲嶉噺",sort = 8)
+    private Double recordWeight = 0.0;
+
+    @Excel(name = "绂诲簱鏃堕棿",sort = 9,dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date completeTime;
+}
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/data/InoutRecordDetailOutExport.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/data/InoutRecordDetailOutExport.java
new file mode 100644
index 0000000..73cc2a5
--- /dev/null
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/data/InoutRecordDetailOutExport.java
@@ -0,0 +1,45 @@
+package com.fzzy.igds.data;
+
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 鍑哄簱鏄庣粏鎶ヨ〃銆佸叆搴撴槑缁嗘姤琛ㄥ鍑哄疄浣撶被
+ *
+ * @author sgj
+ * @date 2025/12/30
+
+ */
+@Data
+public class InoutRecordDetailOutExport implements Serializable {
+
+    @Excel(name = "鏀跺偍鍏徃",sort = 1)
+    private String companyId; //鏀跺偍鍏徃
+
+    @Excel(name = "搴撳尯鍚嶇О",sort = 2)
+    private String deptId;
+
+    @Excel(name = "鍗曟嵁鍙�",sort = 3)
+    private String id;
+
+    @Excel(name = "杞︾墝鍙�",sort = 4)
+    private String plateNum;
+
+    @Excel(name = "浠撳簱",sort = 5)
+    private String depotId;
+
+    @Excel(name = "绮鍝佺",sort = 6)
+    private String foodVariety;
+
+    @Excel(name = "缁撶畻閲嶉噺",sort = 7)
+    private Double settleWeight = 0.0;
+
+    @Excel(name = "鍑哄簱閲嶉噺",sort = 8)
+    private Double recordWeight = 0.0;
+
+    @Excel(name = "绂诲簱鏃堕棿",sort = 9,dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date completeTime;
+}
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/data/InoutRecordInExport.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/data/InoutRecordInExport.java
new file mode 100644
index 0000000..45d1f9e
--- /dev/null
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/data/InoutRecordInExport.java
@@ -0,0 +1,52 @@
+package com.fzzy.igds.data;
+
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 鍑哄簱鎶ヨ〃銆佸叆搴撴姤琛ㄥ鍑哄疄浣撶被
+ *
+ * @author sgj
+ * @date 2025/12/30
+
+ */
+@Data
+public class InoutRecordInExport implements Serializable {
+
+
+    @Excel(name = "鍗曟嵁鍙�",sort = 1)
+    private String id;
+
+    @Excel(name = "杞︾墝鍙�",sort = 2)
+    private String plateNum;
+
+    @Excel(name = "浠撳簱",sort = 3)
+    private String depotId;
+
+    @Excel(name = "绮鍝佺",sort = 4)
+    private String foodVariety;
+
+    @Excel(name = "姣涢噸",sort = 5)
+    private Double fullWeight = 0.0;
+
+    @Excel(name = "鐨噸",sort = 6)
+    private Double emptyWeight = 0.0;
+
+    @Excel(name = "鍑�閲�",sort = 7)
+    private Double netWeight = 0.0;
+
+    @Excel(name = "鎵i噸",sort = 8)
+    private Double deOther = 0.0;
+
+    @Excel(name = "缁撶畻閲嶉噺",sort = 9)
+    private Double settleWeight = 0.0;
+
+    @Excel(name = "鍏ュ簱閲嶉噺",sort = 10)
+    private Double recordWeight = 0.0;
+
+    @Excel(name = "绂诲簱鏃堕棿",sort = 11,dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date completeTime;
+}
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/data/InoutRecordOutExport.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/data/InoutRecordOutExport.java
new file mode 100644
index 0000000..3a27362
--- /dev/null
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/data/InoutRecordOutExport.java
@@ -0,0 +1,52 @@
+package com.fzzy.igds.data;
+
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 鍑哄簱鎶ヨ〃銆佸叆搴撴姤琛ㄥ鍑哄疄浣撶被
+ *
+ * @author sgj
+ * @date 2025/12/30
+
+ */
+@Data
+public class InoutRecordOutExport implements Serializable {
+
+
+    @Excel(name = "鍗曟嵁鍙�",sort = 1)
+    private String id;
+
+    @Excel(name = "杞︾墝鍙�",sort = 2)
+    private String plateNum;
+
+    @Excel(name = "浠撳簱",sort = 3)
+    private String depotId;
+
+    @Excel(name = "绮鍝佺",sort = 4)
+    private String foodVariety;
+
+    @Excel(name = "姣涢噸",sort = 5)
+    private Double fullWeight = 0.0;
+
+    @Excel(name = "鐨噸",sort = 6)
+    private Double emptyWeight = 0.0;
+
+    @Excel(name = "鍑�閲�",sort = 7)
+    private Double netWeight = 0.0;
+
+    @Excel(name = "鎵i噸",sort = 8)
+    private Double deOther = 0.0;
+
+    @Excel(name = "缁撶畻閲嶉噺",sort = 9)
+    private Double settleWeight = 0.0;
+
+    @Excel(name = "鍑哄簱閲嶉噺",sort = 10)
+    private Double recordWeight = 0.0;
+
+    @Excel(name = "绂诲簱鏃堕棿",sort = 11,dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date completeTime;
+}
diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportInDetail.view.xml b/fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportInDetail.view.xml
index 60dd6bb..9b125e6 100644
--- a/fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportInDetail.view.xml
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportInDetail.view.xml
@@ -418,7 +418,25 @@
 	var data = view.get(&quot;#dsQuery.data&quot;);&#xD;
 	view.get(&quot;#dsQuery&quot;).set(&quot;parameter&quot;,data).flushAsync();&#xD;
 };&#xD;
-query();</ClientEvent>
+query();&#xD;
+&#xD;
+&#xD;
+&#xD;
+&#xD;
+//杩借釜&#xD;
+showImg = function(){&#xD;
+	&#xD;
+	var select = view.get(&quot;#dataGridMain2&quot;).get(&quot;selection&quot;);&#xD;
+	if(select){&#xD;
+    	var user = encodeURIComponent(select.get(&quot;userName&quot;));&#xD;
+    	var plateNum = encodeURIComponent(select.get(&quot;plateNum&quot;));&#xD;
+	&#xD;
+    	view.get(&quot;#iFrameImg&quot;).set(&quot;path&quot;, &quot;./basic/inout/inout-img?id=&quot; + select.get(&quot;id&quot;)+&quot;&amp;plateNum=&quot;+plateNum+&quot;&amp;user=&quot;+user);&#xD;
+    	view.get(&quot;#dialogImg&quot;).show();&#xD;
+	}else{&#xD;
+    	$notify(&quot;璇烽�夋嫨鏁版嵁鈥︹��&quot;);&#xD;
+	}&#xD;
+};</ClientEvent>
     <Property name="packages">font-awesome,css-common</Property>
     <DataSet id="dsMain">
       <Property name="dataType">[dtMain]</Property>
@@ -539,7 +557,7 @@
         <Button layoutConstraint="left">
           <ClientEvent name="onClick">var data = view.get(&quot;#dsQuery.data&quot;);&#xD;
 var param = {&#xD;
-	&quot;type&quot;:&quot;IN&quot;,&#xD;
+	&quot;type&quot;:&quot;IN_DETAIL&quot;,&#xD;
     &quot;deptId&quot;:data.get(&quot;deptId&quot;),&#xD;
 	&quot;companyId&quot;:data.get(&quot;companyId&quot;),&#xD;
     &quot;start&quot;:data.get(&quot;start&quot;),&#xD;
@@ -698,6 +716,7 @@
 	arg.dom.style.fontWeight = &quot;bold&quot;;&#xD;
 	//arg.processDefault = false;&#xD;
 }</ClientEvent>
+        <ClientEvent name="onDataRowClick">view.get(&quot;#dataGridMain2&quot;).set(&quot;selection&quot;,arg.data);</ClientEvent>
         <Property name="dataSet">dsMain</Property>
         <Property name="readOnly">true</Property>
         <Property name="highlightCurrentRow">false</Property>
@@ -705,6 +724,8 @@
         <Property name="hideMode">display</Property>
         <Property name="headerRowHeight">30</Property>
         <Property name="rowHeight">50</Property>
+        <Property name="selectionMode">singleRow</Property>
+        <RowSelectorColumn/>
         <RowNumColumn>
           <Property name="caption">搴忓彿</Property>
         </RowNumColumn>
@@ -764,7 +785,10 @@
           <Property name="width">150</Property>
         </DataColumn>
         <DataColumn>
-          <ClientEvent name="onRenderCell">//arg.dom.innerHTML = &quot;&lt;a href='javascript:;' onClick='detail()' class='a-btn1'>鏌ョ湅璇︽儏&lt;/a>&quot;;</ClientEvent>
+          <ClientEvent name="onRenderCell"> var txt = arg.data.getText(&quot;id&quot;);&#xD;
+ if(!txt || txt == '鍚堣') return true;&#xD;
+ &#xD;
+arg.dom.innerHTML = &quot;&lt;a href='javascript:;'  onClick='showImg()' class='a-btn1'>杩囩▼杩芥函&lt;/a>&quot;;</ClientEvent>
           <Property name="width">160</Property>
           <Property name="caption">鎿嶄綔</Property>
           <Property name="align">center</Property>
@@ -782,5 +806,18 @@
         </DataPilot>
       </ToolBar>
     </Container>
+    <Dialog id="dialogImg">
+      <Property name="width">55%</Property>
+      <Property name="height">95%</Property>
+      <Property name="iconClass">fa fa-tasks</Property>
+      <Property name="caption">娴佺▼杩芥函灞曠ず</Property>
+      <Buttons/>
+      <Children>
+        <IFrame id="iFrameImg">
+          <Property name="width">100%</Property>
+        </IFrame>
+      </Children>
+      <Tools/>
+    </Dialog>
   </View>
 </ViewConfig>
diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportInDetailPR.java b/fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportInDetailPR.java
index 0ef8025..a4996d9 100644
--- a/fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportInDetailPR.java
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportInDetailPR.java
@@ -74,6 +74,8 @@
         }
         //鏌ヨ鍏ュ簱鏁版嵁
         param.setType(Constant.TYPE_IN);
+        param.setProgress(Constant.PROGRESS_RECORD);
+        param.setRecordStatus(Constant.RECORD_STATUS_NORMAL);
         //澶氬弬鏁板垎椤垫煡璇�
         com.baomidou.mybatisplus.extension.plugins.pagination.Page<InoutRecord> corePage = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(0, 10000);
         //鏀跺偍鍏徃鏌ヨ澶勭悊
diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportOutDetail.view.xml b/fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportOutDetail.view.xml
index 584341d..79e426e 100644
--- a/fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportOutDetail.view.xml
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportOutDetail.view.xml
@@ -185,7 +185,7 @@
         <Property></Property>
         <Property name="label">瑁呭嵏浠撳簱</Property>
         <Property name="mapping">
-          <Property name="mapValues">${dorado.getDataProvider(&quot;depotPR#getAllCache&quot;).getResult()}</Property>
+          <Property name="mapValues">${dorado.getDataProvider(&quot;depotPR#getData&quot;).getResult()}</Property>
           <Property name="keyProperty">id</Property>
           <Property name="valueProperty">name</Property>
         </Property>
@@ -320,7 +320,7 @@
         <Property></Property>
         <Property name="label">瑁呭嵏浠撳簱</Property>
         <Property name="mapping">
-          <Property name="mapValues">${dorado.getDataProvider(&quot;depotPR#getAllCache&quot;).getResult()}</Property>
+          <Property name="mapValues">${dorado.getDataProvider(&quot;depotPR#getData&quot;).getResult()}</Property>
           <Property name="keyProperty">id</Property>
           <Property name="valueProperty">name</Property>
         </Property>
@@ -417,7 +417,21 @@
 	var data = view.get(&quot;#dsQuery.data&quot;);&#xD;
 	view.get(&quot;#dsQuery&quot;).set(&quot;parameter&quot;,data).flushAsync();&#xD;
 };&#xD;
-query();</ClientEvent>
+query();&#xD;
+&#xD;
+showImg = function(){&#xD;
+	&#xD;
+	var select = view.get(&quot;#dataGridMain2&quot;).get(&quot;selection&quot;);&#xD;
+	if(select){&#xD;
+    	var user = encodeURIComponent(select.get(&quot;userName&quot;));&#xD;
+    	var plateNum = encodeURIComponent(select.get(&quot;plateNum&quot;));&#xD;
+	&#xD;
+    	view.get(&quot;#iFrameImg&quot;).set(&quot;path&quot;, &quot;./basic/inout/inout-img?id=&quot; + select.get(&quot;id&quot;)+&quot;&amp;plateNum=&quot;+plateNum+&quot;&amp;user=&quot;+user);&#xD;
+    	view.get(&quot;#dialogImg&quot;).show();&#xD;
+	}else{&#xD;
+    	$notify(&quot;璇烽�夋嫨鏁版嵁鈥︹��&quot;);&#xD;
+	}&#xD;
+};</ClientEvent>
     <Property name="packages">font-awesome,css-common</Property>
     <DataSet id="dsMain">
       <Property name="dataType">[dtMain]</Property>
@@ -536,7 +550,7 @@
         <Button layoutConstraint="left">
           <ClientEvent name="onClick">var data = view.get(&quot;#dsQuery.data&quot;);&#xD;
 var param = {&#xD;
-	&quot;type&quot;:&quot;OUT&quot;,&#xD;
+	&quot;type&quot;:&quot;OUT_DETAIL&quot;,&#xD;
     &quot;deptId&quot;:data.get(&quot;deptId&quot;),&#xD;
 	&quot;companyId&quot;:data.get(&quot;companyId&quot;),&#xD;
     &quot;start&quot;:data.get(&quot;start&quot;),&#xD;
@@ -695,6 +709,7 @@
 	arg.dom.style.fontWeight = &quot;bold&quot;;&#xD;
 	//arg.processDefault = false;&#xD;
 }</ClientEvent>
+        <ClientEvent name="onDataRowClick">view.get(&quot;#dataGridMain2&quot;).set(&quot;selection&quot;,arg.data);</ClientEvent>
         <Property name="dataSet">dsMain</Property>
         <Property name="readOnly">true</Property>
         <Property name="highlightCurrentRow">false</Property>
@@ -702,6 +717,8 @@
         <Property name="hideMode">display</Property>
         <Property name="headerRowHeight">30</Property>
         <Property name="rowHeight">50</Property>
+        <Property name="selectionMode">singleRow</Property>
+        <RowSelectorColumn/>
         <RowNumColumn>
           <Property name="caption">搴忓彿</Property>
         </RowNumColumn>
@@ -761,7 +778,9 @@
           <Property name="width">150</Property>
         </DataColumn>
         <DataColumn>
-          <ClientEvent name="onRenderCell">//arg.dom.innerHTML = &quot;&lt;a href='javascript:;' onClick='detail()' class='a-btn1'>鏌ョ湅璇︽儏&lt;/a>&quot;;</ClientEvent>
+          <ClientEvent name="onRenderCell"> var txt = arg.data.getText(&quot;id&quot;);&#xD;
+ if(!txt || txt == '鍚堣') return true;&#xD;
+arg.dom.innerHTML = &quot;&lt;a href='javascript:;'  onClick='showImg()' class='a-btn1'>杩囩▼杩芥函&lt;/a>&quot;;</ClientEvent>
           <Property name="width">160</Property>
           <Property name="caption">鎿嶄綔</Property>
           <Property name="align">center</Property>
@@ -779,5 +798,18 @@
         </DataPilot>
       </ToolBar>
     </Container>
+    <Dialog id="dialogImg">
+      <Property name="width">55%</Property>
+      <Property name="height">95%</Property>
+      <Property name="iconClass">fa fa-tasks</Property>
+      <Property name="caption">娴佺▼杩芥函灞曠ず</Property>
+      <Buttons/>
+      <Children>
+        <IFrame id="iFrameImg">
+          <Property name="width">100%</Property>
+        </IFrame>
+      </Children>
+      <Tools/>
+    </Dialog>
   </View>
 </ViewConfig>
diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportOutDetailPR.java b/fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportOutDetailPR.java
index f3cc834..046f512 100644
--- a/fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportOutDetailPR.java
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/ReportOutDetailPR.java
@@ -74,6 +74,8 @@
         }
         //鏌ヨ鍑哄簱鏁版嵁
         param.setType(Constant.TYPE_OUT);
+        param.setProgress(Constant.PROGRESS_RECORD);
+        param.setRecordStatus(Constant.RECORD_STATUS_NORMAL);
         //澶氬弬鏁板垎椤垫煡璇�
         com.baomidou.mybatisplus.extension.plugins.pagination.Page<InoutRecord> corePage = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(0, 10000);
         //鏀跺偍鍏徃鏌ヨ澶勭悊
diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/export/ReportController.java b/fzzy-igdss-view/src/main/java/com/fzzy/igds/export/ReportController.java
index a6b1681..87eb5cd 100644
--- a/fzzy-igdss-view/src/main/java/com/fzzy/igds/export/ReportController.java
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/export/ReportController.java
@@ -1,12 +1,8 @@
 package com.fzzy.igds.export;
 
 
-import com.fzzy.igds.ReportInDetailPR;
-import com.fzzy.igds.ReportOutDetailPR;
-import com.fzzy.igds.SuperInventoryReportPR;
-import com.fzzy.igds.data.InoutParam;
-import com.fzzy.igds.data.SuperInventoryReportData;
-import com.fzzy.igds.data.SuperInventoryReportParam;
+import com.fzzy.igds.*;
+import com.fzzy.igds.data.*;
 import com.fzzy.igds.domain.Company;
 import com.fzzy.igds.domain.Depot;
 import com.fzzy.igds.domain.Dept;
@@ -15,6 +11,7 @@
 import com.fzzy.igds.utils.ContextUtil;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysDept;
+import com.ruoyi.common.core.domain.entity.SysDictData;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -24,9 +21,10 @@
 
 import javax.annotation.Resource;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
 
 
 /**
@@ -42,35 +40,37 @@
 
     @Resource
     private InoutRecordService inoutReportService;
-
     @Resource
     private SysDeptService sysDeptService;
-
-
     @Resource
     private CoreDeptService coreDeptService;
     @Resource
     private DepotService depotService;
-
     @Resource
     private CoreCompanyService coreCompanyService;
-
-
     @Autowired
     private ReportInDetailPR reportInDetailPR;
-
     @Autowired
     private ReportOutDetailPR reportOutDetailPR;
     @Autowired
     private SuperInventoryReportPR superInventoryReportPR;
 
+    @Autowired
+    private CompanyPR companyPR;
 
+    @Autowired
+    private DeptPR deptPR;
 
+    @Autowired
+    private DepotPR depotPR;
 
+    @Autowired
+    private DicPR dicPR;
 
 
     /**
      * 鍑哄叆搴撴姤琛ㄥ鍑�
+     *
      * @return
      */
     @RequestMapping("/inOutReport-excel")
@@ -80,32 +80,152 @@
         String sheetName = "鎶ヨ〃鏁版嵁";
         //鏌ヨ鏁版嵁
         List<InoutRecord> list = new ArrayList<>();
-
-        if (StringUtils.isNotEmpty(param.getType()) && "IN".equals(param.getType())) {
-            sheetName = "鍏ュ簱鎶ヨ〃鏁版嵁";
-            list = reportInDetailPR.listRecord(param);
-        }
-
-        if (StringUtils.isNotEmpty(param.getType()) && "OUT".equals(param.getType())) {
-            sheetName = "鍑哄簱鎶ヨ〃鏁版嵁";
-            list = reportOutDetailPR.listRecord(param);
-        }
-
         //鑾峰彇鍒嗗簱缂栫爜瀵瑰簲鐨勫垎搴撳悕绉�
         String deptName = "";
         SysDept subDept = sysDeptService.getCacheDept(null, ContextUtil.subDeptId(null));
         if (null != subDept) {
             deptName = subDept.getDeptName();
         }
+        //鍒涘缓鏀跺偍鍏徃ID鍒板悕绉扮殑鏄犲皠
+        Map<String, String> companyMap = Optional.ofNullable(companyPR.getData())
+                .orElse(new ArrayList<>())
+                .stream()
+                .collect(Collectors.toMap(Company::getId, Company::getDwmc, (key1, key2) -> key2));
+        //鍒涘缓鎵�鍦ㄥ簱鍖篒D鍒板悕绉扮殑鏄犲皠
+        Map<String, String> deptMap = Optional.ofNullable(deptPR.getAllData())
+                .orElse(new ArrayList<>())
+                .stream()
+                .collect(Collectors.toMap(Dept::getId, Dept::getKqmc, (key1, key2) -> key2));
+        // 鍒涘缓浠撳簱ID鍒板悕绉扮殑鏄犲皠
+        Map<String, String> depotMap = Optional.ofNullable(depotPR.getData(null))
+                .orElse(new ArrayList<>())
+                .stream()
+                .collect(Collectors.toMap(Depot::getId, Depot::getName, (key1, key2) -> key2));
+        //鍒涘缓绮鍝佺ID鍒板悕绉扮殑鏄犲皠
+        Map<String, String> foodVarietyMap = Optional.ofNullable(dicPR.sysDictData("FOOD_VARIETY_"))
+                .orElse(new ArrayList<>())
+                .stream()
+                .collect(Collectors.toMap(SysDictData::getDictValue, SysDictData::getDictLabel, (key1, key2) -> key2));
 
-        //瀵煎嚭
-        ExcelUtil<InoutRecord> util = new ExcelUtil<InoutRecord>(InoutRecord.class);
-        return util.exportExcel(list, sheetName, deptName);
+        //缁勮瀹為檯瀵煎嚭鏁版嵁
+        if (StringUtils.isNotEmpty(param.getType()) && "IN".equals(param.getType())) {
+            sheetName = "鍏ュ簱鎶ヨ〃鏁版嵁";
+            list = reportInDetailPR.listRecord(param);
+            List<InoutRecordInExport> exportList = new ArrayList<>();
+            for (InoutRecord record : list) {
+                InoutRecordInExport export = new InoutRecordInExport();
+                export.setId(record.getId());
+                export.setPlateNum(record.getPlateNum());
+                // 灏嗕粨搴揑D鏄犲皠涓轰粨搴撳悕绉�
+                String depotNameValue = depotMap.get(record.getDepotId());
+                export.setDepotId(depotNameValue != null ? depotNameValue : "");
+                //绮鍝佺鏄犲皠
+                String foodVarietyNameValue = foodVarietyMap.get(record.getFoodVariety());
+                export.setFoodVariety(foodVarietyNameValue != null ? foodVarietyNameValue : "");
+                export.setFullWeight(record.getFullWeight());
+                export.setEmptyWeight(record.getEmptyWeight());
+                export.setNetWeight(record.getNetWeight());
+                export.setSettleWeight(record.getSettleWeight());
+                export.setRecordWeight(record.getRecordWeight());
+                export.setCompleteTime(record.getCompleteTime());
+                export.setDeOther(record.getDeOther());
+                exportList.add(export);
+            }
+            ExcelUtil<InoutRecordInExport> util = new ExcelUtil<InoutRecordInExport>(InoutRecordInExport.class);
+            return util.exportExcel(exportList, sheetName, deptName);
+        }
+
+        if (StringUtils.isNotEmpty(param.getType()) && "OUT".equals(param.getType())) {
+            sheetName = "鍑哄簱鎶ヨ〃鏁版嵁";
+            list = reportOutDetailPR.listRecord(param);
+            List<InoutRecordOutExport> exportList = new ArrayList<>();
+            for (InoutRecord record : list) {
+                InoutRecordOutExport export = new InoutRecordOutExport();
+                export.setId(record.getId());
+                export.setPlateNum(record.getPlateNum());
+                // 灏嗕粨搴揑D鏄犲皠涓轰粨搴撳悕绉�
+                String depotNameValue = depotMap.get(record.getDepotId());
+                export.setDepotId(depotNameValue != null ? depotNameValue : "");
+                //绮鍝佺鏄犲皠
+                String foodVarietyNameValue = foodVarietyMap.get(record.getFoodVariety());
+                export.setFoodVariety(foodVarietyNameValue != null ? foodVarietyNameValue : "");
+                export.setFullWeight(record.getFullWeight());
+                export.setEmptyWeight(record.getEmptyWeight());
+                export.setNetWeight(record.getNetWeight());
+                export.setSettleWeight(record.getSettleWeight());
+                export.setRecordWeight(record.getRecordWeight());
+                export.setCompleteTime(record.getCompleteTime());
+                export.setDeOther(record.getDeOther());
+                exportList.add(export);
+            }
+            ExcelUtil<InoutRecordOutExport> util = new ExcelUtil<InoutRecordOutExport>(InoutRecordOutExport.class);
+            return util.exportExcel(exportList, sheetName, deptName);
+        }
+
+        if (StringUtils.isNotEmpty(param.getType()) && "IN_DETAIL".equals(param.getType())) {
+            sheetName = "鍏ュ簱鏄庣粏鎶ヨ〃鏁版嵁";
+            list = reportInDetailPR.listRecord(param);
+            List<InoutRecordDetailInExport> exportList = new ArrayList<>();
+            for (InoutRecord record : list) {
+                InoutRecordDetailInExport export = new InoutRecordDetailInExport();
+                //鏀跺偍鍏徃鏄犲皠
+                String companyNameValue = companyMap.get(record.getCompanyId());
+                export.setCompanyId(companyNameValue != null ? companyNameValue : "");
+                //搴撳尯鏄犲皠
+                String deptNameValue = deptMap.get(record.getDeptId());
+                export.setDeptId(deptNameValue != null ? deptNameValue : "");
+                export.setId(record.getId());
+                export.setPlateNum(record.getPlateNum());
+                // 灏嗕粨搴揑D鏄犲皠涓轰粨搴撳悕绉�
+                String depotNameValue = depotMap.get(record.getDepotId());
+                export.setDepotId(depotNameValue != null ? depotNameValue : "");
+                //绮鍝佺鏄犲皠
+                String foodVarietyNameValue = foodVarietyMap.get(record.getFoodVariety());
+                export.setFoodVariety(foodVarietyNameValue != null ? foodVarietyNameValue : "");
+                export.setSettleWeight(record.getSettleWeight());
+                export.setRecordWeight(record.getRecordWeight());
+                export.setCompleteTime(record.getCompleteTime());
+                exportList.add(export);
+            }
+            ExcelUtil<InoutRecordDetailInExport> util = new ExcelUtil<InoutRecordDetailInExport>(InoutRecordDetailInExport.class);
+            return util.exportExcel(exportList, sheetName, deptName);
+        }
+
+        if (StringUtils.isNotEmpty(param.getType()) && "OUT_DETAIL".equals(param.getType())) {
+            sheetName = "鍑哄簱鏄庣粏鎶ヨ〃鏁版嵁";
+            list = reportOutDetailPR.listRecord(param);
+            List<InoutRecordDetailOutExport> exportList = new ArrayList<>();
+            for (InoutRecord record : list) {
+                InoutRecordDetailOutExport export = new InoutRecordDetailOutExport();
+                //鏀跺偍鍏徃鏄犲皠
+                String companyNameValue = companyMap.get(record.getCompanyId());
+                export.setCompanyId(companyNameValue != null ? companyNameValue : "");
+                //搴撳尯鏄犲皠
+                String deptNameValue = deptMap.get(record.getDeptId());
+                export.setDeptId(deptNameValue != null ? deptNameValue : "");
+                export.setId(record.getId());
+                export.setPlateNum(record.getPlateNum());
+                // 灏嗕粨搴揑D鏄犲皠涓轰粨搴撳悕绉�
+                String depotNameValue = depotMap.get(record.getDepotId());
+                export.setDepotId(depotNameValue != null ? depotNameValue : "");
+                //绮鍝佺鏄犲皠
+                String foodVarietyNameValue = foodVarietyMap.get(record.getFoodVariety());
+                export.setFoodVariety(foodVarietyNameValue != null ? foodVarietyNameValue : "");
+                export.setSettleWeight(record.getSettleWeight());
+                export.setRecordWeight(record.getRecordWeight());
+                export.setCompleteTime(record.getCompleteTime());
+                exportList.add(export);
+            }
+            ExcelUtil<InoutRecordDetailOutExport> util = new ExcelUtil<InoutRecordDetailOutExport>(InoutRecordDetailOutExport.class);
+            return util.exportExcel(exportList, sheetName, deptName);
+        }
+        return AjaxResult.error("鍙傛暟閿欒");
     }
 
 
     /**
      * 搴撳瓨鎶ヨ〃瀵煎嚭
+     *
      * @return
      */
     @RequestMapping("/superInventoryReport-excel")

--
Gitblit v1.9.3