From 50884f67cc2f622cd9fce212739e07270eb719b5 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周六, 23 11月 2024 15:52:15 +0800
Subject: [PATCH] 22
---
CC/iWareCC_ASRS/ThreadService/02_BZ39工位(补板后工位)/Outbound/2、DataProcess_RobotBuffer_IssueOutboundTask.cs | 123 +++++++++++++++++++---------------------
1 files changed, 59 insertions(+), 64 deletions(-)
diff --git "a/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Outbound/2\343\200\201DataProcess_RobotBuffer_IssueOutboundTask.cs" "b/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Outbound/2\343\200\201DataProcess_RobotBuffer_IssueOutboundTask.cs"
index cfc9068..6411f28 100644
--- "a/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Outbound/2\343\200\201DataProcess_RobotBuffer_IssueOutboundTask.cs"
+++ "b/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Outbound/2\343\200\201DataProcess_RobotBuffer_IssueOutboundTask.cs"
@@ -41,77 +41,72 @@
* 1銆佷粠鏁版嵁搴撲腑鍒ゆ柇鏄惁榻愬
* 2銆佹牴鎹綈濂楃粨鏋滐紝鎺ㄩ�佺粰PLC
*/
- var obj = FormCC.stationView.R_StationForReadCommList.Where(x => x.StationCode == rgvLocation.ToString()).FirstOrDefault();
- if (obj.R_ReqParseData)
+
+ using (WmsDBModel wmsDB = new WmsDBModel())
{
- var result = obj.R_ReadCodeResult;
- if (string.IsNullOrEmpty(result))
+ //瑕佹槸鏈夊凡涓嬪彂鐨勪换鍔★紝灏变笉瑕佹墽琛�
+ var isValidate = TaskHandler.ValidateIssueTaskForRobotBuffer(wmsDB);
+ if (!isValidate)
{
- SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask = $"{rgvLocation.ToString()}-璇锋眰浜嗚В鐮侊紝浣嗘槸缁撴灉鏄┖鐨�,姝ゆ寰幆缁撴潫";
+ SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask = $"{rgvLocation.ToString()}-鏈夆�樺凡涓嬪彂鈥欑殑浠诲姟锛屼笉鑳藉鐞�,姝ゆ寰幆缁撴潫";
continue;
}
- var upiCode = result;
- var qitaoReault = false;
- using (WmsDBModel wmsDB = new WmsDBModel())
+
+ //鍙栧垱寤烘椂闂存渶鏃╃殑閭d釜瑕佸嚭搴撶殑鍖�
+ var firstTask = wmsDB.wms_rbline_task.Where(x =>
+ x.RbTaskType == (int)RbTaskTypeEnum.鍑哄簱浠诲姟
+ && x.TaskStatus == (int)TaskStatusEnum.鏂板缓).OrderBy(x => x.CreateTime).FirstOrDefault();
+ if (firstTask == null)
{
- //瑕佹槸鏈夊凡涓嬪彂鐨勪换鍔★紝灏变笉瑕佹墽琛�
- var isValidate = TaskHandler.ValidateIssueTaskForRobotBuffer(wmsDB);
- if (!isValidate)
- {
- SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask = $"{rgvLocation.ToString()}-鏈夆�樺凡涓嬪彂鈥欑殑浠诲姟锛屼笉鑳藉鐞�,姝ゆ寰幆缁撴潫";
- continue;
- }
-
-
-
- var taskList = wmsDB.wms_rbline_task.Where(x => x.PlaceCode == obj.R_OutboundNumber
- && x.RbTaskType == (int)RbTaskTypeEnum.鍑哄簱浠诲姟
- && x.TaskStatus == (int)TaskStatusEnum.鏂板缓).OrderBy(x => x.PackageCode).ToList();
- if (taskList == null)
- {
- SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask = $"{rgvLocation.ToString()},鏍规嵁 R_OutboundNumber:{obj.R_OutboundNumber}娌℃湁鎵惧埌宸蹭笅鍙戠殑浠诲姟 ";
- continue;
- }
-
- var doTask = taskList.FirstOrDefault();
-
- var upiObj = wmsDB.mes_batchOrderUPI_new.Where(x => x.UPI == upiCode).FirstOrDefault();
- if (upiObj == null)
- {
- SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask = $"{rgvLocation.ToString()},鏍规嵁UPI:{upiCode}娌℃湁鎵惧埌瀵硅薄 ";
- continue;
- }
-
- //杩欓噷鏀逛负 涓嬪彂 鍑哄簱浠诲姟
- using (StationServiceClient client = new StationServiceClient())
- {
- //棣栧厛瑕佹竻鐞�
- var res = await client.OutboundFinishConfirmAsync((int)EDevice.Station, true, rgvLocation);
- if (!res.result)
- {
- SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTaskForOutbound = $"{rgvLocation.ToString()}-涓嬪彂鍑哄簱浠诲姟 澶辫触,OutboundFinishConfirmAsync 杩斿洖:{res.resMsg}";
- continue;
- }
- else
- {
- Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-涓嬪彂鍑哄簱浠诲姟 鎴愬姛,OutboundFinishConfirmAsync锛屽弬鏁�: 绔欑偣{rgvLocation}");
- }
-
- res = await client.WriteOutStoreTaskInfoAsync((int)EDevice.Station, rgvLocation, doTask.PlaceCode, Convert.ToInt32(doTask.TaskNo));
- if (!res.result)
- {
- SystemWarningMsg._lbl_alert_DataProcess_BZ39 = $"{rgvLocation.ToString()}-涓嬪彂鍑哄簱浠诲姟 澶辫触,WriteOutStoreTaskInfoAsync 杩斿洖:{res.resMsg}";
- continue;
- }
- else
- {
- Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-涓嬪彂鍑哄簱浠诲姟 鎴愬姛,WriteOutStoreTaskInfoAsync锛屽弬鏁�: 绔欑偣{rgvLocation}");
- }
- }
-
- wmsDB.SaveChanges();
+ SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask = $"{rgvLocation.ToString()},鏍规嵁 娌℃湁鎵惧埌 鏂板缓 鐨勪换鍔� ";
+ continue;
}
+
+ var taskList = wmsDB.wms_rbline_task.Where(x =>
+ x.RbTaskType == (int)RbTaskTypeEnum.鍑哄簱浠诲姟
+ && x.TaskStatus == (int)TaskStatusEnum.鏂板缓).Where(x => x.PackageCode == firstTask.PackageCode).OrderBy(x => x.CreateTime).ToList();
+ if (taskList == null)
+ {
+ SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask = $"{rgvLocation.ToString()},鏍规嵁 娌℃湁鎵惧埌 鏂板缓 鐨勪换鍔� ";
+ continue;
+ }
+
+ var doTask = taskList.FirstOrDefault();
+
+
+ //杩欓噷涓嬪彂 鍑哄簱浠诲姟
+ using (StationServiceClient client = new StationServiceClient())
+ {
+ //棣栧厛瑕佹竻鐞�
+ var res = await client.OutboundFinishConfirmAsync((int)EDevice.Station, false, rgvLocation);
+ if (!res.result)
+ {
+ SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTaskForOutbound = $"{rgvLocation.ToString()}-涓嬪彂鍑哄簱浠诲姟 澶辫触,OutboundFinishConfirmAsync 杩斿洖:{res.resMsg}";
+ continue;
+ }
+ else
+ {
+ Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-涓嬪彂鍑哄簱浠诲姟 鎴愬姛,OutboundFinishConfirmAsync锛屽弬鏁�: 绔欑偣{rgvLocation}");
+ }
+
+ res = await client.WriteOutStoreTaskInfoAsync((int)EDevice.Station, rgvLocation, doTask.PlaceCode, Convert.ToInt32(doTask.TaskNo));
+ if (!res.result)
+ {
+ SystemWarningMsg._lbl_alert_DataProcess_BZ39 = $"{rgvLocation.ToString()}-涓嬪彂鍑哄簱浠诲姟 澶辫触,WriteOutStoreTaskInfoAsync 杩斿洖:{res.resMsg}";
+ continue;
+ }
+ else
+ {
+ Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-涓嬪彂鍑哄簱浠诲姟 鎴愬姛,WriteOutStoreTaskInfoAsync锛屽弬鏁�: 绔欑偣{rgvLocation}");
+ }
+ }
+
+ doTask.TaskStatus = (int)TaskStatusEnum.宸蹭笅鍙�;
+ doTask.TaskStatusName = TaskStatusEnum.宸蹭笅鍙�.ToString();
+
+ wmsDB.SaveChanges();
}
+
}
}
catch (Exception ex)
--
Gitblit v1.9.3