Forráskód Böngészése

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

Hcsy 8 éve
szülő
commit
5ccde70ef2

+ 23 - 4
UAS-MES/DataOperate/DataHelper.cs

@@ -17,7 +17,7 @@ namespace UAS_MES.DataOperate
         public static string DBConnectionString;
         public static OracleConnection connection = null;
         OracleCommand command = null;
-
+        int ReconnectTime = 0;
         /// <summary>
         /// 执行构造函数的时候打开数据库的链接
         /// </summary>
@@ -58,6 +58,7 @@ namespace UAS_MES.DataOperate
             string sql = "select " + Field + " from " + TableName + " where " + Condition;
             Console.WriteLine(sql);
             command = new OracleCommand(sql, connection);
+            command.CommandTimeout = 60000;
             OracleDataAdapter ad = new OracleDataAdapter();
             ad.SelectCommand = command;
             ad.Fill(dt);
@@ -155,6 +156,7 @@ namespace UAS_MES.DataOperate
             sql += " from " + TableName + " where " + Condition + " and rownum=1";
             Console.WriteLine(sql);
             command = new OracleCommand(sql, connection);
+            command.CommandTimeout = 60000;
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
@@ -232,6 +234,7 @@ namespace UAS_MES.DataOperate
             sql += " from " + TableName + " where " + Condition;
             Console.WriteLine(sql);
             command = new OracleCommand(sql, connection);
+            command.CommandTimeout = 60000;
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
@@ -575,6 +578,7 @@ namespace UAS_MES.DataOperate
         {
             object result = null;
             command = new OracleCommand(SQL, connection);
+            command.CommandTimeout = 600000;
             //用来拼接参数的
             if (names.Length > 0)
             {
@@ -606,9 +610,24 @@ namespace UAS_MES.DataOperate
             {
                 case "SELECT":
                     result = new DataTable();
-                    OracleDataAdapter ad = new OracleDataAdapter(command);
-                    ad.Fill((DataTable)result);
-                    ad.Dispose();
+                    try
+                    {
+                        OracleDataAdapter ad = new OracleDataAdapter(command);
+                        ad.Fill((DataTable)result);
+                        ad.Dispose();
+                        //成功执行后将重复连接数置为0
+                        ReconnectTime = 0;
+                    }
+                    catch (Exception)
+                    {
+                        if (ReconnectTime == 0)
+                        {
+                            //重置的数据库链接后只执行一次
+                            ReconnectTime = ReconnectTime + 1;
+                            connection = new OracleConnection(DBConnectionString);
+                            result = ExecuteSql(SQL, Type, names);
+                        }
+                    }
                     break;
                 case "DELETE":
                     result = command.ExecuteNonQuery();

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.Designer.cs

@@ -147,7 +147,7 @@
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
             this.PrintLabel.Location = new System.Drawing.Point(822, 90);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2);
             this.PrintLabel.Name = "PrintLabel";
             this.PrintLabel.Size = new System.Drawing.Size(152, 20);
             this.PrintLabel.TabIndex = 162;
@@ -155,7 +155,7 @@
             // Printer
             // 
             this.Printer.Location = new System.Drawing.Point(822, 39);
-            this.Printer.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Printer.Margin = new System.Windows.Forms.Padding(4);
             this.Printer.Name = "Printer";
             this.Printer.Size = new System.Drawing.Size(152, 25);
             this.Printer.TabIndex = 159;

+ 65 - 93
UAS-MES/FunctionCode/Make/Make_FeedingCollection.Designer.cs

@@ -71,9 +71,8 @@
             this.panel2.Controls.Add(this.label1);
             this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
             this.panel2.Location = new System.Drawing.Point(0, 0);
-            this.panel2.Margin = new System.Windows.Forms.Padding(4);
             this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(1311, 36);
+            this.panel2.Size = new System.Drawing.Size(983, 29);
             this.panel2.TabIndex = 31;
             // 
             // label1
@@ -81,10 +80,9 @@
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
-            this.label1.Location = new System.Drawing.Point(16, 5);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Location = new System.Drawing.Point(12, 4);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(92, 27);
+            this.label1.Size = new System.Drawing.Size(74, 21);
             this.label1.TabIndex = 0;
             this.label1.Text = "工单信息";
             // 
@@ -92,10 +90,9 @@
             // 
             this.mcd_restqty_label.AutoSize = true;
             this.mcd_restqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_restqty_label.Location = new System.Drawing.Point(797, 136);
-            this.mcd_restqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_restqty_label.Location = new System.Drawing.Point(598, 109);
             this.mcd_restqty_label.Name = "mcd_restqty_label";
-            this.mcd_restqty_label.Size = new System.Drawing.Size(92, 27);
+            this.mcd_restqty_label.Size = new System.Drawing.Size(74, 21);
             this.mcd_restqty_label.TabIndex = 59;
             this.mcd_restqty_label.Text = "待采集数";
             // 
@@ -103,10 +100,9 @@
             // 
             this.mcd_inqty_label.AutoSize = true;
             this.mcd_inqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_inqty_label.Location = new System.Drawing.Point(428, 136);
-            this.mcd_inqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_inqty_label.Location = new System.Drawing.Point(321, 109);
             this.mcd_inqty_label.Name = "mcd_inqty_label";
-            this.mcd_inqty_label.Size = new System.Drawing.Size(92, 27);
+            this.mcd_inqty_label.Size = new System.Drawing.Size(74, 21);
             this.mcd_inqty_label.TabIndex = 56;
             this.mcd_inqty_label.Text = "已采集数";
             // 
@@ -114,10 +110,9 @@
             // 
             this.ma_qty_label.AutoSize = true;
             this.ma_qty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty_label.Location = new System.Drawing.Point(44, 136);
-            this.ma_qty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_qty_label.Location = new System.Drawing.Point(33, 109);
             this.ma_qty_label.Name = "ma_qty_label";
-            this.ma_qty_label.Size = new System.Drawing.Size(92, 27);
+            this.ma_qty_label.Size = new System.Drawing.Size(74, 21);
             this.ma_qty_label.TabIndex = 53;
             this.ma_qty_label.Text = "工单数量";
             // 
@@ -125,10 +120,9 @@
             // 
             this.ms_makecode_label.AutoSize = true;
             this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(44, 74);
-            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode_label.Location = new System.Drawing.Point(33, 59);
             this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(92, 27);
+            this.ms_makecode_label.Size = new System.Drawing.Size(74, 21);
             this.ms_makecode_label.TabIndex = 49;
             this.ms_makecode_label.Text = "归属工单";
             // 
@@ -136,10 +130,9 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(797, 74);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(598, 59);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
             this.pr_detail_label.TabIndex = 50;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -147,10 +140,9 @@
             // 
             this.ma_prodcode_label.AutoSize = true;
             this.ma_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode_label.Location = new System.Drawing.Point(428, 74);
-            this.ma_prodcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_prodcode_label.Location = new System.Drawing.Point(321, 59);
             this.ma_prodcode_label.Name = "ma_prodcode_label";
-            this.ma_prodcode_label.Size = new System.Drawing.Size(92, 27);
+            this.ma_prodcode_label.Size = new System.Drawing.Size(74, 21);
             this.ma_prodcode_label.TabIndex = 51;
             this.ma_prodcode_label.Text = "产品代码";
             // 
@@ -160,10 +152,9 @@
             this.Loading.Checked = true;
             this.Loading.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Loading.ForeColor = System.Drawing.Color.Blue;
-            this.Loading.Location = new System.Drawing.Point(56, 569);
-            this.Loading.Margin = new System.Windows.Forms.Padding(4);
+            this.Loading.Location = new System.Drawing.Point(42, 455);
             this.Loading.Name = "Loading";
-            this.Loading.Size = new System.Drawing.Size(73, 31);
+            this.Loading.Size = new System.Drawing.Size(60, 25);
             this.Loading.TabIndex = 62;
             this.Loading.TabStop = true;
             this.Loading.Text = "上料";
@@ -174,10 +165,9 @@
             this.UnLoading.AutoSize = true;
             this.UnLoading.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.UnLoading.ForeColor = System.Drawing.Color.Blue;
-            this.UnLoading.Location = new System.Drawing.Point(163, 569);
-            this.UnLoading.Margin = new System.Windows.Forms.Padding(4);
+            this.UnLoading.Location = new System.Drawing.Point(122, 455);
             this.UnLoading.Name = "UnLoading";
-            this.UnLoading.Size = new System.Drawing.Size(73, 31);
+            this.UnLoading.Size = new System.Drawing.Size(60, 25);
             this.UnLoading.TabIndex = 63;
             this.UnLoading.Text = "下料";
             this.UnLoading.UseVisualStyleBackColor = true;
@@ -186,10 +176,9 @@
             // 
             this.sn_code_label.AutoSize = true;
             this.sn_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sn_code_label.Location = new System.Drawing.Point(51, 616);
-            this.sn_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sn_code_label.Location = new System.Drawing.Point(38, 493);
             this.sn_code_label.Name = "sn_code_label";
-            this.sn_code_label.Size = new System.Drawing.Size(72, 27);
+            this.sn_code_label.Size = new System.Drawing.Size(58, 21);
             this.sn_code_label.TabIndex = 64;
             this.sn_code_label.Text = "序列号";
             // 
@@ -197,10 +186,9 @@
             // 
             this.code_label.AutoSize = true;
             this.code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.code_label.Location = new System.Drawing.Point(51, 672);
-            this.code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.code_label.Location = new System.Drawing.Point(38, 538);
             this.code_label.Name = "code_label";
-            this.code_label.Size = new System.Drawing.Size(72, 27);
+            this.code_label.Size = new System.Drawing.Size(58, 21);
             this.code_label.TabIndex = 66;
             this.code_label.Text = "录入框";
             // 
@@ -208,10 +196,9 @@
             // 
             this.iflastsn.AutoSize = true;
             this.iflastsn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.iflastsn.Location = new System.Drawing.Point(417, 616);
-            this.iflastsn.Margin = new System.Windows.Forms.Padding(4);
+            this.iflastsn.Location = new System.Drawing.Point(313, 493);
             this.iflastsn.Name = "iflastsn";
-            this.iflastsn.Size = new System.Drawing.Size(142, 31);
+            this.iflastsn.Size = new System.Drawing.Size(115, 25);
             this.iflastsn.TabIndex = 72;
             this.iflastsn.Text = "前一工单SN";
             this.iflastsn.UseVisualStyleBackColor = true;
@@ -220,10 +207,9 @@
             // 
             this.softwareversion_label.AutoSize = true;
             this.softwareversion_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.softwareversion_label.Location = new System.Drawing.Point(939, 208);
-            this.softwareversion_label.Margin = new System.Windows.Forms.Padding(4);
+            this.softwareversion_label.Location = new System.Drawing.Point(704, 166);
             this.softwareversion_label.Name = "softwareversion_label";
-            this.softwareversion_label.Size = new System.Drawing.Size(114, 31);
+            this.softwareversion_label.Size = new System.Drawing.Size(93, 25);
             this.softwareversion_label.TabIndex = 74;
             this.softwareversion_label.Text = "软件版本";
             this.softwareversion_label.UseVisualStyleBackColor = true;
@@ -232,10 +218,9 @@
             // 
             this.ecn_label.AutoSize = true;
             this.ecn_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ecn_label.Location = new System.Drawing.Point(939, 305);
-            this.ecn_label.Margin = new System.Windows.Forms.Padding(4);
+            this.ecn_label.Location = new System.Drawing.Point(704, 244);
             this.ecn_label.Name = "ecn_label";
-            this.ecn_label.Size = new System.Drawing.Size(94, 31);
+            this.ecn_label.Size = new System.Drawing.Size(78, 25);
             this.ecn_label.TabIndex = 75;
             this.ecn_label.Text = "ECN号";
             this.ecn_label.UseVisualStyleBackColor = true;
@@ -244,10 +229,9 @@
             // 
             this.ClearSn_code.Cursor = System.Windows.Forms.Cursors.Hand;
             this.ClearSn_code.Image = global::UAS_MES.Properties.Resources.bindingNavigatorDeleteItem_Image;
-            this.ClearSn_code.Location = new System.Drawing.Point(383, 620);
-            this.ClearSn_code.Margin = new System.Windows.Forms.Padding(4);
+            this.ClearSn_code.Location = new System.Drawing.Point(287, 496);
             this.ClearSn_code.Name = "ClearSn_code";
-            this.ClearSn_code.Size = new System.Drawing.Size(21, 20);
+            this.ClearSn_code.Size = new System.Drawing.Size(16, 16);
             this.ClearSn_code.TabIndex = 138;
             this.ClearSn_code.TabStop = false;
             this.ClearSn_code.Click += new System.EventHandler(this.ClearSn_code_Click);
@@ -256,10 +240,9 @@
             // 
             this.CleanMa_code.Cursor = System.Windows.Forms.Cursors.Hand;
             this.CleanMa_code.Image = global::UAS_MES.Properties.Resources.bindingNavigatorDeleteItem_Image;
-            this.CleanMa_code.Location = new System.Drawing.Point(389, 78);
-            this.CleanMa_code.Margin = new System.Windows.Forms.Padding(4);
+            this.CleanMa_code.Location = new System.Drawing.Point(292, 62);
             this.CleanMa_code.Name = "CleanMa_code";
-            this.CleanMa_code.Size = new System.Drawing.Size(21, 20);
+            this.CleanMa_code.Size = new System.Drawing.Size(16, 16);
             this.CleanMa_code.TabIndex = 139;
             this.CleanMa_code.TabStop = false;
             this.CleanMa_code.Click += new System.EventHandler(this.CleanMa_code_Click);
@@ -268,30 +251,27 @@
             // 
             this.ma_prodcode.AutoSize = true;
             this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode.Location = new System.Drawing.Point(555, 74);
-            this.ma_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_prodcode.Location = new System.Drawing.Point(416, 59);
             this.ma_prodcode.Name = "ma_prodcode";
-            this.ma_prodcode.Size = new System.Drawing.Size(0, 27);
+            this.ma_prodcode.Size = new System.Drawing.Size(0, 21);
             this.ma_prodcode.TabIndex = 99;
             // 
             // pr_detail
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(931, 74);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail.Location = new System.Drawing.Point(698, 59);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 27);
+            this.pr_detail.Size = new System.Drawing.Size(0, 21);
             this.pr_detail.TabIndex = 98;
             // 
             // mcd_remainqty
             // 
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(929, 136);
-            this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_remainqty.Location = new System.Drawing.Point(697, 109);
             this.mcd_remainqty.Name = "mcd_remainqty";
-            this.mcd_remainqty.Size = new System.Drawing.Size(0, 27);
+            this.mcd_remainqty.Size = new System.Drawing.Size(0, 21);
             this.mcd_remainqty.TabIndex = 97;
             this.mcd_remainqty.Tag = "mcd_remainqty";
             // 
@@ -299,29 +279,26 @@
             // 
             this.mcd_inqty.AutoSize = true;
             this.mcd_inqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_inqty.Location = new System.Drawing.Point(555, 136);
-            this.mcd_inqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_inqty.Location = new System.Drawing.Point(416, 109);
             this.mcd_inqty.Name = "mcd_inqty";
-            this.mcd_inqty.Size = new System.Drawing.Size(0, 27);
+            this.mcd_inqty.Size = new System.Drawing.Size(0, 21);
             this.mcd_inqty.TabIndex = 96;
             // 
             // ma_qty
             // 
             this.ma_qty.AutoSize = true;
             this.ma_qty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty.Location = new System.Drawing.Point(181, 136);
-            this.ma_qty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_qty.Location = new System.Drawing.Point(136, 109);
             this.ma_qty.Name = "ma_qty";
-            this.ma_qty.Size = new System.Drawing.Size(0, 27);
+            this.ma_qty.Size = new System.Drawing.Size(0, 21);
             this.ma_qty.TabIndex = 95;
             // 
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(49, 182);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
+            this.OperateResult.Location = new System.Drawing.Point(37, 146);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(856, 362);
+            this.OperateResult.Size = new System.Drawing.Size(643, 290);
             this.OperateResult.TabIndex = 94;
             this.OperateResult.Text = "";
             // 
@@ -332,13 +309,12 @@
             this.Clean.DownImage = ((System.Drawing.Image)(resources.GetObject("Clean.DownImage")));
             this.Clean.Image = ((System.Drawing.Image)(resources.GetObject("Clean.Image")));
             this.Clean.IsShowBorder = true;
-            this.Clean.Location = new System.Drawing.Point(821, 570);
-            this.Clean.Margin = new System.Windows.Forms.Padding(4);
+            this.Clean.Location = new System.Drawing.Point(616, 456);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
             this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
             this.Clean.Power = null;
-            this.Clean.Size = new System.Drawing.Size(80, 30);
+            this.Clean.Size = new System.Drawing.Size(60, 24);
             this.Clean.TabIndex = 80;
             this.Clean.Text = "清除";
             this.Clean.UseVisualStyleBackColor = true;
@@ -351,11 +327,10 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.softwareversion.BackColor = System.Drawing.Color.White;
             this.softwareversion.ID = null;
-            this.softwareversion.Location = new System.Drawing.Point(1077, 208);
-            this.softwareversion.Margin = new System.Windows.Forms.Padding(4);
+            this.softwareversion.Location = new System.Drawing.Point(808, 166);
             this.softwareversion.Name = "softwareversion";
             this.softwareversion.Power = null;
-            this.softwareversion.Size = new System.Drawing.Size(192, 25);
+            this.softwareversion.Size = new System.Drawing.Size(145, 21);
             this.softwareversion.Str = null;
             this.softwareversion.Str1 = null;
             this.softwareversion.Str2 = null;
@@ -368,11 +343,10 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.ecn.BackColor = System.Drawing.Color.White;
             this.ecn.ID = null;
-            this.ecn.Location = new System.Drawing.Point(1077, 305);
-            this.ecn.Margin = new System.Windows.Forms.Padding(4);
+            this.ecn.Location = new System.Drawing.Point(808, 244);
             this.ecn.Name = "ecn";
             this.ecn.Power = null;
-            this.ecn.Size = new System.Drawing.Size(192, 25);
+            this.ecn.Size = new System.Drawing.Size(145, 21);
             this.ecn.Str = null;
             this.ecn.Str1 = null;
             this.ecn.Str2 = null;
@@ -385,13 +359,12 @@
             this.Confirm.DownImage = ((System.Drawing.Image)(resources.GetObject("Confirm.DownImage")));
             this.Confirm.Image = ((System.Drawing.Image)(resources.GetObject("Confirm.Image")));
             this.Confirm.IsShowBorder = true;
-            this.Confirm.Location = new System.Drawing.Point(417, 669);
-            this.Confirm.Margin = new System.Windows.Forms.Padding(4);
+            this.Confirm.Location = new System.Drawing.Point(313, 535);
             this.Confirm.MoveImage = ((System.Drawing.Image)(resources.GetObject("Confirm.MoveImage")));
             this.Confirm.Name = "Confirm";
             this.Confirm.NormalImage = ((System.Drawing.Image)(resources.GetObject("Confirm.NormalImage")));
             this.Confirm.Power = null;
-            this.Confirm.Size = new System.Drawing.Size(80, 30);
+            this.Confirm.Size = new System.Drawing.Size(60, 24);
             this.Confirm.TabIndex = 73;
             this.Confirm.Tag = "IfWrite";
             this.Confirm.Text = "确认";
@@ -403,11 +376,10 @@
             this.code.AllPower = "ifall";
             this.code.BackColor = System.Drawing.Color.White;
             this.code.ID = null;
-            this.code.Location = new System.Drawing.Point(163, 672);
-            this.code.Margin = new System.Windows.Forms.Padding(4);
+            this.code.Location = new System.Drawing.Point(122, 538);
             this.code.Name = "code";
             this.code.Power = null;
-            this.code.Size = new System.Drawing.Size(212, 25);
+            this.code.Size = new System.Drawing.Size(160, 21);
             this.code.Str = null;
             this.code.Str1 = null;
             this.code.Str2 = null;
@@ -421,11 +393,10 @@
             this.sn_code.BackColor = System.Drawing.Color.White;
             this.sn_code.Enabled = false;
             this.sn_code.ID = null;
-            this.sn_code.Location = new System.Drawing.Point(163, 616);
-            this.sn_code.Margin = new System.Windows.Forms.Padding(4);
+            this.sn_code.Location = new System.Drawing.Point(122, 493);
             this.sn_code.Name = "sn_code";
             this.sn_code.Power = null;
-            this.sn_code.Size = new System.Drawing.Size(212, 25);
+            this.sn_code.Size = new System.Drawing.Size(160, 21);
             this.sn_code.Str = null;
             this.sn_code.Str1 = null;
             this.sn_code.Str2 = null;
@@ -435,9 +406,10 @@
             // 
             this.LockMakeCode.AutoSize = true;
             this.LockMakeCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.LockMakeCode.Location = new System.Drawing.Point(181, 46);
+            this.LockMakeCode.Location = new System.Drawing.Point(136, 37);
+            this.LockMakeCode.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.LockMakeCode.Name = "LockMakeCode";
-            this.LockMakeCode.Size = new System.Drawing.Size(61, 24);
+            this.LockMakeCode.Size = new System.Drawing.Size(51, 21);
             this.LockMakeCode.TabIndex = 140;
             this.LockMakeCode.Text = "锁定";
             this.LockMakeCode.UseVisualStyleBackColor = true;
@@ -449,12 +421,13 @@
             this.ma_code.Condition = null;
             this.ma_code.DBTitle = null;
             this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(181, 76);
+            this.ma_code.Location = new System.Drawing.Point(136, 61);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = null;
             this.ma_code.SelectField = null;
             this.ma_code.SetValueField = null;
-            this.ma_code.Size = new System.Drawing.Size(194, 25);
+            this.ma_code.Size = new System.Drawing.Size(146, 21);
             this.ma_code.TabIndex = 141;
             this.ma_code.TableName = null;
             this.ma_code.Tag = "ma_code";
@@ -462,9 +435,9 @@
             // 
             // Make_FeedingCollection
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1311, 710);
+            this.ClientSize = new System.Drawing.Size(983, 568);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.LockMakeCode);
             this.Controls.Add(this.CleanMa_code);
@@ -496,7 +469,6 @@
             this.Controls.Add(this.ma_prodcode_label);
             this.Controls.Add(this.panel2);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Make_FeedingCollection";
             this.Tag = "Make!FeedingCollection";
             this.Text = "上料采集";

+ 87 - 100
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -31,7 +31,7 @@ namespace UAS_MES.Make
         string ms_craftcode;
         //管控类型
 
-        string ErrorMessage;
+        string ErrorMessage="";
 
         //用于提醒的序列B
         string[] RemainList = new string[0];
@@ -96,128 +96,115 @@ namespace UAS_MES.Make
                     if (code.Text != "" && ma_code.Text != "" && sn_code.Text == "")
                     {
                         string ErrorMessage = "";
+                        string oMakeCode = "";
+                        string oMsid = "";
                         bool ifFirst;
-                        if (LogicHandler.CheckCurrentStepAndIfFirst(code.Text, ma_code.Text, User.UserSourceCode, Tag.ToString(), out ifFirst, out ErrorMessage))
+                        if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, code.Text, User.UserCode, out oMakeCode, out oMsid, out ErrorMessage))
                         {
-                            //如果当前工序是第一道工序
                             #region
-                            if (ifFirst)
+                            //根据序列号查出ma_code,ma_prodcode,stepcode
+                            dt = (DataTable)dh.ExecuteSql("select ms_id,ms_makecode,ms_craftcode,ms_status,ms_nextstepcode,ms_prodcode,ms_code from makeserial where ms_sncode='" + code.Text + "'", "select");
+                            if (dt.Rows.Count > 0)
                             {
-                                //根据序列号查出ma_code,ma_prodcode,stepcode
-                                dt = (DataTable)dh.ExecuteSql("select ms_id,ms_makecode,ms_craftcode,ms_status,ms_nextstepcode,ms_prodcode,ms_code from makeserial where ms_sncode='" + code.Text + "'", "select");
-                                if (dt.Rows.Count > 0)
-                                {
-                                    ms_id = dt.Rows[0]["ms_id"].ToString();
-                                    make_code = dt.Rows[0]["ms_makecode"].ToString();
-                                    ms_craftcode = dt.Rows[0]["ms_craftcode"].ToString();
-                                    make_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
-                                    nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
-                                    ms_status = dt.Rows[0]["ms_status"].ToString();
-                                    ms_code = dt.Rows[0]["ms_code"].ToString();
-                                }
-                                //勾选了前一工单
-                                if (iflastsn.Checked)
+                                ms_id = dt.Rows[0]["ms_id"].ToString();
+                                make_code = dt.Rows[0]["ms_makecode"].ToString();
+                                ms_craftcode = dt.Rows[0]["ms_craftcode"].ToString();
+                                make_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
+                                nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
+                                ms_status = dt.Rows[0]["ms_status"].ToString();
+                                ms_code = dt.Rows[0]["ms_code"].ToString();
+                            }
+                            //勾选了前一工单
+                            if (iflastsn.Checked)
+                            {
+                                //判断序列号的前一工单是否已经完工
+                                if (dt.Rows[0]["ms_makecode"].ToString() != ma_code.Text && dt.Rows[0]["ms_status"].ToString() == "2")
                                 {
-                                    //判断序列号的前一工单是否已经完工
-                                    if (dt.Rows[0]["ms_makecode"].ToString() != ma_code.Text && dt.Rows[0]["ms_status"].ToString() == "2")
+                                    sql.Clear();
+                                    sql.Append("Insert into MakeSerial (ms_id, ms_code, ms_sncode ,ms_prodcode, ms_indate,ms_wccode,ms_craftcode,ms_craftname");
+                                    sql.Append(",ms_nextstepcode,ms_status,ms_makecode) select MAKESERIAL_SEQ.NEXTVAL,'" + code.Text + "','" + code.Text + "',");
+                                    sql.Append("ma_prodcode,sysdate,ma_wccode,ma_craftcode,ma_craftname,'" + User.CurrentStepCode + "',0,ma_code from make where ma_code='" + ma_code.Text + "'");
+                                    dh.ExecuteSql(sql.GetString(), "insert");
+                                    //查询 stepproduct 中是否有采集类型为其他序列号, 并且物料号等于ms_prodcode
+                                    dt = (DataTable)dh.ExecuteSql("select sp_id from stepproduct where sp_mothercode='" + make_prodcode + "' and sp_stepcode='" + nextstepcode + "' and sp_soncode='" + make_prodcode + "'", "select");
+                                    string sp_id = dt.Rows[0]["sp_id"].ToString();
+                                    if (dt.Rows.Count > 0)
                                     {
                                         sql.Clear();
-                                        sql.Append("Insert into MakeSerial (ms_id, ms_code, ms_sncode ,ms_prodcode, ms_indate,ms_wccode,ms_craftcode,ms_craftname");
-                                        sql.Append(",ms_nextstepcode,ms_status,ms_makecode) select MAKESERIAL_SEQ.NEXTVAL,'" + code.Text + "','" + code.Text + "',");
-                                        sql.Append("ma_prodcode,sysdate,ma_wccode,ma_craftcode,ma_craftname,'" + User.CurrentStepCode + "',0,ma_code from make where ma_code='" + ma_code.Text + "'");
+                                        sql.Append("insert into Craftmaterial (cm_id, cm_makecode,cm_maid,cm_maprodcode,");
+                                        sql.Append("cm_soncode,cm_mscode,cm_sncode,cm_stepcode,cm_stepname,cm_craftcode,cm_craftname,");
+                                        sql.Append("cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid) ");
+                                        sql.Append("select Craftmaterial_seq.nextval, ma_code, ma_id, ma_prodcode, sp_soncode,");
+                                        sql.Append("'" + code.Text + "','" + code.Text + "',mcd_stepcode,mcd_stepname,ma_craftcode");
+                                        sql.Append(",ma_craftname,'" + code.Text + "',1,sysdate,'" + User.UserName + "',ma_linecode,ma_wccode,");
+                                        sql.Append("'" + User.UserSourceCode + "','" + sp_id + "' from make left join makecraftdetail on mcd_macode=ma_code");
+                                        sql.Append(" left join stepproduct on sp_stepcode=mcd_stepcode  where ma_code = '" + make_code + "'and ");
+                                        sql.Append("sp_id = " + sp_id + " and mcd_stepcode='" + nextstepcode + "'");
                                         dh.ExecuteSql(sql.GetString(), "insert");
-                                        //查询 stepproduct 中是否有采集类型为其他序列号, 并且物料号等于ms_prodcode
-                                        dt = (DataTable)dh.ExecuteSql("select sp_id from stepproduct where sp_mothercode='" + make_prodcode + "' and sp_stepcode='" + nextstepcode + "' and sp_soncode='" + make_prodcode + "'", "select");
-                                        string sp_id = dt.Rows[0]["sp_id"].ToString();
-                                        if (dt.Rows.Count > 0)
+                                        if (make_code == ma_code.Text && nextstepcode == "")
                                         {
+                                            sn_code.Text = code.Text;
                                             sql.Clear();
-                                            sql.Append("insert into Craftmaterial (cm_id, cm_makecode,cm_maid,cm_maprodcode,");
-                                            sql.Append("cm_soncode,cm_mscode,cm_sncode,cm_stepcode,cm_stepname,cm_craftcode,cm_craftname,");
-                                            sql.Append("cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid) ");
-                                            sql.Append("select Craftmaterial_seq.nextval, ma_code, ma_id, ma_prodcode, sp_soncode,");
-                                            sql.Append("'" + code.Text + "','" + code.Text + "',mcd_stepcode,mcd_stepname,ma_craftcode");
-                                            sql.Append(",ma_craftname,'" + code.Text + "',1,sysdate,'" + User.UserName + "',ma_linecode,ma_wccode,");
-                                            sql.Append("'" + User.UserSourceCode + "','" + sp_id + "' from make left join makecraftdetail on mcd_macode=ma_code");
-                                            sql.Append(" left join stepproduct on sp_stepcode=mcd_stepcode  where ma_code = '" + make_code + "'and ");
-                                            sql.Append("sp_id = " + sp_id + " and mcd_stepcode='" + nextstepcode + "'");
-                                            dh.ExecuteSql(sql.GetString(), "insert");
-                                            if (make_code == ma_code.Text && nextstepcode == "")
-                                            {
-                                                sn_code.Text = code.Text;
-                                                sql.Clear();
-                                                sql.Append("select ma_code,ma_prodcode,pr_detail,ma_qty from makeserial left ");
-                                                sql.Append("join product on ms_prodcode=pr_code left join make on ms_makecode=ma_code ");
-                                                sql.Append("left join makecraftdetail on mcd_macode=ms_makecode where ms_sncode='" + sn_code.Text + "'");
-                                                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                                                BaseUtil.SetFormValue(this.Controls, dt);
-                                                //将录入框的值给序列号
-                                                OperateResult.AppendText(">>获取序列号" + code.Text + "成功\n", Color.Green);
-                                                code.Text = "";
-                                            }
-                                            else
-                                                OperateResult.AppendText(">>序列号无前段工单\n", Color.Red);
+                                            sql.Append("select ma_code,ma_prodcode,pr_detail,ma_qty from makeserial left ");
+                                            sql.Append("join product on ms_prodcode=pr_code left join make on ms_makecode=ma_code ");
+                                            sql.Append("left join makecraftdetail on mcd_macode=ms_makecode where ms_sncode='" + sn_code.Text + "'");
+                                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                            BaseUtil.SetFormValue(this.Controls, dt);
+                                            //将录入框的值给序列号
+                                            OperateResult.AppendText(">>获取序列号" + code.Text + "成功\n", Color.Green);
+                                            code.Text = "";
                                         }
-                                    }
-                                    else if (make_code == ma_code.Text && nextstepcode == User.CurrentStepCode)
-                                    {
-                                        sn_code.Text = code.Text;
-                                        OperateResult.AppendText(">>获取序列号" + code.Text + "成功\n", Color.Green);
-                                        code.Text = "";
+                                        else
+                                            OperateResult.AppendText(">>序列号无前段工单\n", Color.Red);
                                     }
                                 }
-                                //未勾选上一工序
-                                else
+                                else if (make_code == ma_code.Text && nextstepcode == User.CurrentStepCode)
                                 {
-                                    dt = (DataTable)dh.ExecuteSql("select ms_status,ms_stepcode,ms_nextstepcode from makeserial where ms_sncode='" + code.Text + "' and ms_makecode='" + ma_code.Text + "'", "select");
-                                    if (dt.Rows.Count == 0)
-                                    {
-                                        sql.Clear();
-                                        sql.Append("Insert into MakeSerial (ms_id, ms_code, ms_sncode ,ms_prodcode, ms_indate,ms_wccode,ms_craftcode,ms_craftname");
-                                        sql.Append(",ms_nextstepcode,ms_status,ms_makecode) select MAKESERIAL_SEQ.NEXTVAL,'" + code.Text + "','" + code.Text + "',");
-                                        sql.Append("ma_prodcode,sysdate,ma_wccode,ma_craftcode,ma_craftname,'" + User.CurrentStepCode + "',0,ma_code from make where ma_code='" + ma_code.Text + "'");
-                                        dh.ExecuteSql(sql.GetString(), "insert");
-                                    }
-                                    else
-                                    {
-                                        nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
-                                        ms_status = dt.Rows[0]["ms_status"].ToString();
-                                    }
-                                    //如果尚未开始工序或者已经在产线并且当前工序和人员负责工序一致
-                                    if ((ms_status == "0" || ms_status == "1") && nextstepcode == User.CurrentStepCode)
-                                    {
-                                        sn_code.Text = code.Text;
-                                        sql.Clear();
-                                        sql.Append("select ma_code,ma_prodcode,pr_detail,ma_qty from makeserial left join product ");
-                                        sql.Append(" on ms_prodcode=pr_code left join make on ms_makecode=ma_code left join ");
-                                        sql.Append("makecraftdetail on mcd_macode=ms_makecode where ms_sncode='" + sn_code.Text + "'");
-                                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                                        BaseUtil.SetFormValue(this.Controls, dt);
-                                        OperateResult.AppendText(">>获取序列号" + code.Text + "成功\n", Color.Green);
-                                        GetCollectItem();
-                                        code.Text = "";
-                                    }
-                                    else
-                                    {
-                                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-                                        code.Text = "";
-                                    }
+                                    sn_code.Text = code.Text;
+                                    OperateResult.AppendText(">>获取序列号" + code.Text + "成功\n", Color.Green);
+                                    code.Text = "";
                                 }
                             }
-                            #endregion
-                            //不是第一道工序
+                            //未勾选上一工序
                             else
                             {
-                                if (dh.CheckExist("makeserial", "ms_sncode='" + code.Text + "' and ms_status=1 and ms_nextstepcode='" + User.CurrentStepCode + "'"))
+                                dt = (DataTable)dh.ExecuteSql("select ms_status,ms_stepcode,ms_nextstepcode from makeserial where ms_sncode='" + code.Text + "' and ms_makecode='" + ma_code.Text + "'", "select");
+                                nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
+                                ms_status = dt.Rows[0]["ms_status"].ToString();
+                                //如果尚未开始工序或者已经在产线并且当前工序和人员负责工序一致
+                                if ((ms_status == "0" || ms_status == "1") && nextstepcode == User.CurrentStepCode)
                                 {
-                                    OperateResult.AppendText(">>获取序列号" + code.Text + "成功\n", Color.Green);
                                     sn_code.Text = code.Text;
+                                    sql.Clear();
+                                    sql.Append("select ma_code,ma_prodcode,pr_detail,ma_qty from makeserial left join product ");
+                                    sql.Append(" on ms_prodcode=pr_code left join make on ms_makecode=ma_code left join ");
+                                    sql.Append("makecraftdetail on mcd_macode=ms_makecode where ms_sncode='" + sn_code.Text + "'");
+                                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                    BaseUtil.SetFormValue(this.Controls, dt);
+                                    OperateResult.AppendText(">>获取序列号" + code.Text + "成功\n", Color.Green);
                                     GetCollectItem();
                                     code.Text = "";
                                 }
                                 else
-                                    OperateResult.AppendText(">>序列号" + code.Text + "错误\n", Color.Red);
+                                {
+                                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                                    code.Text = "";
+                                }
                             }
+                            #endregion
+                            //不是第一道工序
+                            //else
+                            //{
+                            //    if (dh.CheckExist("makeserial", "ms_sncode='" + code.Text + "' and ms_status=1 and ms_nextstepcode='" + User.CurrentStepCode + "'"))
+                            //    {
+                            //        OperateResult.AppendText(">>获取序列号" + code.Text + "成功\n", Color.Green);
+                            //        sn_code.Text = code.Text;
+                            //        GetCollectItem();
+                            //        code.Text = "";
+                            //    }
+                            //    else
+                            //        OperateResult.AppendText(">>序列号" + code.Text + "错误\n", Color.Red);
+                            //}
                         }
                         else
                         {
@@ -357,7 +344,7 @@ namespace UAS_MES.Make
                             string cm_stepcode = dt.Rows[0]["cm_stepcode"].ToString();
                             string cm_mccode = dt.Rows[0]["cm_mccode"].ToString();
                             dh.ExecuteSql("delete from Craftmaterial where cm_id=" + cm_id, "delete");
-                            LogicHandler.InsertMakeProcess(ms_macode, sn_code.Text,"上料采集操作" ,"下料成功", User.UserName);
+                            LogicHandler.InsertMakeProcess(ms_macode, sn_code.Text, "上料采集操作", "下料成功", User.UserName);
                             int count = dh.getRowCount("craftMaterial", "cm_mccode='" + cm_mccode + "' and cm_stepcode='" + cm_stepcode + "' and cm_sncode='" + sn_code.Text + "'");
                             if (count == 0)
                                 dh.UpdateByCondition("makecraftdetail ", "mcd_inqty=mcd_inqty-1,mcd_outqty=mcd_outqty-1,mcd_okqty = mcd_okqty - 1", "mcd_mccode='" + cm_mccode + "' and mcd_stepcode='" + cm_stepcode + "'");
@@ -486,7 +473,7 @@ namespace UAS_MES.Make
                     //上料采集成功,设置序列号栏目为空
                     RemainIndex = 0;
                     OperateResult.AppendText(">>上料采集完成!\n", Color.Green);
-                    if (LogicHandler.UpdateMakeMessage(sn_code.Text, ma_code,"上料采集", User.UserSourceCode, User.UserName, "上料成功", out ErrorMessage))
+                    if (LogicHandler.UpdateMakeMessage(sn_code.Text, ma_code, "上料采集", User.UserSourceCode, User.UserName, "上料成功", out ErrorMessage))
                     {
                         sn_code.Text = "";
                         if (mcd_remainqty.Text == "0")

+ 111 - 86
UAS-MES/FunctionCode/Make/Make_NewBadCode.Designer.cs

@@ -31,14 +31,18 @@
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_NewBadCode));
             this.ChoosedRejectList = new System.Windows.Forms.ListView();
             this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-            this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-            this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-            this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.bg_code = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.bg_name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.bc_code = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.bc_name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.bc_note = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.WaitRejectList = new System.Windows.Forms.ListView();
             this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-            this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-            this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-            this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.bg_code1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.bg_name1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.bc_code1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.bc_name1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.bc_note1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.bg_name_label = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
@@ -62,13 +66,14 @@
             this.ChoosedRejectList.CheckBoxes = true;
             this.ChoosedRejectList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
             this.columnHeader6,
-            this.columnHeader4,
-            this.columnHeader7,
-            this.columnHeader8});
-            this.ChoosedRejectList.Location = new System.Drawing.Point(417, 246);
-            this.ChoosedRejectList.Margin = new System.Windows.Forms.Padding(4);
+            this.bg_code,
+            this.bg_name,
+            this.bc_code,
+            this.bc_name,
+            this.bc_note});
+            this.ChoosedRejectList.Location = new System.Drawing.Point(313, 197);
             this.ChoosedRejectList.Name = "ChoosedRejectList";
-            this.ChoosedRejectList.Size = new System.Drawing.Size(300, 302);
+            this.ChoosedRejectList.Size = new System.Drawing.Size(226, 242);
             this.ChoosedRejectList.TabIndex = 54;
             this.ChoosedRejectList.UseCompatibleStateImageBehavior = false;
             this.ChoosedRejectList.View = System.Windows.Forms.View.Details;
@@ -78,34 +83,44 @@
             this.columnHeader6.Text = " ";
             this.columnHeader6.Width = 20;
             // 
-            // columnHeader4
+            // bg_code
             // 
-            this.columnHeader4.Text = "不良代码组";
-            this.columnHeader4.Width = 97;
+            this.bg_code.Text = "不良代码编号";
+            this.bg_code.Width = 0;
             // 
-            // columnHeader7
+            // bg_name
             // 
-            this.columnHeader7.Text = "不良代码";
-            this.columnHeader7.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            this.columnHeader7.Width = 79;
+            this.bg_name.Text = "不良代码组";
+            this.bg_name.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            this.bg_name.Width = 79;
             // 
-            // columnHeader8
+            // bc_code
             // 
-            this.columnHeader8.Text = "不良名称";
-            this.columnHeader8.Width = 91;
+            this.bc_code.Text = "不良代码编号";
+            this.bc_code.Width = 0;
+            // 
+            // bc_name
+            // 
+            this.bc_name.Text = "不良名称";
+            this.bc_name.Width = 61;
+            // 
+            // bc_note
+            // 
+            this.bc_note.Text = "备注";
             // 
             // WaitRejectList
             // 
             this.WaitRejectList.CheckBoxes = true;
             this.WaitRejectList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
             this.columnHeader5,
-            this.columnHeader3,
-            this.columnHeader1,
-            this.columnHeader2});
-            this.WaitRejectList.Location = new System.Drawing.Point(13, 246);
-            this.WaitRejectList.Margin = new System.Windows.Forms.Padding(4);
+            this.bg_code1,
+            this.bg_name1,
+            this.bc_code1,
+            this.bc_name1,
+            this.bc_note1});
+            this.WaitRejectList.Location = new System.Drawing.Point(14, 194);
             this.WaitRejectList.Name = "WaitRejectList";
-            this.WaitRejectList.Size = new System.Drawing.Size(300, 304);
+            this.WaitRejectList.Size = new System.Drawing.Size(226, 244);
             this.WaitRejectList.TabIndex = 51;
             this.WaitRejectList.UseCompatibleStateImageBehavior = false;
             this.WaitRejectList.View = System.Windows.Forms.View.Details;
@@ -115,30 +130,39 @@
             this.columnHeader5.Text = " ";
             this.columnHeader5.Width = 20;
             // 
-            // columnHeader3
+            // bg_code1
+            // 
+            this.bg_code1.Text = "不良代码组编号";
+            this.bg_code1.Width = 0;
+            // 
+            // bg_name1
+            // 
+            this.bg_name1.Text = "不良代码组";
+            this.bg_name1.Width = 88;
+            // 
+            // bc_code1
             // 
-            this.columnHeader3.Text = "不良代码组";
-            this.columnHeader3.Width = 87;
+            this.bc_code1.Text = "不良代码编号";
+            this.bc_code1.Width = 0;
             // 
-            // columnHeader1
+            // bc_name1
             // 
-            this.columnHeader1.Text = "不良代码";
-            this.columnHeader1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            this.columnHeader1.Width = 87;
+            this.bc_name1.Text = "不良名称";
+            this.bc_name1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            this.bc_name1.Width = 63;
             // 
-            // columnHeader2
+            // bc_note1
             // 
-            this.columnHeader2.Text = "不良名称";
-            this.columnHeader2.Width = 82;
+            this.bc_note1.Text = "备注";
+            this.bc_note1.Width = 56;
             // 
             // bg_name_label
             // 
             this.bg_name_label.AutoSize = true;
             this.bg_name_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.bg_name_label.Location = new System.Drawing.Point(13, 166);
-            this.bg_name_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.bg_name_label.Location = new System.Drawing.Point(10, 133);
             this.bg_name_label.Name = "bg_name_label";
-            this.bg_name_label.Size = new System.Drawing.Size(112, 27);
+            this.bg_name_label.Size = new System.Drawing.Size(90, 21);
             this.bg_name_label.TabIndex = 92;
             this.bg_name_label.Text = "不良代码组";
             // 
@@ -146,10 +170,9 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(13, 213);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Location = new System.Drawing.Point(10, 170);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(92, 27);
+            this.label1.Size = new System.Drawing.Size(74, 21);
             this.label1.TabIndex = 96;
             this.label1.Text = "待选不良";
             // 
@@ -157,10 +180,9 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(412, 213);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(309, 170);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(92, 27);
+            this.label2.Size = new System.Drawing.Size(74, 21);
             this.label2.TabIndex = 97;
             this.label2.Text = "已选不良";
             // 
@@ -170,10 +192,9 @@
             this.label3.BackColor = System.Drawing.SystemColors.ControlDarkDark;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label3.ForeColor = System.Drawing.SystemColors.ControlLightLight;
-            this.label3.Location = new System.Drawing.Point(8, 6);
-            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Location = new System.Drawing.Point(6, 5);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(132, 27);
+            this.label3.Size = new System.Drawing.Size(106, 21);
             this.label3.TabIndex = 99;
             this.label3.Text = "新增不良代码";
             // 
@@ -182,17 +203,18 @@
             this.headBar1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
             this.headBar1.Dock = System.Windows.Forms.DockStyle.Top;
             this.headBar1.Location = new System.Drawing.Point(0, 0);
-            this.headBar1.Margin = new System.Windows.Forms.Padding(4);
             this.headBar1.Name = "headBar1";
-            this.headBar1.Size = new System.Drawing.Size(730, 40);
+            this.headBar1.Size = new System.Drawing.Size(548, 32);
             this.headBar1.TabIndex = 98;
+            this.headBar1.Title = null;
             // 
             // badgroup
             // 
             this.badgroup.FormattingEnabled = true;
-            this.badgroup.Location = new System.Drawing.Point(164, 167);
+            this.badgroup.Location = new System.Drawing.Point(123, 134);
+            this.badgroup.Margin = new System.Windows.Forms.Padding(2);
             this.badgroup.Name = "badgroup";
-            this.badgroup.Size = new System.Drawing.Size(203, 23);
+            this.badgroup.Size = new System.Drawing.Size(153, 20);
             this.badgroup.TabIndex = 95;
             this.badgroup.SelectedIndexChanged += new System.EventHandler(this.badgroup_SelectedIndexChanged);
             // 
@@ -205,9 +227,11 @@
             this.groupBoxWithBorder1.Controls.Add(this.ms_sncode);
             this.groupBoxWithBorder1.Controls.Add(this.ms_sncode_label);
             this.groupBoxWithBorder1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder1.Location = new System.Drawing.Point(0, 44);
+            this.groupBoxWithBorder1.Location = new System.Drawing.Point(0, 35);
+            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(2);
             this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
-            this.groupBoxWithBorder1.Size = new System.Drawing.Size(730, 100);
+            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder1.Size = new System.Drawing.Size(548, 80);
             this.groupBoxWithBorder1.TabIndex = 94;
             this.groupBoxWithBorder1.TabStop = false;
             this.groupBoxWithBorder1.Text = "产品信息";
@@ -223,11 +247,10 @@
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ms_makecode.ForeColor = System.Drawing.Color.Black;
             this.ms_makecode.ID = null;
-            this.ms_makecode.Location = new System.Drawing.Point(417, 45);
-            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4);
+            this.ms_makecode.Location = new System.Drawing.Point(313, 36);
             this.ms_makecode.Name = "ms_makecode";
             this.ms_makecode.Power = null;
-            this.ms_makecode.Size = new System.Drawing.Size(187, 27);
+            this.ms_makecode.Size = new System.Drawing.Size(141, 23);
             this.ms_makecode.Str = null;
             this.ms_makecode.Str1 = null;
             this.ms_makecode.Str2 = null;
@@ -238,10 +261,9 @@
             // 
             this.ms_makecode_label.AutoSize = true;
             this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(320, 45);
-            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode_label.Location = new System.Drawing.Point(240, 36);
             this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(72, 27);
+            this.ms_makecode_label.Size = new System.Drawing.Size(58, 21);
             this.ms_makecode_label.TabIndex = 97;
             this.ms_makecode_label.Text = "工单号";
             // 
@@ -255,11 +277,10 @@
             this.ms_sncode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ms_sncode.ForeColor = System.Drawing.Color.Black;
             this.ms_sncode.ID = null;
-            this.ms_sncode.Location = new System.Drawing.Point(109, 45);
-            this.ms_sncode.Margin = new System.Windows.Forms.Padding(4);
+            this.ms_sncode.Location = new System.Drawing.Point(82, 36);
             this.ms_sncode.Name = "ms_sncode";
             this.ms_sncode.Power = null;
-            this.ms_sncode.Size = new System.Drawing.Size(187, 27);
+            this.ms_sncode.Size = new System.Drawing.Size(141, 23);
             this.ms_sncode.Str = null;
             this.ms_sncode.Str1 = null;
             this.ms_sncode.Str2 = null;
@@ -270,10 +291,9 @@
             // 
             this.ms_sncode_label.AutoSize = true;
             this.ms_sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_sncode_label.Location = new System.Drawing.Point(13, 45);
-            this.ms_sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_sncode_label.Location = new System.Drawing.Point(10, 36);
             this.ms_sncode_label.Name = "ms_sncode_label";
-            this.ms_sncode_label.Size = new System.Drawing.Size(72, 27);
+            this.ms_sncode_label.Size = new System.Drawing.Size(58, 21);
             this.ms_sncode_label.TabIndex = 95;
             this.ms_sncode_label.Text = "序列号";
             // 
@@ -284,12 +304,13 @@
             this.Cancel.DownImage = ((System.Drawing.Image)(resources.GetObject("Cancel.DownImage")));
             this.Cancel.Image = null;
             this.Cancel.IsShowBorder = true;
-            this.Cancel.Location = new System.Drawing.Point(385, 561);
+            this.Cancel.Location = new System.Drawing.Point(289, 449);
+            this.Cancel.Margin = new System.Windows.Forms.Padding(2);
             this.Cancel.MoveImage = ((System.Drawing.Image)(resources.GetObject("Cancel.MoveImage")));
             this.Cancel.Name = "Cancel";
             this.Cancel.NormalImage = ((System.Drawing.Image)(resources.GetObject("Cancel.NormalImage")));
             this.Cancel.Power = null;
-            this.Cancel.Size = new System.Drawing.Size(80, 35);
+            this.Cancel.Size = new System.Drawing.Size(60, 28);
             this.Cancel.TabIndex = 56;
             this.Cancel.Text = "取消";
             this.Cancel.UseVisualStyleBackColor = false;
@@ -302,12 +323,13 @@
             this.Save.DownImage = ((System.Drawing.Image)(resources.GetObject("Save.DownImage")));
             this.Save.Image = null;
             this.Save.IsShowBorder = true;
-            this.Save.Location = new System.Drawing.Point(267, 561);
+            this.Save.Location = new System.Drawing.Point(200, 449);
+            this.Save.Margin = new System.Windows.Forms.Padding(2);
             this.Save.MoveImage = ((System.Drawing.Image)(resources.GetObject("Save.MoveImage")));
             this.Save.Name = "Save";
             this.Save.NormalImage = ((System.Drawing.Image)(resources.GetObject("Save.NormalImage")));
             this.Save.Power = null;
-            this.Save.Size = new System.Drawing.Size(80, 35);
+            this.Save.Size = new System.Drawing.Size(60, 28);
             this.Save.TabIndex = 55;
             this.Save.Text = "保存";
             this.Save.UseVisualStyleBackColor = false;
@@ -316,10 +338,9 @@
             // ChooseedReject
             // 
             this.ChooseedReject.Image = ((System.Drawing.Image)(resources.GetObject("ChooseedReject.Image")));
-            this.ChooseedReject.Location = new System.Drawing.Point(329, 429);
-            this.ChooseedReject.Margin = new System.Windows.Forms.Padding(4);
+            this.ChooseedReject.Location = new System.Drawing.Point(247, 343);
             this.ChooseedReject.Name = "ChooseedReject";
-            this.ChooseedReject.Size = new System.Drawing.Size(67, 29);
+            this.ChooseedReject.Size = new System.Drawing.Size(50, 23);
             this.ChooseedReject.TabIndex = 53;
             this.ChooseedReject.UseVisualStyleBackColor = true;
             this.ChooseedReject.Click += new System.EventHandler(this.ChooseedReject_Click);
@@ -327,19 +348,18 @@
             // WaitReject
             // 
             this.WaitReject.Image = ((System.Drawing.Image)(resources.GetObject("WaitReject.Image")));
-            this.WaitReject.Location = new System.Drawing.Point(329, 349);
-            this.WaitReject.Margin = new System.Windows.Forms.Padding(4);
+            this.WaitReject.Location = new System.Drawing.Point(247, 279);
             this.WaitReject.Name = "WaitReject";
-            this.WaitReject.Size = new System.Drawing.Size(67, 29);
+            this.WaitReject.Size = new System.Drawing.Size(50, 23);
             this.WaitReject.TabIndex = 52;
             this.WaitReject.UseVisualStyleBackColor = true;
             this.WaitReject.Click += new System.EventHandler(this.WaitReject_Click);
             // 
             // Make_NewBadCode
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(730, 608);
+            this.ClientSize = new System.Drawing.Size(548, 486);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.headBar1);
             this.Controls.Add(this.label2);
@@ -354,6 +374,7 @@
             this.Controls.Add(this.WaitReject);
             this.Controls.Add(this.WaitRejectList);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(2);
             this.Name = "Make_NewBadCode";
             this.Tag = "ShowDialogWindow";
             this.Text = "Make_NewBadCode";
@@ -369,12 +390,12 @@
 
         private System.Windows.Forms.ListView ChoosedRejectList;
         private System.Windows.Forms.ColumnHeader columnHeader6;
-        private System.Windows.Forms.ColumnHeader columnHeader7;
+        private System.Windows.Forms.ColumnHeader bg_name;
         private CustomControl.ButtonUtil.ArrowRightButton ChooseedReject;
         private CustomControl.ButtonUtil.ArrowLeftButton WaitReject;
         private System.Windows.Forms.ListView WaitRejectList;
         private System.Windows.Forms.ColumnHeader columnHeader5;
-        private System.Windows.Forms.ColumnHeader columnHeader1;
+        private System.Windows.Forms.ColumnHeader bc_name1;
         private CustomControl.ButtonUtil.NormalButton Save;
         private CustomControl.ButtonUtil.NormalButton Cancel;
         private System.Windows.Forms.Label bg_name_label;
@@ -387,10 +408,14 @@
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Label label2;
         private CustomControl.HeadBar headBar1;
-        private System.Windows.Forms.ColumnHeader columnHeader2;
+        private System.Windows.Forms.ColumnHeader bc_note1;
         private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.ColumnHeader columnHeader3;
-        private System.Windows.Forms.ColumnHeader columnHeader4;
-        private System.Windows.Forms.ColumnHeader columnHeader8;
+        private System.Windows.Forms.ColumnHeader bg_code1;
+        private System.Windows.Forms.ColumnHeader bg_code;
+        private System.Windows.Forms.ColumnHeader bc_code;
+        private System.Windows.Forms.ColumnHeader bg_name1;
+        private System.Windows.Forms.ColumnHeader bc_code1;
+        private System.Windows.Forms.ColumnHeader bc_name;
+        private System.Windows.Forms.ColumnHeader bc_note;
     }
 }

+ 6 - 6
UAS-MES/FunctionCode/Make/Make_NewBadCode.cs

@@ -87,7 +87,7 @@ namespace UAS_MES.Make
                     AddToReject = false;
                     for (int j = 0; j < ChoosedRejectList.Items.Count; j++)
                     {
-                        if ((ChoosedRejectList.Items[j].SubItems[2].Text == WaitRejectList.Items[i].SubItems[2].Text))
+                        if ((ChoosedRejectList.Items[j].SubItems[3].Text == WaitRejectList.Items[i].SubItems[3].Text))
                         {
                             AddToReject = true;
                             break;
@@ -108,7 +108,7 @@ namespace UAS_MES.Make
                     AddToReject = false;
                     for (int j = 0; j < ChoosedRejectList.Items.Count; j++)
                     {
-                        if ((ChoosedRejectList.Items[j].SubItems[2].Text == WaitRejectList.Items[i].SubItems[2].Text))
+                        if ((ChoosedRejectList.Items[j].SubItems[3].Text == WaitRejectList.Items[i].SubItems[3].Text))
                         {
                             AddToReject = true;
                             break;
@@ -174,9 +174,9 @@ namespace UAS_MES.Make
                 {
                     bgcode[i] = ChoosedRejectList.Items[i].SubItems[1].Text;
                     //获取所有的不良代码
-                    bccode[i] = ChoosedRejectList.Items[i].SubItems[2].Text;
+                    bccode[i] = ChoosedRejectList.Items[i].SubItems[3].Text;
                     //获取所有的不良备注
-                    bcremark[i] = ChoosedRejectList.Items[i].SubItems[3].Text;
+                    bcremark[i] = ChoosedRejectList.Items[i].SubItems[5].Text;
                     id[i] = dh.GetSEQ("MakeBad_seq");
                 }
             }
@@ -187,7 +187,7 @@ namespace UAS_MES.Make
             sql.Append("select :id,ma_code,ms_code,ms_sncode,'" + User.UserName + "',sysdate,'" + User.CurrentStepCode + "',ms_sourcecode,:bc_code,:bg_code,'',");
             sql.Append("sp_soncode,'0',:bc_remark from make left join makeSerial on ms_makecode=ma_code left join stepProduct on ");
             sql.Append("sp_mothercode=ma_prodcode and sp_stepcode=ms_nextstepcode where ms_sncode='" + sncode + "'");
-            dh.BatchInsert(sql.GetString(), new string[] { "bg_code", "id", "bg_code", "bc_code", "bc_remark" }, bgcode, id, bgcode, bccode, bcremark);
+            dh.BatchInsert(sql.GetString(), new string[] { "bc_code", "id", "bc_code", "bg_code", "bc_remark" }, bccode, id, bccode, bgcode, bcremark);
             MessageBox.Show("保存成功");
             Close();
         }
@@ -203,7 +203,7 @@ namespace UAS_MES.Make
         private void LoadBadCodeListView()
         {
             sql.Clear();
-            sql.Append("select bg_code,bc_name,bc_note from badcode left join badgroup on bc_groupcode=bg_code where bc_groupcode='" + badgroup.Text + "' and bg_code is not null");
+            sql.Append("select bg_code,bg_name,bc_code,bc_name,bc_note from badcode left join badgroup on bc_groupcode=bg_code where bc_groupcode='" + badgroup.Text + "' and bg_code is not null");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             //往listview中添加数据
             WaitRejectList.Items.Clear();

+ 4 - 4
UAS-MES/FunctionCode/Make/Make_Repair.Designer.cs

@@ -294,7 +294,7 @@
             this.mbp_part_label.AutoSize = true;
             this.mbp_part_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mbp_part_label.ForeColor = System.Drawing.Color.Black;
-            this.mbp_part_label.Location = new System.Drawing.Point(482, 298);
+            this.mbp_part_label.Location = new System.Drawing.Point(481, 298);
             this.mbp_part_label.Name = "mbp_part_label";
             this.mbp_part_label.Size = new System.Drawing.Size(74, 21);
             this.mbp_part_label.TabIndex = 105;
@@ -432,7 +432,7 @@
             this.mbp_partdgv.Margin = new System.Windows.Forms.Padding(2);
             this.mbp_partdgv.Name = "mbp_partdgv";
             this.mbp_partdgv.RowTemplate.Height = 27;
-            this.mbp_partdgv.Size = new System.Drawing.Size(270, 152);
+            this.mbp_partdgv.Size = new System.Drawing.Size(278, 152);
             this.mbp_partdgv.TabIndex = 121;
             // 
             // mbp_part1
@@ -457,11 +457,11 @@
             this.mbl_locdgv.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.mbl_loc1,
             this.mbl_id});
-            this.mbl_locdgv.Location = new System.Drawing.Point(186, 335);
+            this.mbl_locdgv.Location = new System.Drawing.Point(180, 335);
             this.mbl_locdgv.Margin = new System.Windows.Forms.Padding(2);
             this.mbl_locdgv.Name = "mbl_locdgv";
             this.mbl_locdgv.RowTemplate.Height = 27;
-            this.mbl_locdgv.Size = new System.Drawing.Size(270, 152);
+            this.mbl_locdgv.Size = new System.Drawing.Size(278, 152);
             this.mbl_locdgv.TabIndex = 120;
             // 
             // mbl_loc1

+ 18 - 17
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -98,7 +98,7 @@ namespace UAS_MES.Make
             {
                 if (GetSNCode.Text == "")
                 {
-                    MessageBox.Show("序列号不允许为空!");
+                    OperatResult.AppendText(">>序列号不允许为空\n", Color.Red);
                     return;
                 }
                 string ErrorMessage = "";
@@ -121,14 +121,11 @@ namespace UAS_MES.Make
                             BaseUtil.SetFormValue(this.Controls, dt);
                             LoadBadInfTree(sender, e);
                         }
-                        else
-                            OperatResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                        else OperatResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                     }
-                    else
-                        OperatResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                    else OperatResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                 }
-                else
-                    OperatResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                else OperatResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
             }
         }
 
@@ -222,8 +219,12 @@ namespace UAS_MES.Make
                     tnode_0.Nodes.Add(tnode_1);
                 }
             }
-            if (bg_code.Text != "")
-                BadCodeTree.Nodes[bg_code.Text].Expand();
+            try
+            {
+                if (bg_code.Text != "")
+                    BadCodeTree.Nodes[bg_code.Text].Expand();
+            }
+            catch (Exception) { }
         }
 
         private void RefreshTreeView_Click(object sender, EventArgs e)
@@ -251,7 +252,7 @@ namespace UAS_MES.Make
                     {
                         dh.UpdateByCondition("makeserial", "ms_nextstepcode='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_status=1", "ms_sncode='" + ms_sncode.Text + "'");
                         dh.ExecuteSql(insert_makeprocess.Replace("#", "完成维修"), "insert", ms_sncode.Text, User.CurrentStepCode);
-                        OperatResult.AppendText(">>序列号" + ms_sncode.Text + "回流成功\n", Color.Green);
+                        OperatResult.AppendText(">>" + ms_sncode.Text + " 序列号回流成功\n", Color.Green);
                         GetSNCode.Clear();
                     }
                 }
@@ -263,7 +264,7 @@ namespace UAS_MES.Make
             //判断是否有无法维修的记录
             int ScrapNum = int.Parse(dh.getFieldDataByCondition("makebad", "count(0) cn", "mb_sncode='" + ms_sncode.Text + "'").ToString());
             if (ScrapNum == 0)
-                OperatResult.AppendText(">>存在无法维修的记录才允许报废\n", Color.Red);
+                OperatResult.AppendText(">>" + ms_sncode.Text + "存在无法维修的记录才允许报废\n", Color.Red);
             else
             {
                 string confirm = MessageBox.Show(this.ParentForm, "此操作不可撤销,是否确认报废", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk).ToString();
@@ -326,7 +327,7 @@ namespace UAS_MES.Make
             sql.Append(",:location,'" + bc_code.Text + "','" + nr_code.Text + "','" + GetSNCode.Text + "','" + macode + "',");
             sql.Append("sysdate,'" + User.UserCode + "' from dual");
             dh.BatchInsert(sql.GetString(), new string[] { "location" }, location.ToArray());
-            MessageBox.Show("保存成功");
+            OperatResult.AppendText(">>保存成功\n", Color.Red);
         }
 
         private void DeleteRepairInf_Click(object sender, EventArgs e)
@@ -351,8 +352,7 @@ namespace UAS_MES.Make
                 }
                 else OperatResult.AppendText(">>必须选择不良原因\n", Color.Red);
             }
-            else
-                OperatResult.AppendText(">>序列号错误,不存在或者不处于维修状态\n", Color.Red);
+            else OperatResult.AppendText(">>序列号错误,不存在或者不处于维修状态\n", Color.Red);
         }
 
         private void SaveBadLocation_Click(object sender, EventArgs e)
@@ -371,9 +371,9 @@ namespace UAS_MES.Make
                     }
                     else OperatResult.AppendText(">>请先选择不良原因\n", Color.Red);
                 }
+                else OperatResult.AppendText(">>不良位置不能为空\n", Color.Red);
             }
-            else
-                OperatResult.AppendText(">>序列号错误,不存在或者不处于维修状态\n", Color.Red);
+            else OperatResult.AppendText(">>序列号错误,不存在或者不处于维修状态\n", Color.Red);
         }
 
         private void mbl_loc_TextChanged(object sender, EventArgs e)
@@ -410,8 +410,9 @@ namespace UAS_MES.Make
                         dr["mbp_part"] = prodcode.Text;
                         dt.Rows.Add(dr);
                     }
-                    else MessageBox.Show("请先选择不良原因");
+                    else OperatResult.AppendText(">>请先选择不良原因\n", Color.Red);
                 }
+                else OperatResult.AppendText(">>不良零件不能为空\n", Color.Red);
             }
         }
 

+ 0 - 3
UAS-MES/FunctionCode/Make/Make_Repair.resx

@@ -126,9 +126,6 @@
   <metadata name="mbp_part1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="mbp_part1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

+ 27 - 26
UAS-MES/FunctionCode/Make/Make_TestCollection.Designer.cs

@@ -58,6 +58,7 @@
             this.ms_makecode_label = new System.Windows.Forms.Label();
             this.mcd_inqty_label = new System.Windows.Forms.Label();
             this.mc_restqty_label = new System.Windows.Forms.Label();
+            this.Save = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.bc_code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ma_code = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.LockMakeCode = new UAS_MES.CustomControl.CustomCheckBox.LockCheckBox();
@@ -73,7 +74,6 @@
             this.bc_remark = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.bc_groupcode = new UAS_MES.CustomControl.ComBoxWithFocus.ComBoxWithFocus();
             this.ms_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.Save = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.panel2.SuspendLayout();
             this.SuspendLayout();
             // 
@@ -288,7 +288,7 @@
             this.AutoBadCode.AutoSize = true;
             this.AutoBadCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.AutoBadCode.Location = new System.Drawing.Point(94, 241);
-            this.AutoBadCode.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.AutoBadCode.Margin = new System.Windows.Forms.Padding(2);
             this.AutoBadCode.Name = "AutoBadCode";
             this.AutoBadCode.Size = new System.Drawing.Size(123, 21);
             this.AutoBadCode.TabIndex = 69;
@@ -355,6 +355,25 @@
             this.mc_restqty_label.TabIndex = 17;
             this.mc_restqty_label.Text = "待采集数";
             // 
+            // Save
+            // 
+            this.Save.AllPower = null;
+            this.Save.BackColor = System.Drawing.Color.Transparent;
+            this.Save.DownImage = ((System.Drawing.Image)(resources.GetObject("Save.DownImage")));
+            this.Save.Image = null;
+            this.Save.IsShowBorder = true;
+            this.Save.Location = new System.Drawing.Point(529, 520);
+            this.Save.Margin = new System.Windows.Forms.Padding(2);
+            this.Save.MoveImage = ((System.Drawing.Image)(resources.GetObject("Save.MoveImage")));
+            this.Save.Name = "Save";
+            this.Save.NormalImage = ((System.Drawing.Image)(resources.GetObject("Save.NormalImage")));
+            this.Save.Power = null;
+            this.Save.Size = new System.Drawing.Size(65, 26);
+            this.Save.TabIndex = 70;
+            this.Save.Text = "保存";
+            this.Save.UseVisualStyleBackColor = false;
+            this.Save.Click += new System.EventHandler(this.Save_Click);
+            // 
             // bc_code
             // 
             this.bc_code.AllPower = null;
@@ -394,7 +413,7 @@
             this.LockMakeCode.AutoSize = true;
             this.LockMakeCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.LockMakeCode.Location = new System.Drawing.Point(271, 50);
-            this.LockMakeCode.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.LockMakeCode.Margin = new System.Windows.Forms.Padding(2);
             this.LockMakeCode.Name = "LockMakeCode";
             this.LockMakeCode.Size = new System.Drawing.Size(51, 21);
             this.LockMakeCode.TabIndex = 66;
@@ -447,6 +466,7 @@
             this.ma_prodcode.Name = "ma_prodcode";
             this.ma_prodcode.Size = new System.Drawing.Size(0, 21);
             this.ma_prodcode.TabIndex = 53;
+            this.ma_prodcode.TextChanged += new System.EventHandler(this.ma_prodcode_TextChanged);
             // 
             // OperateResult
             // 
@@ -464,7 +484,7 @@
             this.CleanInfo.DownImage = ((System.Drawing.Image)(resources.GetObject("CleanInfo.DownImage")));
             this.CleanInfo.Image = ((System.Drawing.Image)(resources.GetObject("CleanInfo.Image")));
             this.CleanInfo.IsShowBorder = true;
-            this.CleanInfo.Location = new System.Drawing.Point(784, 518);
+            this.CleanInfo.Location = new System.Drawing.Point(786, 518);
             this.CleanInfo.MoveImage = ((System.Drawing.Image)(resources.GetObject("CleanInfo.MoveImage")));
             this.CleanInfo.Name = "CleanInfo";
             this.CleanInfo.NormalImage = ((System.Drawing.Image)(resources.GetObject("CleanInfo.NormalImage")));
@@ -478,7 +498,7 @@
             // ChooseedReject
             // 
             this.ChooseedReject.Image = ((System.Drawing.Image)(resources.GetObject("ChooseedReject.Image")));
-            this.ChooseedReject.Location = new System.Drawing.Point(339, 430);
+            this.ChooseedReject.Location = new System.Drawing.Point(339, 417);
             this.ChooseedReject.Name = "ChooseedReject";
             this.ChooseedReject.Size = new System.Drawing.Size(50, 23);
             this.ChooseedReject.TabIndex = 45;
@@ -488,7 +508,7 @@
             // WaitReject
             // 
             this.WaitReject.Image = ((System.Drawing.Image)(resources.GetObject("WaitReject.Image")));
-            this.WaitReject.Location = new System.Drawing.Point(339, 366);
+            this.WaitReject.Location = new System.Drawing.Point(339, 353);
             this.WaitReject.Name = "WaitReject";
             this.WaitReject.Size = new System.Drawing.Size(50, 23);
             this.WaitReject.TabIndex = 44;
@@ -537,31 +557,12 @@
             this.ms_sncode.Tag = "IfWrite";
             this.ms_sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ms_code_KeyDown);
             // 
-            // Save
-            // 
-            this.Save.AllPower = null;
-            this.Save.BackColor = System.Drawing.Color.Transparent;
-            this.Save.DownImage = ((System.Drawing.Image)(resources.GetObject("Save.DownImage")));
-            this.Save.Image = null;
-            this.Save.IsShowBorder = true;
-            this.Save.Location = new System.Drawing.Point(529, 518);
-            this.Save.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
-            this.Save.MoveImage = ((System.Drawing.Image)(resources.GetObject("Save.MoveImage")));
-            this.Save.Name = "Save";
-            this.Save.NormalImage = ((System.Drawing.Image)(resources.GetObject("Save.NormalImage")));
-            this.Save.Power = null;
-            this.Save.Size = new System.Drawing.Size(65, 26);
-            this.Save.TabIndex = 70;
-            this.Save.Text = "保存";
-            this.Save.UseVisualStyleBackColor = false;
-            this.Save.Click += new System.EventHandler(this.Save_Click);
-            // 
             // Make_TestCollection
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.SystemColors.Control;
-            this.ClientSize = new System.Drawing.Size(922, 568);
+            this.ClientSize = new System.Drawing.Size(922, 560);
             this.Controls.Add(this.Save);
             this.Controls.Add(this.AutoBadCode);
             this.Controls.Add(this.bc_code);

+ 59 - 29
UAS-MES/FunctionCode/Make/Make_TestCollection.cs

@@ -7,6 +7,7 @@ using System.Windows.Forms;
 using UAS_MES.DataOperate;
 using UAS_MES.Entity;
 using UAS_MES.PublicMethod;
+using System.Collections.Generic;
 
 namespace UAS_MES.Make
 {
@@ -35,6 +36,14 @@ namespace UAS_MES.Make
         LogStringBuilder sql = new LogStringBuilder();
 
         AutoSizeFormClass asc = new AutoSizeFormClass();
+        /// <summary>
+        /// 已选的不良
+        /// </summary>
+        List<string> ChoosedList = new List<string>();
+        /// <summary>
+        /// 待选的不良
+        /// </summary>
+        List<string> WaitList = new List<string>();
 
         public Make_TestCollection()
         {
@@ -152,7 +161,6 @@ namespace UAS_MES.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
-
                 bool ifFirst;
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
@@ -174,7 +182,7 @@ namespace UAS_MES.Make
                             string stepcode = dt.Rows[0]["ms_stepcode"].ToString();
                             if (stepcode == User.CurrentStepCode && (status == "1" || status == "2"))
                             {
-                                OperateResult.AppendText(">>序列号已执行过" + User.CurrentStepCode + "工序,采集结果为良品\n", Color.Red);
+                                OperateResult.AppendText(">>"+ ms_sncode.Text+ " 序列号已执行过" + User.CurrentStepCode + "工序,采集结果为良品\n", Color.Red);
                                 return;
                             }
                         }
@@ -185,6 +193,7 @@ namespace UAS_MES.Make
                 }
                 else
                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                ms_sncode.Text = "";
             }
         }
 
@@ -214,9 +223,9 @@ namespace UAS_MES.Make
             }
             else
             {
-                bc_groupcode.DataSource = dt;
                 bc_groupcode.DisplayMember = "pb_badgroup";
                 bc_groupcode.ValueMember = "pb_badgroup";
+                bc_groupcode.DataSource = dt;
             }
         }
 
@@ -225,23 +234,6 @@ namespace UAS_MES.Make
         /// </summary>
         private void LoadBadCodeListView()
         {
-            sql.Clear();
-            object bg_code = bc_groupcode.SelectedValue;
-            sql.Append("select bg_code||':'||bg_name bg_code,bc_code,bc_note from badcode left join badgroup on bc_groupcode=bg_code where bc_groupcode='" + (bg_code != null ? bg_code.ToString() : "") + "' and bg_code is not null");
-            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-            //往listview中添加数据
-            WaitRejectList.Items.Clear();
-            WaitRejectList.BeginUpdate();
-            for (int i = 0; i < dt.Rows.Count; i++)
-            {
-                ListViewItem lvi = new ListViewItem();
-                //第一列是勾选列,设置列头文本为空
-                lvi.Text = "";
-                for (int j = 0; j < dt.Columns.Count; j++)
-                    lvi.SubItems.Add(dt.Rows[i][j].ToString());
-                WaitRejectList.Items.Add(lvi);
-            }
-            WaitRejectList.EndUpdate();
             sql.Clear();
             sql.Append("select bg_code||':'||bg_name bg_code,bc_code,mb_badremark from makebad  ");
             sql.Append("left join badgroup on mb_bgcode=bg_code left join badcode on mb_badcode=bc_code ");
@@ -251,14 +243,39 @@ namespace UAS_MES.Make
             ChoosedRejectList.BeginUpdate();
             for (int i = 0; i < dt.Rows.Count; i++)
             {
-                ListViewItem lvi = new ListViewItem();
-                //第一列是勾选列,设置列头文本为空
-                lvi.Text = "";
-                for (int j = 0; j < dt.Columns.Count; j++)
-                    lvi.SubItems.Add(dt.Rows[i][j].ToString());
-                ChoosedRejectList.Items.Add(lvi);
+                if (!WaitList.Contains(dt.Rows[i]["bc_code"].ToString()))
+                {
+                    ListViewItem lvi = new ListViewItem();
+                    //第一列是勾选列,设置列头文本为空
+                    lvi.Text = "";
+                    ChoosedList.Add(dt.Rows[i]["bc_code"].ToString());
+                    for (int j = 0; j < dt.Columns.Count; j++)
+                        lvi.SubItems.Add(dt.Rows[i][j].ToString());
+                    ChoosedRejectList.Items.Add(lvi);
+                }
             }
             ChoosedRejectList.EndUpdate();
+            sql.Clear();
+            object bg_code = bc_groupcode.SelectedValue;
+            sql.Append("select bg_code||':'||bg_name bg_code,bc_code,bc_note from badcode left join badgroup on bc_groupcode=bg_code where bc_groupcode='" + (bg_code != null ? bg_code.ToString() : "") + "' and bg_code is not null");
+            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            //往listview中添加数据
+            WaitRejectList.Items.Clear();
+            WaitRejectList.BeginUpdate();
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                if (!ChoosedList.Contains(dt.Rows[i]["bc_code"].ToString()))
+                {
+                    ListViewItem lvi = new ListViewItem();
+                    //第一列是勾选列,设置列头文本为空
+                    lvi.Text = "";
+                    WaitList.Add(dt.Rows[i]["bc_code"].ToString());
+                    for (int j = 0; j < dt.Columns.Count; j++)
+                        lvi.SubItems.Add(dt.Rows[i][j].ToString());
+                    WaitRejectList.Items.Add(lvi);
+                }
+            }
+            WaitRejectList.EndUpdate();
         }
 
         /// <summary>
@@ -312,9 +329,15 @@ namespace UAS_MES.Make
 
         private void Save_Click(object sender, EventArgs e)
         {
+            if (ms_sncode.Text == "")
+            {
+                OperateResult.AppendText(">>序列号不允许为空\n", Color.Red);
+                return;
+            }
             if (GoodProduct.Checked)
             {
                 SetTestPass();
+                LoadCollectedNum();
             }
             else if (Reject.Checked)
             {
@@ -390,6 +413,8 @@ namespace UAS_MES.Make
                     ChoosedRejectList.Items.Clear();
                     ms_sncode.Text = "";
                     LoadCollectedNum();
+                    WaitList.Clear();
+                    ChoosedList.Clear();
                 }
                 else
                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
@@ -405,9 +430,9 @@ namespace UAS_MES.Make
                 {
                     for (int i = 0; i < ChoosedRejectList.Items.Count; i++)
                     {
-                        if (ChoosedRejectList.Items[i].ListView.Items[0].SubItems[2].Text == bc_code.Text)
+                        if (ChoosedRejectList.Items[i].ListView.Items[i].SubItems[2].Text == bc_code.Text)
                         {
-                            MessageBox.Show("已添加过不良代码" + bc_code.Text);
+                            OperateResult.AppendText(">>已添加过不良代码"+bc_code.Text+"\n", Color.Red);
                             return;
                         }
                     }
@@ -417,8 +442,13 @@ namespace UAS_MES.Make
                         lvi.SubItems.Add(dt.Rows[0][j].ToString());
                     ChoosedRejectList.Items.Add(lvi);
                 }
-                else MessageBox.Show("不良代码不存在");
+                else OperateResult.AppendText(">>不良代码"+bc_code.Text+"不存在\n", Color.Red);
             }
         }
+
+        private void ma_prodcode_TextChanged(object sender, EventArgs e)
+        {
+            LoadCollectedNum();
+        }
     }
 }

+ 38 - 38
UAS-MES/FunctionCode/Make/Make_TestCollection.resx

@@ -118,6 +118,44 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="Save.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="Save.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="Save.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
   <data name="CleanInfo.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
@@ -285,44 +323,6 @@
         ZrIE7d4UdV3k12BxFb3huIgob74jq7eOllIz0Q9sQrs7Ui9wepGrci6vk/HQgzzKm+7IZUgTOpQ2kj7o
         zB15DHqhq3IurxPdaY8R5U37C1K8XmyU9PGfh25xfV0R/UeTz52y3EtWQ9dqNEP4HY3LfwGra+NvPdw7
         fgAAAABJRU5ErkJggg==
-</value>
-  </data>
-  <data name="Save.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
-        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
-        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
-        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
-        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
-        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
-        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
-        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
-</value>
-  </data>
-  <data name="Save.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
-        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
-        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
-        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
-        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
-        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
-        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
-        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
-        gg==
-</value>
-  </data>
-  <data name="Save.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
-        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
-        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
-        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
-        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
-        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
-        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
-        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
-        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
 </value>
   </data>
 </root>

+ 4 - 10
UAS-MES/FunctionCode/OQC/OQC_BatchResultJudge.cs

@@ -196,7 +196,7 @@ namespace UAS_MES.OQC
                 {
                     if (dt.Rows[0]["re_statuscode"].ToString() == "AUDITED")
                     {
-                        MessageBox.Show("该批次存在已审核的返修工单,不允许撤销");
+                        OperateResult.AppendText(">> 该批次存在已审核的返修工单,不允许撤销\n", Color.Red);
                         return;
                     }
                     else
@@ -207,10 +207,7 @@ namespace UAS_MES.OQC
                             dh.ExecuteSql("delete from reworkdetail where rd_checkno='" + ob_checkno.Text + "' ", "delete");
                             dh.ExecuteSql("delete from rework where re_checkno='" + ob_checkno.Text + "' ", "delete");
                         }
-                        else
-                        {
-                            return;
-                        }
+                        else return;
                     }
                 }
                 dh.ExecuteSql("update OQCBatch set ob_status='UNCHECK' ,ob_result='' where ob_checkno='" + ob_checkno.Text + "'", "select");
@@ -219,10 +216,7 @@ namespace UAS_MES.OQC
                 OperateResult.AppendText(">>撤销判退成功\n", Color.Green);
                 GetBatch.PerformClick();
             }
-            else
-            {
-                OperateResult.AppendText(">>该抽检批次未判退,无需撤销判退\n", Color.Red);
-            }
+            else OperateResult.AppendText(">>该抽检批次未判退,无需撤销判退\n", Color.Red);
         }
 
         private void Clean_Click(object sender, EventArgs e)
@@ -289,7 +283,7 @@ namespace UAS_MES.OQC
                 {
                     //更新下一工序
                     string ErrorMessage = "";
-                    LogicHandler.UpdateMakeMessage(ms_sncode.Text, ob_makecode.Text,"OQC批判过", User.UserSourceCode, User.UserName, "批次通过", out ErrorMessage);
+                    LogicHandler.UpdateMakeMessage(ms_sncode.Text, ob_makecode.Text, "OQC批判过", User.UserSourceCode, User.UserName, "批次通过", out ErrorMessage);
                     //记录操作日志
                     LogicHandler.InsertMakeProcess(ms_sncode.Text, ob_makecode.Text, "批结果判定", Operate, User.UserName);
                 }

+ 141 - 62
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.Designer.cs

@@ -33,7 +33,7 @@
             this.ob_checkno_label = new System.Windows.Forms.Label();
             this.obd_outboxcode_label = new System.Windows.Forms.Label();
             this.ms_sncode_label = new System.Windows.Forms.Label();
-            this.ob_status_label = new System.Windows.Forms.Label();
+            this.bc_code_label = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
             this.label4 = new System.Windows.Forms.Label();
             this.label5 = new System.Windows.Forms.Label();
@@ -75,8 +75,8 @@
             this.ChooseedReject = new UAS_MES.CustomControl.ButtonUtil.ArrowRightButton();
             this.WaitReject = new UAS_MES.CustomControl.ButtonUtil.ArrowLeftButton();
             this.oi_checkqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ob_ngqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_okqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ob_ngqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_batchqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.bccode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.Refresh = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
@@ -87,6 +87,10 @@
             this.ob_checkno = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.obd_outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ms_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ob_aqlcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ob_aqlcode_label = new System.Windows.Forms.Label();
+            this.ob_maxngacceptqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ob_maxngacceptqty_label = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.ChoosedDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.WaitChooseDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.CheckTypeDGV)).BeginInit();
@@ -128,17 +132,17 @@
             this.ms_sncode_label.TabIndex = 152;
             this.ms_sncode_label.Text = "序列号";
             // 
-            // ob_status_label
+            // bc_code_label
             // 
-            this.ob_status_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            this.bc_code_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.ob_status_label.AutoSize = true;
-            this.ob_status_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_status_label.Location = new System.Drawing.Point(807, 164);
-            this.ob_status_label.Name = "ob_status_label";
-            this.ob_status_label.Size = new System.Drawing.Size(74, 21);
-            this.ob_status_label.TabIndex = 177;
-            this.ob_status_label.Text = "不良代码";
+            this.bc_code_label.AutoSize = true;
+            this.bc_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.bc_code_label.Location = new System.Drawing.Point(807, 171);
+            this.bc_code_label.Name = "bc_code_label";
+            this.bc_code_label.Size = new System.Drawing.Size(74, 21);
+            this.bc_code_label.TabIndex = 177;
+            this.bc_code_label.Text = "不良代码";
             // 
             // label1
             // 
@@ -146,7 +150,7 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(807, 26);
+            this.label1.Location = new System.Drawing.Point(807, 41);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(58, 21);
             this.label1.TabIndex = 179;
@@ -158,7 +162,7 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(807, 129);
+            this.label4.Location = new System.Drawing.Point(807, 139);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(74, 21);
             this.label4.TabIndex = 185;
@@ -170,7 +174,7 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(807, 92);
+            this.label5.Location = new System.Drawing.Point(807, 105);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(58, 21);
             this.label5.TabIndex = 187;
@@ -182,7 +186,7 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(807, 58);
+            this.label6.Location = new System.Drawing.Point(807, 71);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(58, 21);
             this.label6.TabIndex = 189;
@@ -192,7 +196,7 @@
             // 
             this.label9.AutoSize = true;
             this.label9.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label9.Location = new System.Drawing.Point(466, 166);
+            this.label9.Location = new System.Drawing.Point(466, 174);
             this.label9.Name = "label9";
             this.label9.Size = new System.Drawing.Size(74, 21);
             this.label9.TabIndex = 192;
@@ -258,7 +262,7 @@
             // ob_status
             // 
             this.ob_status.AutoSize = true;
-            this.ob_status.Location = new System.Drawing.Point(497, 137);
+            this.ob_status.Location = new System.Drawing.Point(15, 9);
             this.ob_status.Name = "ob_status";
             this.ob_status.Size = new System.Drawing.Size(0, 12);
             this.ob_status.TabIndex = 212;
@@ -305,7 +309,7 @@
             this.ob_projectcode.BackColor = System.Drawing.Color.White;
             this.ob_projectcode.Enabled = false;
             this.ob_projectcode.ID = null;
-            this.ob_projectcode.Location = new System.Drawing.Point(663, 22);
+            this.ob_projectcode.Location = new System.Drawing.Point(95, 2);
             this.ob_projectcode.Name = "ob_projectcode";
             this.ob_projectcode.Power = null;
             this.ob_projectcode.Size = new System.Drawing.Size(116, 21);
@@ -384,24 +388,28 @@
             this.ChoosedDGV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.bc_code1,
             this.bc_name1});
-            this.ChoosedDGV.Location = new System.Drawing.Point(810, 197);
+            this.ChoosedDGV.Location = new System.Drawing.Point(810, 204);
             this.ChoosedDGV.Name = "ChoosedDGV";
             this.ChoosedDGV.RowHeadersWidth = 20;
             this.ChoosedDGV.RowTemplate.Height = 23;
-            this.ChoosedDGV.Size = new System.Drawing.Size(244, 256);
+            this.ChoosedDGV.Size = new System.Drawing.Size(244, 257);
             this.ChoosedDGV.TabIndex = 205;
             // 
             // bc_code1
             // 
+            this.bc_code1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
             this.bc_code1.DataPropertyName = "bc_code";
             this.bc_code1.HeaderText = "不良代码";
             this.bc_code1.Name = "bc_code1";
+            this.bc_code1.Width = 78;
             // 
             // bc_name1
             // 
+            this.bc_name1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
             this.bc_name1.DataPropertyName = "bc_name";
             this.bc_name1.HeaderText = "不良原因";
             this.bc_name1.Name = "bc_name1";
+            this.bc_name1.Width = 78;
             // 
             // WaitChooseDGV
             // 
@@ -411,7 +419,7 @@
             this.Column3,
             this.bc_code,
             this.bc_name});
-            this.WaitChooseDGV.Location = new System.Drawing.Point(472, 196);
+            this.WaitChooseDGV.Location = new System.Drawing.Point(472, 204);
             this.WaitChooseDGV.Name = "WaitChooseDGV";
             this.WaitChooseDGV.RowHeadersWidth = 20;
             this.WaitChooseDGV.RowTemplate.Height = 23;
@@ -427,21 +435,23 @@
             this.Column3.HeaderText = "勾选";
             this.Column3.Name = "Column3";
             this.Column3.Resizable = System.Windows.Forms.DataGridViewTriState.False;
-            this.Column3.Width = 55;
+            this.Column3.Width = 60;
             // 
             // bc_code
             // 
+            this.bc_code.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
             this.bc_code.DataPropertyName = "pb_badgroup";
             this.bc_code.HeaderText = "不良分组";
             this.bc_code.Name = "bc_code";
-            this.bc_code.Width = 120;
+            this.bc_code.Width = 78;
             // 
             // bc_name
             // 
+            this.bc_name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
             this.bc_name.DataPropertyName = "bg_name";
             this.bc_name.HeaderText = "分组名称";
             this.bc_name.Name = "bc_name";
-            this.bc_name.Width = 120;
+            this.bc_name.Width = 78;
             // 
             // ob_remark
             // 
@@ -503,28 +513,33 @@
             this.dataGridViewCheckBoxColumn1.HeaderText = "勾选";
             this.dataGridViewCheckBoxColumn1.Name = "dataGridViewCheckBoxColumn1";
             this.dataGridViewCheckBoxColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.False;
-            this.dataGridViewCheckBoxColumn1.Width = 50;
+            this.dataGridViewCheckBoxColumn1.Width = 60;
             // 
             // oi_itemcode
             // 
+            this.oi_itemcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
             this.oi_itemcode.DataPropertyName = "oi_checkkind";
             this.oi_itemcode.HeaderText = "检验类型";
             this.oi_itemcode.Name = "oi_itemcode";
+            this.oi_itemcode.Width = 78;
             // 
             // oi_ng
             // 
-            this.oi_ng.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.oi_ng.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
             this.oi_ng.DataPropertyName = "oi_count";
             dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
             this.oi_ng.DefaultCellStyle = dataGridViewCellStyle1;
             this.oi_ng.HeaderText = "样本数量";
             this.oi_ng.Name = "oi_ng";
+            this.oi_ng.Width = 78;
             // 
             // oi_leveldefect
             // 
+            this.oi_leveldefect.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
             this.oi_leveldefect.DataPropertyName = "oi_checkedcount";
             this.oi_leveldefect.HeaderText = "已检数量";
             this.oi_leveldefect.Name = "oi_leveldefect";
+            this.oi_leveldefect.Width = 78;
             // 
             // ois_remark
             // 
@@ -546,7 +561,7 @@
             // ChooseedReject
             // 
             this.ChooseedReject.Image = ((System.Drawing.Image)(resources.GetObject("ChooseedReject.Image")));
-            this.ChooseedReject.Location = new System.Drawing.Point(750, 349);
+            this.ChooseedReject.Location = new System.Drawing.Point(750, 357);
             this.ChooseedReject.Name = "ChooseedReject";
             this.ChooseedReject.Size = new System.Drawing.Size(50, 23);
             this.ChooseedReject.TabIndex = 195;
@@ -556,7 +571,7 @@
             // WaitReject
             // 
             this.WaitReject.Image = ((System.Drawing.Image)(resources.GetObject("WaitReject.Image")));
-            this.WaitReject.Location = new System.Drawing.Point(750, 285);
+            this.WaitReject.Location = new System.Drawing.Point(750, 293);
             this.WaitReject.Name = "WaitReject";
             this.WaitReject.Size = new System.Drawing.Size(50, 23);
             this.WaitReject.TabIndex = 194;
@@ -569,58 +584,58 @@
             this.oi_checkqty.BackColor = System.Drawing.Color.White;
             this.oi_checkqty.Enabled = false;
             this.oi_checkqty.ID = null;
-            this.oi_checkqty.Location = new System.Drawing.Point(909, 59);
+            this.oi_checkqty.Location = new System.Drawing.Point(908, 72);
             this.oi_checkqty.Name = "oi_checkqty";
             this.oi_checkqty.Power = null;
-            this.oi_checkqty.Size = new System.Drawing.Size(146, 21);
+            this.oi_checkqty.Size = new System.Drawing.Size(147, 21);
             this.oi_checkqty.Str = null;
             this.oi_checkqty.Str1 = null;
             this.oi_checkqty.Str2 = null;
             this.oi_checkqty.TabIndex = 190;
             this.oi_checkqty.Tag = "NoAuto";
             // 
-            // ob_ngqty
-            // 
-            this.ob_ngqty.AllPower = null;
-            this.ob_ngqty.BackColor = System.Drawing.Color.White;
-            this.ob_ngqty.Enabled = false;
-            this.ob_ngqty.ID = null;
-            this.ob_ngqty.Location = new System.Drawing.Point(909, 93);
-            this.ob_ngqty.Name = "ob_ngqty";
-            this.ob_ngqty.Power = null;
-            this.ob_ngqty.Size = new System.Drawing.Size(146, 21);
-            this.ob_ngqty.Str = null;
-            this.ob_ngqty.Str1 = null;
-            this.ob_ngqty.Str2 = null;
-            this.ob_ngqty.TabIndex = 188;
-            this.ob_ngqty.Tag = "NoAuto";
-            // 
             // ob_okqty
             // 
             this.ob_okqty.AllPower = null;
             this.ob_okqty.BackColor = System.Drawing.Color.White;
             this.ob_okqty.Enabled = false;
             this.ob_okqty.ID = null;
-            this.ob_okqty.Location = new System.Drawing.Point(909, 130);
+            this.ob_okqty.Location = new System.Drawing.Point(908, 106);
             this.ob_okqty.Name = "ob_okqty";
             this.ob_okqty.Power = null;
-            this.ob_okqty.Size = new System.Drawing.Size(146, 21);
+            this.ob_okqty.Size = new System.Drawing.Size(147, 21);
             this.ob_okqty.Str = null;
             this.ob_okqty.Str1 = null;
             this.ob_okqty.Str2 = null;
-            this.ob_okqty.TabIndex = 186;
+            this.ob_okqty.TabIndex = 188;
             this.ob_okqty.Tag = "NoAuto";
             // 
+            // ob_ngqty
+            // 
+            this.ob_ngqty.AllPower = null;
+            this.ob_ngqty.BackColor = System.Drawing.Color.White;
+            this.ob_ngqty.Enabled = false;
+            this.ob_ngqty.ID = null;
+            this.ob_ngqty.Location = new System.Drawing.Point(908, 140);
+            this.ob_ngqty.Name = "ob_ngqty";
+            this.ob_ngqty.Power = null;
+            this.ob_ngqty.Size = new System.Drawing.Size(147, 21);
+            this.ob_ngqty.Str = null;
+            this.ob_ngqty.Str1 = null;
+            this.ob_ngqty.Str2 = null;
+            this.ob_ngqty.TabIndex = 186;
+            this.ob_ngqty.Tag = "NoAuto";
+            // 
             // ob_batchqty
             // 
             this.ob_batchqty.AllPower = null;
             this.ob_batchqty.BackColor = System.Drawing.Color.White;
             this.ob_batchqty.Enabled = false;
             this.ob_batchqty.ID = null;
-            this.ob_batchqty.Location = new System.Drawing.Point(909, 27);
+            this.ob_batchqty.Location = new System.Drawing.Point(908, 42);
             this.ob_batchqty.Name = "ob_batchqty";
             this.ob_batchqty.Power = null;
-            this.ob_batchqty.Size = new System.Drawing.Size(146, 21);
+            this.ob_batchqty.Size = new System.Drawing.Size(147, 21);
             this.ob_batchqty.Str = null;
             this.ob_batchqty.Str1 = null;
             this.ob_batchqty.Str2 = null;
@@ -632,15 +647,15 @@
             this.bccode.AllPower = null;
             this.bccode.BackColor = System.Drawing.Color.White;
             this.bccode.ID = null;
-            this.bccode.Location = new System.Drawing.Point(910, 166);
+            this.bccode.Location = new System.Drawing.Point(908, 175);
             this.bccode.Name = "bccode";
             this.bccode.Power = null;
-            this.bccode.Size = new System.Drawing.Size(143, 21);
+            this.bccode.Size = new System.Drawing.Size(147, 21);
             this.bccode.Str = null;
             this.bccode.Str1 = null;
             this.bccode.Str2 = null;
             this.bccode.TabIndex = 178;
-            this.bccode.Tag = "ifRead";
+            this.bccode.Tag = "bc_code";
             this.bccode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.bccode_KeyDown);
             // 
             // Refresh
@@ -790,11 +805,71 @@
             this.ms_sncode.Tag = "NoAuto";
             this.ms_sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ms_sncode_KeyDown);
             // 
+            // ob_aqlcode
+            // 
+            this.ob_aqlcode.AllPower = null;
+            this.ob_aqlcode.BackColor = System.Drawing.Color.White;
+            this.ob_aqlcode.Enabled = false;
+            this.ob_aqlcode.ID = null;
+            this.ob_aqlcode.Location = new System.Drawing.Point(908, 7);
+            this.ob_aqlcode.Name = "ob_aqlcode";
+            this.ob_aqlcode.Power = null;
+            this.ob_aqlcode.Size = new System.Drawing.Size(146, 21);
+            this.ob_aqlcode.Str = null;
+            this.ob_aqlcode.Str1 = null;
+            this.ob_aqlcode.Str2 = null;
+            this.ob_aqlcode.TabIndex = 215;
+            this.ob_aqlcode.Tag = "NoAuto";
+            // 
+            // ob_aqlcode_label
+            // 
+            this.ob_aqlcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.ob_aqlcode_label.AutoSize = true;
+            this.ob_aqlcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_aqlcode_label.Location = new System.Drawing.Point(807, 7);
+            this.ob_aqlcode_label.Name = "ob_aqlcode_label";
+            this.ob_aqlcode_label.Size = new System.Drawing.Size(42, 21);
+            this.ob_aqlcode_label.TabIndex = 214;
+            this.ob_aqlcode_label.Text = "AQL";
+            // 
+            // ob_maxngacceptqty
+            // 
+            this.ob_maxngacceptqty.AllPower = null;
+            this.ob_maxngacceptqty.BackColor = System.Drawing.Color.White;
+            this.ob_maxngacceptqty.Enabled = false;
+            this.ob_maxngacceptqty.ID = null;
+            this.ob_maxngacceptqty.Location = new System.Drawing.Point(645, 42);
+            this.ob_maxngacceptqty.Name = "ob_maxngacceptqty";
+            this.ob_maxngacceptqty.Power = null;
+            this.ob_maxngacceptqty.Size = new System.Drawing.Size(146, 21);
+            this.ob_maxngacceptqty.Str = null;
+            this.ob_maxngacceptqty.Str1 = null;
+            this.ob_maxngacceptqty.Str2 = null;
+            this.ob_maxngacceptqty.TabIndex = 217;
+            this.ob_maxngacceptqty.Tag = "NoAuto";
+            // 
+            // ob_maxngacceptqty_label
+            // 
+            this.ob_maxngacceptqty_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.ob_maxngacceptqty_label.AutoSize = true;
+            this.ob_maxngacceptqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_maxngacceptqty_label.Location = new System.Drawing.Point(641, 9);
+            this.ob_maxngacceptqty_label.Name = "ob_maxngacceptqty_label";
+            this.ob_maxngacceptqty_label.Size = new System.Drawing.Size(138, 21);
+            this.ob_maxngacceptqty_label.TabIndex = 216;
+            this.ob_maxngacceptqty_label.Text = "最大不合格通过数";
+            // 
             // OQC_SamplingDataCollection
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1065, 600);
+            this.ClientSize = new System.Drawing.Size(1065, 610);
+            this.Controls.Add(this.ob_maxngacceptqty);
+            this.Controls.Add(this.ob_maxngacceptqty_label);
+            this.Controls.Add(this.ob_aqlcode);
+            this.Controls.Add(this.ob_aqlcode_label);
             this.Controls.Add(this.ob_projectcode);
             this.Controls.Add(this.ob_status);
             this.Controls.Add(this.Clean);
@@ -816,14 +891,14 @@
             this.Controls.Add(this.label9);
             this.Controls.Add(this.oi_checkqty);
             this.Controls.Add(this.label6);
-            this.Controls.Add(this.ob_ngqty);
-            this.Controls.Add(this.label5);
             this.Controls.Add(this.ob_okqty);
+            this.Controls.Add(this.label5);
+            this.Controls.Add(this.ob_ngqty);
             this.Controls.Add(this.label4);
             this.Controls.Add(this.ob_batchqty);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.bccode);
-            this.Controls.Add(this.ob_status_label);
+            this.Controls.Add(this.bc_code_label);
             this.Controls.Add(this.Refresh);
             this.Controls.Add(this.GetBatch);
             this.Controls.Add(this.BatchPass);
@@ -863,12 +938,12 @@
         private CustomControl.ButtonUtil.NormalButton GetBatch;
         private new CustomControl.ButtonUtil.NormalButton Refresh;
         private CustomControl.TextBoxWithIcon.EnterTextBox bccode;
-        private System.Windows.Forms.Label ob_status_label;
+        private System.Windows.Forms.Label bc_code_label;
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_batchqty;
         private System.Windows.Forms.Label label1;
-        private CustomControl.TextBoxWithIcon.EnterTextBox ob_okqty;
-        private System.Windows.Forms.Label label4;
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_ngqty;
+        private System.Windows.Forms.Label label4;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ob_okqty;
         private System.Windows.Forms.Label label5;
         private CustomControl.TextBoxWithIcon.EnterTextBox oi_checkqty;
         private System.Windows.Forms.Label label6;
@@ -895,9 +970,9 @@
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
         private CustomControl.ButtonUtil.NormalButton Clean;
         private System.Windows.Forms.Label ob_status;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ob_projectcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn bc_code1;
         private System.Windows.Forms.DataGridViewTextBoxColumn bc_name1;
-        private CustomControl.TextBoxWithIcon.EnterTextBox ob_projectcode;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Column3;
         private System.Windows.Forms.DataGridViewTextBoxColumn bc_code;
         private System.Windows.Forms.DataGridViewTextBoxColumn bc_name;
@@ -908,5 +983,9 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn ois_remark;
         private System.Windows.Forms.DataGridViewTextBoxColumn ois_status;
         private System.Windows.Forms.DataGridViewTextBoxColumn ois_id;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ob_aqlcode;
+        private System.Windows.Forms.Label ob_aqlcode_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ob_maxngacceptqty;
+        private System.Windows.Forms.Label ob_maxngacceptqty_label;
     }
 }

+ 53 - 23
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.cs

@@ -21,6 +21,7 @@ namespace UAS_MES.OQC
         List<DataGridViewRow> dgvr = new List<DataGridViewRow>();
         LogStringBuilder sql = new LogStringBuilder();
         string[] LevelDefect = new string[] { "A#A", "B#B", "C#C", "D#D" };
+
         public OQC_SamplingDataCollection()
         {
             InitializeComponent();
@@ -46,10 +47,7 @@ namespace UAS_MES.OQC
                 BaseUtil.SetFormValue(Controls, dt[0]);
                 BaseUtil.FillExpandDgvWithDataTable(CheckTypeDGV, dt[1], true);
             }
-            else
-            {
-                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-            }
+            else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
         }
 
         private void Clean_Click(object sender, EventArgs e)
@@ -71,37 +69,22 @@ namespace UAS_MES.OQC
                         if (dt.Rows.Count > 0)
                         {
                             if (dt.Rows[0]["ob_source"].ToString() != "工序")
-                            {
                                 GetBatchTypeGridData();
-                            }
                             else
                             {
                                 string ErrorMessage = "";
                                 bool ifFirst;
                                 if (LogicHandler.CheckCurrentStepAndIfFirst(sncode.Text, dt.Rows[0]["ob_makecode"].ToString(), User.UserSourceCode, "OQC!SamplingDataCollection", out ifFirst, out ErrorMessage))
-                                {
                                     GetBatchTypeGridData();
-                                }
                                 else
-                                {
                                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-                                }
                             }
                         }
-                        else
-                        {
-                            OperateResult.AppendText(">>该序列号不属于当前抽检批次\n", Color.Red);
-                        }
-                    }
-                    else
-                    {
-                        OperateResult.AppendText(">>送检批次必须是待检验或者检验中\n", Color.Red);
+                        else OperateResult.AppendText(">>该序列号不属于当前抽检批次\n", Color.Red);
                     }
+                    else OperateResult.AppendText(">>送检批次必须是待检验或者检验中\n", Color.Red);
                 }
-                else
-                {
-                    OperateResult.AppendText(">>输入的内容不能为空\n", Color.Red);
-                }
+                else OperateResult.AppendText(">>输入的内容不能为空\n", Color.Red);
             }
         }
 
@@ -214,7 +197,26 @@ namespace UAS_MES.OQC
 
         private void BatchPass_Click(object sender, EventArgs e)
         {
-
+            if (CheckBefore())
+            {
+                sql.Clear();
+                sql.Append("select max(nvl(ad_maxngacceptqty,0)) maxngacceptqty from QUA_Aql,QUA_AqlDetail where al_id=ad_alid ");
+                sql.Append("and al_statuscode='AUDITED' and al_code ='" + ob_aqlcode.Text + "' and " + (ob_batchqty.Text != "" ? ob_batchqty.Text : "0") + " >= ad_minqty");
+                sql.Append(" and " + (ob_batchqty.Text != "" ? ob_batchqty.Text : "0") + "<=ad_maxqty ");
+                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                if (int.Parse(ob_ngqty.Text == "" ? "0" : ob_ngqty.Text) <= int.Parse(dt.Rows[0]["maxngacceptqty"].ToString() == "" ? ob_maxngacceptqty.Text : dt.Rows[0]["maxngacceptqty"].ToString()))
+                {
+                    dh.ExecuteSql("update OQCBatch set ob_status='OK',ob_result='OK' where ob_checkno='" + ob_checkno.Text + "'", "select");
+                    string ErrorMessage;
+                    LogicHandler.UpdateMakeMessage(ms_sncode.Text, ob_makecode.Text, "OQC批判过", User.UserSourceCode, User.UserName, "批次通过", out ErrorMessage);
+                    //记录操作日志
+                    LogicHandler.InsertMakeProcess(ms_sncode.Text, ob_makecode.Text, "批结果判定", "批次通过", User.UserName);
+                    GetBatch.PerformClick();
+                    OperateResult.AppendText(">>通过批成功\n", Color.Green);
+                }
+                else
+                    OperateResult.AppendText(">>当前批次不合格数为" + ob_ngqty.Text + ",大于最大不合格允通过数" + ob_maxngacceptqty.Text + "\n", Color.Red);
+            }
         }
 
         private void Refresh_Click(object sender, EventArgs e)
@@ -222,6 +224,34 @@ namespace UAS_MES.OQC
 
         }
 
+        private bool CheckBefore()
+        {
+            //如果AQL标准为空
+            if (ob_aqlcode.Text == "")
+            {
+                if (ob_maxngacceptqty.Text == "")
+                    OperateResult.AppendText(">>AQL标准为空的时候必须填写最大不合格允许通过数\n", Color.Red);
+                else
+                {
+                    sql.Clear();
+                    sql.Append("select wm_concat(oi_itemcode) codes from OQCitems where ");
+                    sql.Append("nvl(oi_checkqty,0)<oi_sampleqty  and oi_sampleqty>0 and rownum<30 and oi_checkno='" + ob_checkno.Text + "'");
+                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        if (dt.Rows[0]["codes"].ToString() != "")
+                        {
+                            OperateResult.AppendText(">>项目编号抽检数未达到样本数,项目编号['" + ob_makecode.Text + "']\n", Color.Red);
+                            return false;
+                        }
+                        else
+                            return true;
+                    }
+                }
+            }
+            return false;
+        }
+
         private void WaitReject_Click(object sender, EventArgs e)
         {
             BaseUtil.CleanDGVData(ChoosedDGV);

+ 1 - 1
UAS-MES/Program.cs

@@ -91,7 +91,7 @@ namespace UAS_MES
             if (ex != null)
             {
                 sb.AppendLine(ex.Message);
-                sb.AppendLine("【异常方法】:" + ex.StackTrace);
+                //sb.AppendLine("【异常方法】:" + ex.StackTrace);
             }
             //else { sb.AppendLine("【未处理异常】:" + backStr); }
             return sb.ToString();

+ 4 - 5
UAS-MES/PublicMethod/LogicHandler.cs

@@ -382,9 +382,10 @@ namespace UAS_MES.PublicMethod
             if (dt.Rows.Count > 0)
             {
                 string em_name = dt.Rows[0]["em_name"].ToString();
-                if (dt.Rows[0]["em_type"].ToString() == "admin" && iSourceCode == "")
+                if (iSourceCode == "")
                 {
-                    return true;
+                    oErrorMessage = "岗位资源不允许为空";
+                    return false;
                 }
                 dt = dh.getFieldsDatasByCondition("cs$empgroup left join cs$userresource on ur_groupcode=eg_groupcode left join source on ur_resourcecode=sc_code", new string[] { "ur_resourcecode" }, "eg_emcode = '" + iUserCode + "' and sc_statuscode='AUDITED'");
                 //如果存在该编号
@@ -885,16 +886,14 @@ namespace UAS_MES.PublicMethod
                 case "OQCDATACOLLECTION":
                     sql.Clear();
                     sql.Append("select ob_checkno,ob_makecode,ob_prodcode,ob_batchqty,pr_detail,ob_ngqty,ob_okqty,oi_checkqty,");
-                    sql.Append("ob_remark,ob_makecode,ob_status,ob_projectcode from OQCBatch left join product on ");
+                    sql.Append("ob_remark,ob_makecode,ob_status,ob_projectcode,ob_aqlcode,ob_maxngacceptqty from OQCBatch left join product on ");
                     sql.Append("pr_code=ob_prodcode left join oqcitems on oi_checkno =ob_checkno and oi_projectcode =ob_projectcode where ob_checkno='" + iCheckNo + "'");
                     Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                     //状态为UNCHECK或者CHECKING并且有抽样计划的才能操作
                     if (Form.Rows.Count > 0)
                     {
                         if (Form.Rows[0]["ob_projectcode"].ToString() == "" || !(Form.Rows[0]["ob_status"].ToString() != "UNCHECK" || Form.Rows[0]["ob_status"].ToString() != "CHECKING"))
-                        {
                             oErrorMessage = "状态为未检验或者送检中并且有抽样计划的才能操作";
-                        }
                     }
                     else
                     {

+ 71 - 75
UAS-MES/UAS-MES.csproj

@@ -22,7 +22,6 @@
     </SccAuxPath>
     <SccProvider>
     </SccProvider>
-    <PublishUrl>ftp://172.16.11.99/</PublishUrl>
     <PublishUrl>ftp://192.168.253.9/MESSetting/</PublishUrl>
     <Install>true</Install>
     <InstallFrom>Web</InstallFrom>
@@ -31,21 +30,18 @@
     <UpdateInterval>7</UpdateInterval>
     <UpdateIntervalUnits>Days</UpdateIntervalUnits>
     <UpdatePeriodically>false</UpdatePeriodically>
-    <UpdateRequired>false</UpdateRequired>
+    <UpdateRequired>true</UpdateRequired>
     <MapFileExtensions>true</MapFileExtensions>
-    <InstallUrl>http://172.16.11.99/</InstallUrl>
-    <InstallUrl>http://218.17.158.219:8888/publish.htm/</InstallUrl>
+    <InstallUrl>http://218.17.158.219:8888/</InstallUrl>
     <UpdateUrl>http://218.17.158.219:8888/publish.htm/</UpdateUrl>
     <TargetCulture>zh</TargetCulture>
     <ProductName>优软MES系统</ProductName>
     <PublisherName>深圳市优软科技有限公司</PublisherName>
     <SuiteName>优软MES系统</SuiteName>
-    <MinimumRequiredVersion>1.0.0.59</MinimumRequiredVersion>
+    <MinimumRequiredVersion>1.0.0.201</MinimumRequiredVersion>
     <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
     <WebPage>publish.htm</WebPage>
-    <ApplicationRevision>194</ApplicationRevision>
-    <OpenBrowserOnPublish>false</OpenBrowserOnPublish>
-    <ApplicationRevision>201</ApplicationRevision>
+    <ApplicationRevision>203</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <UseApplicationTrust>true</UseApplicationTrust>
     <CreateDesktopShortcut>true</CreateDesktopShortcut>
@@ -411,12 +407,6 @@
     <Compile Include="FunctionCode\Make\Make_ColorBoxLabelPrint.Designer.cs">
       <DependentUpon>Make_ColorBoxLabelPrint.cs</DependentUpon>
     </Compile>
-    <Compile Include="FunctionCode\Make\Make_ColorBoxLoadPrint.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="FunctionCode\Make\Make_ColorBoxLoadPrint.Designer.cs">
-      <DependentUpon>Make_ColorBoxLoadPrint.cs</DependentUpon>
-    </Compile>
     <Compile Include="FunctionCode\Make\Make_FuselageLabelPrint.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -605,6 +595,12 @@
     <Compile Include="FunctionCode\Make\Make_NewPallet.Designer.cs">
       <DependentUpon>Make_NewPallet.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_ColorBoxLoadPrint.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_ColorBoxLoadPrint.Designer.cs">
+      <DependentUpon>Make_ColorBoxLoadPrint.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_PalletWeigh.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -870,9 +866,6 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_ColorBoxLabelPrint.resx">
       <DependentUpon>Make_ColorBoxLabelPrint.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="FunctionCode\Make\Make_ColorBoxLoadPrint.resx">
-      <DependentUpon>Make_ColorBoxLoadPrint.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_FuselageLabelPrint.resx">
       <DependentUpon>Make_FuselageLabelPrint.cs</DependentUpon>
     </EmbeddedResource>
@@ -962,6 +955,9 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_NewPallet.resx">
       <DependentUpon>Make_NewPallet.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_ColorBoxLoadPrint.resx">
+      <DependentUpon>Make_ColorBoxLoadPrint.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_PalletWeigh.resx">
       <DependentUpon>Make_PalletWeigh.cs</DependentUpon>
     </EmbeddedResource>
@@ -1179,292 +1175,292 @@
   <ItemGroup>
     <PublishFile Include="BtSystem.Client">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="BtSystem.Client.Reader">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="BtSystem.Interfaces">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="BtSystem.Network">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="BtSystem.Reprint.Support">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="BtSystem.Strings">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="BtSystem.Support">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="BtSystem.UI">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevComponents.DotNetBar2">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevExpress.Data.v11.1">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevExpress.Printing.v11.1.Core">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevExpress.Utils.v11.1">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevExpress.Xpo.v11.1">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevExpress.XtraBars.v11.1">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevExpress.XtraEditors.v11.1">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevExpress.XtraGrid.v11.1">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevExpress.XtraLayout.v11.1">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Interop.BarTender">
       <Visible>False</Visible>
+      <PublishState>Include</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Include</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Interop.DriverAutomationLibrary">
       <Visible>False</Visible>
+      <PublishState>Include</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Include</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Interop.NetFwTypeLib">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Maestro.Interface">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Maestro.Library">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Seagull.Framework">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Seagull.Framework.Interop">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Seagull.Interop">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Seagull.Librarian.Core">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Seagull.Security">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Seagull.Security.Interop">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Seagull.XpoDataAccess">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
   </ItemGroup>

+ 1 - 1
UAS_WinForm.sln

@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 14
-VisualStudioVersion = 14.0.25420.1
+VisualStudioVersion = 14.0.24720.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS-MES接口", "MES接口\UAS-MES接口.csproj", "{A52EFE9C-838E-4E8C-BAAA-B1C226E57A81}"
 EndProject