From 521fdf6c46213cad7c5c55015401154db0e78848 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期五, 24 十月 2025 13:17:43 +0800
Subject: [PATCH] 优化出入库历史单据头表从表查询

---
 新建文件夹/WIDESEA_WMSServer/WIDESEA_Model/Models/SquareCabin/Dt_DeliveryOrder_Hty.cs       |   70 ++++++-----------
 新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderHtyServices.cs           |    7 +
 新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderHtyServices.cs        |    7 +
 新建文件夹/WMS/src/views/inbound/inboundOrderDetail_Hty.vue                                 |   12 +-
 新建文件夹/WMS/src/views/inbound/inboundOrder_Hty.vue                                       |   16 ++--
 新建文件夹/WIDESEA_WMSServer/WIDESEA_Model/Models/SquareCabin/Dt_DeliveryOrderDetail_Hty.cs |   71 +++++------------
 6 files changed, 74 insertions(+), 109 deletions(-)

diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_Model/Models/SquareCabin/Dt_DeliveryOrderDetail_Hty.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_Model/Models/SquareCabin/Dt_DeliveryOrderDetail_Hty.cs"
index 0c55bbe..5f233e4 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_Model/Models/SquareCabin/Dt_DeliveryOrderDetail_Hty.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_Model/Models/SquareCabin/Dt_DeliveryOrderDetail_Hty.cs"
@@ -1,4 +1,5 @@
-锘縰sing SqlSugar;
+锘縰sing Magicodes.ExporterAndImporter.Core;
+using SqlSugar;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -9,59 +10,31 @@
 namespace WIDESEA_Model.Models
 {
     [SugarTable("Dt_DeliveryOrderDetail_Hty", "鍑哄簱鏄庣粏鍘嗗彶琛�")]
-    public class Dt_DeliveryOrderDetail_Hty : BaseEntity
+    public class Dt_DeliveryOrderDetail_Hty : Dt_DeliveryOrderDetail, IBaseHistoryEntity
     {
-        [SugarColumn(ColumnName = "HistoryId", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "鍘嗗彶璁板綍涓婚敭")]
-        public int HistoryId { get; set; }
-
-        [SugarColumn(ColumnName = "Id", ColumnDescription = "鍘熶富閿�")]
-        public int Id { get; set; }
-
-        [SugarColumn(ColumnName = "DeliveryOrderId", IsNullable = true, ColumnDescription = "鍏宠仈鍏ュ簱鍗旾D")]
-        public int DeliveryOrderId { get; set; }
-
-        [SugarColumn(ColumnName = "Reservoirarea", IsNullable = true, Length = 50, ColumnDescription = "搴撳尯")]
-        public string Reservoirarea { get; set; }
-
-        [SugarColumn(ColumnName = "Goods_no", IsNullable = true, Length = 50, ColumnDescription = "鑽搧缂栫爜")]
-        public string Goods_no { get; set; }
-
-
-        [SugarColumn(ColumnName = "Order_qty", IsNullable = true, ColumnDescription = "鍑哄簱閫�璐ф椂涓鸿礋鏁�")]
-        public decimal Order_qty { get; set; }
-
-
-        [SugarColumn(ColumnName = "Order_Outqty", IsNullable = true, ColumnDescription = "鍑哄簱瀹屾垚鏁伴噺")]
-        public decimal Order_Outqty { get; set; }
-
-        [SugarColumn(ColumnName = "Batch_num", IsNullable = true, Length = 50, ColumnDescription = "鎵瑰彿")]
-        public string Batch_num { get; set; }
-
-        [SugarColumn(ColumnName = "Exp_date", IsNullable = true, Length = 8, ColumnDescription = "鏍℃湡(yyyymmmdd)")]
-        public string Exp_date { get; set; }
         /// <summary>
-        /// 璁㈠崟璇︽儏鐘舵�� 鏂板缓锛屽紑濮嬶紝宸插畬鎴�
-        /// 搴撴埧鍙�+鐘舵��+锛堟柊寤猴級锛氬垽鏂槸鍚︿笅鍙戠粰wcs
-        /// 璇︽儏寮�濮嬶紙寮�濮嬶級
-        /// 璇︽儏瀹屾垚锛堝凡瀹屾垚锛岀Щ鍏ュ巻鍙茶〃鍒犻櫎淇℃伅锛�
+        /// 鍘熻〃涓婚敭
         /// </summary>
-        [SugarColumn(ColumnName = "OotDetailStatus", IsNullable = true, Length = 50, ColumnDescription = "鐘舵��")]
-        public string OotDetailStatus { get; set; }
+        [ImporterHeader(Name = "鍘熻〃涓婚敭")]
+        [ExporterHeader(DisplayName = "鍘熻〃涓婚敭")]
+        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "鍘熻〃涓婚敭")]
+        public int SourceId { get; set; }
 
+        /// <summary>
+        /// 鎿嶄綔绫诲瀷
+        /// </summary>
+        [ImporterHeader(Name = "鎿嶄綔绫诲瀷")]
+        [ExporterHeader(DisplayName = "鎿嶄綔绫诲瀷")]
+        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鎿嶄綔绫诲瀷")]
+        public string OperateType { get; set; }
 
-        [SugarColumn(ColumnName = "Status", IsNullable = true, ColumnDescription = "涓嬫父鐘舵�侊紝鍚屾鐘舵�侊細0鏈悓姝ワ紝1宸插悓姝ワ紙鍚屾鍙戠粰wcs锛�")]
-        public int Status { get; set; }
-
-        // 瀵艰埅灞炴�э細涓�涓槑缁嗗搴斾竴涓嵂鍝佷俊鎭�
-        // 淇瀵艰埅灞炴�э細浣跨敤 Goods_no 鍏宠仈 MaterielCode
-        [Navigate(NavigateType.OneToOne, nameof(Goods_no), nameof(Dt_MaterielInfo.MaterielCode))]
-        public Dt_MaterielInfo MedicineGoods { get; set; }
-
-        //鏄惁闇�瑕佷笅闈㈢殑瀛楁
-        //sku鍚嶇О productName
-        //sku瑙勬牸 ProductSpecifications
-        //鏁伴噺 quantity 
-        //鐩樹簭鏄庣粏 StocktakingDetails 
+        /// <summary>
+        /// 绉诲叆鍘嗗彶鏃堕棿
+        /// </summary>
+        [ImporterHeader(Name = "绉诲叆鍘嗗彶鏃堕棿")]
+        [ExporterHeader(DisplayName = "绉诲叆鍘嗗彶鏃堕棿")]
+        [SugarColumn(IsNullable = false, ColumnDescription = "绉诲叆鍘嗗彶鏃堕棿")]
+        public DateTime InsertTime { get; set; }
 
     }
 }
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_Model/Models/SquareCabin/Dt_DeliveryOrder_Hty.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_Model/Models/SquareCabin/Dt_DeliveryOrder_Hty.cs"
index 019b4a4..4632982 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_Model/Models/SquareCabin/Dt_DeliveryOrder_Hty.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_Model/Models/SquareCabin/Dt_DeliveryOrder_Hty.cs"
@@ -1,4 +1,5 @@
-锘縰sing SqlSugar;
+锘縰sing Magicodes.ExporterAndImporter.Core;
+using SqlSugar;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -9,55 +10,32 @@
 namespace WIDESEA_Model.Models
 {
     [SugarTable("Dt_DeliveryOrder_Hty", "鍑哄簱鍗曞巻鍙茶〃")]
-    public  class Dt_DeliveryOrder_Hty : BaseEntity
+    public class Dt_DeliveryOrder_Hty : Dt_DeliveryOrder, IBaseHistoryEntity
     {
-        [SugarColumn(ColumnName = "HistoryId", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "鍘嗗彶璁板綍涓婚敭")]
-        public int HistoryId { get; set; }
-
-        [SugarColumn(ColumnName = "Id", ColumnDescription = "鍘熶富閿�")]
-        public  int  Id { get; set; }
-        [SugarColumn(ColumnName = "Out_no", IsNullable = true, Length = 50, ColumnDescription = "鍑哄簱鍗曞彿")]
-        public string Out_no { get; set; }
-
-        [SugarColumn(ColumnName = "Out_type", IsNullable = true, Length = 3, ColumnDescription = "鍑哄簱鍗曠被鍨�")]
-        public string Out_type { get; set; }
-
-        [SugarColumn(ColumnName = "Client_no", IsNullable = true, Length = 50, ColumnDescription = "瀹㈡埛浠g爜")]
-        public string Client_no { get; set; }
-
-
-        [SugarColumn(ColumnName = "Client_name", IsNullable = true, Length = 50, ColumnDescription = "瀹㈡埛鍚嶇О")]
-        public string Client_name { get; set; }
-
-
-        //搴撴埧鍙�
-        [SugarColumn(ColumnName = "Warehouse_no", IsNullable = true, ColumnDescription = "搴撴埧鍙�")]
-        public string Warehouse_no { get; set; }
-
-
-
-
-        [SugarColumn(ColumnName = "Account_time", IsNullable = true, ColumnDescription = "鍑哄簱璁拌处鏃堕棿")]
-        public DateTime? Account_time { get; set; }
+        [Navigate(NavigateType.OneToMany, nameof(Dt_DeliveryOrderDetail_Hty.DeliveryOrderId))]
+        public new List<Dt_DeliveryOrderDetail_Hty> Details { get; set; }
+        /// <summary>
+        /// 鍘熻〃涓婚敭
+        /// </summary>
+        [ImporterHeader(Name = "鍘熻〃涓婚敭")]
+        [ExporterHeader(DisplayName = "鍘熻〃涓婚敭")]
+        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "鍘熻〃涓婚敭")]
+        public int SourceId { get; set; }
 
         /// <summary>
-        /// 琛ㄥご鐘舵�侊細鏂板缓锛屽紑濮嬶紝宸插畬鎴� //璇︽儏琛ㄥ叏閮ㄧ姸鎬佷负鍏ㄩ儴锛屽湪灏嗙姸鎬佹敼鎴愬畬鎴愬悗鎵嶄細涓婁紶缁欎笂娓哥郴缁�
+        /// 鎿嶄綔绫诲瀷
         /// </summary>
-        [SugarColumn(ColumnName = "OutStatus", IsNullable = true, ColumnDescription = "鐘舵��")]
-        public string OutStatus { get; set; }
+        [ImporterHeader(Name = "鎿嶄綔绫诲瀷")]
+        [ExporterHeader(DisplayName = "鎿嶄綔绫诲瀷")]
+        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鎿嶄綔绫诲瀷")]
+        public string OperateType { get; set; }
 
-        //鏄惁闇�瑕佷笅闈㈢殑瀛楁
-        //浼樺厛绾� priority
-        //鏄惁鍙栨秷 Is_cancel
-
-        //浼樺厛绾� priority
-        //[SugarColumn(ColumnName = "Priority", IsNullable = true, ColumnDescription = "浼樺厛绾�")]
-        //public int Priority { get; set; }
-
-        ////鏄惁鍙栨秷 Iscancel
-        //[SugarColumn(ColumnName = "Iscancel", IsNullable = true, ColumnDescription = "鏄惁鍙栨秷")]
-        //public int Iscancel { get; set; }
-        [Navigate(NavigateType.OneToMany, nameof(Dt_DeliveryOrderDetail.DeliveryOrderId))]
-        public List<Dt_DeliveryOrderDetail> Details { get; set; }
+        /// <summary>
+        /// 绉诲叆鍘嗗彶鏃堕棿
+        /// </summary>
+        [ImporterHeader(Name = "绉诲叆鍘嗗彶鏃堕棿")]
+        [ExporterHeader(DisplayName = "绉诲叆鍘嗗彶鏃堕棿")]
+        [SugarColumn(IsNullable = false, ColumnDescription = "绉诲叆鍘嗗彶鏃堕棿")]
+        public DateTime InsertTime { get; set; }
     }
 }
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderHtyServices.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderHtyServices.cs"
index fee7e37..3c62718 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderHtyServices.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderHtyServices.cs"
@@ -3,6 +3,7 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEA_Core;
 using WIDESEA_Core.BaseRepository;
 using WIDESEA_Core.BaseServices;
 using WIDESEA_ISquareCabinServices;
@@ -15,5 +16,11 @@
         public CabinOrderHtyServices(IRepository<Dt_CabinOrder_Hty> BaseDal) : base(BaseDal)
         {
         }
+        public override object GetDetailPage(PageDataOptions pageData)
+        {
+            var a = BaseDal.QueryFirst(x => x.Id == Convert.ToInt32(pageData.Value));
+            pageData.Value = a.SourceId;
+            return base.GetDetailPage(pageData);
+        }
     }
 }
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderHtyServices.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderHtyServices.cs"
index 6b8b8e1..22b93b4 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderHtyServices.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderHtyServices.cs"
@@ -3,6 +3,7 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEA_Core;
 using WIDESEA_Core.BaseRepository;
 using WIDESEA_Core.BaseServices;
 using WIDESEA_ISquareCabinServices;
@@ -15,5 +16,11 @@
         public DeliveryOrderHtyServices(IRepository<Dt_DeliveryOrder_Hty> BaseDal) : base(BaseDal)
         {
         }
+        public override object GetDetailPage(PageDataOptions pageData)
+        {
+            var a = BaseDal.QueryFirst(x => x.Id == Convert.ToInt32(pageData.Value));
+            pageData.Value = a.SourceId;
+            return base.GetDetailPage(pageData);
+        }
     }
 }
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/views/inbound/inboundOrderDetail_Hty.vue" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/views/inbound/inboundOrderDetail_Hty.vue"
index 2843c92..8921adf 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/views/inbound/inboundOrderDetail_Hty.vue"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/views/inbound/inboundOrderDetail_Hty.vue"
@@ -22,12 +22,12 @@
     export default defineComponent({
         setup() {
             const table = ref({
-                key: 'historyId',
+                key: 'id',
                 footer: "Foots",
                 cnName: '鍘嗗彶鍏ュ簱鍗曟槑缁�',
                 name: 'dtCabinOrderDetailHty',
                 url: "/DtCabinOrderDetailHty/",
-                sortName: "historyId"
+                sortName: "id"
             });
             const editFormFields = ref({});
             const editFormOptions = ref([]);
@@ -69,7 +69,7 @@
             ]);
             const columns = ref([
                 {
-                    field: 'historyId',
+                    field: 'id',
                     title: '鍘嗗彶璁板綍涓婚敭',
                     type: 'int',
                     width: 120,
@@ -79,7 +79,7 @@
                     align: 'left'
                 },
                 {
-                    field: 'id',
+                    field: 'sourceId',
                     title: '鍘熶富閿�',
                     type: 'int',
                     width: 100,
@@ -288,8 +288,8 @@
             sort: true
         }
     ],
-    sortName: "orderId",
-    key: "orderId"
+    sortName: "sourceId",
+    key: "sourceId"
 });
             return {
                 table,
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/views/inbound/inboundOrder_Hty.vue" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/views/inbound/inboundOrder_Hty.vue"
index 510755d..be232d6 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/views/inbound/inboundOrder_Hty.vue"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/views/inbound/inboundOrder_Hty.vue"
@@ -22,12 +22,12 @@
     export default defineComponent({
         setup() {
             const table = ref({
-                key: 'historyId',
+                key: 'id',
                 footer: "Foots",
                 cnName: '鍘嗗彶鍏ュ簱鍗�',
                 name: 'CabinOrderHty',
                 url: "/CabinOrderHty/",
-                sortName: "historyId"
+                sortName: "id"
             });
             const editFormFields = ref({});
             const editFormOptions = ref([]);
@@ -66,7 +66,7 @@
             ]);
             const columns = ref([
                 {
-                    field: 'historyId',
+                    field: 'id',
                     title: '鍘嗗彶璁板綍涓婚敭',
                     type: 'int',
                     width: 120,
@@ -76,7 +76,7 @@
                     align: 'left'
                 },
                 {
-                    field: 'id',
+                    field: 'sourceId',
                     title: '鍘熶富閿�',
                     type: 'int',
                     width: 100,
@@ -172,7 +172,7 @@
                 url: "/CabinOrderDetailHty/",
                 columns: [
                     {
-                        field: 'historyId',
+                        field: 'id',
                         title: '鍘嗗彶璁板綍涓婚敭',
                         type: 'int',
                         width: 120,
@@ -182,7 +182,7 @@
                         align: 'left'
                     },
                     {
-                        field: 'id',
+                        field: 'sourceId',
                         title: '鍘熶富閿�',
                         type: 'int',
                         width: 100,
@@ -279,8 +279,8 @@
                         sort: true
                     }
                 ],
-                sortName: "historyId",
-                key: "historyId"
+                sortName: "id",
+                key: "id"
             });
             return {
                 table,

--
Gitblit v1.9.3