From 801fec86bfbb206e59522981d4ea3d7ae2b23756 Mon Sep 17 00:00:00 2001
From: admin <qiutairan163@163.com>
Date: 星期三, 26 十一月 2025 16:40:42 +0800
Subject: [PATCH] 拣货拼托还原部分代码
---
Wms/WMS.BLL/DataServer/StockDetailServer.cs | 92 ++++++++++++++++++++++++++++++---------------
1 files changed, 61 insertions(+), 31 deletions(-)
diff --git a/Wms/WMS.BLL/DataServer/StockDetailServer.cs b/Wms/WMS.BLL/DataServer/StockDetailServer.cs
index 3d94e2f..edaa9b0 100644
--- a/Wms/WMS.BLL/DataServer/StockDetailServer.cs
+++ b/Wms/WMS.BLL/DataServer/StockDetailServer.cs
@@ -6,6 +6,7 @@
using SqlSugar;
using WMS.BLL.LogServer;
using WMS.DAL;
+using WMS.Entity.BllAsnEntity;
using WMS.Entity.BllQualityEntity;
using WMS.Entity.Context;
using WMS.Entity.DataEntity;
@@ -13,11 +14,11 @@
namespace WMS.BLL.DataServer
{
- public class StockDetailServer:DbHelper<DataStockDetail>,IStockDetailServer
+ public class StockDetailServer : DbHelper<DataStockDetail>, IStockDetailServer
{
private static readonly SqlSugarScope Db = DataContext.Db;
- public StockDetailServer():base(Db)
+ public StockDetailServer() : base(Db)
{
}
@@ -37,17 +38,14 @@
/// <param name="bitBoxMark">闆剁鏍囪</param>
/// <param name="inspectStatus">璐ㄩ噺鐘舵��</param>
/// <returns></returns>
- public List<StockDetailDto> GetBindList(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)
+ public List<StockDetailDto> GetBindList(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)
{
- string str = "select detail.*,house.WareHouseNo + '-' + house.WareHouseName as WareHouseName,roadway.RoadwayNo + '-' + roadway.RoadwayName as RoadwayName," +
- "area.AreaNo + '-' + area.AreaName as AreaName " +
- "from DataStockDetail detail " +
- "left join SysStorageRoadway roadway on detail.RoadwayNo = roadway.RoadwayNo " +
- "left join SysWareHouse house on detail.WareHouseNo = house.WareHouseNo " +
- "left join SysStorageArea area on detail.AreaNo = area.AreaNo " +
- "where detail.IsDel = @isdel";
+ string str = $@"select detail.*,house.WareHouseNo+'-'+house.WareHouseName as WareHouseName,roadway.RoadwayNo+'-'+roadway.RoadwayName as RoadwayName,area.AreaNo+'-'+area.AreaName as AreaName
+from DataStockDetail detail
+left join SysStorageRoadway roadway on detail.RoadwayNo=roadway.RoadwayNo
+left join SysWareHouse house on detail.WareHouseNo=house.WareHouseNo
+left join SysStorageArea area on detail.AreaNo=area.AreaNo
+where detail.IsDel=@isdel";
//鍒ゆ柇鐗╂枡鍙锋槸鍚︿负绌�
if (!string.IsNullOrEmpty(skuNo))
{
@@ -71,7 +69,7 @@
//鍒ゆ柇闆舵墭鏍囪鏄惁涓虹┖
if (!string.IsNullOrEmpty(bitPalletMark))
{
- str += " and detail.BitPalletMark = @bitpalletmark";
+ str += " and detail.BitPalletMark=@bitpalletmark";
}
//鍒ゆ柇璐т富缂栫爜鏄惁涓虹┖
if (!string.IsNullOrEmpty(ownerNo))
@@ -85,29 +83,30 @@
}
if (!string.IsNullOrEmpty(startTime))
{
- str += $" and detail.CompleteTime >= '{startTime}'";
+ str += $" and detail.CompleteTime>='{startTime}'";
}
if (!string.IsNullOrEmpty(endTime))
{
endTime = Convert.ToDateTime(endTime).AddDays(1).ToString();
- str += $" and detail.CompleteTime < '{endTime}'";
+ str += $" and detail.CompleteTime<'{endTime}'";
}
- if (!string.IsNullOrEmpty(WareHouseNo))
- {
- str += $" and detail.WareHouseNo = '{WareHouseNo}'";
- }
+ //閲嶅鏉′欢
+ //if (!string.IsNullOrEmpty(WareHouseNo))
+ //{
+ // str += $" and detail.WareHouseNo = '{WareHouseNo}'";
+ //}
if (!string.IsNullOrEmpty(WareHouseNo))
{
- str += $" and detail.WareHouseNo = '{WareHouseNo}'";
+ str += $" and detail.WareHouseNo='{WareHouseNo}'";
}
if (!string.IsNullOrEmpty(AreaNo))
{
- str += $" and detail.AreaNo = '{AreaNo}'";
+ str += $" and detail.AreaNo='{AreaNo}'";
}
int i = 0;
//鍦ㄧ鐮佹槑缁嗕腑鑾峰彇鐩稿簲鏁版嵁
- string boxstr = "select StockDetailId from DataBoxInfo Where IsDel = @isdel";
+ string boxstr = "select StockDetailId from DataBoxInfo Where IsDel=@isdel";
//鍒ゆ柇绠辩爜鏄惁涓虹┖
if (!string.IsNullOrEmpty(boxNo))
{
@@ -117,27 +116,27 @@
//鍒ゆ柇绠辨敮鐘舵�佹槸鍚︿负绌�
if (!string.IsNullOrEmpty(status))
{
- boxstr += " and Status = @status";
+ boxstr += " and Status=@status";
i = 1;
}
//鍒ゆ柇妫�楠屾爣璁版槸鍚︿负绌�
if (!string.IsNullOrEmpty(inspectMark))
{
- boxstr += " and InspectMark = @inspectmark";
- str += " and detail.InspectMark = @inspectmark";
+ boxstr += " and InspectMark=@inspectmark";
+ str += " and detail.InspectMark=@inspectmark";
i = 1;
}
//鍒ゆ柇闆剁鏍囪鏄惁涓虹┖
if (!string.IsNullOrEmpty(bitBoxMark))
{
- boxstr += " and BitBoxMark = @bitboxmark";
+ boxstr += " and BitBoxMark=@bitboxmark";
i = 1;
}
//鍒ゆ柇璐ㄩ噺鐘舵�佹槸鍚︿负绌�
if (!string.IsNullOrEmpty(inspectStatus))
{
- boxstr += " and InspectStatus = @inspectstatus";
- str += " and detail.InspectStatus = @inspectstatus";
+ boxstr += " and InspectStatus=@inspectstatus";
+ str += " and detail.InspectStatus=@inspectstatus";
i = 1;
}
//灏嗙鐮佹暟鎹繘琛屾帓搴�
@@ -173,11 +172,11 @@
}
if (!string.IsNullOrEmpty(arr))
{
- str += $" and Id in ({arr})";
+ str += $" and detail.Id in ({arr})";
}
else
{
- str += " and Id = ''";
+ str += " and detail.Id=''";
}
}
@@ -200,7 +199,38 @@
return boxInforList;
}
+ /// <summary>
+ /// 鎵樼洏鏄庣粏澶囨敞
+ /// </summary>
+ /// <param name="id"></param>
+ /// <param name="demo"></param>
+ /// <param name="userId"></param>
+ /// <exception cref="Exception"></exception>
+ public void EditStockDetailDemo(int id, string demo, int userId)
+ {
+ try
+ {
+ var detail = Db.Queryable<DataStockDetail>().First(m => m.IsDel == "0" && m.Id == id);
+ if (detail == null)
+ {
+ throw new Exception("鏈煡璇㈠埌搴撳瓨鏄庣粏淇℃伅");
+ }
+ detail.Demo = demo + "".Trim();
+ detail.UpdateUser = userId;
+ detail.UpdateTime = DateTime.Now;
+ int i = Db.Updateable(detail).ExecuteCommand();
+ if (i > 0)
+ {
+ //娣诲姞鎿嶄綔鏃ュ織
+ new OperationASNServer().AddLogOperationAsn("搴撳瓨缁熻", "鎵樼洏鏄庣粏", detail.PalletNo, "缂栬緫", $"缂栬緫浜嗘墭鐩樺彿涓簕detail.PalletNo}鐨勫娉ㄤ俊鎭�", userId);
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new Exception(ex.Message);
+ }
+ }
#endregion
@@ -219,7 +249,7 @@
/// <param name="bitBoxMark">闆剁鏍囪</param>
/// <param name="inspectStatus">璐ㄩ噺鐘舵��</param>
/// <returns></returns>
- public List<DataStockDetail> GetBindListDaoChu(string skuNo, string skuName, string palletNo, string lotNo, string boxNo,
+ public List<DataStockDetail> GetBindListDaoChu(string skuNo, string skuName, string palletNo, string lotNo, string boxNo,
string status, string inspectMark, string bitPalletMark, string bitBoxMark, string inspectStatus)
{
string str = "select Id,LotNo,LotText,SupplierLot,SkuNo,SkuName,Qty,LockQty,FrozenQty,AreaNo,LocatNo,PalletNo,PalletNo2," +
--
Gitblit v1.8.0