From ef48a7627cbb8dd2a257960a0890cebf190f75b5 Mon Sep 17 00:00:00 2001
From: DESKTOP-9BNTV8O <DESKTOP-9BNTV8O@163.com>
Date: 星期六, 14 十二月 2024 14:38:53 +0800
Subject: [PATCH] 修改问题
---
Wms/WMS.BLL/BllTransServer/RcsServer.cs | 90 ++++++++++++++++++++++++++++++++-------------
1 files changed, 64 insertions(+), 26 deletions(-)
diff --git a/Wms/WMS.BLL/BllTransServer/RcsServer.cs b/Wms/WMS.BLL/BllTransServer/RcsServer.cs
index 6024291..9c651a2 100644
--- a/Wms/WMS.BLL/BllTransServer/RcsServer.cs
+++ b/Wms/WMS.BLL/BllTransServer/RcsServer.cs
@@ -56,12 +56,19 @@
switch (model.Type)
{
case "0"://鍙噣妗�
- pallet = stockDetail.Where(w => w.WareHouseNo == houseNo && w.PalletStatus == "0"
- && (w.AreaNo.Contains("01") || w.AreaNo.Contains("11") || w.AreaNo.Contains("21") || w.AreaNo.Contains("31"))).OrderByDescending(o => o.CreateTime).First();
+ //鏌ユ壘鍒拌杞﹂棿鍑�妗跺尯
+ List<string> areaNoList = Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.Type == "0" && w.WareHouseNo == houseNo).Select(s=>s.AreaNo).ToList();
+ //鏌ユ壘鍑�妗�
+ pallet = stockDetail.Where(w => w.WareHouseNo == houseNo && w.PalletStatus == "0" && w.Status == "0"
+ && areaNoList.Contains(w.AreaNo)).OrderByDescending(o => o.CreateTime).First();
if (pallet == null)
{
throw new Exception("鏆傛棤鍑�妗跺彲鍒嗛厤");
- }
+ }
+ pallet.Status = "2";//鍒嗛厤鐘舵�� 0:寰呭垎閰嶏紝1锛氶儴鍒嗗垎閰� 锛� 2:宸插垎閰�
+ //鏇存柊妗跺簱瀛樻槑缁�
+ Db.Updateable(pallet).ExecuteCommand();
+
taskMsg = "璁惧鍙噣妗朵换鍔�";
break;
case "1"://鍙枡妗讹紙娣锋枡锛�
@@ -70,15 +77,18 @@
{
throw new Exception("鎵规鍙蜂负绌猴紒");
}
+ //鏌ユ壘鍒拌杞﹂棿棰勬贩鍖�
+ List<string> areaNoList2 = Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.Type == "1" && w.WareHouseNo == houseNo).Select(s => s.AreaNo).ToList();
//鏌ユ壘搴撳瓨涓槸鍚︽湁鍙敤鐨勬鎵规鐨勬贩鏂欐《
- pallet = stockDetail.Where(w => w.WareHouseNo == houseNo && w.PalletStatus == "1" && w.LotNo == model.LotNo
- && (w.AreaNo.Contains("02") || w.AreaNo.Contains("12") || w.AreaNo.Contains("22") || w.AreaNo.Contains("32"))).OrderByDescending(o => o.CompleteTime).First();
+ pallet = stockDetail.Where(w => w.WareHouseNo == houseNo && w.PalletStatus == "1" && w.Status == "0" && w.LotNo == model.LotNo
+ && areaNoList2.Contains(w.AreaNo)).OrderByDescending(o => o.CompleteTime).First();
if (pallet == null)
{
throw new Exception("鏆傛棤娣锋枡妗跺彲鍒嗛厤");
}
- pallet.LotNo = model.LotNo;
- //鏇存柊妗跺簱瀛樻槑缁嗙淮鎶ゆ壒娆″彿
+ pallet.Status = "2";//鍒嗛厤鐘舵�� 0:寰呭垎閰嶏紝1锛氶儴鍒嗗垎閰� 锛� 2:宸插垎閰�
+ pallet.LotNo = model.LotNo;//鎵规鍙�
+ //鏇存柊妗跺簱瀛樻槑缁�
Db.Updateable(pallet).ExecuteCommand();
taskMsg = "璁惧鍙枡妗舵贩鏂欎换鍔�";
@@ -107,19 +117,26 @@
//鏇存柊鍑哄簱鍗�
Db.Updateable(soNotice).ExecuteCommand();
+ //鏌ユ壘鍒拌杞﹂棿鍗婃垚鍝佸尯
+ List<string> areaNoList3 = Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.Type == "2" && w.WareHouseNo == houseNo).Select(s => s.AreaNo).ToList();
//鏌ユ壘搴撳瓨涓槸鍚︽湁姝ゆ壒娆$殑鍚堟牸涓嬫枡妗�
- pallet = stockDetail.Where(w => w.WareHouseNo == houseNo && w.PalletStatus == "2" && w.LotNo == model.LotNo && w.InspectStatus=="1"
- && (w.AreaNo.Contains("03") || w.AreaNo.Contains("13") || w.AreaNo.Contains("23") || w.AreaNo.Contains("33"))).OrderByDescending(o => o.CompleteTime).First();
+ pallet = stockDetail.Where(w => w.WareHouseNo == houseNo && w.PalletStatus == "2" && w.Status == "0" && w.LotNo == model.LotNo && w.InspectStatus=="1"
+ && areaNoList3.Contains(w.AreaNo)).OrderByDescending(o => o.CompleteTime).First();
if (pallet == null)
{
throw new Exception("鏆傛棤涓嬫枡妗跺彲鍒嗛厤");
}
+ pallet.Status = "2";//鍒嗛厤鐘舵�� 0:寰呭垎閰嶏紝1锛氶儴鍒嗗垎閰� 锛� 2:宸插垎閰�
+ //鏇存柊妗跺簱瀛樻槑缁�
+ Db.Updateable(pallet).ExecuteCommand();
taskMsg = "璁惧鍙枡妗朵笅鏂欎换鍔�";
break;
case "3"://鍙剰妗�
- List<DataStockDetail> palletList = stockDetail.Where(w => w.WareHouseNo == houseNo && w.PalletStatus == "3"
- && (w.AreaNo.Contains("03") || w.AreaNo.Contains("13") || w.AreaNo.Contains("23") || w.AreaNo.Contains("33"))).OrderByDescending(o => o.CompleteTime).ToList();
+ //鏌ユ壘鍒拌杞﹂棿鑴忔《鍖�
+ List<string> areaNoList4 = Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.Type == "3" && w.WareHouseNo == houseNo).Select(s => s.AreaNo).ToList();
+ List<DataStockDetail> palletList = stockDetail.Where(w => w.WareHouseNo == houseNo && w.PalletStatus == "3" && w.Status == "0"
+ && areaNoList4.Contains(w.AreaNo)).OrderByDescending(o => o.CompleteTime).ToList();
if (palletList.Count <= 0)
{
throw new Exception("鏆傛棤鑴忔《鍙垎閰�");
@@ -160,6 +177,9 @@
//}
#endregion
+ item.Status = "2";//鍒嗛厤鐘舵�� 0:寰呭垎閰嶏紝1锛氶儴鍒嗗垎閰� 锛� 2:宸插垎閰�
+ //鏇存柊妗跺簱瀛樻槑缁�
+ Db.Updateable(item).ExecuteCommand();
//璧峰鍌ㄤ綅鍦板潃淇℃伅
var startLoction2 = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == item.LocatNo);
if (startLoction2 == null)
@@ -183,7 +203,7 @@
IsCancel = 1,//鏄惁鍙彇娑�
IsFinish = 1,//鏄惁鍙畬鎴�
Type = "1",//浠诲姟绫诲瀷 0 鍏ュ簱浠诲姟 1 鍑哄簱浠诲姟 2 绉诲簱浠诲姟
- OrderType = "2",//鍗曟嵁绫诲瀷 0 鍏ュ簱 1 鍑哄簱 3鍏朵粬
+ OrderType = "3",//鍗曟嵁绫诲瀷 0 鍏ュ簱 1 鍑哄簱 3鍏朵粬
Status = "0",//浠诲姟鐘舵��0锛氱瓑寰呮墽琛�1姝e湪鎵ц2鎵ц瀹屾垚
NoticeDetailNo = int.Parse(noticeNo),
Msg = taskMsg, //鍏抽敭淇℃伅
@@ -257,7 +277,7 @@
IsCancel = 1,//鏄惁鍙彇娑�
IsFinish = 1,//鏄惁鍙畬鎴�
Type = "1",//浠诲姟绫诲瀷 0 鍏ュ簱浠诲姟 1 鍑哄簱浠诲姟 2 绉诲簱浠诲姟
- OrderType = "2",//鍗曟嵁绫诲瀷 0 鍏ュ簱 1 鍑哄簱 3鍏朵粬
+ OrderType = "3",//鍗曟嵁绫诲瀷 0 鍏ュ簱 1 鍑哄簱 3鍏朵粬
Status = "0",//浠诲姟鐘舵��0锛氱瓑寰呮墽琛�1姝e湪鎵ц2鎵ц瀹屾垚
NoticeDetailNo = int.Parse(noticeNo),
Msg = taskMsg, //鍏抽敭淇℃伅
@@ -337,7 +357,9 @@
switch (model.Type)
{
case "3"://娓呮礂璁惧鐢宠鍌ㄤ綅锛堝噣妗剁敵璇峰偍浣嶏級
- loction = storageLocat.Where(w => w.WareHouseNo == houseNo && (w.AreaNo.Contains("01") || w.AreaNo.Contains("11") || w.AreaNo.Contains("21") || w.AreaNo.Contains("31"))).OrderByDescending(o => o.CreateTime).First();
+ //鏌ユ壘鍒拌杞﹂棿鍑�妗跺尯
+ List<string> areaNoList = Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.Type == "0" && w.WareHouseNo == houseNo).Select(s => s.AreaNo).ToList();
+ loction = storageLocat.Where(w => w.WareHouseNo == houseNo && areaNoList.Contains(w.AreaNo)).OrderByDescending(o => o.CreateTime).First();
if (loction == null)
{
throw new Exception("璇ヨ溅闂村噣妗跺尯鏆傛棤绌轰綑鍌ㄤ綅");
@@ -351,7 +373,9 @@
{
throw new Exception("鎵规鍙蜂负绌猴紒");
}
- loction = storageLocat.Where(w => w.WareHouseNo == houseNo && (w.AreaNo.Contains("02") || w.AreaNo.Contains("12") || w.AreaNo.Contains("22") || w.AreaNo.Contains("32"))).OrderByDescending(o => o.CreateTime).First();
+ //鏌ユ壘鍒拌杞﹂棿棰勬贩鍖�
+ List<string> areaNoList2 = Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.Type == "1" && w.WareHouseNo == houseNo).Select(s => s.AreaNo).ToList();
+ loction = storageLocat.Where(w => w.WareHouseNo == houseNo && areaNoList2.Contains(w.AreaNo)).OrderByDescending(o => o.CreateTime).First();
if (loction == null)
{
throw new Exception("璇ヨ溅闂撮娣峰尯鏆傛棤绌轰綑鍌ㄤ綅");
@@ -382,7 +406,9 @@
//鏇存柊鍏ュ簱鍗曠姸鎬�
Db.Updateable(notice).ExecuteCommand();
- loction = storageLocat.Where(w => w.WareHouseNo == houseNo && (w.AreaNo.Contains("03") || w.AreaNo.Contains("13") || w.AreaNo.Contains("23") || w.AreaNo.Contains("33"))).OrderByDescending(o => o.CreateTime).First();
+ //鏌ユ壘鍒拌杞﹂棿鍗婃垚鍝佸尯
+ List<string> areaNoList3 = Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.Type == "2" && w.WareHouseNo == houseNo).Select(s => s.AreaNo).ToList();
+ loction = storageLocat.Where(w => w.WareHouseNo == houseNo && areaNoList3.Contains(w.AreaNo)).OrderByDescending(o => o.CreateTime).First();
if (loction == null)
{
throw new Exception("璇ヨ溅闂村崐鎴愬搧鍖烘殏鏃犵┖浣欏偍浣�");
@@ -391,7 +417,9 @@
taskMsg = "鎺ユ枡璁惧锛堟贩鏂欐《锛夌敵璇峰偍浣嶄换鍔�";
break;
case "2"://涓嬫枡璁惧鐢宠鍌ㄤ綅锛堣剰妗剁敵璇峰偍浣嶏級
- loction = storageLocat.Where(w => w.WareHouseNo == houseNo && (w.AreaNo.Contains("04") || w.AreaNo.Contains("14") || w.AreaNo.Contains("24") || w.AreaNo.Contains("34"))).OrderByDescending(o => o.CreateTime).First();
+ //鏌ユ壘鍒拌杞﹂棿鑴忔《鍖�
+ List<string> areaNoList4 = Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.Type == "3" && w.WareHouseNo == houseNo).Select(s => s.AreaNo).ToList();
+ loction = storageLocat.Where(w => w.WareHouseNo == houseNo && areaNoList4.Contains(w.AreaNo)).OrderByDescending(o => o.CreateTime).First();
if (loction == null)
{
throw new Exception("璇ヨ溅闂磋剰妗跺尯鏆傛棤绌轰綑鍌ㄤ綅");
@@ -418,7 +446,7 @@
IsCancel = 1,//鏄惁鍙彇娑�
IsFinish = 1,//鏄惁鍙畬鎴�
Type = "0",//浠诲姟绫诲瀷 0 鍏ュ簱浠诲姟 1 鍑哄簱浠诲姟 2 绉诲簱浠诲姟
- OrderType = "2",//鍗曟嵁绫诲瀷 0 鍏ュ簱 1 鍑哄簱 3鍏朵粬
+ OrderType = "3",//鍗曟嵁绫诲瀷 0 鍏ュ簱 1 鍑哄簱 3鍏朵粬
Status = "0",//浠诲姟鐘舵��0锛氱瓑寰呮墽琛�1姝e湪鎵ц2鎵ц瀹屾垚
NoticeDetailNo = int.Parse(noticeno),
Msg = taskMsg, //鍏抽敭淇℃伅
@@ -606,7 +634,8 @@
//涓嬭溅浠诲姟鍗�
AgvSchedulingTask agvTask = new AgvSchedulingTask();
- agvTask.reqCode = taskDetial.Taskno;//浠诲姟鍙�
+ agvTask.reqCode = taskDetial.Taskno;//璇锋眰缂栧彿
+ agvTask.taskCode= taskDetial.Taskno;//浠诲姟鍙�
agvTask.ctnrCode = taskDetial.Pallno;//妗跺彿
agvTask.ctnrTyp = "1";
agvTask.reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");//璇锋眰鏃堕棿
@@ -726,30 +755,39 @@
//淇敼鐩爣鍌ㄤ綅鐘舵��
Db.Updateable(endLocatInfo).ExecuteCommand();
+ //鐩爣鍌ㄤ綅鎵�灞炲尯鍩�
+ var endAreaInfo = Db.Queryable<SysStorageArea>().First(w => w.IsDel == "0" && w.WareHouseNo == endLocatInfo.WareHouseNo && w.AreaNo == endLocatInfo.AreaNo);
+ if (endAreaInfo == null)
+ {
+ throw new Exception($"鐩爣鍌ㄤ綅鎵�灞炲尯鍩熶俊鎭笉瀛樺湪");
+ }
+
stockDetail.WareHouseNo = endLocatInfo.WareHouseNo;//鎵�灞炰粨搴�
stockDetail.RoadwayNo = endLocatInfo.RoadwayNo;//鎵�灞炲贩閬�
stockDetail.AreaNo = endLocatInfo.AreaNo;//鎵�灞炲尯鍩�
- stockDetail.LocatNo = endLocatInfo.LocatNo;//鍌ㄤ綅鍦板潃
- stockDetail.Status = "0";
- if (endLocatInfo.AreaNo.Contains("01") || endLocatInfo.AreaNo.Contains("11") || endLocatInfo.AreaNo.Contains("21") || endLocatInfo.AreaNo.Contains("31"))//娲佸噣鍖�
+ stockDetail.LocatNo = endLocatInfo.LocatNo;//鍌ㄤ綅鍦板潃
+ if (endAreaInfo.Type=="0")//娲佸噣鍖�
{
stockDetail.PalletStatus = "0";
- stockDetail.Status = "0";
+ stockDetail.Status = "0";//寰呭垎閰�
}
- else if (endLocatInfo.AreaNo.Contains("02") || endLocatInfo.AreaNo.Contains("12") || endLocatInfo.AreaNo.Contains("22") || endLocatInfo.AreaNo.Contains("32"))//棰勬贩鍖�
+ else if (endAreaInfo.Type == "1")//棰勬贩鍖�
{
stockDetail.PalletStatus = "1";
+ stockDetail.Status = "0";//寰呭垎閰�
}
- else if (endLocatInfo.AreaNo.Contains("03") || endLocatInfo.AreaNo.Contains("13") || endLocatInfo.AreaNo.Contains("23") || endLocatInfo.AreaNo.Contains("33"))//鍗婃垚鍝佸尯
+ else if (endAreaInfo.Type == "2")//鍗婃垚鍝佸尯
{
stockDetail.PalletStatus = "2";
+ stockDetail.Status = "0";//寰呭垎閰�
}
- else if (endLocatInfo.AreaNo.Contains("04") || endLocatInfo.AreaNo.Contains("14") || endLocatInfo.AreaNo.Contains("24")|| endLocatInfo.AreaNo.Contains("34"))//鑴忔《鍖�
+ else if (endAreaInfo.Type == "3")//鑴忔《鍖�
{
stockDetail.PalletStatus = "3";
stockDetail.LotNo = "";//鎵规
stockDetail.SkuNo = "";
stockDetail.SkuName = "";
+ stockDetail.Status = "0";//寰呭垎閰�
stockDetail.InspectStatus = "0";//寰呮楠�
}
//淇敼搴撳瓨鏄庣粏
--
Gitblit v1.8.0