From 8193a4f5f70dbae83f5292aa6175476603653cd7 Mon Sep 17 00:00:00 2001
From: test <15284381150@163.com>
Date: 星期日, 21 九月 2025 10:48:52 +0800
Subject: [PATCH] 添加临期预警过期时间,修改库存查询

---
 Wms/WMS.BLL/DataServer/DataBoxInfoServer.cs    |    4 
 Wms/Model/ModelDto/DataDto/MateDataStockDto.cs |    1 
 Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs        |  153 +++++++++++++++++++++++++++++++++------------------
 Wms/Model/ModelVm/SysVm/PackagVm.cs            |    2 
 HTML/views/StatisticalReport/AdventSlot.html   |   15 +++++
 5 files changed, 118 insertions(+), 57 deletions(-)

diff --git a/HTML/views/StatisticalReport/AdventSlot.html b/HTML/views/StatisticalReport/AdventSlot.html
index d843642..c61edb9 100644
--- a/HTML/views/StatisticalReport/AdventSlot.html
+++ b/HTML/views/StatisticalReport/AdventSlot.html
@@ -121,6 +121,13 @@
 							}}
 							{{ GetBtn(d) }}
 						</script>
+						<script type="text/html" id="templetExpirationTime">
+							{{# function GetBtn(d){
+								return formatDate(d.ExpirationTime);
+							}
+						}}
+						{{GetBtn(d)}}
+						</script>
 						<!-- #endregion -->
 					</div>
 
@@ -277,6 +284,12 @@
                 //                 },
                 //             },
                 //             {
+                //                 field: 'ExpirationTime', title: '杩囨湡鏃堕棿', align: 'center',width:150,
+                //                 templet: function(d) {
+                //                     return formatDate2(d.ExpirationTime);
+                //                 },
+                //             },
+                //             {
                 //                 field: 'Status', title: '鐗╂枡鐘舵��', align: 'center',width:100, templet: '#buttonTpl'
                 //             },
                 //             {
@@ -308,11 +321,13 @@
                             {field: 'LotText',title: '鎵规鎻忚堪',  align: 'center', width:100},
                             {field: 'SupplierLot',title: '渚涜揣鎵规', align: 'center', width:100},
                             {field: 'ProductionTime', title: '鐢熶骇鏃堕棿', align: 'center',width:150,templet: '#templetProductionTime'},
+                            {field: 'ExpirationTime', title: '杩囨湡鏃堕棿', align: 'center',width:150,templet: '#templetExpirationTime'},
                             {field: 'Status', title: '鐗╂枡鐘舵��', align: 'center',width:100, templet: '#buttonTpl'},
                             {field: 'InspectMark', title: '鎶芥鏍囪', align: 'center',width:100, templet: '#InspectMarkStatus'},
                             {field: 'InspectStatus', title: '璐ㄩ噺鐘舵��', align: 'center',width:100, templet: '#InspectStatus1'},
 						]];
 				var TotalColsSysArr=encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//灏嗚〃澶存暟鎹繘琛寀rl缂栫爜
+				console.log(TotalColsSysArr);
 				//#endregion
 				//鑾峰彇鎬婚噺淇℃伅
 				function refreshTable(SkuNo,SkuName,LotNo,PalletNo,Status,InspectMark,InspectStatus,IsBale,IsBelt) {
diff --git a/Wms/Model/ModelDto/DataDto/MateDataStockDto.cs b/Wms/Model/ModelDto/DataDto/MateDataStockDto.cs
index dee475d..cdebd2e 100644
--- a/Wms/Model/ModelDto/DataDto/MateDataStockDto.cs
+++ b/Wms/Model/ModelDto/DataDto/MateDataStockDto.cs
@@ -264,6 +264,7 @@
         /// Desc:澶嶆鏃ユ湡
         /// </summary>           
         public DateTime? InspectTime { get; set; }
+        public DateTime? ExpirationTime { get; set; }
     }
 
 
diff --git a/Wms/Model/ModelVm/SysVm/PackagVm.cs b/Wms/Model/ModelVm/SysVm/PackagVm.cs
index a1ce975..f019a78 100644
--- a/Wms/Model/ModelVm/SysVm/PackagVm.cs
+++ b/Wms/Model/ModelVm/SysVm/PackagVm.cs
@@ -15,7 +15,7 @@
         public string PackagNo { get; set; }
 
         [Required]
-        [MaxLength(20)]
+        [MaxLength(100)]
         public string PackagName { get; set; }
 
         /// <summary>
diff --git a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
index 5ce43ae..2455d1f 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
@@ -429,60 +429,105 @@
         //}
         public async Task<List<StockDetailWithQtyDto>> GetStockQueryList(string locatNo, string palletNo, string boxNo)
         {
-                return await Db.Queryable<DataStockDetail>("a")
-                    .InnerJoin<DataBoxInfo>((a, b) => a.LotNo == b.LotNo)
-                    .Where((a, b) => a.IsDel == "0")
-                    .WhereIF(!string.IsNullOrWhiteSpace(locatNo), (a, b) => a.LocatNo.Contains(locatNo))
-                    .WhereIF(!string.IsNullOrWhiteSpace(palletNo), (a, b) => a.PalletNo.Contains(palletNo))
-                    .WhereIF(!string.IsNullOrWhiteSpace(boxNo), (a, b) => b.BoxNo.Contains(boxNo))
-                    .OrderBy((a, b) => new { a.LotNo, a.LocatNo, a.PalletNo })
-                    .Select((a, b) => new StockDetailWithQtyDto
-                    {
-                        LotNo = a.LotNo,
-                        LotText = a.LotText,
-                        SupplierLot = a.SupplierLot,
-                        OwnerNo = a.OwnerNo,
-                        OwnerName = a.OwnerName,
-                        SupplierNo = a.SupplierNo,
-                        SupplierName = a.SupplierName,
-                        SkuNo = a.SkuNo,
-                        SkuName = a.SkuName,
-                        Standard = a.Standard,
-                        Qty = b.Qty,  // DataBoxInfo鐨凲ty瀛楁
-                        LockQty = a.LockQty,
-                        FrozenQty = a.FrozenQty,
-                        InspectQty = a.InspectQty,
-                        ASNNo = a.ASNNo,
-                        ASNDetailNo = a.ASNDetailNo,
-                        SONo = a.SONo,
-                        WareHouseNo = a.WareHouseNo,
-                        RoadwayNo = a.RoadwayNo,
-                        AreaNo = a.AreaNo,
-                        LocatNo = a.LocatNo,
-                        PalletNo = a.PalletNo,
-                        PalletNo2 = a.PalletNo2,
-                        PalletNo3 = a.PalletNo3,
-                        PalletTags = a.PalletTags,
-                        CompleteTime = a.CompleteTime,
-                        ProductionTime = a.ProductionTime,
-                        ExpirationTime = a.ExpirationTime,
-                        Status = a.Status,
-                        InspectMark = a.InspectMark,
-                        BitPalletMark = a.BitPalletMark,
-                        InspectStatus = a.InspectStatus,
-                        InspectTime = a.InspectTime,
-                        PackagNo = a.PackagNo,
-                        IsBale = a.IsBale,
-                        IsBelt = a.IsBelt,
-                        UDF5 = a.UDF5,
-                        IsDel = a.IsDel,
-                        CreateTime = a.CreateTime,
-                        CreateUser = a.CreateUser,
-                        UpdateTime = a.UpdateTime,
-                        UpdateUser = a.UpdateUser,
-                        Demo = a.Demo
-                    })
-                    .ToListAsync();
+            return await Db.Queryable<DataStockDetail>("a")
+                .InnerJoin<DataBoxInfo>((a, b) => a.LotNo == b.LotNo)
+                .Where((a, b) => a.IsDel == "0")
+                .WhereIF(!string.IsNullOrWhiteSpace(locatNo), (a, b) => a.LocatNo.Contains(locatNo))
+                .WhereIF(!string.IsNullOrWhiteSpace(palletNo), (a, b) => a.PalletNo.Contains(palletNo))
+                .WhereIF(!string.IsNullOrWhiteSpace(boxNo), (a, b) => b.BoxNo.Contains(boxNo))
+                .GroupBy((a, b) => new
+                {
+                    a.LotNo,
+                    a.LotText,
+                    a.SupplierLot,
+                    a.OwnerNo,
+                    a.OwnerName,
+                    a.SupplierNo,
+                    a.SupplierName,
+                    a.SkuNo,
+                    a.SkuName,
+                    a.Standard,
+                    a.LockQty,
+                    a.FrozenQty,
+                    a.InspectQty,
+                    a.ASNNo,
+                    a.ASNDetailNo,
+                    a.SONo,
+                    a.WareHouseNo,
+                    a.RoadwayNo,
+                    a.AreaNo,
+                    a.LocatNo,
+                    a.PalletNo,
+                    a.PalletNo2,
+                    a.PalletNo3,
+                    a.PalletTags,
+                    a.CompleteTime,
+                    a.ProductionTime,
+                    a.ExpirationTime,
+                    a.Status,
+                    a.InspectMark,
+                    a.BitPalletMark,
+                    a.InspectStatus,
+                    a.InspectTime,
+                    a.PackagNo,
+                    a.IsBale,
+                    a.IsBelt,
+                    a.UDF5,
+                    a.IsDel,
+                    a.CreateTime,
+                    a.CreateUser,
+                    a.UpdateTime,
+                    a.UpdateUser,
+                    a.Demo
+                })
+                .OrderBy((a, b) => new { a.LotNo, a.LocatNo, a.PalletNo })
+                .Select((a, b) => new StockDetailWithQtyDto
+                {
+                    LotNo = a.LotNo,
+                    LotText = a.LotText,
+                    SupplierLot = a.SupplierLot,
+                    OwnerNo = a.OwnerNo,
+                    OwnerName = a.OwnerName,
+                    SupplierNo = a.SupplierNo,
+                    SupplierName = a.SupplierName,
+                    SkuNo = a.SkuNo,
+                    SkuName = a.SkuName,
+                    Standard = a.Standard,
+                    Qty = SqlFunc.AggregateSum(b.Qty),  // DataBoxInfo鐨凲ty瀛楁
+                    LockQty = a.LockQty,
+                    FrozenQty = a.FrozenQty,
+                    InspectQty = a.InspectQty,
+                    ASNNo = a.ASNNo,
+                    ASNDetailNo = a.ASNDetailNo,
+                    SONo = a.SONo,
+                    WareHouseNo = a.WareHouseNo,
+                    RoadwayNo = a.RoadwayNo,
+                    AreaNo = a.AreaNo,
+                    LocatNo = a.LocatNo,
+                    PalletNo = a.PalletNo,
+                    PalletNo2 = a.PalletNo2,
+                    PalletNo3 = a.PalletNo3,
+                    PalletTags = a.PalletTags,
+                    CompleteTime = a.CompleteTime,
+                    ProductionTime = a.ProductionTime,
+                    ExpirationTime = a.ExpirationTime,
+                    Status = a.Status,
+                    InspectMark = a.InspectMark,
+                    BitPalletMark = a.BitPalletMark,
+                    InspectStatus = a.InspectStatus,
+                    InspectTime = a.InspectTime,
+                    PackagNo = a.PackagNo,
+                    IsBale = a.IsBale,
+                    IsBelt = a.IsBelt,
+                    UDF5 = a.UDF5,
+                    IsDel = a.IsDel,
+                    CreateTime = a.CreateTime,
+                    CreateUser = a.CreateUser,
+                    UpdateTime = a.UpdateTime,
+                    UpdateUser = a.UpdateUser,
+                    Demo = a.Demo
+                })
+                .ToListAsync();
         }
         #endregion
 
diff --git a/Wms/WMS.BLL/DataServer/DataBoxInfoServer.cs b/Wms/WMS.BLL/DataServer/DataBoxInfoServer.cs
index 5456865..c564488 100644
--- a/Wms/WMS.BLL/DataServer/DataBoxInfoServer.cs
+++ b/Wms/WMS.BLL/DataServer/DataBoxInfoServer.cs
@@ -186,7 +186,7 @@
         public List<AdventBoxInfoDto> GetEmergencyWarning(string skuNo, string skuName, string lotNo, string palletNo, string status, string inspectMark, string inspectStatus)
         {
             string str = @" select d.WareHouseName,d.WareHouseNo,e.RoadwayName,e.RoadwayNo,f.AreaName,f.AreaNo,c.LocatNo,a.PalletNo,
-                             a.SkuNo,a.SkuName,SUM(a.Qty) as Qty,a.Standard,a.LotNo,a.SupplierLot,a.ProductionTime,a.Status
+                             a.SkuNo,a.SkuName,SUM(a.Qty) as Qty,a.Standard,a.LotNo,a.SupplierLot,a.ProductionTime,a.Status,c.ExpirationTime
                              from DataBoxInfo a
                              left join SysMaterials b on a.SkuNo = b.SkuNo 
                              left join DataStockDetail c on a.StockDetailId = c.Id
@@ -230,7 +230,7 @@
                 str += " and a.InspectStatus = @inspectstatus";
             }
             //鎺掑簭
-            str += @" group by d.WareHouseName,d.WareHouseNo,e.RoadwayName,e.RoadwayNo,f.AreaName,f.AreaNo,c.LocatNo,a.PalletNo,a.SkuNo,a.SkuName,a.Standard,a.LotNo,a.SupplierLot,a.ProductionTime,a.Status order by a.SkuNo,a.LotNo ";
+            str += @" group by d.WareHouseName,d.WareHouseNo,e.RoadwayName,e.RoadwayNo,f.AreaName,f.AreaNo,c.LocatNo,a.PalletNo,a.SkuNo,a.SkuName,a.Standard,a.LotNo,a.SupplierLot,a.ProductionTime,a.Status,c.ExpirationTime order by a.SkuNo,a.LotNo ";
             List<AdventBoxInfoDto> stockList = Db.Ado.SqlQuery<AdventBoxInfoDto>(str, new
             {
                 skuno = skuNo, //鐗╂枡鍙�

--
Gitblit v1.8.0