Browse Source

修改未获取到产品编号的BUG

章政 8 years ago
parent
commit
762f763ee7

+ 13 - 13
UAS-MES/FunctionCode/Make/Make_PackageCollection.Designer.cs

@@ -57,7 +57,7 @@
             this.pa_indate = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.AutoPrint = new UAS_MES.CustomControl.CustomCheckBox.AutoPrintCheckBox();
-            this.pa_prodcode = new System.Windows.Forms.Label();
+            this.pr_code = new System.Windows.Forms.Label();
             this.pr_detail = new System.Windows.Forms.Label();
             this.pa_currentqty = new System.Windows.Forms.Label();
             this.groupBoxWithBorder1 = new UAS_MES.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
@@ -418,17 +418,17 @@
             this.AutoPrint.Size = new System.Drawing.Size(112, 27);
             this.AutoPrint.TabIndex = 166;
             // 
-            // pa_prodcode
+            // pr_code
             // 
-            this.pa_prodcode.AutoSize = true;
-            this.pa_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_prodcode.Location = new System.Drawing.Point(130, 157);
-            this.pa_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pa_prodcode.MaximumSize = new System.Drawing.Size(200, 0);
-            this.pa_prodcode.Name = "pa_prodcode";
-            this.pa_prodcode.Size = new System.Drawing.Size(0, 27);
-            this.pa_prodcode.TabIndex = 167;
-            this.pa_prodcode.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
+            this.pr_code.AutoSize = true;
+            this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_code.Location = new System.Drawing.Point(130, 157);
+            this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pr_code.Name = "pr_code";
+            this.pr_code.Size = new System.Drawing.Size(0, 27);
+            this.pr_code.TabIndex = 167;
+            this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
             // 
             // pr_detail
             // 
@@ -462,7 +462,7 @@
             this.groupBoxWithBorder1.Controls.Add(this.pr_code_label);
             this.groupBoxWithBorder1.Controls.Add(this.pr_detail);
             this.groupBoxWithBorder1.Controls.Add(this.pr_outboxinnerqty_label);
-            this.groupBoxWithBorder1.Controls.Add(this.pa_prodcode);
+            this.groupBoxWithBorder1.Controls.Add(this.pr_code);
             this.groupBoxWithBorder1.Controls.Add(this.pa_code_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(5, 7);
@@ -767,7 +767,7 @@
         private CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode pa_outboxcode;
         private System.Windows.Forms.NumericUpDown PrintNum;
         private CustomControl.CustomCheckBox.AutoPrintCheckBox AutoPrint;
-        private System.Windows.Forms.Label pa_prodcode;
+        private System.Windows.Forms.Label pr_code;
         private System.Windows.Forms.Label pr_detail;
         private System.Windows.Forms.Label pa_currentqty;
         private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder1;

+ 11 - 6
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -84,6 +84,7 @@ namespace UAS_MES.Make
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)
             {
+                //记录该数据保证在修改不被允许的前提下能偶回复之前的值
                 StandardQTY = decimal.Parse(dt.Rows[0]["pr_outboxinnerqty"].ToString());
                 BaseUtil.SetFormValue(this.Controls, dt);
             }
@@ -112,7 +113,7 @@ namespace UAS_MES.Make
                 }
                 else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "尚未封箱,请封箱后执行打印\n", Color.Red);
             }
-            else OperateResult.AppendText(">>产品" + pa_prodcode.Text + "未维护打印标签\n", Color.Red);
+            else OperateResult.AppendText(">>产品" + pr_code.Text + "未维护打印标签\n", Color.Red);
         }
 
         //加载工单信息和装箱明细信息
@@ -135,8 +136,9 @@ namespace UAS_MES.Make
                 {
                     if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                     {
+                        //获取序列号信息
                         sql.Clear();
-                        sql.Append("select pa_prodcode,ms_makecode,pr_code,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,pa_standardqty,");
+                        sql.Append("select pr_code,ms_makecode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,nvl(pa_standardqty,0) pa_standardqty,");
                         sql.Append("pr_outboxinnerqty from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
                         sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -145,6 +147,7 @@ namespace UAS_MES.Make
                             StandardQTY = decimal.Parse(dt.Rows[0]["pr_outboxinnerqty"].ToString());
                             BaseUtil.SetFormValue(this.Controls, dt);
                         }
+                        //保证箱内容量不会被重置
                         if (pa_standardqty.Text != "0")
                         {
                             pr_outboxinnerqty.Text = pa_standardqty.Text;
@@ -152,6 +155,7 @@ namespace UAS_MES.Make
                         if (pa_outboxcode.Text == "")
                         {
                             string boxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString();
+                            //序列号存在箱号的情况下获取所有的装箱数据
                             if (boxcode != "")
                             {
                                 pa_outboxcode.Text = boxcode;
@@ -159,6 +163,7 @@ namespace UAS_MES.Make
                             }
                             else
                             {
+                                //如果勾选了自动生成箱号,在封箱或者首次
                                 if (AutoGenBoxCode.Checked && (pa_status.Text == "1" || pa_status.Text == ""))
                                     pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
                             }
@@ -195,7 +200,7 @@ namespace UAS_MES.Make
                                     }
                                     break;
                                 case "PROD":
-                                    if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pa_prodcode.Text)
+                                    if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pr_code.Text)
                                     {
                                         OperateResult.AppendText(">>序列号" + sn_code.Text + "对应物料和该箱所装物料不同\n", Color.Red, sn_code);
                                         return;
@@ -284,9 +289,9 @@ namespace UAS_MES.Make
         {
             LoadCheckQTY();
             pa_outboxcode.MakeCode = pa_makecode.Text;
-            pa_outboxcode.ProdCode = pa_prodcode.Text;
+            pa_outboxcode.ProdCode = pr_code.Text;
             pa_outboxcode.Caller = "PACKAGE";
-            dt = (DataTable)dh.ExecuteSql("select pl_labelcode||':'||pl_labelname pl_laname,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pa_prodcode.Text + "' order by pl_isdefault desc ", "select");
+            dt = (DataTable)dh.ExecuteSql("select pl_labelcode||':'||pl_labelname pl_laname,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' order by pl_isdefault desc ", "select");
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_laname";
             PrintLabel.ValueMember = "pl_labelcode";
@@ -354,7 +359,7 @@ namespace UAS_MES.Make
                 condition = "and ob_status='ENTERING' ";
             }
             sql.Append("select ob_batchqty,ob_nowcheckqty,ob_checkno from oqcbatch where ");
-            sql.Append("ob_linecode='" + User.UserLineCode + "' and ob_prodcode='" + pa_prodcode.Text + "' and ");
+            sql.Append("ob_linecode='" + User.UserLineCode + "' and ob_prodcode='" + pr_code.Text + "' and ");
             sql.Append("ob_stepcode='" + User.CurrentStepCode + "' " + condition);
             DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)

+ 13 - 13
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.Designer.cs

@@ -61,7 +61,7 @@
             this.pr_code_label = new System.Windows.Forms.Label();
             this.pr_detail = new System.Windows.Forms.Label();
             this.pr_outboxinnerqty_label = new System.Windows.Forms.Label();
-            this.pa_prodcode = new System.Windows.Forms.Label();
+            this.pr_code = new System.Windows.Forms.Label();
             this.AutoGenBoxCode = new System.Windows.Forms.CheckBox();
             this.groupBoxWithBorder2 = new UAS_MES.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
             this.ob_nowcheckqty = new System.Windows.Forms.Label();
@@ -394,7 +394,7 @@
             this.groupBoxWithBorder1.Controls.Add(this.pr_code_label);
             this.groupBoxWithBorder1.Controls.Add(this.pr_detail);
             this.groupBoxWithBorder1.Controls.Add(this.pr_outboxinnerqty_label);
-            this.groupBoxWithBorder1.Controls.Add(this.pa_prodcode);
+            this.groupBoxWithBorder1.Controls.Add(this.pr_code);
             this.groupBoxWithBorder1.Controls.Add(this.AutoGenBoxCode);
             this.groupBoxWithBorder1.Controls.Add(this.pa_outboxcode);
             this.groupBoxWithBorder1.Controls.Add(this.pa_code_label);
@@ -486,17 +486,17 @@
             this.pr_outboxinnerqty_label.TabIndex = 176;
             this.pr_outboxinnerqty_label.Text = "箱内容量";
             // 
-            // pa_prodcode
+            // pr_code
             // 
-            this.pa_prodcode.AutoSize = true;
-            this.pa_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_prodcode.Location = new System.Drawing.Point(130, 147);
-            this.pa_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pa_prodcode.MaximumSize = new System.Drawing.Size(200, 0);
-            this.pa_prodcode.Name = "pa_prodcode";
-            this.pa_prodcode.Size = new System.Drawing.Size(0, 27);
-            this.pa_prodcode.TabIndex = 177;
-            this.pa_prodcode.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
+            this.pr_code.AutoSize = true;
+            this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_code.Location = new System.Drawing.Point(130, 147);
+            this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pr_code.Name = "pr_code";
+            this.pr_code.Size = new System.Drawing.Size(0, 27);
+            this.pr_code.TabIndex = 177;
+            this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
             // 
             // AutoGenBoxCode
             // 
@@ -920,7 +920,7 @@
         private System.Windows.Forms.Label pr_code_label;
         private System.Windows.Forms.Label pr_detail;
         private System.Windows.Forms.Label pr_outboxinnerqty_label;
-        private System.Windows.Forms.Label pa_prodcode;
+        private System.Windows.Forms.Label pr_code;
         private System.Windows.Forms.Label ms_makecode;
         private System.Windows.Forms.Label pa_standardqty;
     }

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

@@ -190,7 +190,7 @@ namespace UAS_MES.Make
                 }
                 else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "尚未封箱,请封箱后执行打印\n", Color.Red);
             }
-            else OperateResult.AppendText(">>产品" + pa_prodcode.Text + "未维护打印标签\n", Color.Red);
+            else OperateResult.AppendText(">>产品" + pr_code.Text + "未维护打印标签\n", Color.Red);
         }
 
         //加载工单信息和装箱明细信息
@@ -214,7 +214,7 @@ namespace UAS_MES.Make
                     if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                     {
                         sql.Clear();
-                        sql.Append("select ms_makecode,pa_prodcode,pr_code,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,nvl(pa_standardqty,pr_outboxinnerqty) ");
+                        sql.Append("select ms_makecode,pr_code,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,nvl(pa_standardqty,0) pa_standardqty");
                         sql.Append("pr_outboxinnerqty from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
                         sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -273,7 +273,7 @@ namespace UAS_MES.Make
                                     }
                                     break;
                                 case "PROD":
-                                    if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pa_prodcode.Text)
+                                    if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pr_code.Text)
                                     {
                                         OperateResult.AppendText(">>序列号" + sn_code.Text + "对应物料和该箱所装物料不同\n", Color.Red, sn_code);
                                         return;
@@ -365,9 +365,9 @@ namespace UAS_MES.Make
         {
             LoadCheckQTY();
             pa_outboxcode.MakeCode = pa_makecode.Text;
-            pa_outboxcode.ProdCode = pa_prodcode.Text;
+            pa_outboxcode.ProdCode = pr_code.Text;
             pa_outboxcode.Caller = "PACKAGE";
-            dt = (DataTable)dh.ExecuteSql("select pl_labelcode||':'||pl_labelname pl_laname,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pa_prodcode.Text + "' order by pl_isdefault desc ", "select");
+            dt = (DataTable)dh.ExecuteSql("select pl_labelcode||':'||pl_labelname pl_laname,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' order by pl_isdefault desc ", "select");
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_laname";
             PrintLabel.ValueMember = "pl_labelcode";
@@ -444,7 +444,7 @@ namespace UAS_MES.Make
                 condition = "and ob_status='ENTERING' ";
             }
             sql.Append("select ob_batchqty,ob_nowcheckqty,ob_checkno from oqcbatch where ");
-            sql.Append("ob_linecode='" + User.UserLineCode + "' and ob_prodcode='" + pa_prodcode.Text + "' and ");
+            sql.Append("ob_linecode='" + User.UserLineCode + "' and ob_prodcode='" + pr_code.Text + "' and ");
             sql.Append("ob_stepcode='" + User.CurrentStepCode + "' " + condition);
             DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)