Browse Source

返工抽检批次必须所有的下一道都是OQC

章政 8 years ago
parent
commit
3211e0cdfc

+ 17 - 0
UAS-MES/FunctionCode/OQC/OQC_PlanMaintain.cs

@@ -113,6 +113,23 @@ namespace UAS_MES.OQC
         {
             if (ob_status.Text == "待检验")
             {
+                if (ob_source.Text == "返工" && ob_reworkcode.Text != "")
+                {
+                    dt = (DataTable)dh.ExecuteSql("select re_id from rework where re_code='" + ob_reworkcode.Text + "' and nvl(re_nullngfinsh,0)<>0", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        sql.Clear();
+                        sql.Append("select count(1),wm_concat(obd_sncode) sn from oqcbatchdetail left join makeserial ");
+                        sql.Append("on ms_sncode=obd_sncode and  ms_reworkcheckno=obd_checkno where obd_checkno");
+                        sql.Append("='" + ob_checkno.Text + "'and ms_nextstepcode<>'" + User.CurrentStepCode + "' and rownum<20");
+                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        if (dt.Rows[0]["sn"].ToString() != "")
+                        {
+                            OperateResult.AppendText(">>序列号" + dt.Rows[0]["sn"].ToString() + "下一道不是OQC工序", Color.Red);
+                            return;
+                        }
+                    }
+                }
                 //新增的数据
                 List<string> oi_id = new List<string>();
                 List<string> ci_kind = new List<string>();

+ 29 - 0
UAS-MES/FunctionCode/OQC/OQC_PlanMaintain.designer.cs

@@ -66,6 +66,8 @@
             this.ob_checkno = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ms_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ChooseAll = new UAS_MES.CustomControl.ButtonUtil.ChooseAllButton();
+            this.ob_reworkcode = new System.Windows.Forms.Label();
+            this.ob_source = new System.Windows.Forms.Label();
             this.panel2.SuspendLayout();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.CheckTypeDGV)).BeginInit();
@@ -436,6 +438,7 @@
             this.ci_id,
             this.ci_kind,
             this.oi_sampleqty});
+            this.CheckTypeDGV.EnableContentClick = true;
             this.CheckTypeDGV.Location = new System.Drawing.Point(33, 315);
             this.CheckTypeDGV.Margin = new System.Windows.Forms.Padding(4);
             this.CheckTypeDGV.Name = "CheckTypeDGV";
@@ -583,11 +586,35 @@
             this.ChooseAll.Text = "全选";
             this.ChooseAll.UseVisualStyleBackColor = true;
             // 
+            // ob_reworkcode
+            // 
+            this.ob_reworkcode.AutoSize = true;
+            this.ob_reworkcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_reworkcode.Location = new System.Drawing.Point(1062, 233);
+            this.ob_reworkcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_reworkcode.Name = "ob_reworkcode";
+            this.ob_reworkcode.Size = new System.Drawing.Size(0, 27);
+            this.ob_reworkcode.TabIndex = 195;
+            this.ob_reworkcode.Visible = false;
+            // 
+            // ob_source
+            // 
+            this.ob_source.AutoSize = true;
+            this.ob_source.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_source.Location = new System.Drawing.Point(1062, 198);
+            this.ob_source.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_source.Name = "ob_source";
+            this.ob_source.Size = new System.Drawing.Size(0, 27);
+            this.ob_source.TabIndex = 196;
+            this.ob_source.Visible = false;
+            // 
             // OQC_PlanMaintain
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1363, 781);
+            this.Controls.Add(this.ob_source);
+            this.Controls.Add(this.ob_reworkcode);
             this.Controls.Add(this.ChooseAll);
             this.Controls.Add(this.panel1);
             this.Controls.Add(this.pr_detail);
@@ -668,5 +695,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn ci_id;
         private System.Windows.Forms.DataGridViewTextBoxColumn ci_kind;
         private System.Windows.Forms.DataGridViewTextBoxColumn oi_sampleqty;
+        private System.Windows.Forms.Label ob_reworkcode;
+        private System.Windows.Forms.Label ob_source;
     }
 }

+ 1 - 1
UAS-MES/PublicMethod/LogicHandler.cs

@@ -430,7 +430,7 @@ namespace UAS_MES.PublicMethod
                     break;
                 case "OQCPLANMAINTAIN":
                     sql.Clear();
-                    sql.Append("select ob_prodcode,ob_maxngacceptqty,ob_id,ob_checkno,ob_projectcode,ob_nowcheckqty,ob_source,ob_remark,");
+                    sql.Append("select ob_reworkcode,ob_prodcode,ob_maxngacceptqty,ob_id,ob_checkno,ob_projectcode,ob_nowcheckqty,ob_source,ob_remark,");
                     sql.Append("ob_status,pr_id,pr_detail,pr_kind,pr_manutype,pr_qualmethod,nvl(ob_aqlcode,pr_aql)ob_aqlcode from OQCBatch left join product on ");
                     sql.Append("pr_code=ob_prodcode where ob_checkno='" + iCheckNo + "'");
                     Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");