From bd66e0df64fb45ec648ddacff4518992ce52e98f Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周一, 10 3月 2025 11:02:06 +0800
Subject: [PATCH] 缓存岛需要加个批次号条件、可以选择某个批次出
---
CC/iWareCC_ASRS/ThreadService/05_BZ30(齐套验证)/DataProcess_ValidateQiTao.cs | 263 ++++++++++++++++++++++++++-------------------------
1 files changed, 134 insertions(+), 129 deletions(-)
diff --git "a/CC/iWareCC_ASRS/ThreadService/05_BZ30\050\351\275\220\345\245\227\351\252\214\350\257\201\051/DataProcess_ValidateQiTao.cs" "b/CC/iWareCC_ASRS/ThreadService/05_BZ30\050\351\275\220\345\245\227\351\252\214\350\257\201\051/DataProcess_ValidateQiTao.cs"
index 353b0de..f83187a 100644
--- "a/CC/iWareCC_ASRS/ThreadService/05_BZ30\050\351\275\220\345\245\227\351\252\214\350\257\201\051/DataProcess_ValidateQiTao.cs"
+++ "b/CC/iWareCC_ASRS/ThreadService/05_BZ30\050\351\275\220\345\245\227\351\252\214\350\257\201\051/DataProcess_ValidateQiTao.cs"
@@ -1,144 +1,149 @@
-锘縰sing Admin.NET.Application;
-using iWareCC.Common.Helper;
-using iWareCC.StationService;
-using iWareCommon.Common.Globle;
-using iWareCommon.Utils;
-using iWareModel;
-using iWareSql.DataAccess;
-using iWareSql.DBModel;
-using iWareSql.WmsDBModel;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.Remoting.Messaging;
-using System.ServiceModel.Configuration;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using WZ.Useful.Commons;
-using XiGang.Core.Model;
+锘�//using Admin.NET.Application;
+//using iWareCC.Common.Helper;
+//using iWareCC.StationService;
+//using iWareCommon.Common.Globle;
+//using iWareCommon.Utils;
+//using iWareModel;
+//using iWareSql.DataAccess;
+//using iWareSql.DBModel;
+//using iWareSql.WmsDBModel;
+//using System;
+//using System.Collections.Generic;
+//using System.Linq;
+//using System.Runtime.Remoting.Messaging;
+//using System.ServiceModel.Configuration;
+//using System.Text;
+//using System.Threading;
+//using System.Threading.Tasks;
+//using WZ.Useful.Commons;
+//using XiGang.Core.Model;
-namespace iWareCC.ThreadService
-{
- /// <summary>
- /// BZ30榻愬楠岃瘉
- /// </summary>
- public static class DataProcess_ValidateQiTao
- {
- public static async void Handler()
- {
- var alertMsg = "";
- LogType logType = LogType.DataProcess_ValidateQiTao;
- while (true)
- {
- Thread.Sleep(2000);//浼戠湢2绉掞紝灏嗕紤鐪犲啓鍒板墠闈紝鏄负浜嗕笅闈㈢殑continue鏂规硶鎵ц鍚庝笉鏄剧ず閿欒淇℃伅鐨勬彁绀猴紒锛侊紒銆怑ditBy shaocx,2022-05-24銆�
- SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = string.Empty;
- try
- {
- //if (SystemValue.isAllowRuning_DataProcess_ValidateQiTao && SystemValue.isStartedModel)
- if (SystemValue.isStartedModel)
- {
- var rgvLocation = StationLocationEnum.BZ30.ToString();
+//namespace iWareCC.ThreadService
+//{
+// /// <summary>
+// /// BZ30榻愬楠岃瘉
+// /// </summary>
+// public static class DataProcess_ValidateQiTao
+// {
+// public static async void Handler()
+// {
+// var alertMsg = "";
+// LogType logType = LogType.DataProcess_ValidateQiTao;
+// while (true)
+// {
+// Thread.Sleep(2000);//浼戠湢2绉掞紝灏嗕紤鐪犲啓鍒板墠闈紝鏄负浜嗕笅闈㈢殑continue鏂规硶鎵ц鍚庝笉鏄剧ず閿欒淇℃伅鐨勬彁绀猴紒锛侊紒銆怑ditBy shaocx,2022-05-24銆�
+// SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = string.Empty;
+// try
+// {
+// //if (SystemValue.isAllowRuning_DataProcess_ValidateQiTao && SystemValue.isStartedModel)
+// if (SystemValue.isStartedModel)
+// {
+// var rgvLocation = StationLocationEnum.BZ30.ToString();
- using (WmsDBModel wmsDB = new WmsDBModel())
- {
- var bz30Config = wmsDB.SysConfig.Where(x => x.Code == "wms_bz30_qitao").FirstOrDefault();
- if (bz30Config == null)
- {
- SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"娌℃湁閰嶇疆 wms_bz30_qitao 鍊�";
- continue;
- }
- var configValue = bz30Config.Value;
- if (string.IsNullOrEmpty(configValue) || configValue.IndexOf('|') <= -1)
- {
- SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"閰嶇疆 wms_bz30_qitao 鍊納configValue}涓虹┖鎴栦笉姝g‘";
- continue;
- }
- var configValues = configValue.Split('|');
- var packageCode = configValues[0];
- var qitaoValue = configValues[1];//榻愬 涓嶉綈濂�
- var _UnlinePerson = configValues[2];
- bool iscomplete = false;
- if (qitaoValue.Equals("榻愬"))
- {
- iscomplete = true;
- }
- //TODO:鎺ㄩ�佺粰PLC 鍘诲摢涓柟鍚戯紵
+// using (WmsDBModel wmsDB = new WmsDBModel())
+// {
+// var bz30Config = wmsDB.SysConfig.Where(x => x.Code == "wms_bz30_qitao").FirstOrDefault();
+// if (bz30Config == null)
+// {
+// SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"娌℃湁閰嶇疆 wms_bz30_qitao 鍊�";
+// continue;
+// }
+// var configValue = bz30Config.Value;
+// if (string.IsNullOrEmpty(configValue) || configValue.IndexOf('|') <= -1)
+// {
+// SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"閰嶇疆 wms_bz30_qitao 鍊納configValue}涓虹┖鎴栦笉姝g‘";
+// continue;
+// }
+// var configValues = configValue.Split('|');
+// var packageCode = configValues[0];
+// var qitaoValue = configValues[1];//榻愬 涓嶉綈濂�
+// var _UnlinePerson = configValues[2];
+// bool iscomplete = false;
+// if (qitaoValue.Equals("榻愬"))
+// {
+// iscomplete = true;
+// }
+// //TODO:鎺ㄩ�佺粰PLC 鍘诲摢涓柟鍚戯紵
- using (StationServiceClient client = new StationServiceClient())
- {
- var res = client.WriteQiTaoInfo((int)EDevice.Station, rgvLocation, iscomplete);
- if (!res.result)
- {
- SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"{rgvLocation.ToString()}-鎺ㄩ�佺粰PLC鏄惁榻愬澶辫触,ChangeModeAsync 杩斿洖:{res.resMsg}";
- continue;
- }
- else
- {
- Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-鎺ㄩ�佺粰PLC鏄惁榻愬 鎴愬姛,ChangeModeAsync锛屽弬鏁�: 绔欑偣{rgvLocation}");
- }
- }
- //
+// using (StationServiceClient client = new StationServiceClient())
+// {
+// var res = client.WriteQiTaoInfo((int)EDevice.Station, rgvLocation, iscomplete);
+// if (!res.result)
+// {
+// SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"{rgvLocation.ToString()}-鎺ㄩ�佺粰PLC鏄惁榻愬澶辫触,ChangeModeAsync 杩斿洖:{res.resMsg}";
+// continue;
+// }
+// else
+// {
+// Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-鎺ㄩ�佺粰PLC鏄惁榻愬 鎴愬姛,ChangeModeAsync锛屽弬鏁�: 绔欑偣{rgvLocation}");
+// }
+// }
+// //
- //鏇存柊鍊�
- bz30Config.Value = "";
- var package = wmsDB.mes_package_gather.Where(x => x.PackageCode == packageCode).FirstOrDefault();
- if (package != null)
- {
- package.UpiStatus = (int)UpiStatusEnum.宸蹭笅绾�;
- package.AreaCode = (int)AreaCodeEnum.涓嬬嚎鍖哄煙;
- }
- var upiList = wmsDB.mes_batchOrderUPI_new.Where(x => x.PackageCode == packageCode).ToList();
- foreach (var item in upiList)
- {
- item.UpiStatus = (int)UpiStatusEnum.宸蹭笅绾�;
- item.AreaCode = (int)AreaCodeEnum.涓嬬嚎鍖哄煙;
- item.UpdateTime = DateTime.Now;
- }
- //鍒犻櫎闃熷垪淇℃伅
- var lineQueue = wmsDB.mes_package_linequeue.Where(x => x.PackageCode == packageCode).FirstOrDefault();
- if (lineQueue != null)
- {
- wmsDB.mes_package_linequeue.Remove(lineQueue);
- }
+// //鏇存柊鍊�
+// bz30Config.Value = "";
+// var package = wmsDB.mes_package_gather.Where(x => x.PackageCode == packageCode).FirstOrDefault();
+// if (package != null)
+// {
+// package.UpiStatus = (int)UpiStatusEnum.宸蹭笅绾�;
+// package.AreaCode = (int)AreaCodeEnum.涓嬬嚎鍖哄煙;
+// }
+// var upiList = wmsDB.mes_batchOrderUPI_new.Where(x => x.PackageCode == packageCode).ToList();
+// foreach (var item in upiList)
+// {
+// item.UpiStatus = (int)UpiStatusEnum.宸蹭笅绾�;
+// item.AreaCode = (int)AreaCodeEnum.涓嬬嚎鍖哄煙;
+// item.UpdateTime = DateTime.Now;
+// }
+// //鍒犻櫎闃熷垪淇℃伅
+// var lineQueue = wmsDB.mes_package_linequeue.Where(x => x.PackageCode == packageCode).FirstOrDefault();
+// if (lineQueue != null)
+// {
+// wmsDB.mes_package_linequeue.Remove(lineQueue);
+// }
- //澶勭悊琛� mes_order_gather
- var errmsg = "";
- var result = MyExtendHelper.HandlerOrderGather(wmsDB, package, qitaoValue, _UnlinePerson, out errmsg);
- if (result == false)
- {
- SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = errmsg;
- continue;
- }
+// //澶勭悊琛� mes_order_gather
+// var errmsg = "";
+// var result = MyExtendHelper.HandlerOrderGather(wmsDB, package, qitaoValue, _UnlinePerson, out errmsg);
+// if (result == false)
+// {
+// SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = errmsg;
+// continue;
+// }
- //鏂板涓嬬嚎璁板綍
- mes_package_unline_record record = new mes_package_unline_record();
- record = ClassHelper.RotationMapping<mes_package_unline_record, mes_package_gather>(package);
- record.Id = Yitter.IdGenerator.YitIdHelper.NextId();
- record.CreateTime = DateTime.Now;
- record.UpdateTime = DateTime.Now;
- record.OpRemark = "涓嬬嚎";
- wmsDB.mes_package_unline_record.Add(record);
+// //鏂板涓嬬嚎璁板綍
+// //鍒ゆ柇濡傛灉鍖呭凡缁忎笅绾夸簡锛屽氨涓嶅啀鍐欏叆涓嬬嚎璁板綍浜�
+// var existPackObj = wmsDB.mes_package_unline_record.Where(x => x.PackageCode == package.PackageCode).FirstOrDefault();
+// if (existPackObj == null)
+// {
+// mes_package_unline_record record = new mes_package_unline_record();
+// record = ClassHelper.RotationMapping<mes_package_unline_record, mes_package_gather>(package);
+// record.Id = Yitter.IdGenerator.YitIdHelper.NextId();
+// record.CreateTime = DateTime.Now;
+// record.UpdateTime = DateTime.Now;
+// record.OpRemark = "涓嬬嚎";
+// wmsDB.mes_package_unline_record.Add(record);
+// }
- WmsRecordUpiProcessHandler.SaveWmsRecordPackageProcess(wmsDB, package, "BZ30", "榻愬楠岃瘉");
+// WmsRecordUpiProcessHandler.SaveWmsRecordPackageProcess(wmsDB, package, "BZ30", "榻愬楠岃瘉");
- wmsDB.SaveChanges();
- }
- }
+// wmsDB.SaveChanges();
+// }
+// }
- }
- catch (Exception ex)
- {
- SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao += " 鍑虹幇寮傚父:" + ex.Message + SysGloble.SPLIT_STR;
- Log4NetHelper.WriteErrorLog(logType, " 鍑虹幇寮傚父锛�" + ex.Message, ex);
- }
- }
- }
+// }
+// catch (Exception ex)
+// {
+// SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao += " 鍑虹幇寮傚父:" + ex.Message + SysGloble.SPLIT_STR;
+// Log4NetHelper.WriteErrorLog(logType, " 鍑虹幇寮傚父锛�" + ex.Message, ex);
+// }
+// }
+// }
- }
-}
+// }
+//}
--
Gitblit v1.9.3