Преглед изворни кода

处理拦截工序BUG,修改测试值范围限制

callm пре 1 недеља
родитељ
комит
8517b7cb44

+ 20 - 4
UAS_MES_XMW/FunctionCode/Make/Make_MakeDown.Designer.cs

@@ -54,6 +54,7 @@
             this.md_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_detail = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.MD_DOWNMAN = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.label2 = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.LabelDataGridView)).BeginInit();
             this.SuspendLayout();
             // 
@@ -113,7 +114,7 @@
             this.pr_detail,
             this.MD_DOWNMAN});
             this.LabelDataGridView.Location = new System.Drawing.Point(46, 388);
-            this.LabelDataGridView.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.LabelDataGridView.Margin = new System.Windows.Forms.Padding(6);
             this.LabelDataGridView.Name = "LabelDataGridView";
             this.LabelDataGridView.RowHeadersVisible = false;
             this.LabelDataGridView.RowHeadersWidth = 82;
@@ -155,7 +156,7 @@
             // mdcode
             // 
             this.mdcode.Location = new System.Drawing.Point(192, 20);
-            this.mdcode.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.mdcode.Margin = new System.Windows.Forms.Padding(6);
             this.mdcode.Name = "mdcode";
             this.mdcode.ReadOnly = true;
             this.mdcode.Size = new System.Drawing.Size(196, 35);
@@ -239,6 +240,7 @@
             this.cd_stepcode.Caller = null;
             this.cd_stepcode.Condition = null;
             this.cd_stepcode.DBTitle = "回流工序";
+            this.cd_stepcode.Enabled = false;
             this.cd_stepcode.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.cd_stepcode.FormName = null;
             this.cd_stepcode.Location = new System.Drawing.Point(688, 86);
@@ -360,11 +362,24 @@
             this.MD_DOWNMAN.Name = "MD_DOWNMAN";
             this.MD_DOWNMAN.Width = 2;
             // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label2.ForeColor = System.Drawing.Color.Red;
+            this.label2.Location = new System.Drawing.Point(1013, 86);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(466, 41);
+            this.label2.TabIndex = 212;
+            this.label2.Text = "先输入序列号,再选择拦截工序";
+            // 
             // Make_MakeDown
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1624, 912);
+            this.Controls.Add(this.label2);
             this.Controls.Add(this.cd_stepcode);
             this.Controls.Add(this.st_rstepcode_label);
             this.Controls.Add(this.ma_craftcode_label);
@@ -382,14 +397,14 @@
             this.Controls.Add(this.md_code_label);
             this.Controls.Add(this.LabelDataGridView);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.Margin = new System.Windows.Forms.Padding(6);
             this.Name = "Make_MakeDown";
             this.Tag = "Make!MakeDown";
             this.Text = "Make_MakeDown";
             this.Load += new System.EventHandler(this.Make_MakeDown_Load);
             this.SizeChanged += new System.EventHandler(this.Make_MakeDown_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.LabelDataGridView)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }
@@ -421,5 +436,6 @@
         private System.Windows.Forms.Label st_rstepcode_label;
         private System.Windows.Forms.Label ma_craftcode_label;
         private CustomControl.TextBoxWithIcon.SearchTextBox cr_code;
+        private System.Windows.Forms.Label label2;
     }
 }

+ 1 - 0
UAS_MES_XMW/FunctionCode/Make/Make_MakeDown.cs

@@ -135,6 +135,7 @@ namespace UAS_MES_NEW.Make
                                     //更新序列号状态为下地
                                     dh.UpdateByCondition("makeserial", "ms_downstatus='-1'", "ms_id='" + ms_id + "'");
                                     OperateResult.AppendText(">>>序列号" + sn_code.Text + "下地成功\n", Color.Green);
+                                    cd_stepcode.Enabled = true;
                                     //更新数量
                                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "下地操作", "序列号" + sn_code.Text + "下地成功", sn_code.Text, "");
                                     count++;

+ 27 - 5
UAS_MES_XMW/FunctionCode/Make/Make_TestCollection_Param.Designer.cs

@@ -108,6 +108,8 @@ namespace UAS_MES_NEW.Make
             this.pid_detno = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pid_item = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pid_value = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pid_minvalue = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pid_maxvalue = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.BadInfSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.ParamDataGridView)).BeginInit();
@@ -890,7 +892,7 @@ namespace UAS_MES_NEW.Make
             this.bc_remark.Multiline = true;
             this.bc_remark.Name = "bc_remark";
             this.bc_remark.Power = null;
-            this.bc_remark.Size = new System.Drawing.Size(344, 120);
+            this.bc_remark.Size = new System.Drawing.Size(271, 120);
             this.bc_remark.Str = null;
             this.bc_remark.Str1 = null;
             this.bc_remark.Str2 = null;
@@ -977,12 +979,14 @@ namespace UAS_MES_NEW.Make
             this.ParamDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.pid_detno,
             this.pid_item,
-            this.pid_value});
-            this.ParamDataGridView.Location = new System.Drawing.Point(1093, 264);
+            this.pid_value,
+            this.pid_minvalue,
+            this.pid_maxvalue});
+            this.ParamDataGridView.Location = new System.Drawing.Point(1020, 264);
             this.ParamDataGridView.Name = "ParamDataGridView";
             this.ParamDataGridView.RowHeadersWidth = 82;
             this.ParamDataGridView.RowTemplate.Height = 37;
-            this.ParamDataGridView.Size = new System.Drawing.Size(609, 218);
+            this.ParamDataGridView.Size = new System.Drawing.Size(682, 218);
             this.ParamDataGridView.TabIndex = 203;
             // 
             // pid_detno
@@ -1009,7 +1013,23 @@ namespace UAS_MES_NEW.Make
             this.pid_value.HeaderText = "参数值";
             this.pid_value.MinimumWidth = 10;
             this.pid_value.Name = "pid_value";
-            this.pid_value.Width = 200;
+            this.pid_value.Width = 141;
+            // 
+            // pid_minvalue
+            // 
+            this.pid_minvalue.DataPropertyName = "pid_minvalue";
+            this.pid_minvalue.HeaderText = "最小值";
+            this.pid_minvalue.MinimumWidth = 10;
+            this.pid_minvalue.Name = "pid_minvalue";
+            this.pid_minvalue.Width = 130;
+            // 
+            // pid_maxvalue
+            // 
+            this.pid_maxvalue.DataPropertyName = "pid_maxvalue";
+            this.pid_maxvalue.HeaderText = "最大值";
+            this.pid_maxvalue.MinimumWidth = 10;
+            this.pid_maxvalue.Name = "pid_maxvalue";
+            this.pid_maxvalue.Width = 130;
             // 
             // Make_TestCollection_Param
             // 
@@ -1161,5 +1181,7 @@ namespace UAS_MES_NEW.Make
         private System.Windows.Forms.DataGridViewTextBoxColumn pid_detno;
         private System.Windows.Forms.DataGridViewTextBoxColumn pid_item;
         private System.Windows.Forms.DataGridViewTextBoxColumn pid_value;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pid_minvalue;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pid_maxvalue;
     }
 }

+ 28 - 10
UAS_MES_XMW/FunctionCode/Make/Make_TestCollection_Param.cs

@@ -49,10 +49,6 @@ namespace UAS_MES_NEW.Make
 
         DataTable Dbfind;
 
-        LabelFormatDocument format;
-
-        Engine engine;
-
         bool EnablePrint;
 
         public Make_TestCollection_Param()
@@ -89,9 +85,6 @@ namespace UAS_MES_NEW.Make
                 OperateResult.AppendText("已安装BarTender\n");
                 try
                 {
-                    engine = new Engine();
-                    engine.Start();
-                    format = engine.Documents.Open(Application.StartupPath + "/BadCode.btw");
                     EnablePrint = true;
                 }
                 catch (Exception)
@@ -395,6 +388,29 @@ namespace UAS_MES_NEW.Make
                     }
                     else
                     {
+                        for (int i = 0; i < ParamDataGridView.Rows.Count; i++)
+                        {
+                            double maxvalue = 1000000;
+                            double minvalue = 0;
+                            double value = 0;
+                            if (ParamDataGridView.Rows[i].Cells["pid_maxvalue"].Value != null && ParamDataGridView.Rows[i].Cells["pid_maxvalue"].Value.ToString() != "")
+                            {
+                                maxvalue = double.Parse(ParamDataGridView.Rows[i].Cells["pid_maxvalue"].Value.ToString());
+                            }
+                            if (ParamDataGridView.Rows[i].Cells["pid_minvalue"].Value != null && ParamDataGridView.Rows[i].Cells["pid_minvalue"].Value.ToString() != "")
+                            {
+                                minvalue = double.Parse(ParamDataGridView.Rows[i].Cells["pid_minvalue"].Value.ToString());
+                            }
+                            if (ParamDataGridView.Rows[i].Cells["pid_value"].Value != null)
+                            {
+                                value = double.Parse(ParamDataGridView.Rows[i].Cells["pid_value"].Value.ToString());
+                            }
+                            if (!(value >= minvalue && value <= maxvalue))
+                            {
+                                OperateResult.AppendText(">>测试项" + ParamDataGridView.Rows[i].Cells["pid_item"].Value + "测试值不在范围内\n", Color.Red, ms_sncode);
+                                return;
+                            }
+                        }
                         //良品信息采集
                         if (LogicHandler.SetStepResult1(ma_code.Text, User.UserSourceCode, ms_sncode.Text, "良品采集", "检测合格", User.UserCode, out ErrorMessage))
                         {
@@ -404,8 +420,10 @@ namespace UAS_MES_NEW.Make
                             }
                             for (int i = 0; i < ParamDataGridView.Rows.Count; i++)
                             {
-                                dh.ExecuteSql("insert into STEPTESTDETAIL(std_id,STD_SN, STD_MAKECODE, STD_CLASS, STD_ACTUALVALUE)" +
-                                    " values(STEPTESTDETAIL_seq.nextval,'" + ms_sncode.Text + "','" + ma_code.Text + "','" + ParamDataGridView.Rows[i].Cells["pid_item"].Value + "','" + ParamDataGridView.Rows[i].Cells["pid_value"].Value + "')", "insert");
+                                dh.ExecuteSql("insert into STEPTESTDETAIL(std_id,STD_SN,STD_MAXVALUE, STD_MINVALUE, STD_MAKECODE, STD_CLASS, STD_ACTUALVALUE,STD_RESCODE, STD_STEPCODE)" +
+                                    " values(STEPTESTDETAIL_seq.nextval,'" + ms_sncode.Text + "','" + ParamDataGridView.Rows[i].Cells["pid_maxvalue"].Value + "','" + ParamDataGridView.Rows[i].Cells["pid_minvalue"].Value + "'," +
+                                    "'" + ma_code.Text + "','" + ParamDataGridView.Rows[i].Cells["pid_item"].Value + "','" + ParamDataGridView.Rows[i].Cells["pid_value"].Value + "'" +
+                                    ",'" + User.UserSourceCode + "','" + User.CurrentStepCode + "')", "insert");
                                 ParamDataGridView.Rows[i].Cells["pid_value"].Value = null;
                             }
                             //提示正确返回时传递的信息
@@ -782,7 +800,7 @@ namespace UAS_MES_NEW.Make
         private void ma_prodcode_TextChanged(object sender, EventArgs e)
         {
             LoadBadGroupData();
-            DataTable par = (DataTable)dh.ExecuteSql("select PID_DETNO, PID_ITEM from productitem left join productitemdetail on pi_id=pid_piid where pi_prodcode='" + ma_prodcode.Text + "'", "select");
+            DataTable par = (DataTable)dh.ExecuteSql("select PID_DETNO, PID_ITEM,pid_maxvalue,pid_minvalue from productitem left join productitemdetail on pi_id=pid_piid where pi_prodcode='" + ma_prodcode.Text + "'", "select");
             BaseUtil.FillDgvWithDataTable(ParamDataGridView, par);
         }
 

+ 7 - 1
UAS_MES_XMW/FunctionCode/Make/Make_TestCollection_Param.resx

@@ -259,7 +259,7 @@
         RudN65tdA8sHzg46DF645Xrr8m2v29fvrLwzMBQydHc4cnjkLvvu5L2key/vZ9yff7DpIfph4SOpR+WP
         lR7X/aj3Y+uI5ciZUdfRvidBTx6Mscae/5T+04fx/Kfkp+UTqhONk2aTp6fcp24+W/1s/Hnq8/npgp+l
         f65+ofviu18cf+mbWTUz/pL/cuHX4lfyr468Xva6e9Z/9vGb5Dfzc4Vv5d8efcd41/s+7P3EfOYH7IeK
-        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDwAACw8BkvkDpQAACdNJREFUeF7t3dtOW4cW
+        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDgAACw4BQL7hQQAACdNJREFUeF7t3dtOW4cW
         heFe9VUibakv1/eoVGk/TFedps2hnCGAjTnYnAlgbGNzJpUqza2xgL2zmSlL4oqV8V98Fx2q190/YxwC
         30XEdwA8pQGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHykAYCPNADwkQYAPtIAwEcaAPhIAwAfaQDg
         Iw0AfKQBgI80APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8pAGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMN
@@ -414,4 +414,10 @@
   <metadata name="pid_value.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="pid_minvalue.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pid_maxvalue.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>