Browse Source

外箱采集进度更新

章政 7 years ago
parent
commit
de9f3d5cdb

+ 4 - 4
UAS-出货标签管理(吉利通)/PublicMethod/DataHelper.cs

@@ -957,12 +957,12 @@ namespace UAS_LabelMachine
                 if (names[0][i - 1].ToString().ToUpper().Contains("DATE"))
                 {
                     DateTime[] time = new DateTime[names[i].Length];
-                    for (int j = 0; j < names[i].Length; j++)
-                    {
-                        time[j] = Convert.ToDateTime(names[i][j]);
-                    }
                     try
                     {
+                        for (int j = 0; j < names[i].Length; j++)
+                        {
+                            time[j] = Convert.ToDateTime(names[i][j]);
+                        }
                         command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Date, time, ParameterDirection.Input));
                     }
                     catch (Exception)

+ 14 - 14
UAS-出货标签管理(吉利通)/UAS_出货标签管理.Designer.cs

@@ -207,7 +207,7 @@
             this.label10 = new System.Windows.Forms.Label();
             this.label6 = new System.Windows.Forms.Label();
             this.OutBoxPrinter = new UAS_LabelMachine.CustomControl.PrinterCombox();
-            this.OutboxCapacity = new System.Windows.Forms.NumericUpDown();
+            this.OutBoxCapacity = new System.Windows.Forms.NumericUpDown();
             this.OutBoxLabelPrint = new System.Windows.Forms.Button();
             this.OutBoxLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.OutBoxCombox = new System.Windows.Forms.ComboBox();
@@ -228,7 +228,7 @@
             this.OutBoxLabel.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.cu_print_papercount)).BeginInit();
             this.groupBoxWithBorder3.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.OutboxCapacity)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.OutBoxCapacity)).BeginInit();
             this.SuspendLayout();
             // 
             // ExportData
@@ -1975,7 +1975,7 @@
             this.OutBoxLabel.Controls.Add(this.label10);
             this.OutBoxLabel.Controls.Add(this.label6);
             this.OutBoxLabel.Controls.Add(this.OutBoxPrinter);
-            this.OutBoxLabel.Controls.Add(this.OutboxCapacity);
+            this.OutBoxLabel.Controls.Add(this.OutBoxCapacity);
             this.OutBoxLabel.Controls.Add(this.OutBoxLabelPrint);
             this.OutBoxLabel.Controls.Add(this.OutBoxLabelAutoPrint);
             this.OutBoxLabel.Controls.Add(this.OutBoxCombox);
@@ -2125,20 +2125,20 @@
             this.OutBoxPrinter.Size = new System.Drawing.Size(158, 25);
             this.OutBoxPrinter.TabIndex = 82;
             // 
-            // OutboxCapacity
+            // OutBoxCapacity
             // 
-            this.OutboxCapacity.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutboxCapacity.Location = new System.Drawing.Point(211, 68);
-            this.OutboxCapacity.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.OutboxCapacity.Name = "OutboxCapacity";
-            this.OutboxCapacity.Size = new System.Drawing.Size(38, 23);
-            this.OutboxCapacity.TabIndex = 84;
-            this.OutboxCapacity.Value = new decimal(new int[] {
+            this.OutBoxCapacity.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OutBoxCapacity.Location = new System.Drawing.Point(211, 68);
+            this.OutBoxCapacity.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.OutBoxCapacity.Name = "OutBoxCapacity";
+            this.OutBoxCapacity.Size = new System.Drawing.Size(38, 23);
+            this.OutBoxCapacity.TabIndex = 84;
+            this.OutBoxCapacity.Value = new decimal(new int[] {
             1,
             0,
             0,
             0});
-            this.OutboxCapacity.Leave += new System.EventHandler(this.MidBoxCapacity_Leave);
+            this.OutBoxCapacity.Leave += new System.EventHandler(this.MidBoxCapacity_Leave);
             // 
             // OutBoxLabelPrint
             // 
@@ -2252,7 +2252,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.cu_print_papercount)).EndInit();
             this.groupBoxWithBorder3.ResumeLayout(false);
             this.groupBoxWithBorder3.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.OutboxCapacity)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.OutBoxCapacity)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -2265,7 +2265,7 @@
         private System.Windows.Forms.ComboBox OutBoxCombox;
         private System.Windows.Forms.CheckBox OutBoxLabelAutoPrint;
         private System.Windows.Forms.Button OutBoxLabelPrint;
-        private System.Windows.Forms.NumericUpDown OutboxCapacity;
+        private System.Windows.Forms.NumericUpDown OutBoxCapacity;
         private CustomControl.PrinterCombox OutBoxPrinter;
         private System.Windows.Forms.Label label6;
         private System.Windows.Forms.Label label10;

+ 19 - 9
UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

@@ -168,7 +168,7 @@ namespace UAS_LabelMachine
             Width = ScreenArea.Width;
             Height = ScreenArea.Height;
             MidBoxCapacity.Value = Properties.Settings.Default.MidBoxCapacity;
-            OutboxCapacity.Value = Properties.Settings.Default.OutboxCapacity;
+            OutBoxCapacity.Value = Properties.Settings.Default.OutboxCapacity;
             asc.controllInitializeSize(this);
             asc.controlAutoSize(this);
             //实例化打印进程
@@ -204,6 +204,12 @@ namespace UAS_LabelMachine
             }
         }
 
+        string LotNo = "";
+        string DateCode = "";
+        string Order = "";
+        string QTY = "";
+        string PN = "";
+        string OutBox = "";
         //获取串口数据
         private void Serial_DataReceived(object sender, SerialDataReceivedEventArgs e)
         {
@@ -214,12 +220,6 @@ namespace UAS_LabelMachine
                 byte[] readBuffer = new byte[len];
                 port.Read(readBuffer, 0, len); //将数据读入缓存
                 string msg = Encoding.ASCII.GetString(readBuffer, 0, len); //获取出入库产品编号
-                string LotNo = "";
-                string DateCode = "";
-                string Order = "";
-                string QTY = "";
-                string PN = "";
-                string OutBox = "";
                 string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
                 switch (port.Tag)
                 {
@@ -336,10 +336,16 @@ namespace UAS_LabelMachine
                         //获取当前最大的箱号
                         string boxcode = adh.getFieldDataByCondition("prodiobarcode", "max(pib_outboxcode1)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
                         int outboxcode1 = int.Parse(boxcode == "" ? "1" : boxcode);
+                        boxcode = adh.getFieldDataByCondition("prodiobarcode", "max(pib_outboxcode2)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
+                        int outboxcode2 = int.Parse(boxcode == "" ? "1" : boxcode);
                         if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + outboxcode1) >= MidBoxCapacity.Value)
                         {
                             outboxcode1 = outboxcode1 + 1;
                         }
+                        if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + outboxcode2) >= OutBoxCapacity.Value)
+                        {
+                            outboxcode2 = outboxcode2 + 1;
+                        }
                         else if (CurrentRowIndex - 1 >= 0)
                         {
                             if (cu_print_midlotno.Checked)
@@ -364,19 +370,21 @@ namespace UAS_LabelMachine
                             }
                         }
                         LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value = outboxcode1;
-                        adh.ExecuteSql("update prodiobarcode set pib_outboxcode1=" + outboxcode1 + ",pib_lotno='" + LotNo + "',pib_datecode='" + DateCode + "',pib_ifpick=-1 where pib_id=" + pib_id, "update");
+                        LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode2"].Value = outboxcode2;
+                        adh.ExecuteSql("update prodiobarcode set pib_outboxcode2=" + outboxcode2 + ",pib_outboxcode1=" + outboxcode1 + ",pib_lotno='" + LotNo + "',pib_datecode='" + DateCode + "',pib_ifpick=-1 where pib_id=" + pib_id, "update");
                         LabelInf.Refresh();
                         if (CurrentRowIndex + 1 < LabelInf.Rows.Count)
                             CurrentRowIndex = CurrentRowIndex + 1;
                         RefreshProcessData();
+                        LogicHandler.CheckUploadData(pi_inoutno.Text, UploadNum);
                         break;
                     default:
                         break;
                 }
-                LogicHandler.CheckUploadData(pi_inoutno.Text, UploadNum);
             }
             catch (Exception ex)
             {
+                LogManager.DoLog(ex.StackTrace);
                 MessageBox.Show("接收返回消息异常!具体原因:" + ex.Message, "提示信息");
             }
         }
@@ -1148,7 +1156,9 @@ namespace UAS_LabelMachine
                         Count++;
                 }
                 int midboxcount = adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + (midboxcode == "" ? "0" : midboxcode));
+                int outboxcount = adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + (outboxcode == "" ? "0" : outboxcode));
                 midboxProcess.Text = midboxcount + "/" + MidBoxCapacity.Value;
+                outboxProcess.Text = outboxcount + "/" + OutBoxCapacity.Value;
                 //设置当前的箱号和盒号
                 Process_midboxcode.Text = midboxcode;
                 Process_outboxcode.Text = outboxcode;