Browse Source

修改包装采集BUG

章政 8 years ago
parent
commit
6500eb6c98

+ 1 - 1
UAS-MES/CustomControl/TextBoxWithIcon/TextBoxGeneratePaCode.cs

@@ -54,7 +54,7 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
             }
         }
 
-        private void GeneratePaCode_Click(object sender, EventArgs e)
+        public void GeneratePaCode_Click(object sender, EventArgs e)
         {
             IconClick?.Invoke(sender, new EventArgs());
             //如果未实现则继续

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

@@ -87,7 +87,7 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(7, 102);
+            this.pr_detail_label.Location = new System.Drawing.Point(12, 101);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
             this.pr_detail_label.TabIndex = 80;
@@ -97,7 +97,7 @@
             // 
             this.ma_code_label.AutoSize = true;
             this.ma_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_code_label.Location = new System.Drawing.Point(269, 53);
+            this.ma_code_label.Location = new System.Drawing.Point(271, 53);
             this.ma_code_label.Name = "ma_code_label";
             this.ma_code_label.Size = new System.Drawing.Size(58, 21);
             this.ma_code_label.TabIndex = 76;
@@ -129,7 +129,7 @@
             // 
             this.pa_packageqty_label.AutoSize = true;
             this.pa_packageqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_packageqty_label.Location = new System.Drawing.Point(268, 102);
+            this.pa_packageqty_label.Location = new System.Drawing.Point(270, 102);
             this.pa_packageqty_label.Name = "pa_packageqty_label";
             this.pa_packageqty_label.Size = new System.Drawing.Size(74, 21);
             this.pa_packageqty_label.TabIndex = 95;
@@ -139,7 +139,7 @@
             // 
             this.pa_totalqty_label.AutoSize = true;
             this.pa_totalqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_totalqty_label.Location = new System.Drawing.Point(269, 149);
+            this.pa_totalqty_label.Location = new System.Drawing.Point(271, 149);
             this.pa_totalqty_label.Name = "pa_totalqty_label";
             this.pa_totalqty_label.Size = new System.Drawing.Size(74, 21);
             this.pa_totalqty_label.TabIndex = 97;
@@ -160,7 +160,7 @@
             // 
             this.pa_code_label.AutoSize = true;
             this.pa_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_code_label.Location = new System.Drawing.Point(7, 55);
+            this.pa_code_label.Location = new System.Drawing.Point(12, 54);
             this.pa_code_label.Name = "pa_code_label";
             this.pa_code_label.Size = new System.Drawing.Size(42, 21);
             this.pa_code_label.TabIndex = 113;
@@ -170,7 +170,7 @@
             // 
             this.PrintList_label.AutoSize = true;
             this.PrintList_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintList_label.Location = new System.Drawing.Point(7, 149);
+            this.PrintList_label.Location = new System.Drawing.Point(12, 148);
             this.PrintList_label.Name = "PrintList_label";
             this.PrintList_label.Size = new System.Drawing.Size(90, 21);
             this.PrintList_label.TabIndex = 116;
@@ -288,20 +288,20 @@
             // pa_outboxcode
             // 
             this.pa_outboxcode.ErrorMsg = null;
-            this.pa_outboxcode.Location = new System.Drawing.Point(108, 54);
+            this.pa_outboxcode.Location = new System.Drawing.Point(109, 54);
             this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(4);
             this.pa_outboxcode.Name = "pa_outboxcode";
             this.pa_outboxcode.Pr_id = null;
-            this.pa_outboxcode.Size = new System.Drawing.Size(149, 21);
+            this.pa_outboxcode.Size = new System.Drawing.Size(148, 21);
             this.pa_outboxcode.TabIndex = 163;
             this.pa_outboxcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pa_code_KeyDown);
             // 
             // PrintList
             // 
-            this.PrintList.Location = new System.Drawing.Point(108, 149);
+            this.PrintList.Location = new System.Drawing.Point(109, 149);
             this.PrintList.Margin = new System.Windows.Forms.Padding(4);
             this.PrintList.Name = "PrintList";
-            this.PrintList.Size = new System.Drawing.Size(150, 25);
+            this.PrintList.Size = new System.Drawing.Size(148, 25);
             this.PrintList.TabIndex = 158;
             // 
             // OperateResult
@@ -321,7 +321,7 @@
             this.ma_code.Condition = null;
             this.ma_code.DBTitle = "工单查询";
             this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(352, 54);
+            this.ma_code.Location = new System.Drawing.Point(355, 54);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = null;
             this.ma_code.ReturnData = null;
@@ -377,7 +377,7 @@
             this.pa_packageqty.BackColor = System.Drawing.Color.White;
             this.pa_packageqty.Enabled = false;
             this.pa_packageqty.ID = null;
-            this.pa_packageqty.Location = new System.Drawing.Point(351, 102);
+            this.pa_packageqty.Location = new System.Drawing.Point(354, 102);
             this.pa_packageqty.Name = "pa_packageqty";
             this.pa_packageqty.Power = null;
             this.pa_packageqty.Size = new System.Drawing.Size(150, 21);
@@ -410,7 +410,7 @@
             this.pr_outboxinnerqty.AllPower = null;
             this.pr_outboxinnerqty.BackColor = System.Drawing.Color.White;
             this.pr_outboxinnerqty.ID = null;
-            this.pr_outboxinnerqty.Location = new System.Drawing.Point(352, 149);
+            this.pr_outboxinnerqty.Location = new System.Drawing.Point(355, 149);
             this.pr_outboxinnerqty.Name = "pr_outboxinnerqty";
             this.pr_outboxinnerqty.Power = null;
             this.pr_outboxinnerqty.Size = new System.Drawing.Size(150, 21);
@@ -426,10 +426,10 @@
             this.pr_detail.BackColor = System.Drawing.Color.White;
             this.pr_detail.Enabled = false;
             this.pr_detail.ID = null;
-            this.pr_detail.Location = new System.Drawing.Point(108, 102);
+            this.pr_detail.Location = new System.Drawing.Point(109, 102);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Power = null;
-            this.pr_detail.Size = new System.Drawing.Size(150, 21);
+            this.pr_detail.Size = new System.Drawing.Size(149, 21);
             this.pr_detail.Str = null;
             this.pr_detail.Str1 = null;
             this.pr_detail.Str2 = null;

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

@@ -43,7 +43,7 @@ namespace UAS_MES.Make
             AutoPrint.Checked = true;
             //设置DbFind的必须的数据
             ma_code.FormName = Name;
-            ma_code.SetValueField = new string[] { "ma_code", "pr_code", "ma_prodname" , "pr_outboxinnerqty" };
+            ma_code.SetValueField = new string[] { "ma_code", "pr_code", "ma_prodname", "pr_outboxinnerqty" };
             ma_code.TableName = "Make left join product on  ma_prodcode=pr_code";
             ma_code.SelectField = "ma_code # 工单号,pr_code # 物料编号,pr_detail # 物料名称,pr_outboxinnerqty # 箱内容量";
             ma_code.Condition = "ma_statuscode='STARTED'";
@@ -92,6 +92,14 @@ namespace UAS_MES.Make
             dt = (DataTable)dh.ExecuteSql("select pa_outboxcode,pd_barcode,pd_innerqty,pa_indate from packageDetail left join package on pa_id=pd_paid where pa_outboxcode='" + pa_outboxcode.Text + "'", "select");
             BaseUtil.FillDgvWithDataTable(PackageDetail, dt);
             barcode.Clear();
+            if (pr_outboxinnerqty.Text == pa_packageqty.Text)
+            {
+                pa_restqty.Text = "";
+                pa_packageqty.Text = "";
+                pa_outboxcode.Text = "";
+                BaseUtil.CleanDGVData(PackageDetail);
+                pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
+            }
         }
 
         private void InsertDetail()
@@ -103,9 +111,12 @@ namespace UAS_MES.Make
                 sql.Append("select packagedetail_seq.nextval,pa_id,pa_outboxcode,pa_totalqty,'" + barcode.Text + "' from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
                 dh.ExecuteSql(sql.GetString(), "insert");
                 dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty+1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                OperateResult.AppendText("序列号" + barcode.Text + "采集成功!\n", Color.Green);
-                barcode.Clear();
-                LoadData();
+                if (LogicHandler.UpdateMakeMessage(barcode.Text, ma_code.Text, "包装采集", User.UserSourceCode, User.UserCode, "装箱成功", out ErrorMessage))
+                {
+                    OperateResult.AppendText(">>序列号" + barcode.Text + "采集成功!\n", Color.Green);
+                    barcode.Clear();
+                    LoadData();
+                }
             }
             else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已采集满\n", Color.Red);
 
@@ -121,7 +132,7 @@ namespace UAS_MES.Make
                 {
                     try
                     {
-                        OperateResult.AppendText("开始打印\n", Color.Green);
+                        OperateResult.AppendText(">>开始打印\n", Color.Green);
                         Print.CodeSoft(lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
                     }
                     catch
@@ -170,7 +181,7 @@ namespace UAS_MES.Make
                         OperateResult.AppendText(">>箱内数量必须大于0\n", Color.Red);
                         return;
                     }
-                    if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, barcode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage)) { }
+                    if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, barcode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                     {
                         //如果未勾选了取消录入
                         if (!Cancel.Checked)
@@ -178,7 +189,7 @@ namespace UAS_MES.Make
                             //判断序列号是否已经装箱
                             if (dh.CheckExist("packagedetail", "pd_barcode='" + barcode.Text + "'"))
                             {
-                                OperateResult.AppendText("序列号" + barcode.Text + "已经装箱!\n", Color.Red);
+                                OperateResult.AppendText(">>序列号" + barcode.Text + "已经装箱!\n", Color.Red);
                                 barcode.Clear();
                             }
                             else
@@ -192,7 +203,7 @@ namespace UAS_MES.Make
                                     sql.Append("select package_seq.nextval,'" + pa_outboxcode.Text + "',0," + pr_outboxinnerqty.Text + ",0,");
                                     sql.Append("sysdate,'" + ma_code.Text + "', ma_prodcode,ma_salecode,ma_custcode from make where ma_code = '" + ma_code.Text + "'");
                                     dh.ExecuteSql(sql.GetString(), "insert");
-                                    OperateResult.AppendText("箱号" + pa_outboxcode.Text + "采集成功!\n", Color.Green);
+                                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "采集成功!\n", Color.Green);
                                     //验证序列号插入明细表的数据
                                     InsertDetail();
                                 }
@@ -216,13 +227,13 @@ namespace UAS_MES.Make
                                 dh.ExecuteSql("delete from packagedetail where pd_barcode='" + barcode.Text + "' and pd_paid=(select pa_id from package where pa_outboxcode='" + pa_outboxcode.Text + "')", "delete");
                                 //更新已装数 
                                 dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty-1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                                dh.UpdateByCondition("makeserial", "ms_nextstepcode=ms_stepcode", "ms_sncode='" + barcode.Text + "'");
                                 OperateResult.AppendText(">>已从该箱中移除序列号" + barcode.Text + "\n", Color.Green);
                                 LoadData();
                             }
                             else OperateResult.AppendText(">>序列号" + barcode.Text + "不在该箱内,请输入正确的序列号\n", Color.Red);
                         }
                     }
+                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                 }
                 else LoadData();
             }
@@ -241,8 +252,6 @@ namespace UAS_MES.Make
                 {
                     OperateResult.AppendText(">>打印箱号" + pa_outboxcode.Text + "\n", Color.Green);
                     Print.CodeSoft(lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
-                    PackageDetail.DataSource = null;
-                    BaseUtil.CleanForm(this);
                 }
             }
         }
@@ -278,6 +287,7 @@ namespace UAS_MES.Make
         private void 包装采集_FormClosing(object sender, FormClosingEventArgs e)
         {
             lbl.Quit();
+            dh.Dispose();
         }
 
         private void ma_code_UserControlTextChanged(object sender, EventArgs e)

+ 15 - 0
UAS-MES/FunctionCode/Make/Make_PackageCollection.resx

@@ -395,4 +395,19 @@
   <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="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>
 </root>

+ 3 - 0
UAS_KanBan/Process.resx

@@ -120,6 +120,9 @@
   <metadata name="Refresh.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>
+  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>62</value>
+  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>