Browse Source

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

Hcsy 7 years ago
parent
commit
fe26e2ec98

+ 2 - 1
PLCDataReader/Device/Information/DeviceStatusInfo.cs

@@ -42,7 +42,8 @@ namespace UAS_PLCDataReader.Device.Infomation
             if (Main.ReturnData.ContainsKey(de_code))
             {
                 dpg_count.Text = Main.ReturnData[de_code].SendCount.ToString();
-                dpg_runtime.Text = (DateTime.Now - Main.ReturnData[de_code].StartTime).TotalMinutes.ToString().Substring(0, 3) + "分钟";
+                string totalMinutes = (DateTime.Now - Main.ReturnData[de_code].StartTime).TotalMinutes.ToString();
+                dpg_runtime.Text = (DateTime.Now - Main.ReturnData[de_code].StartTime).TotalMinutes.ToString("f1") + "分钟";
                 dpg_starttime.Text = Main.ReturnData[de_code].StartTime.ToString("yyyy-MM-dd HH:mm:ss");
                 dpg_senddatasize.Text = Main.ReturnData[de_code].SendDataSize.ToString();
                 dpg_receivedatasize.Text = Main.ReturnData[de_code].ReceiveDataSize.ToString();

+ 7 - 30
PLCDataReader/Main.cs

@@ -290,7 +290,6 @@ namespace UAS_PLCDataReader
         /// <param name="e"></param>
         private void TimerUpdateDevice_Tick(object sender, EventArgs e)
         {
-            Console.WriteLine("Begin" + QueueUpdateDevice.Count);
             while (QueueUpdateDevice.Count > 0)
             {
                 Entity.Device item = QueueUpdateDevice.Dequeue();
@@ -306,7 +305,6 @@ namespace UAS_PLCDataReader
                 sql.Append(" where dpg_id=(select max(dpg_id) from DEVICEPOLLINGLOG where dpg_decode='" + item.Decode + "')");
                 dh.ExecuteSql(sql.ToString(), "update");
             }
-            Console.WriteLine("End" + QueueUpdateDevice.Count);
         }
         #endregion
 
@@ -533,31 +531,6 @@ namespace UAS_PLCDataReader
                         }
                     }
                     client[DpcID].Returnvalue.Remove(IP);
-                    //SQL.Clear();
-                    ////更新轮询状态
-                    //sql.Clear();
-                    //sql.Append("update DEVICEPOLLINGCONFIG set dpc_status='Running' where dpc_decode='" + Decode + "' and dpc_dccode='" + Dccode + "'");
-                    //dh.ExecuteSql(sql.ToString(), "update");
-                    ////更新轮询日志状态
-                    //sql.Clear();
-                    //sql.Append("update DEVICEPOLLINGLOG set dpg_status='Running',dpg_senddatasize=nvl(dpg_senddatasize,0)+" + SendCommandByteSize);
-                    //sql.Append(",dpg_receivedatasize=nvl(dpg_receivedatasize,0)+" + ReceiveCommandByteSize + ",dpg_count=nvl(dpg_count,0)+1 ");
-                    //sql.Append(" where dpg_id=(select max(dpg_id) from DEVICEPOLLINGLOG where dpg_decode='" + Decode + "')");
-                    //dh.ExecuteSql(sql.ToString(), "update");
-                }
-                else
-                {
-                    //SQL.Clear();
-                    ////更新轮询状态
-                    //sql.Clear();
-                    //sql.Append("update DEVICEPOLLINGCONFIG set dpc_status='Stop' where dpc_decode='" + Decode + "' and dpc_dccode='" + Dccode + "'");
-                    //dh.ExecuteSql(sql.ToString(), "update");
-                    ////更新轮询日志状态
-                    //sql.Clear();
-                    //sql.Append("update DEVICEPOLLINGLOG set dpg_status='Running',dpg_senddatasize=nvl(dpg_senddatasize,0)+");
-                    //sql.Append(SendCommandByteSize + ",dpg_count=nvl(dpg_count,0)+1 ");
-                    //sql.Append("where dpg_id=(select max(dpg_id) from DEVICEPOLLINGLOG where dpg_decode='" + Decode + "')");
-                    //dh.ExecuteSql(sql.ToString(), "update");
                 }
             }
         }
@@ -769,13 +742,17 @@ namespace UAS_PLCDataReader
                         pic.Picedit.Name = dt.Rows[j * CountPerRow + i]["de_code"].ToString();
                         pic.Picedit.MouseHover += Pic_MouseHover;
                         pic.Picedit.Properties.SizeMode = PictureSizeMode.Squeeze;
-                        if (dt.Rows[j * CountPerRow + i]["dpc_status"].ToString() != "Running")
+                        //如果该设备已启动
+                        if (ReturnData.ContainsKey(dt.Rows[j * CountPerRow + i]["de_code"].ToString()))
                         {
-                            pic.Picedit.Image = Properties.Resources.network_offline;
+                            if (ReturnData[dt.Rows[j * CountPerRow + i]["de_code"].ToString()].RunStatus == "Running")
+                            {
+                                pic.Picedit.Image = Properties.Resources.net_connected;
+                            }
                         }
                         else
                         {
-                            pic.Picedit.Image = Properties.Resources.net_connected;
+                            pic.Picedit.Image = Properties.Resources.network_offline;
                         }
                         pic.Text = dt.Rows[j * CountPerRow + i]["de_code"].ToString();
                         pic.Picedit.BorderStyle = BorderStyles.HotFlat;

+ 1 - 1
UAS-出货标签管理(泽天)/PublicMethod/ExcelHandler.cs

@@ -20,7 +20,7 @@ namespace UAS_LabelMachine
             MemoryStream ms;
             ms = DataTableToExcel(dt);
             //以系统当前时间命名文件,FileMode.Create表示创建文件,FileAccess.Write表示拥有写的权限
-            string filePath = @FolderPath + "\\" + FileName + ".xls";
+            string filePath = @FolderPath + "\\" + FileName + ".xlsx";
             FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write);
             byte[] data = ms.ToArray();
             fs.Write(data, 0, data.Length);

+ 46 - 34
UAS-出货标签管理(泽天)/UAS_出货标签管理.Designer.cs

@@ -93,10 +93,10 @@
             this.DCCheck = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.GridPrcode = new UAS_LabelMachine.CustomControl.DataGridViewWithSerialNum();
             this.pd_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_whcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pjd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_custprodcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_whcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.CollectedNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.UnCollectedNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_outqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -248,6 +248,7 @@
             // 
             // RefreshDBConnect
             // 
+            this.RefreshDBConnect.Interval = 10000;
             this.RefreshDBConnect.Tick += new System.EventHandler(this.RefreshDBConnect_Tick);
             // 
             // GetGridOnly
@@ -728,10 +729,10 @@
             this.GridPrcode.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.GridPrcode.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.pd_pdno,
+            this.pd_whcode,
             this.pjd_id,
             this.pd_custprodcode1,
             this.pd_prodcode,
-            this.pd_whcode,
             this.CollectedNum,
             this.UnCollectedNum,
             this.pd_outqty,
@@ -762,12 +763,20 @@
             // 
             // pd_pdno
             // 
-            this.pd_pdno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pd_pdno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
             this.pd_pdno.DataPropertyName = "pd_pdno";
-            this.pd_pdno.HeaderText = "明细序号";
+            this.pd_pdno.HeaderText = "序号";
             this.pd_pdno.Name = "pd_pdno";
             this.pd_pdno.ReadOnly = true;
-            this.pd_pdno.Width = 80;
+            this.pd_pdno.Width = 54;
+            // 
+            // pd_whcode
+            // 
+            this.pd_whcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
+            this.pd_whcode.DataPropertyName = "pd_whcode";
+            this.pd_whcode.HeaderText = "仓别";
+            this.pd_whcode.Name = "pd_whcode";
+            this.pd_whcode.Width = 54;
             // 
             // pjd_id
             // 
@@ -786,29 +795,25 @@
             // 
             // pd_prodcode
             // 
-            this.pd_prodcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.pd_prodcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
             this.pd_prodcode.DataPropertyName = "pd_prodcode";
             this.pd_prodcode.HeaderText = "物料编号";
             this.pd_prodcode.Name = "pd_prodcode";
             this.pd_prodcode.ReadOnly = true;
             this.pd_prodcode.Width = 78;
             // 
-            // pd_whcode
-            // 
-            this.pd_whcode.DataPropertyName = "pd_whcode";
-            this.pd_whcode.HeaderText = "仓别";
-            this.pd_whcode.Name = "pd_whcode";
-            this.pd_whcode.Visible = false;
-            // 
             // CollectedNum
             // 
+            this.CollectedNum.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
             this.CollectedNum.DataPropertyName = "CollectedNum";
             this.CollectedNum.HeaderText = "已采数";
             this.CollectedNum.Name = "CollectedNum";
             this.CollectedNum.ReadOnly = true;
+            this.CollectedNum.Width = 66;
             // 
             // UnCollectedNum
             // 
+            this.UnCollectedNum.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
             this.UnCollectedNum.DataPropertyName = "UnCollectedNum";
             this.UnCollectedNum.HeaderText = "未采集";
             this.UnCollectedNum.Name = "UnCollectedNum";
@@ -817,35 +822,41 @@
             // 
             // pd_outqty
             // 
+            this.pd_outqty.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
             this.pd_outqty.DataPropertyName = "pd_outqty";
             this.pd_outqty.HeaderText = "出库数量";
             this.pd_outqty.Name = "pd_outqty";
             this.pd_outqty.ReadOnly = true;
             this.pd_outqty.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.pd_outqty.Width = 59;
             // 
             // pr_unit
             // 
+            this.pr_unit.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
             this.pr_unit.DataPropertyName = "pr_unit";
             this.pr_unit.HeaderText = "单位";
             this.pr_unit.Name = "pr_unit";
             this.pr_unit.ReadOnly = true;
             this.pr_unit.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.pr_unit.Width = 35;
             // 
             // pr_spec1
             // 
-            this.pr_spec1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.pr_spec1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader;
             this.pr_spec1.DataPropertyName = "pr_spec";
             this.pr_spec1.HeaderText = "规格";
+            this.pr_spec1.MinimumWidth = 100;
             this.pr_spec1.Name = "pr_spec1";
-            this.pr_spec1.Width = 54;
             // 
             // pd_brand
             // 
+            this.pd_brand.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
             this.pd_brand.DataPropertyName = "pd_brand";
             this.pd_brand.HeaderText = "品牌";
             this.pd_brand.Name = "pd_brand";
             this.pd_brand.ReadOnly = true;
             this.pd_brand.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.pd_brand.Width = 35;
             // 
             // pjd_zxbzs_user
             // 
@@ -879,7 +890,7 @@
             // 
             this.label18.AutoSize = true;
             this.label18.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label18.Location = new System.Drawing.Point(59, 118);
+            this.label18.Location = new System.Drawing.Point(64, 122);
             this.label18.Name = "label18";
             this.label18.Size = new System.Drawing.Size(13, 17);
             this.label18.TabIndex = 90;
@@ -913,7 +924,7 @@
             // 
             this.label16.AutoSize = true;
             this.label16.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label16.Location = new System.Drawing.Point(58, 55);
+            this.label16.Location = new System.Drawing.Point(63, 59);
             this.label16.Name = "label16";
             this.label16.Size = new System.Drawing.Size(13, 17);
             this.label16.TabIndex = 87;
@@ -947,7 +958,7 @@
             // 
             this.label12.AutoSize = true;
             this.label12.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label12.Location = new System.Drawing.Point(9, 92);
+            this.label12.Location = new System.Drawing.Point(6, 89);
             this.label12.Name = "label12";
             this.label12.Size = new System.Drawing.Size(56, 17);
             this.label12.TabIndex = 77;
@@ -957,7 +968,7 @@
             // 
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(7, 30);
+            this.label7.Location = new System.Drawing.Point(4, 27);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(56, 17);
             this.label7.TabIndex = 76;
@@ -1013,6 +1024,7 @@
             this.LabelInf.TabIndex = 27;
             this.LabelInf.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.LabelInf_CellClick);
             this.LabelInf.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.LabelInf_DataError);
+            this.LabelInf.SelectionChanged += new System.EventHandler(this.LabelInf_SelectionChanged);
             // 
             // Choose
             // 
@@ -1227,7 +1239,7 @@
             // 
             this.SingleLabelPrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.SingleLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelPrint.Location = new System.Drawing.Point(88, 178);
+            this.SingleLabelPrint.Location = new System.Drawing.Point(54, 177);
             this.SingleLabelPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SingleLabelPrint.Name = "SingleLabelPrint";
             this.SingleLabelPrint.Size = new System.Drawing.Size(68, 26);
@@ -1242,7 +1254,7 @@
             this.SingleLabelAutoPrint.Checked = true;
             this.SingleLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
             this.SingleLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(8, 95);
+            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(5, 92);
             this.SingleLabelAutoPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SingleLabelAutoPrint.Name = "SingleLabelAutoPrint";
             this.SingleLabelAutoPrint.Size = new System.Drawing.Size(75, 21);
@@ -1300,7 +1312,7 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(4, 116);
+            this.label2.Location = new System.Drawing.Point(7, 122);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(32, 17);
             this.label2.TabIndex = 92;
@@ -1323,7 +1335,7 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(4, 149);
+            this.label5.Location = new System.Drawing.Point(7, 155);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(32, 17);
             this.label5.TabIndex = 50;
@@ -1356,7 +1368,7 @@
             this.MidLabelAutoPrint.Checked = true;
             this.MidLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
             this.MidLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabelAutoPrint.Location = new System.Drawing.Point(7, 92);
+            this.MidLabelAutoPrint.Location = new System.Drawing.Point(4, 89);
             this.MidLabelAutoPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.MidLabelAutoPrint.Name = "MidLabelAutoPrint";
             this.MidLabelAutoPrint.Size = new System.Drawing.Size(75, 21);
@@ -1399,7 +1411,7 @@
             // LogingOut
             // 
             this.LogingOut.AutoSize = true;
-            this.LogingOut.Location = new System.Drawing.Point(104, 10);
+            this.LogingOut.Location = new System.Drawing.Point(101, 7);
             this.LogingOut.Name = "LogingOut";
             this.LogingOut.Size = new System.Drawing.Size(42, 21);
             this.LogingOut.TabIndex = 77;
@@ -1425,7 +1437,7 @@
             // 
             this.label10.AutoSize = true;
             this.label10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label10.Location = new System.Drawing.Point(8, 142);
+            this.label10.Location = new System.Drawing.Point(9, 148);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(32, 17);
             this.label10.TabIndex = 90;
@@ -1435,7 +1447,7 @@
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(8, 108);
+            this.label6.Location = new System.Drawing.Point(9, 114);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(32, 17);
             this.label6.TabIndex = 87;
@@ -1489,7 +1501,7 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(233)))), ((int)(((byte)(206)))));
-            this.ClientSize = new System.Drawing.Size(1257, 729);
+            this.ClientSize = new System.Drawing.Size(1259, 729);
             this.Controls.Add(this.ProcessCount);
             this.Controls.Add(this.label9);
             this.Controls.Add(this.label8);
@@ -1541,18 +1553,18 @@
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridPrcode)).EndInit();
-            this.groupBoxWithBorder1.ResumeLayout(false);
+            this.groupBoxWithBorder1.ResumeLayout(true);
             this.groupBoxWithBorder1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.LabelInf)).EndInit();
-            this.SingleLabel.ResumeLayout(false);
+            this.SingleLabel.ResumeLayout(true);
             this.SingleLabel.PerformLayout();
-            this.MidLabel.ResumeLayout(false);
+            this.MidLabel.ResumeLayout(true);
             this.MidLabel.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.MidboxCapacity)).EndInit();
-            this.OutBoxLabel.ResumeLayout(false);
+            this.OutBoxLabel.ResumeLayout(true);
             this.OutBoxLabel.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.OutboxCapacity)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }
@@ -1675,10 +1687,10 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_pdno;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_whcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pjd_id;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_custprodcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_prodcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_whcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn CollectedNum;
         private System.Windows.Forms.DataGridViewTextBoxColumn UnCollectedNum;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_outqty;

+ 42 - 16
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -101,6 +101,7 @@ namespace UAS_LabelMachine
         public UAS_出货标签打印(string Master)
         {
             InitializeComponent();
+            (new EnvironmentSettings()).ReportSettings.ShowProgress = false;
             Text = Text + "-" + Master;
         }
 
@@ -268,6 +269,14 @@ namespace UAS_LabelMachine
             double CollectNum = 0;
             if (CurrentUnit == "KPCS")
             {
+                try
+                {
+                    double.Parse(CurrentZXBZ);
+                }
+                catch (Exception)
+                {
+                    MessageBox.Show("请检查最小包装数");
+                }
                 //如果单位是KPCS则必须是1000的整数倍
                 if (Convert.ToDouble((double.Parse(Data["QTY"]) / 1000).ToString("0.000")) / Convert.ToDouble(double.Parse(CurrentZXBZ).ToString("0.000")) % 1 != 0)
                 {
@@ -791,7 +800,7 @@ namespace UAS_LabelMachine
                     SelectMidBoxCode = LabelInf.Rows[SelectRowIndex].Cells["pib_outboxcode1"].Value.ToString();
                     for (int i = SelectRowIndex; i >= 0; i--)
                     {
-                        if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() == SelectProdcode)
+                        if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() == SelectProdcode && SelectMidBoxCode == LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())
                         {
                             if (!MidOutBoxCode.Contains(int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())))
                             {
@@ -806,7 +815,7 @@ namespace UAS_LabelMachine
                     }
                     for (int i = SelectRowIndex; i < LabelInf.Rows.Count - 1; i++)
                     {
-                        if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() == SelectProdcode)
+                        if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() == SelectProdcode && SelectMidBoxCode == LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())
                         {
                             if (!MidOutBoxCode.Contains(int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())))
                             {
@@ -1079,7 +1088,8 @@ namespace UAS_LabelMachine
             sql.Append("pr_zxbzs,pr_unit,pib_barcode,pib_outboxcode1,pib_outboxcode2,nvl(pib_ifprint,0)pib_ifprint from prodiobarcode left join ");
             sql.Append("prodiodetail on pib_piid=pd_piid and pd_pdno=pib_pdno and pd_prodcode=pib_prodcode left join product on pr_code=pib_prodcode  ");
             sql.Append("left join sale on sa_code=pib_ordercode left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode where pib_piid='" + PI_ID + "' ");
-            if (OutBoxNum.Text != "全部") {
+            if (OutBoxNum.Text != "全部")
+            {
                 sql.Append(" and pib_outboxcode2='" + OutBoxNum.Text + "' ");
             }
             sql.Append(" order by to_number(pib_outboxcode2),pib_id,pd_prodcode");
@@ -1550,21 +1560,28 @@ namespace UAS_LabelMachine
         /// <param name="DateCode"></param>
         private bool CheckDateCode(string DateCode)
         {
-            //根据DateCode计算的日期
-            string Year = DateCode.Substring(0, 2);
-            System.DateTime dt = new System.DateTime(int.Parse("20" + Year), 01, 01);
-            string Week = DateCode.Substring(2, 2);
-            System.DateTime dt1 = dt.AddDays(int.Parse(Week) * 7);
-
-            //减去DC校验后的日期
-            System.DateTime now = System.DateTime.Now;
-            System.DateTime now1 = now.AddDays(-int.Parse(DCCheck.Text));
-            //物料的DateCode大于限制日期即可
-            if (dt1 > now1)
+            try
+            {
+                //根据DateCode计算的日期
+                string Year = DateCode.Substring(0, 2);
+                System.DateTime dt = new System.DateTime(int.Parse("20" + Year), 01, 01);
+                string Week = DateCode.Substring(2, 2);
+                System.DateTime dt1 = dt.AddDays(int.Parse(Week) * 7);
+
+                //减去DC校验后的日期
+                System.DateTime now = System.DateTime.Now;
+                System.DateTime now1 = now.AddDays(-int.Parse(DCCheck.Text));
+                //物料的DateCode大于限制日期即可
+                if (dt1 > now1)
+                {
+                    return true;
+                }
+                return false;
+            }
+            catch (Exception)
             {
-                return true;
+                return false;
             }
-            return false;
         }
 
         private void PrintFooter_Click(object sender, EventArgs e)
@@ -1752,5 +1769,14 @@ namespace UAS_LabelMachine
         {
             LoadGridData(sender, e);
         }
+
+        private void LabelInf_SelectionChanged(object sender, EventArgs e)
+        {
+            DataGridViewSelectedRowCollection dsc = LabelInf.SelectedRows;
+            if (dsc.Count > 0)
+            {
+                SelectRowIndex = dsc[0].Index;
+            }
+        }
     }
 }

+ 3 - 3
UAS-出货标签管理(泽天)/UAS_出货标签管理.resx

@@ -129,6 +129,9 @@
   <metadata name="pd_pdno.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="pd_whcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="pjd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
@@ -138,9 +141,6 @@
   <metadata name="pd_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pd_whcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="CollectedNum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

+ 1 - 1
UAS_CheckWork/App.config

@@ -6,7 +6,7 @@
         </sectionGroup>
     </configSections>
     <startup> 
-        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
     </startup>
     <userSettings>
         <UAS_CheckWork.Properties.Settings>

+ 1 - 1
UAS_CheckWork/Properties/AssemblyInfo.cs

@@ -17,7 +17,7 @@ using System.Runtime.InteropServices;
 //将 ComVisible 设置为 false 将使此程序集中的类型
 //对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
 //请将此类型的 ComVisible 特性设置为 true。
-[assembly: ComVisible(false)]
+[assembly: ComVisible(true)]
 
 // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
 [assembly: Guid("28f8d16e-0332-4430-b0dc-e1e4c7da0bd1")]

+ 1 - 1
UAS_CheckWork/Tools/DataHelper.cs

@@ -9,7 +9,7 @@ namespace Check.DataOperate
     class DataHelper
     {
         //系统默认的的连接字符串
-        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=OSAUTO;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.247)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DOBOT_YJ;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=oa.dobot.cc)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
         //用户选择的数据库的连接字符串
         public static string DBConnectionString;
         public static OracleConnection connection = null;

+ 0 - 1
UAS_CheckWork/Tools/ExcelHandler.cs

@@ -148,7 +148,6 @@ namespace Check.DataOperate
         {
             StreamWriter sr;
             string filePath = @FolderPath;
-            string report;
             if (File.Exists(filePath + "\\" + FileName))   //如果文件存在,则创建File.AppendText对象   
             {
                 File.Delete(filePath + "\\" + FileName);

+ 37 - 3
UAS_CheckWork/UAS_CheckWork.csproj

@@ -13,6 +13,21 @@
     <FileAlignment>512</FileAlignment>
     <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
     <TargetFrameworkProfile />
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <PlatformTarget>AnyCPU</PlatformTarget>
@@ -23,6 +38,7 @@
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <PlatformTarget>AnyCPU</PlatformTarget>
@@ -33,6 +49,12 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup>
+    <StartupObject>UAS_CheckWork.Program</StartupObject>
+  </PropertyGroup>
+  <PropertyGroup>
+    <NoWin32Manifest>true</NoWin32Manifest>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="NPOI">
       <HintPath>tool\NPOI.dll</HintPath>
@@ -44,11 +66,9 @@
     <Reference Include="System.Core" />
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="Microsoft.CSharp" />
     <Reference Include="System.Data" />
     <Reference Include="System.Deployment" />
     <Reference Include="System.Drawing" />
-    <Reference Include="System.Net.Http" />
     <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Xml" />
   </ItemGroup>
@@ -117,7 +137,21 @@
     </Compile>
   </ItemGroup>
   <ItemGroup>
-    <None Include="App.config" />
+    <None Include="App.config">
+      <SubType>Designer</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include=".NETFramework,Version=v4.0">
+      <Visible>False</Visible>
+      <ProductName>Microsoft .NET Framework 4 %28x86 和 x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
   </ItemGroup>
   <ItemGroup>
     <COMReference Include="zkemkeeper">