From 34971d1815420aab6548d1603fee08c787d53a23 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期二, 25 十一月 2025 09:07:42 +0800
Subject: [PATCH] 优化叫脏桶处理逻辑
---
Wms/WMS.BLL/BllTransServer/RcsServer.cs | 84 ++++++++----------------------------------
1 files changed, 16 insertions(+), 68 deletions(-)
diff --git a/Wms/WMS.BLL/BllTransServer/RcsServer.cs b/Wms/WMS.BLL/BllTransServer/RcsServer.cs
index 3c23ffc..4a17d93 100644
--- a/Wms/WMS.BLL/BllTransServer/RcsServer.cs
+++ b/Wms/WMS.BLL/BllTransServer/RcsServer.cs
@@ -235,7 +235,7 @@
}
break;
case "3"://娓呮礂璁惧鍙剰妗�
- {
+ {
//鍙《鐩爣鍌ㄤ綅鍦板潃淇℃伅
endLoction = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.WareHouseNo == houseNo && w.AreaNo == deviceInfo.AreaNo && w.Column == 1);// Column=1 娓呮礂鍌ㄤ綅锛孋olumn=2 娓呮礂瀹屾枡鍌ㄤ綅
if (endLoction == null)
@@ -266,6 +266,7 @@
throw new Exception("鏆傛棤鑴忔《鍙垎閰�");
}
taskMsg = "璁惧鍙剰妗朵换鍔�";
+ int callResult = 0;//鏄惁鍙剰妗舵垚鍔�
//閬嶅巻搴撳瓨鑴忔《锛岃繑鍥濵ES楠岃瘉
foreach (var item in palletList)
{
@@ -286,6 +287,7 @@
//淇敼璇ユ《搴撳瓨鐘舵��
Db.Updateable(item).ExecuteCommand();
+ callResult = 1;
continue;
}
}
@@ -296,78 +298,24 @@
#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)
- {
- throw new Exception($"璧峰鐩爣鍌ㄤ綅淇℃伅涓嶅瓨鍦紝妗跺彿锛歿item.PalletNo}");
- }
- taskNo = new Common().GetMaxNo("TN");//浠诲姟鍙�
- var logTaskEntry2 = new LogTask
- {
- TaskNo = taskNo,
- Sender = "WMS",
- Receiver = "RCS",
- //IsSuccess = 1, //鏄惁涓嬪彂鎴愬姛 0澶辫触 1鎴愬姛
- SendDate = DateTime.Now, //鍙戦�佹椂闂�
- //BackDate = DateTime.Now, //杩斿洖鏃堕棿
- StartLocat = item.LocatNo,//璧峰浣嶇疆
- EndLocat = endLoction.LocatNo,//鐩爣浣嶇疆
- PalletNo = item.PalletNo,//鎵樼洏鐮�
- IsSend = 1,//鏄惁鍙啀娆′笅鍙�
- IsCancel = 1,//鏄惁鍙彇娑�
- IsFinish = 1,//鏄惁鍙畬鎴�
- Type = "1",//浠诲姟绫诲瀷 0 鍏ュ簱浠诲姟 1 鍑哄簱浠诲姟 2 绉诲簱浠诲姟
- OrderType = "3",//鍗曟嵁绫诲瀷 0 鍏ュ簱 1 鍑哄簱 3 绉诲簱
- Status = "0",//浠诲姟鐘舵��0锛氱瓑寰呮墽琛�1姝e湪鎵ц2鎵ц瀹屾垚
- NoticeDetailNo = int.Parse(noticeNo),
- Msg = taskMsg, //鍏抽敭淇℃伅
- LotNo = item.LotNo//鎵规鍙�
- };
- //缁勭粐涓嬪彂灏忚溅浠诲姟淇℃伅
- var task2 = new TaskDetial
- {
- Taskno = taskNo,//浠诲姟鍙�
- Startport = item.LocatNo,
- Endport = model.Location,//endLoction.LocatNo,
- Pallno = item.PalletNo,
- Crtype = "1",//鍙《
- WareHouseNo = houseNo
- };
- //缁欎笅杞︿笅鍙戜换鍔�
- logTaskEntry2.SendDate = DateTime.Now;//鍙戦�佹椂闂�
- var agvResult2 = CreateTaskForAgv(task2, url, out agvMsg);
- if (agvResult2)//鎴愬姛
- {
- //璇锋眰鎴愬姛淇敼浠诲姟琛ㄧ浉搴斿瓧娈电姸鎬�
- logTaskEntry2.IsSuccess = 1;
- logTaskEntry2.IsSend = 0;
- //logTaskEntry2.IsCancel = 0;
- logTaskEntry2.BackDate = DateTime.Now;
- logTaskEntry2.Status = "1";
- Db.Insertable(logTaskEntry2).ExecuteCommand();
-
- startLoction2.Status = "3";//鍑哄簱涓�
- Db.Updateable(startLoction2).ExecuteCommand();
-
- endLoction.Status = "2";//鍏ュ簱涓�
- Db.Updateable(endLoction).ExecuteCommand();
- }
- else//澶辫触
- {
- logTaskEntry2.IsSuccess = 0;
- logTaskEntry2.Information = agvMsg;
- Db.Insertable(logTaskEntry2).ExecuteCommand();
-
- }
+ pallet = item;
+
+ callResult = 2;
+ break;
+ }
+ if (callResult == 1)
+ {
//鎻愪氦浜嬪姟
Db.CommitTran();
- return;
+ throw new Exception("鏆傛棤鑴忔《鍙垎閰�");
}
- throw new Exception("鏆傛棤鑴忔《鍙垎閰�");
+ else if (callResult == 0)
+ {
+ throw new Exception("鏆傛棤鑴忔《鍙垎閰�");
+ }
}
break;
default:
--
Gitblit v1.8.0