From 67f5edce916d4cb8b13a0aafa637af1ad0c7161f Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周二, 03 12月 2024 14:55:37 +0800
Subject: [PATCH] 2

---
 CC/iWareCC_ASRS/FormCC.Designer.cs |   15 +++++++++++++++
 CC/iWareCC_ASRS/FormCC.cs          |   38 ++++++++++++++++++++++++++++++++++++--
 2 files changed, 51 insertions(+), 2 deletions(-)

diff --git a/CC/iWareCC_ASRS/FormCC.Designer.cs b/CC/iWareCC_ASRS/FormCC.Designer.cs
index 9b42137..5727cd0 100644
--- a/CC/iWareCC_ASRS/FormCC.Designer.cs
+++ b/CC/iWareCC_ASRS/FormCC.Designer.cs
@@ -474,6 +474,7 @@
             this.dataGridViewTextBoxColumn62 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn63 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.btn_Find_OutTaskRetryToMes = new System.Windows.Forms.Button();
+            this.button25 = new System.Windows.Forms.Button();
             this.tPTransAsrs.SuspendLayout();
             this.panel14.SuspendLayout();
             this.panel15.SuspendLayout();
@@ -5499,6 +5500,7 @@
             // 
             // tabPage3
             // 
+            this.tabPage3.Controls.Add(this.button25);
             this.tabPage3.Controls.Add(this.button24);
             this.tabPage3.Controls.Add(this.tb_PackageCode);
             this.tabPage3.Controls.Add(this.label23);
@@ -5879,6 +5881,18 @@
             this.btn_Find_OutTaskRetryToMes.Text = "查询";
             this.btn_Find_OutTaskRetryToMes.UseVisualStyleBackColor = true;
             this.btn_Find_OutTaskRetryToMes.Click += new System.EventHandler(this.btn_Find_OutTaskRetryToMes_Click);
+            // 
+            // button25
+            // 
+            this.button25.BackColor = System.Drawing.Color.Red;
+            this.button25.Location = new System.Drawing.Point(1006, 489);
+            this.button25.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.button25.Name = "button25";
+            this.button25.Size = new System.Drawing.Size(155, 48);
+            this.button25.TabIndex = 156;
+            this.button25.Text = "一键初始化整包板件";
+            this.button25.UseVisualStyleBackColor = false;
+            this.button25.Click += new System.EventHandler(this.button25_Click);
             // 
             // FormCC
             // 
@@ -6397,6 +6411,7 @@
         private System.Windows.Forms.TextBox tb_PackageCode;
         private System.Windows.Forms.Label label23;
         private System.Windows.Forms.Label lbl_currHandlerPackageCodeForIssueOutboundTask;
+        private System.Windows.Forms.Button button25;
     }
 }
 
diff --git a/CC/iWareCC_ASRS/FormCC.cs b/CC/iWareCC_ASRS/FormCC.cs
index 2217055..0e8a877 100644
--- a/CC/iWareCC_ASRS/FormCC.cs
+++ b/CC/iWareCC_ASRS/FormCC.cs
@@ -1,4 +1,5 @@
-锘縰sing iWareCC.Common.Helper;
+锘縰sing Admin.NET.Application;
+using iWareCC.Common.Helper;
 using iWareCC.DeviceThreadFactory;
 using iWareCC.Forms;
 using iWareCC.RgvService;
@@ -355,7 +356,7 @@
                     this.lbl_Alter_Srm1ReleaseFinish.Text = showNowTime + SystemWarningMsg._lbl_Alert_Srm1ReleaseFinish;
                     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_PushPaperCutToMes.Text = showNowTime + SystemWarningMsg._lbl_Alert_PushPaperCutToMes;
@@ -3572,5 +3573,38 @@
                 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