Browse Source

修改抽样数据采集不良数BUG

章政 8 years ago
parent
commit
0258f7a215

+ 19 - 19
UAS-MES/FunctionCode/OQC/OQC_BatchResultJudge.Designer.cs

@@ -59,7 +59,7 @@
             this.ob_checkno = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_checkno = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.obd_outboxcode = 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.ms_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ob_batchqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ob_nowcheckqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_okqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_okqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.oi_checkqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.oi_checkqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_ngqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_ngqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
@@ -462,22 +462,22 @@
             this.ms_sncode.Tag = "NoAuto";
             this.ms_sncode.Tag = "NoAuto";
             this.ms_sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ms_sncode_KeyDown);
             this.ms_sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ms_sncode_KeyDown);
             // 
             // 
-            // 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(800, 328);
-            this.ob_batchqty.Margin = new System.Windows.Forms.Padding(4);
-            this.ob_batchqty.Name = "ob_batchqty";
-            this.ob_batchqty.Power = null;
-            this.ob_batchqty.Size = new System.Drawing.Size(195, 25);
-            this.ob_batchqty.Str = null;
-            this.ob_batchqty.Str1 = null;
-            this.ob_batchqty.Str2 = null;
-            this.ob_batchqty.TabIndex = 176;
-            this.ob_batchqty.Tag = "NoAuto";
+            // ob_nowcheckqty
+            // 
+            this.ob_nowcheckqty.AllPower = null;
+            this.ob_nowcheckqty.BackColor = System.Drawing.Color.White;
+            this.ob_nowcheckqty.Enabled = false;
+            this.ob_nowcheckqty.ID = null;
+            this.ob_nowcheckqty.Location = new System.Drawing.Point(800, 328);
+            this.ob_nowcheckqty.Margin = new System.Windows.Forms.Padding(4);
+            this.ob_nowcheckqty.Name = "ob_nowcheckqty";
+            this.ob_nowcheckqty.Power = null;
+            this.ob_nowcheckqty.Size = new System.Drawing.Size(195, 25);
+            this.ob_nowcheckqty.Str = null;
+            this.ob_nowcheckqty.Str1 = null;
+            this.ob_nowcheckqty.Str2 = null;
+            this.ob_nowcheckqty.TabIndex = 176;
+            this.ob_nowcheckqty.Tag = "";
             // 
             // 
             // ob_okqty
             // ob_okqty
             // 
             // 
@@ -730,7 +730,7 @@
             this.Controls.Add(this.obd_outboxcode_label);
             this.Controls.Add(this.obd_outboxcode_label);
             this.Controls.Add(this.ms_sncode);
             this.Controls.Add(this.ms_sncode);
             this.Controls.Add(this.ms_sncode_label);
             this.Controls.Add(this.ms_sncode_label);
-            this.Controls.Add(this.ob_batchqty);
+            this.Controls.Add(this.ob_nowcheckqty);
             this.Controls.Add(this.ob_okqty);
             this.Controls.Add(this.ob_okqty);
             this.Controls.Add(this.oi_checkqty);
             this.Controls.Add(this.oi_checkqty);
             this.Controls.Add(this.ob_ngqty);
             this.Controls.Add(this.ob_ngqty);
@@ -784,7 +784,7 @@
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_ngqty;
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_ngqty;
         private CustomControl.TextBoxWithIcon.EnterTextBox oi_checkqty;
         private CustomControl.TextBoxWithIcon.EnterTextBox oi_checkqty;
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_okqty;
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_okqty;
-        private CustomControl.TextBoxWithIcon.EnterTextBox ob_batchqty;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ob_nowcheckqty;
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_prodcode;
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_prodcode;
         private System.Windows.Forms.Label ob_prodcode_label;
         private System.Windows.Forms.Label ob_prodcode_label;
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_makecode;
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_makecode;

+ 3 - 3
UAS-MES/FunctionCode/OQC/OQC_BatchResultJudge.cs

@@ -132,8 +132,8 @@ namespace UAS_MES.OQC
             {
             {
                 sql.Clear();
                 sql.Clear();
                 sql.Append("select max(nvl(ad_maxngacceptqty,0)) maxngacceptqty from QUA_Aql,QUA_AqlDetail where al_id=ad_alid ");
                 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 ");
+                sql.Append("and al_statuscode='AUDITED'  and al_code ='" + ob_aqlcode.Text + "' and " + (ob_nowcheckqty.Text != "" ? ob_nowcheckqty.Text : "0") + " >= ad_minqty ");
+                sql.Append("and " + (ob_nowcheckqty.Text != "" ? ob_nowcheckqty.Text : "0") + "<=ad_maxqty ");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 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()))
                 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()))
                 {
                 {
@@ -263,7 +263,7 @@ namespace UAS_MES.OQC
                         {
                         {
                             for (int i = 0; i < dt.Rows.Count; i++)
                             for (int i = 0; i < dt.Rows.Count; i++)
                             {
                             {
-                                int batchqty = int.Parse(ob_batchqty.Text == "" ? "0" : ob_batchqty.Text);
+                                int batchqty = int.Parse(ob_nowcheckqty.Text == "" ? "0" : ob_nowcheckqty.Text);
                                 int minqty = int.Parse(dt.Rows[i]["ad_minqty"].ToString());
                                 int minqty = int.Parse(dt.Rows[i]["ad_minqty"].ToString());
                                 int maxqty = int.Parse(dt.Rows[i]["ad_maxqty"].ToString());
                                 int maxqty = int.Parse(dt.Rows[i]["ad_maxqty"].ToString());
                                 if (batchqty > minqty && batchqty <= maxqty)
                                 if (batchqty > minqty && batchqty <= maxqty)

+ 83 - 83
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.Designer.cs

@@ -29,7 +29,7 @@
         private void InitializeComponent()
         private void InitializeComponent()
         {
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OQC_SamplingDataCollection));
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OQC_SamplingDataCollection));
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
             this.ob_checkno_label = new System.Windows.Forms.Label();
             this.ob_checkno_label = new System.Windows.Forms.Label();
             this.obd_outboxcode_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.ms_sncode_label = new System.Windows.Forms.Label();
@@ -65,12 +65,19 @@
             this.ob_remark = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_remark = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.CheckTypeDGV = new UAS_MES.CustomControl.DataGrid_View.DataGridViewExpand();
             this.CheckTypeDGV = new UAS_MES.CustomControl.DataGrid_View.DataGridViewExpand();
+            this.choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.oi_itemcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.oi_ng = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.oi_leveldefect = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ois_remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ois_status = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ois_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ChooseedReject = new UAS_MES.CustomControl.ButtonUtil.ArrowRightButton();
             this.ChooseedReject = new UAS_MES.CustomControl.ButtonUtil.ArrowRightButton();
             this.WaitReject = new UAS_MES.CustomControl.ButtonUtil.ArrowLeftButton();
             this.WaitReject = new UAS_MES.CustomControl.ButtonUtil.ArrowLeftButton();
             this.oi_checkqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.oi_checkqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_okqty = 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_ngqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ob_batchqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ob_nowcheckqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.bccode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.bccode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.GetBatch = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.GetBatch = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.BatchPass = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.BatchPass = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
@@ -83,13 +90,6 @@
             this.obd_outboxcode_dgv = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.obd_outboxcode_dgv = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ob_makecode_dgv = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ob_makecode_dgv = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.obd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.obd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.oi_itemcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.oi_ng = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.oi_leveldefect = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ois_remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ois_status = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ois_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.ChoosedDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.ChoosedDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.WaitChooseDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.WaitChooseDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.CheckTypeDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.CheckTypeDGV)).BeginInit();
@@ -564,6 +564,62 @@
             this.CheckTypeDGV.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.CheckTypeDGV_DataError);
             this.CheckTypeDGV.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.CheckTypeDGV_DataError);
             this.CheckTypeDGV.RowHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.CheckTypeDGV_RowHeaderMouseClick);
             this.CheckTypeDGV.RowHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.CheckTypeDGV_RowHeaderMouseClick);
             // 
             // 
+            // choose
+            // 
+            this.choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.choose.DataPropertyName = "choose";
+            this.choose.HeaderText = "勾选";
+            this.choose.Name = "choose";
+            this.choose.Resizable = System.Windows.Forms.DataGridViewTriState.False;
+            this.choose.Width = 60;
+            // 
+            // oi_itemcode
+            // 
+            this.oi_itemcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.oi_itemcode.DataPropertyName = "oi_checkkind";
+            this.oi_itemcode.HeaderText = "检验类型";
+            this.oi_itemcode.Name = "oi_itemcode";
+            // 
+            // oi_ng
+            // 
+            this.oi_ng.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.oi_ng.DataPropertyName = "oi_count";
+            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+            this.oi_ng.DefaultCellStyle = dataGridViewCellStyle2;
+            this.oi_ng.HeaderText = "样本数量";
+            this.oi_ng.Name = "oi_ng";
+            this.oi_ng.Width = 96;
+            // 
+            // oi_leveldefect
+            // 
+            this.oi_leveldefect.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.oi_leveldefect.DataPropertyName = "oi_checkedcount";
+            this.oi_leveldefect.HeaderText = "已检数量";
+            this.oi_leveldefect.Name = "oi_leveldefect";
+            this.oi_leveldefect.Width = 96;
+            // 
+            // ois_remark
+            // 
+            this.ois_remark.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.ois_remark.HeaderText = "";
+            this.ois_remark.Name = "ois_remark";
+            this.ois_remark.Width = 23;
+            // 
+            // ois_status
+            // 
+            this.ois_status.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.ois_status.HeaderText = "";
+            this.ois_status.Name = "ois_status";
+            // 
+            // ois_id
+            // 
+            this.ois_id.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.ois_id.DataPropertyName = "ois_id";
+            this.ois_id.HeaderText = "";
+            this.ois_id.Name = "ois_id";
+            this.ois_id.Visible = false;
+            this.ois_id.Width = 80;
+            // 
             // ChooseedReject
             // ChooseedReject
             // 
             // 
             this.ChooseedReject.Image = ((System.Drawing.Image)(resources.GetObject("ChooseedReject.Image")));
             this.ChooseedReject.Image = ((System.Drawing.Image)(resources.GetObject("ChooseedReject.Image")));
@@ -637,22 +693,22 @@
             this.ob_ngqty.TabIndex = 186;
             this.ob_ngqty.TabIndex = 186;
             this.ob_ngqty.Tag = "NoAuto";
             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(1211, 52);
-            this.ob_batchqty.Margin = new System.Windows.Forms.Padding(4);
-            this.ob_batchqty.Name = "ob_batchqty";
-            this.ob_batchqty.Power = null;
-            this.ob_batchqty.Size = new System.Drawing.Size(195, 25);
-            this.ob_batchqty.Str = null;
-            this.ob_batchqty.Str1 = null;
-            this.ob_batchqty.Str2 = null;
-            this.ob_batchqty.TabIndex = 180;
-            this.ob_batchqty.Tag = "NoAuto";
+            // ob_nowcheckqty
+            // 
+            this.ob_nowcheckqty.AllPower = null;
+            this.ob_nowcheckqty.BackColor = System.Drawing.Color.White;
+            this.ob_nowcheckqty.Enabled = false;
+            this.ob_nowcheckqty.ID = null;
+            this.ob_nowcheckqty.Location = new System.Drawing.Point(1211, 52);
+            this.ob_nowcheckqty.Margin = new System.Windows.Forms.Padding(4);
+            this.ob_nowcheckqty.Name = "ob_nowcheckqty";
+            this.ob_nowcheckqty.Power = null;
+            this.ob_nowcheckqty.Size = new System.Drawing.Size(195, 25);
+            this.ob_nowcheckqty.Str = null;
+            this.ob_nowcheckqty.Str1 = null;
+            this.ob_nowcheckqty.Str2 = null;
+            this.ob_nowcheckqty.TabIndex = 180;
+            this.ob_nowcheckqty.Tag = "";
             // 
             // 
             // bccode
             // bccode
             // 
             // 
@@ -819,62 +875,6 @@
             this.obd_id.Name = "obd_id";
             this.obd_id.Name = "obd_id";
             this.obd_id.Visible = false;
             this.obd_id.Visible = false;
             // 
             // 
-            // choose
-            // 
-            this.choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.choose.DataPropertyName = "choose";
-            this.choose.HeaderText = "勾选";
-            this.choose.Name = "choose";
-            this.choose.Resizable = System.Windows.Forms.DataGridViewTriState.False;
-            this.choose.Width = 60;
-            // 
-            // oi_itemcode
-            // 
-            this.oi_itemcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.oi_itemcode.DataPropertyName = "oi_checkkind";
-            this.oi_itemcode.HeaderText = "检验类型";
-            this.oi_itemcode.Name = "oi_itemcode";
-            // 
-            // oi_ng
-            // 
-            this.oi_ng.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            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 = 96;
-            // 
-            // oi_leveldefect
-            // 
-            this.oi_leveldefect.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.oi_leveldefect.DataPropertyName = "oi_checkedcount";
-            this.oi_leveldefect.HeaderText = "已检数量";
-            this.oi_leveldefect.Name = "oi_leveldefect";
-            this.oi_leveldefect.Width = 96;
-            // 
-            // ois_remark
-            // 
-            this.ois_remark.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
-            this.ois_remark.HeaderText = "";
-            this.ois_remark.Name = "ois_remark";
-            this.ois_remark.Width = 23;
-            // 
-            // ois_status
-            // 
-            this.ois_status.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.ois_status.HeaderText = "";
-            this.ois_status.Name = "ois_status";
-            // 
-            // ois_id
-            // 
-            this.ois_id.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.ois_id.DataPropertyName = "ois_id";
-            this.ois_id.HeaderText = "";
-            this.ois_id.Name = "ois_id";
-            this.ois_id.Visible = false;
-            this.ois_id.Width = 80;
-            // 
             // OQC_SamplingDataCollection
             // OQC_SamplingDataCollection
             // 
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
@@ -909,7 +909,7 @@
             this.Controls.Add(this.label5);
             this.Controls.Add(this.label5);
             this.Controls.Add(this.ob_ngqty);
             this.Controls.Add(this.ob_ngqty);
             this.Controls.Add(this.label4);
             this.Controls.Add(this.label4);
-            this.Controls.Add(this.ob_batchqty);
+            this.Controls.Add(this.ob_nowcheckqty);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.bccode);
             this.Controls.Add(this.bccode);
             this.Controls.Add(this.bc_code_label);
             this.Controls.Add(this.bc_code_label);
@@ -950,7 +950,7 @@
         private CustomControl.ButtonUtil.NormalButton GetBatch;
         private CustomControl.ButtonUtil.NormalButton GetBatch;
         private CustomControl.TextBoxWithIcon.EnterTextBox bccode;
         private CustomControl.TextBoxWithIcon.EnterTextBox bccode;
         private System.Windows.Forms.Label bc_code_label;
         private System.Windows.Forms.Label bc_code_label;
-        private CustomControl.TextBoxWithIcon.EnterTextBox ob_batchqty;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ob_nowcheckqty;
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Label label1;
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_ngqty;
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_ngqty;
         private System.Windows.Forms.Label label4;
         private System.Windows.Forms.Label label4;

+ 9 - 3
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.cs

@@ -54,6 +54,7 @@ namespace UAS_MES.OQC
                 if (ErrorMessage == "")
                 if (ErrorMessage == "")
                 {
                 {
                     BaseUtil.SetFormValue(Controls, dt[0]);
                     BaseUtil.SetFormValue(Controls, dt[0]);
+                    oi_checkqty.Text = dh.getFieldDataByCondition("oqcitems", "max(oi_checkqty)", "oi_checkno='"+ob_checkno.Text+"'").ToString();
                     if (ob_aqlcode.Text == "")
                     if (ob_aqlcode.Text == "")
                     {
                     {
 
 
@@ -197,6 +198,7 @@ namespace UAS_MES.OQC
                         //将布尔值转换为0,-1
                         //将布尔值转换为0,-1
                         if (TempForCheckType.Rows[i]["ois_id"].ToString() != "" && TempForCheckType.Rows[i]["ois_id"].ToString() != "0")
                         if (TempForCheckType.Rows[i]["ois_id"].ToString() != "" && TempForCheckType.Rows[i]["ois_id"].ToString() != "0")
                         {
                         {
+
                             ois_ifng_update.Add(TempForCheckType.Rows[i]["oi_ng"].ToString());
                             ois_ifng_update.Add(TempForCheckType.Rows[i]["oi_ng"].ToString());
                             ois_defectlevel_update.Add(TempForCheckType.Rows[i]["oi_leveldefect"].ToString());
                             ois_defectlevel_update.Add(TempForCheckType.Rows[i]["oi_leveldefect"].ToString());
                             ois_remark_update.Add(TempForCheckType.Rows[i]["ois_remark"].ToString());
                             ois_remark_update.Add(TempForCheckType.Rows[i]["ois_remark"].ToString());
@@ -264,7 +266,7 @@ namespace UAS_MES.OQC
                             dh.BatchInsert(sql.GetString(), new string[] { "a", "b" }, bc_code.ToArray(), bc_name.ToArray());
                             dh.BatchInsert(sql.GetString(), new string[] { "a", "b" }, bc_code.ToArray(), bc_name.ToArray());
                         }
                         }
                         //更新项目编号中的抽检数、不合格数,根据采样项目记录
                         //更新项目编号中的抽检数、不合格数,根据采样项目记录
-                        sql.Clear();
+                        sql.Clear();    
                         sql.Append("UPDATE OQCItems SET (oi_ngqty,oi_checkqty)=(select nvl(sum(case when ");
                         sql.Append("UPDATE OQCItems SET (oi_ngqty,oi_checkqty)=(select nvl(sum(case when ");
                         sql.Append("nvl(ois_ifng,0)=0 then 0 else 1 end),0) ,count(1) from OQCItemSamples where ois_checkno=oi_checkno ");
                         sql.Append("nvl(ois_ifng,0)=0 then 0 else 1 end),0) ,count(1) from OQCItemSamples where ois_checkno=oi_checkno ");
                         sql.Append("and ois_itemcode=oi_itemcode)where oi_checkno ='" + ob_checkno.Text + "' and oi_projectcode ='" + ob_projectcode.Text + "'");
                         sql.Append("and ois_itemcode=oi_itemcode)where oi_checkno ='" + ob_checkno.Text + "' and oi_projectcode ='" + ob_projectcode.Text + "'");
@@ -272,7 +274,11 @@ namespace UAS_MES.OQC
                         //更新检验状态,如果是待检验的更新为检验中
                         //更新检验状态,如果是待检验的更新为检验中
                         dh.ExecuteSql("update OQCBatch set ob_status='CHECKING' where ob_checkno='" + ob_checkno.Text + "' and ob_status='UNCHECK'", "update");
                         dh.ExecuteSql("update OQCBatch set ob_status='CHECKING' where ob_checkno='" + ob_checkno.Text + "' and ob_status='UNCHECK'", "update");
                         //更新批次中的合格数不合格数:用抽检批检验项目表获取最大的抽检数和不合格数
                         //更新批次中的合格数不合格数:用抽检批检验项目表获取最大的抽检数和不合格数
-                        dh.ExecuteSql("update OQCBATCH set (ob_ngqty,ob_okqty)=(select nvl(max(oi_ngqty),0),max(oi_checkqty)-nvl(max(oi_ngqty),0) from OQCItems where oi_checkno ='" + ob_checkno.Text + "') where ob_checkno ='" + ob_checkno.Text + "'", "update");
+                        sql.Clear();
+                        sql.Append("select count(1)from (select ois_sncode from OQCITEMSAMPLES where ");
+                        sql.Append("ois_checkno = '"+ob_checkno.Text+"' and ois_ifng = 1 group by ois_sncode)");
+                        string ngqty = (dh.ExecuteSql(sql.GetString(),"select") as DataTable).Rows[0][0].ToString();
+                        dh.ExecuteSql("update OQCBATCH set ob_ngqty='"+ngqty+"',ob_okqty=(select max(oi_checkqty)-'"+ngqty+"' from OQCItems where oi_checkno ='" + ob_checkno.Text + "') where ob_checkno ='" + ob_checkno.Text + "'", "update");
                         OperateResult.AppendText(">>序列号 " + sncode.Text + "操作成功\n", Color.Green);
                         OperateResult.AppendText(">>序列号 " + sncode.Text + "操作成功\n", Color.Green);
                         GetBatch.PerformClick();
                         GetBatch.PerformClick();
                         ChoosedDGV.DataSource = null;
                         ChoosedDGV.DataSource = null;
@@ -322,7 +328,7 @@ namespace UAS_MES.OQC
                     {
                     {
                         for (int i = 0; i < dt.Rows.Count; i++)
                         for (int i = 0; i < dt.Rows.Count; i++)
                         {
                         {
-                            int batchqty = int.Parse(ob_batchqty.Text == "" ? "0" : ob_batchqty.Text);
+                            int batchqty = int.Parse(ob_nowcheckqty.Text == "" ? "0" : ob_nowcheckqty.Text);
                             int minqty = int.Parse(dt.Rows[i]["ad_minqty"].ToString());
                             int minqty = int.Parse(dt.Rows[i]["ad_minqty"].ToString());
                             int maxqty = int.Parse(dt.Rows[i]["ad_maxqty"].ToString());
                             int maxqty = int.Parse(dt.Rows[i]["ad_maxqty"].ToString());
                             if (batchqty > minqty && batchqty <= maxqty)
                             if (batchqty > minqty && batchqty <= maxqty)

+ 39 - 0
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.resx

@@ -258,6 +258,24 @@
   <metadata name="bc_name1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <metadata name="bc_name1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
     <value>True</value>
   </metadata>
   </metadata>
+  <metadata name="or_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bc_code1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bc_name1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bg_code.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bg_name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
     <value>True</value>
   </metadata>
   </metadata>
@@ -288,6 +306,27 @@
   <metadata name="ois_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <metadata name="ois_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
     <value>True</value>
   </metadata>
   </metadata>
+  <metadata name="choose.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="oi_itemcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="oi_ng.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="oi_leveldefect.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ois_remark.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ois_status.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ois_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <data name="ChooseedReject.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
   <data name="ChooseedReject.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
     <value>
         iVBORw0KGgoAAAANSUhEUgAAACUAAAAXCAYAAACMLIalAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
         iVBORw0KGgoAAAANSUhEUgAAACUAAAAXCAYAAACMLIalAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6

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

@@ -199,12 +199,12 @@ namespace UAS_MES.PublicMethod
         /// <param name="iSourceCode"></param>
         /// <param name="iSourceCode"></param>
         /// <param name="oErrMessage"></param>
         /// <param name="oErrMessage"></param>
         /// <returns></returns>
         /// <returns></returns>
-        public static bool CheckCurrentStep(string iSnCode, string iMakeCode, string iSourceCode, out string oErrMessage)
+        public static bool CheckCurrentStep(string iSnCode, string iMakeCode, string iSourceCode,string iUserCode, out string oErrMessage)
         {
         {
             oErrMessage = "";
             oErrMessage = "";
-            string[] param = new string[] { iSnCode, iMakeCode, iSourceCode, oErrMessage };
+            string[] param = new string[] { iSnCode, iMakeCode, iSourceCode, iUserCode, oErrMessage };
             dh.CallProcedure("CS_CHECKSTEPSNANDMACODE", ref param);
             dh.CallProcedure("CS_CHECKSTEPSNANDMACODE", ref param);
-            oErrMessage = param[3];
+            oErrMessage = param[4];
             if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
             if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
                 return true;
                 return true;
             else
             else
@@ -780,7 +780,7 @@ namespace UAS_MES.PublicMethod
                     break;
                     break;
                 case "OQCDATACOLLECTION":
                 case "OQCDATACOLLECTION":
                     sql.Clear();
                     sql.Clear();
-                    sql.Append("select ob_checkno,ob_makecode,ob_prodcode,ob_batchqty,pr_detail,ob_ngqty,ob_okqty,oi_checkqty,");
+                    sql.Append("select ob_checkno,ob_makecode,ob_prodcode,ob_nowcheckqty,pr_detail,ob_ngqty,ob_okqty,");
                     sql.Append("ob_remark,ob_makecode,ob_status,ob_projectcode,ob_aqlcode,ob_maxngacceptqty 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 + "'");
                     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");
                     Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
@@ -804,7 +804,7 @@ namespace UAS_MES.PublicMethod
                     //查询Form数据
                     //查询Form数据
                     sql.Clear();
                     sql.Clear();
                     sql.Append("select ob_id,ob_aqlcode,ob_makecode,ob_status,ob_prodcode,(select max(oi_checkqty)from OQCItems where oi_checkno='" + iCheckNo + "') oi_checkqty,");
                     sql.Append("select ob_id,ob_aqlcode,ob_makecode,ob_status,ob_prodcode,(select max(oi_checkqty)from OQCItems where oi_checkno='" + iCheckNo + "') oi_checkqty,");
-                    sql.Append("ob_batchqty,nvl(ob_okqty,0) ob_okqty,nvl(ob_ngqty,0) ob_ngqty,ob_maxngacceptqty,ob_source,ob_checkno,ob_result from OQCBatch where ob_checkno='" + iCheckNo + "'");
+                    sql.Append("ob_nowcheckqty,nvl(ob_okqty,0) ob_okqty,nvl(ob_ngqty,0) ob_ngqty,ob_maxngacceptqty,ob_source,ob_checkno,ob_result from OQCBatch where ob_checkno='" + iCheckNo + "'");
                     Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                     Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                     if (Form.Rows.Count == 0)
                     if (Form.Rows.Count == 0)
                     {
                     {