From e561870f9644a5e80925346485fe623da678177f Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期二, 14 十月 2025 10:20:57 +0800
Subject: [PATCH] 调整WMS出库逻辑,原辅料可选择成品库出库;
---
Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs | 52 ++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 44 insertions(+), 8 deletions(-)
diff --git a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
index 2455d1f..4653959 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
@@ -836,7 +836,7 @@
if (models.WareHouseNo == "W02")
{
- storageArea = await Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.AreaNo != storageLocat.AreaNo && w.WareHouseNo == "W04" && (w.AreaNo == "B01" || w.AreaNo == "B02")).OrderBy(o => o.AreaNo).ToListAsync();
+ storageArea = await Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.AreaNo != storageLocat.AreaNo && w.WareHouseNo == "W04" && (w.AreaNo == "B01" || w.AreaNo == "B02" || w.AreaNo == "B05")).OrderBy(o => o.AreaNo).ToListAsync();
}
else
{
@@ -845,6 +845,29 @@
}
return storageArea;
+ }
+ /// <summary>
+ /// 鏍规嵁鍖哄煙鍙疯幏鍙栧偍浣嶅湴鍧�闆嗗悎
+ /// </summary>
+ /// <param name="areaNo"></param>
+ /// <returns></returns>
+ /// <exception cref="Exception"></exception>
+ public List<string> GetLocatByArea(string areaNo)
+ {
+ try
+ {
+ if (string.IsNullOrEmpty(areaNo))
+ {
+ throw new Exception("璇烽�夋嫨鍖哄煙");
+ }
+ var _list = Db.Queryable<SysStorageLocat>().Where(w => w.IsDel == "0" && w.AreaNo == areaNo && w.WareHouseNo == "W04").Select(s => s.LocatNo).ToList();
+
+ return _list;
+ }
+ catch (Exception ex)
+ {
+ throw new Exception(ex.Message);
+ }
}
/// <summary>
/// 鑾峰彇宸插垎閰嶇殑鍑哄簱鍗曟嵁
@@ -1056,7 +1079,7 @@
}
}*/
- public async Task AgvTransport(string palletNo, string areaNo, string ruku, string url, int userId)
+ public async Task AgvTransport(string palletNo, string areaNo,string locatNoEnd, string ruku, string url, int userId)
{
try
{
@@ -1091,7 +1114,14 @@
{
throw Oops.Bah("鎵�閫夊尯鍩熶俊鎭笉瀛樺湪,璇锋鏌�!");
}
- EndLocat = await GetLocat(areaNo);
+ if (!string.IsNullOrEmpty(locatNoEnd))
+ {
+ EndLocat = locatNoEnd;//鎸囧畾鍌ㄤ綅鍦板潃
+ }
+ else
+ {
+ EndLocat = await GetLocat(areaNo);//绯荤粺鍒嗛厤鍌ㄤ綅鍦板潃
+ }
}
else
{
@@ -1106,9 +1136,9 @@
{
throw Oops.Bah("鎵樼洏鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
}
- if (stockDetail.WareHouseNo != "W04")
+ if (stockDetail.WareHouseNo != "W04" && stockDetail.WareHouseNo != "W02")
{
- throw Oops.Bah("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!");
+ throw Oops.Bah("璇ユ墭鐩樻湭鍦ㄥ钩搴撴垨璐ф灦搴撳唴,璇锋鏌�!");
}
//璧峰鍌ㄤ綅淇℃伅
@@ -1118,9 +1148,15 @@
throw Oops.Bah("鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
}
//鐩爣鍌ㄤ綅淇℃伅
- //var storageLocatEnd = new SysStorageLocat();
-
- var storageLocatEnd = await Db.Queryable<SysStorageLocat>().FirstAsync(w => w.IsDel == "0" && w.LocatNo == EndLocat && w.Flag == "0");
+ var storageLocatEnd = new SysStorageLocat();
+ if (!string.IsNullOrEmpty(areaNo))
+ {
+ storageLocatEnd = await Db.Queryable<SysStorageLocat>().FirstAsync(w => w.IsDel == "0" && w.LocatNo == EndLocat && w.Flag == "0" && w.WareHouseNo == "W04" && w.AreaNo == areaNo);
+ }
+ else
+ {
+ storageLocatEnd = await Db.Queryable<SysStorageLocat>().FirstAsync(w => w.IsDel == "0" && w.LocatNo == EndLocat && w.Flag == "0" && w.WareHouseNo == "W04");
+ }
if (storageLocatEnd == null)
{
throw Oops.Bah("鐩爣鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!");
--
Gitblit v1.8.0