Browse Source

修改装箱采集BUG

章政 8 years ago
parent
commit
68547df066

+ 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.pr_code = new System.Windows.Forms.Label();
+            this.pa_prodcode = 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;
             // 
-            // pr_code
+            // pa_prodcode
             // 
-            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);
+            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);
             // 
             // 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.pr_code);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_prodcode);
             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 pr_code;
+        private System.Windows.Forms.Label pa_prodcode;
         private System.Windows.Forms.Label pr_detail;
         private System.Windows.Forms.Label pa_currentqty;
         private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder1;

+ 9 - 9
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -78,7 +78,7 @@ namespace UAS_MES.Make
             //加载表单数据
             string Err = "";
             sql.Clear();
-            sql.Append("select pr_code,pa_outboxcode,pa_makecode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,pa_status,pr_packrule,pr_detail,pa_packageqty,pa_standardqty,pr_outboxinnerqty,pa_currentqty from package left join product on pa_prodcode=");
+            sql.Append("select pr_code,pa_outboxcode,pa_prodcode,pa_makecode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,pa_status,pr_packrule,pr_detail,pa_packageqty,pa_standardqty,pr_outboxinnerqty,pa_currentqty from package left join product on pa_prodcode=");
             sql.Append("pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
             Err = "箱号";
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -112,7 +112,7 @@ namespace UAS_MES.Make
                 }
                 else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "尚未封箱,请封箱后执行打印\n", Color.Red);
             }
-            else OperateResult.AppendText(">>产品" + pr_code.Text + "未维护打印标签\n", Color.Red);
+            else OperateResult.AppendText(">>产品" + pa_prodcode.Text + "未维护打印标签\n", Color.Red);
         }
 
         //加载工单信息和装箱明细信息
@@ -136,7 +136,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,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 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("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");
@@ -184,18 +184,18 @@ namespace UAS_MES.Make
                                     if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
                                     {
                                         sql.Clear();
-                                        sql.Append("select 1 from package left join make on pa_salecode=ma_salecode left join makeserial ");
+                                        sql.Append("select 1 from package left join make on pa_salecode=ma_salecode and pa_prodcode=ma_prodcode left join makeserial ");
                                         sql.Append("on ma_code=ms_makecode where pa_outboxcode='" + pa_outboxcode.Text + "' and ms_id='" + oMsID + "'");
                                         DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                         if (dt.Rows.Count == 0)
                                         {
-                                            OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号和当前箱号订单不相等\n", Color.Red, sn_code);
+                                            OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号和当前箱号订单不相等或者订单产品不相等\n", Color.Red, sn_code);
                                             return;
                                         }
                                     }
                                     break;
                                 case "PROD":
-                                    if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pr_code.Text)
+                                    if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pa_prodcode.Text)
                                     {
                                         OperateResult.AppendText(">>序列号" + sn_code.Text + "对应物料和该箱所装物料不同\n", Color.Red, sn_code);
                                         return;
@@ -284,9 +284,9 @@ namespace UAS_MES.Make
         {
             LoadCheckQTY();
             pa_outboxcode.MakeCode = pa_makecode.Text;
-            pa_outboxcode.ProdCode = pr_code.Text;
+            pa_outboxcode.ProdCode = pa_prodcode.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='" + pr_code.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='" + pa_prodcode.Text + "' order by pl_isdefault desc ", "select");
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_laname";
             PrintLabel.ValueMember = "pl_labelcode";
@@ -354,7 +354,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='" + pr_code.Text + "' and ");
+            sql.Append("ob_linecode='" + User.UserLineCode + "' and ob_prodcode='" + pa_prodcode.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.pr_code = new System.Windows.Forms.Label();
+            this.pa_prodcode = 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.pr_code);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_prodcode);
             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 = "箱内容量";
             // 
-            // pr_code
+            // pa_prodcode
             // 
-            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);
+            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);
             // 
             // 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 pr_code;
+        private System.Windows.Forms.Label pa_prodcode;
         private System.Windows.Forms.Label ms_makecode;
         private System.Windows.Forms.Label pa_standardqty;
     }

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

@@ -144,7 +144,7 @@ namespace UAS_MES.Make
             //加载表单数据
             string Err = "";
             sql.Clear();
-            sql.Append("select pr_cartonmaxw,pa_makecode,pr_cartonunit,pr_cartonminw,pr_cartongw,pa_outboxcode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,");
+            sql.Append("select pa_prodcode,pr_cartonmaxw,pa_makecode,pr_cartonunit,pr_cartonminw,pr_cartongw,pa_outboxcode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,");
             sql.Append("pa_status,pr_packrule,pr_detail,pa_packageqty,nvl(pa_standardqty,pr_outboxinnerqty)pr_outboxinnerqty,pa_currentqty from package left join ");
             sql.Append("product on pa_prodcode=pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
             Err = "箱号";
@@ -190,7 +190,7 @@ namespace UAS_MES.Make
                 }
                 else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "尚未封箱,请封箱后执行打印\n", Color.Red);
             }
-            else OperateResult.AppendText(">>产品" + pr_code.Text + "未维护打印标签\n", Color.Red);
+            else OperateResult.AppendText(">>产品" + pa_prodcode.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,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,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("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");
@@ -262,7 +262,7 @@ namespace UAS_MES.Make
                                     if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
                                     {
                                         sql.Clear();
-                                        sql.Append("select 1 from package left join make on pa_salecode=ma_salecode left join makeserial ");
+                                        sql.Append("select 1 from package left join make on pa_salecode=ma_salecode and pa_prodcode=ma_prodcode left join makeserial ");
                                         sql.Append("on ma_code=ms_makecode where pa_outboxcode='" + pa_outboxcode.Text + "' and ms_id='" + oMsID + "'");
                                         DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                         if (dt.Rows.Count == 0)
@@ -273,7 +273,7 @@ namespace UAS_MES.Make
                                     }
                                     break;
                                 case "PROD":
-                                    if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pr_code.Text)
+                                    if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pa_prodcode.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 = pr_code.Text;
+            pa_outboxcode.ProdCode = pa_prodcode.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='" + pr_code.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='" + pa_prodcode.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='" + pr_code.Text + "' and ");
+            sql.Append("ob_linecode='" + User.UserLineCode + "' and ob_prodcode='" + pa_prodcode.Text + "' and ");
             sql.Append("ob_stepcode='" + User.CurrentStepCode + "' " + condition);
             DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)

+ 18 - 0
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.resx

@@ -212,6 +212,24 @@
   <metadata name="pd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="pd_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pa_outboxcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pa_prodcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_innerqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pa_indate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <data name="SendCheck.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m