From d5430d9a9e73eae213c16baea9fbbcf54cc5d5da Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期三, 22 一月 2025 16:13:53 +0800
Subject: [PATCH] 库存导出,采购单接收,物料接收优化,前端显示优化,测试架AGV任务大小托盘更改

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGV_CSJExtend.cs                                             |    2 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/PurchaseOrderService.cs                                    |    7 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockViewService.cs                                          |  127 +++++++++++++++++++++++++
 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/2a0d6254-87a5-4e06-8f11-a55bef72e58d.vsidx |    0 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/StationOccupiedEnum.cs                                          |   15 +++
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IStockViewService.cs                                        |    1 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderService.cs                                     |   11 ++
 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock                                  |    0 
 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/c7c4fe2b-1337-4db8-9421-77da433aa08c.vsidx |    0 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockViewDTO.cs                                                 |   30 +++++
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/MaterielInfoService.cs                               |   10 -
 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/7af258a1-75ee-4cab-a966-eaa9df544e99.vsidx |    0 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderDetailService.cs                               |    5 
 /dev/null                                                                                                    |    0 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockViewController.cs                        |   34 ++++++
 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/4ef9aa26-983d-4be3-b9d9-b250c0540681.vsidx |    0 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrder.cs                                   |    3 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrderDetail.cs                            |    6 +
 代码管理/WMS/WIDESEA_WMSClient/src/views/inbound/purchaseOrder.vue                                               |    7 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrderDetail.cs                             |    8 +
 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock                                  |    0 
 代码管理/WMS/WIDESEA_WMSClient/public/webconfig.js                                                               |    2 
 代码管理/WMS/WIDESEA_WMSClient/src/views/inbound/receiveOrder.vue                                                |    5 
 23 files changed, 246 insertions(+), 27 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/4ef9aa26-983d-4be3-b9d9-b250c0540681.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/4ef9aa26-983d-4be3-b9d9-b250c0540681.vsidx"
new file mode 100644
index 0000000..9beeb8b
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/4ef9aa26-983d-4be3-b9d9-b250c0540681.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/7af258a1-75ee-4cab-a966-eaa9df544e99.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/7af258a1-75ee-4cab-a966-eaa9df544e99.vsidx"
new file mode 100644
index 0000000..e9d9f74
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/7af258a1-75ee-4cab-a966-eaa9df544e99.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/c7c4fe2b-1337-4db8-9421-77da433aa08c.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/c7c4fe2b-1337-4db8-9421-77da433aa08c.vsidx"
new file mode 100644
index 0000000..380bf1b
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/c7c4fe2b-1337-4db8-9421-77da433aa08c.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock"
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock"
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/StationOccupiedEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/StationOccupiedEnum.cs"
new file mode 100644
index 0000000..fb9f974
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/StationOccupiedEnum.cs"
@@ -0,0 +1,15 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEAWCS_Common
+{
+    public enum StationOccupiedEnum
+    {
+
+        None,
+        Sure
+    }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGV_CSJExtend.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGV_CSJExtend.cs"
index c3ae198..f1f81ec 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGV_CSJExtend.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGV_CSJExtend.cs"
@@ -47,7 +47,7 @@
                             }
                         },
                             TaskCode = agvTask.AgvTaskNum,
-                            PodTyp = agvTask.PalletType < 3 ? "XX" : "DD",
+                            PodTyp = agvTask.PalletType < 3 ? "ZC" : "DX",
                         };
                         WebResponseContent content = _taskService.AgvSendTask(taskDTO);
                         if (content.Status)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/public/webconfig.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/public/webconfig.js"
index 91884d8..9ca9383 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/public/webconfig.js"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/public/webconfig.js"
@@ -1,4 +1,4 @@
 window.webConfig = {
-    "webApiBaseUrl": "http://10.30.5.60:9293/",
+    "webApiBaseUrl": "http://127.0.0.1:9293/",
     "webApiProduction":"http://10.30.4.92:9283/"
 }
\ No newline at end of file
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/purchaseOrder.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/purchaseOrder.vue"
index 8851231..9ce18f6 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/purchaseOrder.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/purchaseOrder.vue"
@@ -203,7 +203,7 @@
           title: "琛屽彿",
           type: "string",
           width: 150,
-          align: "left",
+          align: "left"
         },
         {
           field: "materielCode",
@@ -215,12 +215,11 @@
           required: true,
         },
         {
-          field: "materielCode",
+          field: "materielName",
           title: "鐗╂枡鍚嶇О",
           type: "string",
           width: 100,
-          align: "left",
-          bind: { key: "MaterielNames", data: [] },
+          align: "left"
         },
         // {
         //   field: "batchNo",
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/receiveOrder.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/receiveOrder.vue"
index 4d9407f..b26e5b0 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/receiveOrder.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/receiveOrder.vue"
@@ -53,7 +53,7 @@
       ],
       [
         { title: "渚涘簲鍟�", field: "suppliersId", type: "select",dataKey:"suppliers",data:[]},
-        { title: "鍒涘缓鑰�", field: "creater", type: "like" },
+        { title: "鍒涘缓鑰�", field: "creater", type: "like" }
       ],
     ]);
 
@@ -267,12 +267,11 @@
           required: true,
         },
         {
-          field: "materielCode",
+          field: "materielName",
           title: "鐗╂枡鍚嶇О",
           type: "string",
           width: 100,
           align: "left",
-          bind: { key: "MaterielNames", data: [] },
         },
         {
           field: "lotNo",
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/2a0d6254-87a5-4e06-8f11-a55bef72e58d.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/2a0d6254-87a5-4e06-8f11-a55bef72e58d.vsidx"
new file mode 100644
index 0000000..b4b45ca
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/2a0d6254-87a5-4e06-8f11-a55bef72e58d.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/dccce252-b152-41ce-8008-d5273b5116f7.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/dccce252-b152-41ce-8008-d5273b5116f7.vsidx"
deleted file mode 100644
index 4198d1f..0000000
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/dccce252-b152-41ce-8008-d5273b5116f7.vsidx"
+++ /dev/null
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock"
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock"
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/MaterielInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/MaterielInfoService.cs"
index df5f06c..578c271 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/MaterielInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/MaterielInfoService.cs"
@@ -80,15 +80,7 @@
         {
             try
             {
-                Dt_Warehouse? warehouse = null;
-                if (model.ItemType.ObjToInt() == MaterielTypeEnum.RawMateriel.ObjToInt())
-                {
-                    warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == model.WaId);
-                    if (warehouse == null)
-                    {
-                        return WebResponseContent.Instance.Error("鏈壘鍒颁粨搴撲俊鎭�");
-                    }
-                }
+                Dt_Warehouse? warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == model.WaId);
                 if (model.OperateType.ObjToInt() == 0)
                 {
                     Dt_MaterielInfo materielInfo = new Dt_MaterielInfo()
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockViewDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockViewDTO.cs"
index 39e46e9..79a89f5 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockViewDTO.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockViewDTO.cs"
@@ -11,122 +11,150 @@
 namespace WIDESEA_DTO.Stock
 {
     /// <summary>
-    /// 
+    /// 搴撳瓨瑙嗗浘
     /// </summary>
     public class StockViewDTO
     {
         /// <summary>
         /// 浠撳簱ID
         /// </summary>
+        [ExporterHeader(DisplayName = "浠撳簱ID")]
         public int WarehouseId {  get; set; }
         /// <summary>
         /// 璐т綅缂栧彿
         /// </summary>
+        [ExporterHeader(DisplayName = "璐т綅缂栧彿")]
         public string LocationCode { get; set; }
 
         /// <summary>
         /// 璐т綅鍚嶇О
         /// </summary>
+        [ExporterHeader(DisplayName = "璐т綅鍚嶇О")]
         public string LocationName { get; set; }
 
         /// <summary>
         /// 璐т綅鍒�
         /// </summary>
+        [ExporterHeader(DisplayName = "璐т綅鍒�")]
         public int Column { get; set; }
 
         /// <summary>
         /// 璐т綅琛�
         /// </summary>
+        [ExporterHeader(DisplayName = "璐т綅琛�")]
         public int Row { get; set; }
 
         /// <summary>
         /// 璐т綅灞�
         /// </summary>
+        [ExporterHeader(DisplayName = "璐т綅灞�")]
         public int Layer { get; set; }
 
         /// <summary>
         /// 璐т綅娣卞害
         /// </summary>
+        [ExporterHeader(DisplayName = "璐т綅娣卞害")]
         public int Depth { get; set; }
 
         /// <summary>
         /// 璐т綅鐘舵��
         /// </summary>
+        [ExporterHeader(DisplayName = "璐т綅鐘舵��")]
         public int LocationStatus { get; set; }
 
         /// <summary>
         /// 璐т綅绫诲瀷
         /// </summary>
+        [ExporterHeader(DisplayName = "璐т綅绫诲瀷")]
         public int LocationType { get; set; }
 
         /// <summary>
         /// 宸烽亾缂栧彿
         /// </summary>
+        [ExporterHeader(DisplayName = "宸烽亾缂栧彿")]
         public string RoadwayNo { get; set; }
 
         /// <summary>
         /// 绂佺敤鐘舵��
         /// </summary>
+        [ExporterHeader(IsIgnore = true)]
         public int EnalbeStatus { get; set; }
 
         /// <summary>
         /// 搴撳瓨涓婚敭
         /// </summary>
+        [ExporterHeader(IsIgnore = true)]
         public int StockId { get; set; }
 
         /// <summary>
         /// 鎵樼洏鍙�
         /// </summary>
+        [ExporterHeader(DisplayName = "鎵樼洏鍙�")]
         public string PalletCode { get; set; }
 
         /// <summary>
         /// 
         /// </summary>
+        [ExporterHeader(IsIgnore = true)]
         public bool IsFull { get; set; }
 
         /// <summary>
         /// 鐗╂枡缂栫爜
         /// </summary>
+        [ExporterHeader(DisplayName = "鐗╂枡缂栫爜")]
         public string MaterielCode { get; set; }
 
         /// <summary>
         /// 鐗╂枡鎵瑰彿
         /// </summary>
+        [ExporterHeader(DisplayName = "鐗╂枡鎵瑰彿")]
         public string BatchNo { get; set; }
+        /// <summary>
+        /// 搴撳瓨鏁伴噺
+        /// </summary>
+        [ExporterHeader(DisplayName = "搴撳瓨鏁伴噺")]
+        public string StockCounts { get; set; }
 
         /// <summary>
         /// 搴撳瓨鐘舵��
         /// </summary>
+        [ExporterHeader(IsIgnore = true)]
         public int StockStatus { get; set; }
 
         /// <summary>
         /// 搴撳瓨澶囨敞
         /// </summary>
+        [ExporterHeader(IsIgnore = true)]
         public string StockRemark { get; set; }
 
         /// <summary>
         /// 鍒涘缓浜�
         /// </summary>
+        [ExporterHeader(DisplayName = "鍒涘缓浜�")]
         public string Creater { get; set; }
 
         /// <summary>
         /// 鍒涘缓鏃堕棿
         /// </summary>
+        [ExporterHeader(DisplayName = "鍒涘缓鏃堕棿")]
         public DateTime CreateDate { get; set; }
 
         /// <summary>
         /// 淇敼浜�
         /// </summary>
+        [ExporterHeader(DisplayName = "淇敼浜�")]
         public string Modifier { get; set; }
 
         /// <summary>
         /// 淇敼鏃堕棿
         /// </summary>
+        [ExporterHeader(DisplayName = "淇敼鏃堕棿")]
         public DateTime? ModifyDate { get; set; }
 
         /// <summary>
         /// 搴撳瓨璇︽儏
         /// </summary>
+        [ExporterHeader(IsIgnore = true)]
         [Navigate(NavigateType.OneToMany, nameof(Dt_StockInfoDetail.StockId), nameof(StockId))]
         public List<Dt_StockInfoDetail> Details { get; set; }
     }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IStockViewService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IStockViewService.cs"
index 4dbc93f..b53e4ca 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IStockViewService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IStockViewService.cs"
@@ -14,5 +14,6 @@
         PageGridData<StockViewDTO> GetPageData(PageDataOptions options);
 
         object GetDetailPage(PageDataOptions pageData);
+        WebResponseContent Export(PageDataOptions options);
     }
 }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/PurchaseOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/PurchaseOrderService.cs"
index 1e593eb..324067a 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/PurchaseOrderService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/PurchaseOrderService.cs"
@@ -98,6 +98,7 @@
                     Dt_PurchaseOrderDetail purchaseOrderDetail = new Dt_PurchaseOrderDetail()
                     {
                         MaterielCode = item.MCode,
+                        MaterielName = materielInfo.MaterielName,
                         PurchaseDetailQuantity = item.Qty,
                         PurchaseDetailReceiveQty = 0,
                         PurchaseDetailStatus = PurchaseOrderDetailStatusEnum.NotReceived.ObjToInt(),
@@ -133,7 +134,7 @@
         {
             try
             {
-                Dt_PurchaseOrder purchaseOrder = Db.Queryable<Dt_PurchaseOrder>().First(x => x.PurchaseOrderNo == model.OrderNo);
+                Dt_PurchaseOrder purchaseOrder = Db.Queryable<Dt_PurchaseOrder>().Where(x => x.PurchaseOrderNo == model.OrderNo).Includes(x => x.Details).First();
                 if (purchaseOrder == null)
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒伴噰璐崟淇℃伅");
@@ -225,7 +226,7 @@
         {
             try
             {
-                Dt_PurchaseOrder purchaseOrder = Db.Queryable<Dt_PurchaseOrder>().First(x => x.PurchaseOrderNo == model.OrderNo);
+                Dt_PurchaseOrder purchaseOrder = Db.Queryable<Dt_PurchaseOrder>().Where(x => x.PurchaseOrderNo == model.OrderNo).Includes(x => x.Details).First();
                 if (purchaseOrder == null)
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒伴噰璐崟淇℃伅");
@@ -247,7 +248,7 @@
         {
             try
             {
-                Dt_PurchaseOrder purchaseOrder = Db.Queryable<Dt_PurchaseOrder>().First(x => x.PurchaseOrderNo == model.OrderNo);
+                Dt_PurchaseOrder purchaseOrder = Db.Queryable<Dt_PurchaseOrder>().Where(x=>x.PurchaseOrderNo== model.OrderNo).Includes(x=>x.Details).First();
                 if (purchaseOrder == null)
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒伴噰璐崟淇℃伅");
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderDetailService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderDetailService.cs"
index eb1fd26..706575c 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderDetailService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderDetailService.cs"
@@ -100,8 +100,8 @@
                 {
                     return WebResponseContent.Instance.Error($"璇ユ敹璐у崟鏄庣粏宸叉敹璐�");
                 }
-                //鑾峰彇鍏蜂綋鎵规
-                Dt_ReceiveOrderDetail? detail = details.FirstOrDefault(x => x.LotNo == model.LotNo);
+                //鑾峰彇鍏蜂綋鎵规鍙婄墿鏂�
+                Dt_ReceiveOrderDetail? detail = details.FirstOrDefault(x => x.LotNo == model.LotNo && x.MaterielCode==model.MaterielCode);
                 lock (_rowNoLocker)
                 {
                     if (detail != null)
@@ -149,6 +149,7 @@
                             ReceivedQuantity = model.Quantity,
                             MaterielCode = model.MaterielCode,
                             LotNo = model.LotNo,
+                            MaterielName=materielInfo.MaterielName,
                             ReceiveOrderId = receiveOrder.ReceiveOrderId,
                             PurchaseOrderDetailRowNo = purchaseOrderDetail.RowNo,
                             IfInspection = materielInfo.IsCheck.ObjToInt(),
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderService.cs"
index ad6a375..3aa437c 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderService.cs"
@@ -42,7 +42,16 @@
             _basicRepository = basicRepository;
             _invokeERPService = invokeERPService;
         }
-
+        public override PageGridData<Dt_ReceiveOrder> GetPageData(PageDataOptions options)
+        {
+            PageGridData<Dt_ReceiveOrder> pageGridData = base.GetPageData(options);
+            //foreach (var item in pageGridData.Rows)
+            //{
+            //    //鑾峰彇鏀惰揣鏄庣粏
+            //    item.PurchaseOrderNo
+            //}
+            return pageGridData;
+        }
         public override WebResponseContent AddData(SaveModel saveModel)
         {
             if (saveModel.MainData.ContainsKey(nameof(Dt_ReceiveOrder.ReceiveOrderStatus).FirstLetterToLower()))
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrderDetail.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrderDetail.cs"
index 70e71fc..e79c97e 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrderDetail.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrderDetail.cs"
@@ -67,5 +67,11 @@
         /// </summary>
         [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍗曚綅")]
         public string Unit { get; set; }
+
+        /// <summary>
+        /// 鐗╂枡鍚嶇О
+        /// </summary>
+        [SugarColumn(IsNullable = true, Length = 100, ColumnDescription = "鐗╂枡鍚嶇О")]
+        public string MaterielName { get; set; }
     }
 }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrder.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrder.cs"
index c48f4f8..b18f8d9 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrder.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrder.cs"
@@ -88,5 +88,8 @@
         /// </summary>
         [Navigate(NavigateType.OneToMany, nameof(Dt_ReceiveOrderDetail.ReceiveOrderId), nameof(ReceiveOrderId))]
         public List<Dt_ReceiveOrderDetail> Details { get; set; }
+
+        [SugarColumn(IsIgnore = true)]
+        public string? PurchaseOrderNo { get; set; }
     }
 }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrderDetail.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrderDetail.cs"
index 36534f9..3c5114c 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrderDetail.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrderDetail.cs"
@@ -95,7 +95,13 @@
         /// <summary>
         /// 鍗曚綅
         /// </summary>
-        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "")]
+        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍗曚綅")]
         public string Unit { get; set; }
+
+        /// <summary>
+        /// 鐗╂枡鍚嶇О
+        /// </summary>
+        [SugarColumn(IsNullable = true, Length = 100, ColumnDescription = "鐗╂枡鍚嶇О")]
+        public string MaterielName { get; set; }
     }
 }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockViewService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockViewService.cs"
index 8a732e7..29b525d 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockViewService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockViewService.cs"
@@ -1,5 +1,7 @@
 锘�
 using HslCommunication.Secs.Types;
+using Magicodes.ExporterAndImporter.Core;
+using Magicodes.ExporterAndImporter.Excel;
 using Microsoft.AspNetCore.Http;
 using SqlSugar;
 using System;
@@ -177,7 +179,132 @@
             }
             return new PageGridData<object>(total: 0, null);
         }
+        public virtual WebResponseContent Export(PageDataOptions options)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                Type t = typeof(StockViewDTO);
 
+                string savePath = AppDomain.CurrentDomain.BaseDirectory + $"ExcelExport";
+                IExporter exporter = new ExcelExporter();
+                options.Page = 1;
+                options.Rows = 30;
+                options.Order = "desc";
+                options.Sort = "stockId";
+                List<StockViewDTO> stockViewDTOs = new List<StockViewDTO>();
+
+                string where = string.Empty;
+                ISugarQueryable<Dt_StockInfo> sugarQueryable1 = _dbBase.Queryable<Dt_StockInfo>().Includes(x => x.Details);
+                if (!string.IsNullOrEmpty(options.Wheres))
+                {
+                    try
+                    {
+                        List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>();
+                        if (searchParametersList.Count > 0)
+                        {
+                            {
+                                SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfoDetail.MaterielCode).FirstLetterToLower());
+                                if (searchParameters != null)
+                                {
+                                    sugarQueryable1 = sugarQueryable1.Where(x => x.Details.Any(v => v.MaterielCode.Contains(searchParameters.Value)));
+                                }
+                            }
+
+                            {
+                                SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfoDetail.BatchNo).FirstLetterToLower());
+                                if (searchParameters != null)
+                                {
+                                    sugarQueryable1 = sugarQueryable1.Where(x => x.Details.Any(v => v.BatchNo.Contains(searchParameters.Value)));
+                                }
+                            }
+
+                        }
+
+                    }
+                    catch { }
+                }
+                string whereSto = GetDataRole(typeof(Dt_StockInfo));
+                sugarQueryable1 = sugarQueryable1.Where(whereSto);
+                EntityProperties.ValidatePageOptions(options, ref sugarQueryable1);
+
+                string whereLo = GetDataRole(typeof(Dt_LocationInfo));
+                ISugarQueryable<Dt_LocationInfo> sugarQueryable = _dbBase.Queryable<Dt_LocationInfo>().Where(whereLo);
+
+                EntityProperties.ValidatePageOptions(options, ref sugarQueryable);
+
+                ISugarQueryable<StockViewDTO> list = sugarQueryable1.InnerJoin(sugarQueryable, (b, a) => a.LocationCode == b.LocationCode).Select((b, a)
+                    => new StockViewDTO
+                    {
+                        LocationCode = b.LocationCode,
+                        Column = a.Column,
+                        WarehouseId = b.WarehouseId,
+                        CreateDate = b.CreateDate,
+                        Creater = b.Creater,
+                        Depth = a.Depth,
+                        EnalbeStatus = a.EnableStatus,
+                        Layer = a.Layer,
+                        LocationName = a.LocationName,
+                        LocationStatus = a.LocationStatus,
+                        LocationType = a.LocationType,
+                        Modifier = b.Modifier,
+                        ModifyDate = b.ModifyDate,
+                        PalletCode = b.PalletCode,
+                        StockRemark = b.Remark,
+                        RoadwayNo = a.RoadwayNo,
+                        Row = a.Row,
+                        StockId = b.Id,
+                        StockStatus = b.StockStatus,
+                        Details = b.Details,
+                    });
+
+                var pklist = sugarQueryable1.Where(b => b.LocationCode == "骞冲簱浣�").Select(b => new StockViewDTO
+                {
+                    LocationCode = b.LocationCode,
+                    Column = 0,
+                    WarehouseId = b.WarehouseId,
+                    CreateDate = b.CreateDate,
+                    Creater = b.Creater,
+                    Depth = 0,
+                    EnalbeStatus = EnableStatusEnum.Normal.ObjToInt(),
+                    Layer = 0,
+                    LocationName = "骞冲簱浣�",
+                    LocationStatus = LocationStatusEnum.InStock.ObjToInt(),
+                    LocationType = LocationTypeEnum.Undefined.ObjToInt(),
+                    Modifier = b.Modifier,
+                    ModifyDate = b.ModifyDate,
+                    PalletCode = b.PalletCode,
+                    StockRemark = b.Remark,
+                    RoadwayNo = "骞冲簱",
+                    Row = 0,
+                    StockId = b.Id,
+                    StockStatus = b.StockStatus,
+                    Details = b.Details,
+                });
+                stockViewDTOs = list.ToList();
+                stockViewDTOs.AddRange(pklist.ToList());
+                stockViewDTOs.ForEach(x =>
+                {
+                    x.MaterielCode = (string.Join(",", x.Details.Select(x => x.MaterielCode).Distinct())) ?? "绌虹";
+                    x.BatchNo = (string.Join(",", x.Details.Select(x => x.BatchNo).Distinct())) ?? "鏃�";
+                    x.StockCounts = x.Details.Sum(x => x.StockQuantity).ToString() + x.Details.FirstOrDefault()?.Unit;
+                }
+                );
+
+                byte[] data = exporter.ExportAsByteArray(stockViewDTOs).Result;
+                
+                string fileName = "搴撳瓨瑙嗗浘.xlsx";
+               
+                FileHelper.WriteFile(savePath, fileName, data);
+
+                content = WebResponseContent.Instance.OK(data: savePath + "\\" + fileName);
+            }
+            catch (Exception ex)
+            {
+                content = WebResponseContent.Instance.Error(ex.Message);
+            }
+            return content;
+        }
         private string GetDataRole(Type type)
         {
             try
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockViewController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockViewController.cs"
index 69857e1..4bd93c8 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockViewController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockViewController.cs"
@@ -1,7 +1,10 @@
-锘縰sing Microsoft.AspNetCore.Authorization;
+锘縰sing Autofac.Core;
+using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Options;
+using SqlSugar;
+using System.Reflection;
 using WIDESEA_Core;
 using WIDESEA_Core.BaseController;
 using WIDESEA_DTO.Stock;
@@ -34,5 +37,34 @@
         {
             return _stockViewService.GetDetailPage(pageData);
         }
+
+        /// <summary>
+        /// 瀵煎嚭鏁版嵁
+        /// </summary>
+        /// <param name="loadData"></param>
+        /// <returns></returns>
+        [HttpPost, Route("Export")]
+        public virtual ActionResult Export([FromBody] PageDataOptions loadData)
+        {
+            WebResponseContent result = InvokeService("Export", new object[] { loadData }) as WebResponseContent;
+            if (result.Status)
+                return File(
+                       System.IO.File.ReadAllBytes(result.Data.ToString()),
+                       System.Net.Mime.MediaTypeNames.Application.Octet,
+                       Path.GetFileName(result.Data.ToString())
+                   );
+            return Json(result);
+        }
+        private object InvokeService(string methodName, object[] parameters)
+        {
+            Type t = _stockViewService.GetType();
+            List<Type> types = new List<Type>();
+            foreach (var param in parameters)
+            {
+                types.Add(param.GetType());
+            }
+            MethodInfo method = t.GetMethod(methodName, types.ToArray());
+            return method.Invoke(_stockViewService, parameters);
+        }
     }
 }

--
Gitblit v1.9.3