From 8ea8c5786c87651acbb17381c8ff34bc08ada04b Mon Sep 17 00:00:00 2001
From: admin <qiutairan163@163.com>
Date: 星期一, 15 十二月 2025 17:09:07 +0800
Subject: [PATCH] 托盘明细导出GetBindListDaoChu
---
Wms/WMS.BLL/DataServer/StockDetailServer.cs | 144 ++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 140 insertions(+), 4 deletions(-)
diff --git a/Wms/WMS.BLL/DataServer/StockDetailServer.cs b/Wms/WMS.BLL/DataServer/StockDetailServer.cs
index 1e4326c..7b7b936 100644
--- a/Wms/WMS.BLL/DataServer/StockDetailServer.cs
+++ b/Wms/WMS.BLL/DataServer/StockDetailServer.cs
@@ -1,9 +1,10 @@
-锘縰sing System;
+锘縰sing Model.ModelDto.DataDto;
+using Model.ModelDto.SysDto;
+using SqlSugar;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
-using Model.ModelDto.DataDto;
-using SqlSugar;
using WMS.BLL.LogServer;
using WMS.DAL;
using WMS.Entity.BllAsnEntity;
@@ -254,9 +255,17 @@
/// <param name="bitPalletMark">闆舵墭鏍囪</param>
/// <param name="bitBoxMark">闆剁鏍囪</param>
/// <param name="inspectStatus">璐ㄩ噺鐘舵��</param>
+ /// <param name="ownerNo">璐т富缂栫爜</param>
+ /// <param name="ownerName">璐т富鍚嶇О</param>
+ /// <param name="startTime">寮�濮嬫椂闂�</param>
+ /// <param name="endTime">缁撴潫鏃堕棿</param>
+ /// <param name="wareHouseNo">鎵�灞炰粨搴�</param>
+ /// <param name="areaNo">鎵�灞炲尯鍩�</param>
/// <returns></returns>
- public List<DataStockDetail> GetBindListDaoChu(string skuNo, string skuName, string palletNo, string lotNo, string boxNo, string status, string inspectMark, string bitPalletMark, string bitBoxMark, string inspectStatus)
+ public List<StockDetailDto> GetBindListDaoChu(string skuNo, string skuName, string palletNo, string lotNo, string boxNo, string status, string inspectMark, string bitPalletMark, string bitBoxMark, string inspectStatus, string ownerNo, string ownerName, string startTime, string endTime, string wareHouseNo, string areaNo)
{
+ #region GetBindListDaoChu
+ /*
string str = "select Id,LotNo,LotText,SupplierLot,SkuNo,SkuName,Qty,LockQty,FrozenQty,AreaNo,LocatNo,PalletNo,PalletNo2," +
"PalletNo3,InspectMark,BitPalletMark from DataStockDetail where IsDel = @isdel";
//鍒ゆ柇鐗╂枡鍙锋槸鍚︿负绌�
@@ -389,6 +398,133 @@
}
}
return boxInforList;
+ */
+ #endregion
+ string listWhere = "a.IsDel='0'";
+ //鐗╂枡鍙�
+ if (!string.IsNullOrEmpty(skuNo))
+ {
+ listWhere += $@" and a.SkuNo like'%{skuNo}%'";
+ }
+ //鐗╂枡鍚嶇О
+ if (!string.IsNullOrEmpty(skuName))
+ {
+ listWhere += $@" and a.SkuName like'%{skuName}%'";
+ }
+
+ //鎵樼洏鍙�
+ if (!string.IsNullOrEmpty(palletNo))
+ {
+ listWhere += $@" and a.PalletNo like'%{palletNo}%'";
+ }
+
+ //鎵规
+ if (!string.IsNullOrEmpty(lotNo))
+ {
+ listWhere += $@" and a.LotNo like'%{lotNo}%'";
+ }
+
+ //闆舵墭鏍囪
+ if (!string.IsNullOrEmpty(bitPalletMark))
+ {
+ listWhere += $@" and a.BitPalletMark='{bitPalletMark}'";
+ }
+
+ //璐т富缂栫爜
+ if (!string.IsNullOrEmpty(ownerNo))
+ {
+ listWhere += $@" and a.OwnerNo like'%{ownerNo}%'";
+ }
+ //璐т富鍚嶇О
+ if (!string.IsNullOrEmpty(ownerName))
+ {
+ listWhere += $@" and a.OwnerName like'%{ownerName}%'";
+ }
+
+ //寮�濮嬫椂闂�
+ if (!string.IsNullOrEmpty(startTime))
+ {
+ listWhere += $" and a.CompleteTime>='{startTime}'";
+ }
+ //缁撴潫鏃堕棿
+ if (!string.IsNullOrEmpty(endTime))
+ {
+ endTime = Convert.ToDateTime(endTime).AddDays(1).ToString();
+ listWhere += $" and a.CompleteTime<'{endTime}'";
+ }
+
+ //浠撳簱
+ if (!string.IsNullOrEmpty(wareHouseNo))
+ {
+ listWhere += $" and a.WareHouseNo='{wareHouseNo}'";
+ }
+ //鍖哄煙
+ if (!string.IsNullOrEmpty(areaNo))
+ {
+ listWhere += $" and a.AreaNo='{areaNo}'";
+ }
+
+ //绠辩爜鏄庣粏鏉′欢
+ string boxWhere = "IsDel='0'";
+ //绠辩爜
+ if (!string.IsNullOrEmpty(boxNo))
+ {
+ boxWhere += $@" and BoxNo like'%{boxNo}%'";
+ }
+ //绠辨敮鐘舵��
+ if (!string.IsNullOrEmpty(status))
+ {
+ boxWhere += $@" and Status='{status}'";
+ }
+ //妫�楠屾爣璁�
+ if (!string.IsNullOrEmpty(inspectMark))
+ {
+ boxWhere += $@" and InspectMark='{inspectMark}'";
+ listWhere += $@" and a.InspectMark='{inspectMark}'";
+ }
+ //闆剁鏍囪
+ if (!string.IsNullOrEmpty(bitBoxMark))
+ {
+ boxWhere += $@" and BitBoxMark='{bitBoxMark}'";
+ }
+ //璐ㄩ噺鐘舵��
+ if (!string.IsNullOrEmpty(inspectStatus))
+ {
+ boxWhere += $@" and InspectStatus='{inspectStatus}'";
+ listWhere += $@" and a.InspectStatus='{inspectStatus}'";
+ }
+
+ //鍒ゆ柇鏄惁鏈夋煡绠辩爜淇℃伅
+ if (boxWhere != "IsDel='0'")
+ {
+ listWhere += $@" and a.Id in (select StockDetailId from DataBoxInfo Where {boxWhere} group by StockDetailId)";
+ }
+
+ string listSql = $@"select a.Id,c.WareHouseNo+'-'+c.WareHouseName as WareHouseName,b.RoadwayNo+'-'+b.RoadwayName as RoadwayName,d.AreaNo+'-'+d.AreaName as AreaName,a.LocatNo,a.PalletNo,a.SkuNo,a.SkuName,a.LotNo,a.SupplierLot,a.Qty,a.LockQty,a.FrozenQty,e.DictName as Status,f.DictName as InspectStatus,a.InspectMark,case a.BitPalletMark when 0 then '鍚�' when 1 then '鏄�' else '' end BitPalletMark,a.ProductionTime,a.ExpirationTime,a.OwnerNo,a.OwnerName,a.SupplierNo,a.SupplierName,a.Demo
+ from DataStockDetail a
+ left join SysStorageRoadway b on b.RoadwayNo=a.RoadwayNo
+ left join SysWareHouse c on c.WareHouseNo=a.WareHouseNo
+ left join SysStorageArea d on d.AreaNo=a.AreaNo
+ left join (select DictNo,DictName from SysDictionary where ParentNo='DataStockDetailStatus') e on e.DictNo=a.Status
+ left join (select DictNo,DictName from SysDictionary where ParentNo='InspectStatus') f on f.DictNo=a.InspectStatus
+ where {listWhere}
+ order by a.PalletNo,a.SkuNo,a.LotNo";
+ List<StockDetailDto> boxInforList = Db.Ado.SqlQuery<StockDetailDto>(listSql);
+
+ foreach (var item in boxInforList)
+ {
+ //鍌ㄤ綅鍦板潃锛屽姞涓婂崟寮曞彿鏄槻姝㈠鍑哄埌excel鑷姩鎶婂墠闈㈢殑0缁欏幓鎺�
+ if (!string.IsNullOrEmpty(item.LocatNo) && item.LocatNo.Substring(0, 1) == "0")
+ {
+ item.LocatNo = $@"'{item.LocatNo}";
+ }
+ //鐗╂枡缂栫爜
+ if (!string.IsNullOrEmpty(item.SkuNo) && item.SkuNo.Substring(0, 1) == "0")
+ {
+ item.SkuNo = $@"'{item.SkuNo}";
+ }
+ }
+ return boxInforList;
}
#endregion
--
Gitblit v1.8.0