From 761aaf597639c55c6f36b03f3a89ba2d49a1d3f4 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周二, 03 12月 2024 19:24:03 +0800
Subject: [PATCH] 增加是否允许切纸

---
 CC/iWareCC_ASRS/FormCC.cs |  223 ++++++++++++++++++++++++++++++-------------------------
 1 files changed, 123 insertions(+), 100 deletions(-)

diff --git a/CC/iWareCC_ASRS/FormCC.cs b/CC/iWareCC_ASRS/FormCC.cs
index ef4c92f..0e8a877 100644
--- a/CC/iWareCC_ASRS/FormCC.cs
+++ b/CC/iWareCC_ASRS/FormCC.cs
@@ -1,10 +1,13 @@
-锘縰sing iWareCC.Common.Helper;
+锘縰sing Admin.NET.Application;
+using iWareCC.Common.Helper;
 using iWareCC.DeviceThreadFactory;
 using iWareCC.Forms;
 using iWareCC.RgvService;
 using iWareCC.SrmService;
 using iWareCC.StationService;
 using iWareCC.ThreadService;
+using iWareCC.ThreadService._03_BZ12_鏈哄櫒浜虹爜鍖呭伐浣峗;
+using iWareCC.ThreadService._04_BZ21_鎼繍鏁村灈鏈哄櫒浜篲;
 using iWareCC.WCF;
 using iWareCommon.Common.Globle;
 using iWareCommon.Utils;
@@ -27,6 +30,7 @@
 using XiGang.Core.Model;
 using XiGang.Core.Model.ViewModels;
 
+
 namespace iWareCC
 {
     public partial class FormCC : Form
@@ -36,6 +40,11 @@
         /// 鍏ㄥ眬鈥旀槸鍚﹀彲浠ヨ繍琛屾墽琛屽嚭搴撴ā寮�
         /// </summary>
         public static bool IsAllowRunOutMode = false;
+
+        /// <summary>
+        /// 褰撳墠涓嬪彂鍑哄簱浠诲姟鐨勫寘鍙�
+        /// </summary>
+        public static string currHandlerPackageCodeForIssueOutboundTask = "";
 
         /// <summary>
         /// 1鍙峰爢鍨涙満鍏ュ簱鍙f壂鐮佸己鍒堕獙璇侀�氳繃
@@ -194,13 +203,14 @@
             //鍫嗗灈鏈篣I璧嬪��
             SetSrmUI();
 
+            tskSetSrmLable = new Thread(SrmRead_Label);
+            tskSetSrmLable.Start();
+
             #endregion
 
             #region 璁剧疆鏄剧ずUI
-            tskSetSrmLable = new Thread(SrmRead_Label);
-            tskSetSrmLable.Start();
-            tskSetRgvLable = new Thread(SetRgvLable);
-            tskSetRgvLable.Start();
+
+
             #endregion
 
             #region 鏈嶅姟绾跨▼鍚姩
@@ -213,32 +223,41 @@
             // rgvService.StartService();
 
 
-            //澶勭悊銆愪笅鍙戜腑銆戠殑鍑哄簱璁″垝浠诲姟
-            // new Thread(OutPlanTaskDecompose.HandlerIssuingTask).Start();
 
-            //浠诲姟鍒嗚В绾跨▼-鍑哄簱
-            // new Thread(MainTaskDecompose.HandlerMainTaskDecompose).Start();
+            new Thread(DataProcess_RobotBuffer_ModeChange.Handler).Start();
 
-            //浠诲姟鍒嗚В绾跨▼-缁勭洏鍏ュ簱
-            // new Thread(MainTaskDecompose_ZPRK.HandlerMainTaskDecompose_ZPRK).Start();
+            new Thread(DataProcess_RobotBuffer_IssueOutboundTask.Handler).Start();
+
+
+            new Thread(DataProcess_RobotBuffer_AutoQiTaoOutbound.Handler).Start();
 
             new Thread(DataProcess_RobotBuffer_FinishTaskForOutbound.Handler).Start();
 
-            //鑷姩缁勭洏浠诲姟
+
             new Thread(DataProcess_RobotBuffer_FinishTask.Handler).Start();
 
             new Thread(DataProcess_BZ01.Handler).Start();
 
-            //閲嶆柊鑾峰彇鍙戝姩鏈轰俊鎭�
+
             new Thread(DataProcess_269.Handler).Start();
 
-            //1014搴撲綅杞繍鍒�1020绾跨▼
+
             new Thread(DataProcess_BZ39.Handler).Start();
+            new Thread(DataProcess_BZ39_IssueInboundTask.Handler).Start();
+            new Thread(DataProcess_BZ12.Hander).Start();
+            new Thread(DataProcess_BZ12_IssueTask.Handler).Start();
 
 
+            new Thread(DataProcess_BZ12_FinishTask.Handler).Start();
+
+            new Thread(DataProcess_BZ21.Hander).Start();
+            new Thread(DataProcess_BZ21_IssueTask.Handler).Start();
+
+            new Thread(DataProcess_BZ21_FinishTask.Handler).Start();
             new Thread(DeleteData).Start();
 
-            new Thread(LineInSacnResult.HandlerLineInSacnResult).Start();
+            new Thread(PushPackageCodeToMes.Handler).Start();
+            new Thread(PushPaperCutToMes.Handler).Start();
 
 
 
@@ -316,10 +335,6 @@
             //btn_Start_Click(null, null);
         }
 
-
-
-        #region 鍫嗗灈鏈虹嚎绋嬪拰UI澶勭悊
-
         /// <summary>
         /// 璁剧疆1/2鍙峰爢鍨涙満鐨勫墠绔樉绀�
         /// </summary>
@@ -333,33 +348,35 @@
 
                     var showNowTime = "(" + DateTimeHelper.ConvertToStringForOnlyShowTime(DateTime.Now) + ")";
                     //璁剧疆鍫嗗灈鏈轰换鍔′笅鍙戝拰浠诲姟纭绾跨▼娑堟伅
-                    this.lbl_Alter_Srm1Release.Text = showNowTime + SystemWarningMsg._lbl_Alert_Srm1Release;
+                    this.lbl_Alert_DataProcess_BZ39_IssueInboundTask.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_BZ39_IssueInboundTask;
                     this.lbl_Alert_Srm2Release.Text = showNowTime + SystemWarningMsg._lbl_Alert_Srm2Release;
-                    this.lbl_Alert_Srm3Release.Text = showNowTime + SystemWarningMsg._lbl_Alert_Srm3Release;
+                    this.lbl_Alert_DataProcess_BZ12.Text = showNowTime + SystemWarningMsg._lbl_alert_DataProcess_BZ12;
                     this.lbl_Alert_Srm4Release.Text = showNowTime + SystemWarningMsg._lbl_Alert_Srm4Release;
                     //璁剧疆鍫嗗灈鏈轰换鍔′笅鍙戝拰浠诲姟瀹屾垚纭绾跨▼娑堟伅
                     this.lbl_Alter_Srm1ReleaseFinish.Text = showNowTime + SystemWarningMsg._lbl_Alert_Srm1ReleaseFinish;
-                    this.lbl_Alert_Srm2ReleaseFinish.Text = showNowTime + SystemWarningMsg._lbl_Alert_Srm2ReleaseFinish;
-                    this.lbl_Alert_Srm3ReleaseFinish.Text = showNowTime + SystemWarningMsg._lbl_Alert_Srm3ReleaseFinish;
-                    this.lbl_Alert_Srm4ReleaseFinish.Text = showNowTime + SystemWarningMsg._lbl_Alert_Srm4ReleaseFinish;
+                    this.lbl_Alert_DataProcess_BZ12_FinishTask.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_BZ12_FinishTask;
+                    this.lbl_Alert_DataProcess_BZ21_FinishTask.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_BZ21_FinishTask;
 
-                    this.lbl_Alert_RgvRelease.Text = showNowTime + SystemWarningMsg._lbl_Alert_RgvRelease;
-                    this.lbl_Alert_RgvReleaseFinish.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_ModeChange;
-                    this.lbl_Alert_RgvReleaseFinish_BuChang.Text = showNowTime + SystemWarningMsg._lbl_Alert_RgvReleaseFinish_BuChang;
 
-                    this.lbl_Alert_HandlerIssuingTask.Text = showNowTime + SystemWarningMsg._lbl_Alert_HandlerIssuingTask;
+
+                    this.lbl_Alert_PushPaperCutToMes.Text = showNowTime + SystemWarningMsg._lbl_Alert_PushPaperCutToMes;
+                    this.lbl_Alert_PushPackageCodeToMes.Text = showNowTime + SystemWarningMsg._lbl_Alert_PushPackageCodeToMes;
+
+                    this.lbl_Alert_DataProcess_BZ12_IssueTask.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_BZ12_IssueTask;
 
                     this.lbl_Alert_DataProcess_RobotBuffer_FinishTask.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTask;
 
-                    this.lbl_MainTaskDecompose.Text = showNowTime + SystemWarningMsg._lbl_Alert_MainTaskDecompose;
+                    this.lbl_DataProcess_BZ21_IssueTask.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_BZ21_IssueTask;
 
-                    this.lbl_DataProcess_RobotBuffer_ModeChange.Text = showNowTime + SystemWarningMsg._lbl_Alert_MainTaskDecompose_ZPRK;
+                    this.lbl_DataProcess_RobotBuffer_ModeChange.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_ModeChange;
 
                     this.lbl_Alert_DataProcess_RobotBuffer_FinishTaskForOutbound.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTaskForOutbound;
 
                     this.lbl_Alert_DeleteData.Text = showNowTime + SystemWarningMsg._lbl_Alert_DeleteData;
 
                     this.lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound;
+
+                    this.lbl_Alter_DataProcess_BZ21.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_BZ21;
 
                     this.lbl_alert_DataProcess_BZ39.Text = showNowTime + SystemWarningMsg._lbl_alert_DataProcess_BZ39;
 
@@ -370,19 +387,19 @@
                     this.lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask.Text = showNowTime + SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask;
 
 
-                    this.lbl_Alter_OutTaskRetryToMes.Text = showNowTime + SystemWarningMsg._lbl_Alert_OutTaskRetryToMes;
-
-
 
                     //this.lblSrmPosX1.Text="111";
                 }
                 catch (Exception ex)
                 {
-                    Log4NetHelper.WriteErrorLog(iWareCommon.Utils.LogType.SrmTheadService, "鏂规硶SrmRead_Label鍑虹幇寮傚父锛�" + ex.Message, ex);
                     continue;
                 }
             }
         }
+
+        #region 鍫嗗灈鏈虹嚎绋嬪拰UI澶勭悊
+
+
 
         /// <summary>
         /// 鑾峰彇鍫嗗灈鏈虹殑瀹炴椂淇℃伅
@@ -407,18 +424,18 @@
                             {
                                 for (int i = 0; i < waringList.Count; i++)
                                 {
-                                    DeviceWarningHandler.SaveWarning(device, iWareCommon.Utils.LogType.SrmTheadService,
+                                    DeviceWarningHandler.SaveWarning(device, iWareCommon.Utils.LogType.DataProcess_BZ39_IssueInboundTask,
                                         waringList[i].Code, waringList[i].Address, waringList[i].Context);//鏂板鎶ヨ
                                     warningAddressList.Add(waringList[i].Address);
                                 }
                             }
                         }
-                        DeviceWarningHandler.AutoCloseWarning(device, iWareCommon.Utils.LogType.SrmTheadService, warningAddressList);//鑷姩鍏抽棴鎶ヨ
+                        DeviceWarningHandler.AutoCloseWarning(device, iWareCommon.Utils.LogType.DataProcess_BZ39_IssueInboundTask, warningAddressList);//鑷姩鍏抽棴鎶ヨ
                     }
                 }
                 catch (Exception ex)
                 {
-                    Log4NetHelper.WriteErrorLog(iWareCommon.Utils.LogType.SrmTheadService, "鑾峰彇" + device.ToString() + "鐨勫疄鏃朵俊鎭紓甯�:" + ex.Message, ex);
+                    Log4NetHelper.WriteErrorLog(iWareCommon.Utils.LogType.DataProcess_BZ39_IssueInboundTask, "鑾峰彇" + device.ToString() + "鐨勫疄鏃朵俊鎭紓甯�:" + ex.Message, ex);
                     continue;
                 }
             };
@@ -459,7 +476,7 @@
             };
             realTimeList.Add(obj);
 
-            DeviceSrmRealTimeHandler.Update(realTimeList, iWareCommon.Utils.LogType.SrmTheadService);
+            DeviceSrmRealTimeHandler.Update(realTimeList, iWareCommon.Utils.LogType.DataProcess_BZ39_IssueInboundTask);
 
         }
 
@@ -967,53 +984,6 @@
 
         #endregion
 
-        #region AGV
-
-
-        /// <summary>
-        /// 鑾峰彇AGV杞﹁締鍒楄〃
-        /// </summary>
-        public void GetAgvVehicles()
-        {
-            while (true)
-            {
-                try
-                {
-                    if (SystemValue.isAllowRuning_DataProcess_RobotBuffer_AutoQiTaoOutbound && SystemValue.isStartedModel)
-                    {
-                        AGVRetModel list = AgvRequestHelper.GetVehicles();
-                        AgvHandler.SaveAgvData(list);
-
-                        List<String> warningAddressList = new List<string>();
-                        if (list.alarms != null && list.alarms.errors != null && list.alarms.errors.Count > 0)
-                        {
-                            var waringList = list.alarms.errors;
-                            if (waringList != null && waringList.Count > 0)
-                            {
-                                for (int i = 0; i < waringList.Count; i++)
-                                {
-                                    DeviceWarningHandler.SaveWarning(EDevice.AGV, iWareCommon.Utils.LogType.DataProcess_RobotBuffer_AutoQiTaoOutbound,
-                                        waringList[i].code, waringList[i].code, waringList[i].desc);//鏂板鎶ヨ
-                                    warningAddressList.Add(waringList[i].code);
-                                }
-                            }
-                        }
-                        DeviceWarningHandler.AutoCloseWarning(EDevice.AGV, iWareCommon.Utils.LogType.DataProcess_RobotBuffer_AutoQiTaoOutbound, warningAddressList);//鑷姩鍏抽棴鎶ヨ
-                        this.lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound.Text = "鑾峰彇AGV杞﹁締淇℃伅鎴愬姛";
-                    }
-                }
-                catch (Exception ex)
-                {
-                    Log4NetHelper.WriteErrorLog(iWareCommon.Utils.LogType.CCWCFService, "鑾峰彇AGV杞﹁締鍒楄〃 鍑虹幇寮傚父:" + ex.Message, ex);
-                    this.lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound.Text = "鑾峰彇AGV杞﹁締淇℃伅寮傚父锛�" + ex.Message;
-                }
-                finally
-                {
-                    Thread.Sleep(5000);//5绉掍竴娆� 
-                }
-            }
-        }
-        #endregion
 
         #region 鍏朵粬绾跨▼
 
@@ -1218,7 +1188,7 @@
                 using (var opcClinet = new SrmService.SrmServiceClient())
                 {
                     var result = opcClinet.SendEStop((int)_EDevice);
-                    Log4NetHelper.WriteInfoLog(iWareCommon.Utils.LogType.SrmTheadService, "瀛楃涓诧細" + JsonConvert.SerializeObject(result));
+                    Log4NetHelper.WriteInfoLog(iWareCommon.Utils.LogType.DataProcess_BZ39_IssueInboundTask, "瀛楃涓诧細" + JsonConvert.SerializeObject(result));
                     if (result.result)
                     {
                         WZ.Useful.Commons.MessageUtil.ShowTips("鍙戦��" + _EDevice.ToString() + "鎬ュ仠鎸囦护鎴愬姛");
@@ -1521,8 +1491,8 @@
                 this.lbl_ModelText.Text = title + currentCheckModelText;
                 SetAllCheckBoxChecked(true);
                 //灏嗙壒娈婄殑鍙栨秷
-                this.ckHandlerIssuingTask.Checked = false;
-                this.ckMainTaskDecompose.Checked = false;
+                this.ck_DataProcess_BZ12_IssueTask.Checked = false;
+                this.ck_DataProcess_BZ21_IssueTask.Checked = false;
 
                 this.gBoxThread.Enabled = true;
             }
@@ -1558,16 +1528,16 @@
         private void CommonCheckedChanged(object sender, EventArgs e)
         {
             //鍫嗗灈鏈�1浠诲姟涓嬪彂
-            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_SrmTaskThreadService_1, ckBSrm1Release);
+            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_SrmTaskThreadService_1, ckB_DataProcess_BZ39_IssueInboundTask);
             DoCommonCheckedChanged(ref SystemValue.isAllowRuning_SrmTaskThreadService_1_Finish, ckBSrm1FinishedHandle);
 
             //鍫嗗灈鏈�2浠诲姟涓嬪彂
             DoCommonCheckedChanged(ref SystemValue.isAllowRuning_SrmTaskThreadService_2, ckBSrm2Release);
-            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_SrmTaskThreadService_2_Finish, ckBSrm2FinishedHandle);
+            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_SrmTaskThreadService_2_Finish, ckBDataProcess_BZ12_FinishTask);
 
             //鍫嗗灈鏈�3浠诲姟涓嬪彂
-            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_SrmTaskThreadService_3, ckBSrm3Release);
-            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_SrmTaskThreadService_3_Finish, ckBSrm3FinishedHandle);
+            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_SrmTaskThreadService_3, ckBDataProcess_BZ12);
+            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_SrmTaskThreadService_3_Finish, ckBDataProcess_BZ21_FinishTask);
 
             //鍫嗗灈鏈�4浠诲姟涓嬪彂
             DoCommonCheckedChanged(ref SystemValue.isAllowRuning_SrmTaskThreadService_4, ckBSrm4Release);
@@ -1576,16 +1546,18 @@
 
             //RGV浠诲姟涓嬪彂
             DoCommonCheckedChanged(ref SystemValue.isAllowRuning_RgvThreadService, ckBRgvRelease);
-            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_RgvThreadService_Finish, ckBRgvFinishedHandle);
-            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_RgvThreadService_Finish_BuChang, ckBRgvFinishedHandle_BuChang);
+            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_RgvThreadService_Finish, ckB_PushPaperCutToMes);
+            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_RgvThreadService_Finish_BuChang, ck_PushPackageCodeToMes);
 
-            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_HandlerIssuingTask, ckHandlerIssuingTask);
+            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_HandlerIssuingTask, ck_DataProcess_BZ12_IssueTask);
 
             DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_RobotBuffer_FinishTask, ck_DataProcess_RobotBuffer_FinishTask);
 
-            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_MainTaskDecompose, ckMainTaskDecompose);
+            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_MainTaskDecompose, ck_DataProcess_BZ21_IssueTask);
 
             DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_RobotBuffer_ModeChange, ck_DataProcess_RobotBuffer_ModeChange);
+
+            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_ValidateQiTao, ck_DataProcess_ValidateQiTao);
 
             DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_RobotBuffer_FinishTaskForOutbound, checkBox_DataProcess_RobotBuffer_FinishTaskForOutbound);
 
@@ -1594,17 +1566,15 @@
 
             DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_RobotBuffer_AutoQiTaoOutbound, ckDataProcess_RobotBuffer_AutoQiTaoOutbound);
 
-            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_RobotBuffer_IssueOutboundTask, ckEmptySalverTransfer);
-
             DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_BZ39, ck_DataProcess_BZ39);
 
             DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_BZ01, ck_AutoIssueInStoreTask);
 
             DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_269, ck_DataProcess_269);
 
-            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_Place1014To1020Task, ck_DataProcess_RobotBuffer_IssueOutboundTask);
+            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_RobotBuffer_IssueOutboundTask, ck_DataProcess_RobotBuffer_IssueOutboundTask);
 
-            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_OutTaskRetryToMes, checkBox_OutTaskRetryToMes);
+            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_OutTaskRetryToMes, checkBox_DataProcess_BZ21);
         }
 
         private void DoCommonCheckedChanged(ref bool isAllowValue, CheckBox cb)
@@ -1879,6 +1849,9 @@
                         this.btn_Start.BackColor = default_btn_Start_Color;//杩樺師棰滆壊
                     }
                 }
+
+                this.lbl_RobotMode.Text = "缂撳瓨宀涙満鍣ㄤ汉妯″紡:" + (IsAllowRunOutMode ? "鍑哄簱妯″紡" : "鍏ュ簱妯″紡");
+                this.lbl_currHandlerPackageCodeForIssueOutboundTask.Text = "褰撳墠涓嬪彂鍑哄簱浠诲姟鐨勫寘鍙�:" + currHandlerPackageCodeForIssueOutboundTask;
             }
         }
 
@@ -3583,5 +3556,55 @@
         {
 
         }
+
+        private void button24_Click(object sender, EventArgs e)
+        {
+            //寮哄埗璇ュ寘鍙峰嚭搴�
+            var packageCode = this.tb_PackageCode.Text.Trim();
+
+            var alertMsg = "";
+            DataProcess_RobotBuffer_ForceOutbound.Handler(packageCode, ref alertMsg);
+            if (!string.IsNullOrEmpty(alertMsg))
+            {
+                MessageBox.Show("閿欒:" + alertMsg);
+            }
+            else
+            {
+                MessageBox.Show("宸插鐞�");
+            }
+        }
+
+        private void button25_Click(object sender, EventArgs e)
+        {
+            var packageCode = this.tb_PackageCode.Text.Trim();
+
+            var alertMsg = "";
+            using (WmsDBModel db = new WmsDBModel())
+            {
+                var upiList = db.mes_batchOrderUPI_new.Where(x => x.PackageCode == packageCode).ToList();
+                foreach (var item in upiList)
+                {
+                    item.AreaCode = (int)AreaCodeEnum.鏃犲尯鍩�;
+                    item.UpiStatus = (int)UpiStatusEnum.鍒濆;
+                }
+
+                var pList = db.mes_package_gather.Where(x => x.PackageCode == packageCode).ToList();
+                foreach (var item in pList)
+                {
+                    item.AreaCode = (int)AreaCodeEnum.鏃犲尯鍩�;
+                    item.UpiStatus = (int)UpiStatusEnum.鍒濆;
+                }
+
+                db.SaveChanges();
+            }
+            if (!string.IsNullOrEmpty(alertMsg))
+            {
+                MessageBox.Show("閿欒:" + alertMsg);
+            }
+            else
+            {
+                MessageBox.Show("宸插鐞�");
+            }
+        }
     }
 }

--
Gitblit v1.9.3