Przeglądaj źródła

不同工单批次不允许拆解

章政 8 lat temu
rodzic
commit
42af22845f

+ 34 - 7
UAS-MES/FunctionCode/OQC/OQC_CheckNoSplit.Designer.cs

@@ -58,6 +58,8 @@
             this.pr_detail = new System.Windows.Forms.Label();
             this.SplitCheckNo = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.ChooseAll = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.ob_makecode = new System.Windows.Forms.Label();
+            this.ob_makecode_label = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.OutBoxDGV)).BeginInit();
             this.groupBoxWithBorder2.SuspendLayout();
             this.SuspendLayout();
@@ -84,7 +86,7 @@
             // 
             this.ob_checkno_label.AutoSize = true;
             this.ob_checkno_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_checkno_label.Location = new System.Drawing.Point(45, 29);
+            this.ob_checkno_label.Location = new System.Drawing.Point(45, 28);
             this.ob_checkno_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ob_checkno_label.Name = "ob_checkno_label";
             this.ob_checkno_label.Size = new System.Drawing.Size(72, 27);
@@ -113,7 +115,7 @@
             // 
             this.obd_outboxcode_label.AutoSize = true;
             this.obd_outboxcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.obd_outboxcode_label.Location = new System.Drawing.Point(45, 77);
+            this.obd_outboxcode_label.Location = new System.Drawing.Point(45, 76);
             this.obd_outboxcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.obd_outboxcode_label.Name = "obd_outboxcode_label";
             this.obd_outboxcode_label.Size = new System.Drawing.Size(52, 27);
@@ -142,7 +144,7 @@
             // 
             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(45, 121);
+            this.ms_sncode_label.Location = new System.Drawing.Point(45, 120);
             this.ms_sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_sncode_label.Name = "ms_sncode_label";
             this.ms_sncode_label.Size = new System.Drawing.Size(72, 27);
@@ -153,7 +155,7 @@
             // 
             this.ob_prodcode_label.AutoSize = true;
             this.ob_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_prodcode_label.Location = new System.Drawing.Point(45, 166);
+            this.ob_prodcode_label.Location = new System.Drawing.Point(383, 171);
             this.ob_prodcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ob_prodcode_label.Name = "ob_prodcode_label";
             this.ob_prodcode_label.Size = new System.Drawing.Size(92, 27);
@@ -164,7 +166,7 @@
             // 
             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(384, 166);
+            this.pr_detail_label.Location = new System.Drawing.Point(708, 171);
             this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
@@ -175,7 +177,7 @@
             // 
             this.ob_prodcode.AutoSize = true;
             this.ob_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_prodcode.Location = new System.Drawing.Point(153, 166);
+            this.ob_prodcode.Location = new System.Drawing.Point(491, 171);
             this.ob_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ob_prodcode.Name = "ob_prodcode";
             this.ob_prodcode.Size = new System.Drawing.Size(0, 27);
@@ -369,6 +371,8 @@
             // groupBoxWithBorder2
             // 
             this.groupBoxWithBorder2.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder2.Controls.Add(this.ob_makecode);
+            this.groupBoxWithBorder2.Controls.Add(this.ob_makecode_label);
             this.groupBoxWithBorder2.Controls.Add(this.pr_detail);
             this.groupBoxWithBorder2.Controls.Add(this.obd_outboxcode);
             this.groupBoxWithBorder2.Controls.Add(this.ob_checkno_label);
@@ -395,7 +399,7 @@
             // 
             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(484, 166);
+            this.pr_detail.Location = new System.Drawing.Point(818, 171);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 27);
@@ -441,6 +445,27 @@
             this.ChooseAll.UseVisualStyleBackColor = true;
             this.ChooseAll.Click += new System.EventHandler(this.ChooseAll_Click);
             // 
+            // ob_makecode
+            // 
+            this.ob_makecode.AutoSize = true;
+            this.ob_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_makecode.Location = new System.Drawing.Point(148, 171);
+            this.ob_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_makecode.Name = "ob_makecode";
+            this.ob_makecode.Size = new System.Drawing.Size(0, 27);
+            this.ob_makecode.TabIndex = 230;
+            // 
+            // ob_makecode_label
+            // 
+            this.ob_makecode_label.AutoSize = true;
+            this.ob_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_makecode_label.Location = new System.Drawing.Point(45, 171);
+            this.ob_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_makecode_label.Name = "ob_makecode_label";
+            this.ob_makecode_label.Size = new System.Drawing.Size(72, 27);
+            this.ob_makecode_label.TabIndex = 229;
+            this.ob_makecode_label.Text = "工单号";
+            // 
             // OQC_CheckNoSplit
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
@@ -505,5 +530,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn obd_builddate;
         private System.Windows.Forms.Label pr_detail;
         private CustomControl.ButtonUtil.NormalButton ChooseAll;
+        private System.Windows.Forms.Label ob_makecode;
+        private System.Windows.Forms.Label ob_makecode_label;
     }
 }

+ 13 - 3
UAS-MES/FunctionCode/OQC/OQC_CheckNoSplit.cs

@@ -79,8 +79,18 @@ namespace UAS_MES.OQC
                     {
                         List<string> sqls = new List<string>();
                         //插入新批次的主表
-                        string ob_id = dh.getFieldDataByCondition("oqcbatch", "ob_id", "ob_checkno='" + new_checkno.Text + "'").ToString();
-                        if (ob_id == "")
+                        dt = (DataTable)dh.ExecuteSql("select ob_id,ob_makecode from oqcbatch where ob_checkno='" + new_checkno.Text + "'", "select");
+                        string ob_id = "";
+                        if (dt.Rows.Count > 0)
+                        {
+                            ob_id = dt.Rows[0]["ob_id"].ToString();
+                            if (ob_makecode.Text != dt.Rows[0]["ob_makecode"].ToString())
+                            {
+                                OperateResult.AppendText(">>原批次工单" + ob_makecode.Text + ",新批次工单" + dt.Rows[0]["ob_makecode"].ToString() + ",不允许拆批\n", Color.Red);
+                                return;
+                            }
+                        }
+                        if (dt.Rows.Count == 0)
                         {
                             ob_id = dh.GetSEQ("oqcbatch_seq");
                             sql.Clear();
@@ -107,8 +117,8 @@ namespace UAS_MES.OQC
                         dh.ExecuteSQLTran(sqls.ToArray());
                         LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, "抽检批拆解", "拆解成功,原批次" + ob_checkno.Text + "新批次:" + new_checkno.Text, "", ob_checkno.Text);
                         DeleteSn.Clear();
+                        OperateResult.AppendText(">>批次" + ob_checkno.Text + ",成功拆解至批次" + new_checkno.Text + "\n ", Color.Green);
                         GetBatch.PerformClick();
-                        OperateResult.AppendText(">>批次" + ob_checkno.Text + "拆解成功\n ", Color.Green);
                     }
                     else OperateResult.AppendText(">>批次状态必须是待检验\n", Color.Red);
                 }