Browse Source

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

Hcsy 7 years ago
parent
commit
0208dfd467

+ 1 - 1
UAS-MES/App.config

@@ -44,7 +44,7 @@
   <applicationSettings>
     <UAS_MES.Properties.Settings>
       <setting name="MES" serializeAs="String">
-        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230.200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
+        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
       </setting>
     </UAS_MES.Properties.Settings>
   </applicationSettings>

+ 1 - 1
UAS-MES/Login.cs

@@ -106,7 +106,7 @@ namespace UAS_MES
             //设置选中数据库的链接
             string DBUser = DB.SelectedValue.ToString().Split('#')[0];
             string Address = DB.SelectedValue.ToString().Split('#')[1];
-            DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" + Address + ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.CurrentDB = DBUser;
             //设置屏幕的宽高信息
             SystemInf.ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;

+ 12 - 12
UAS-MES/Properties/Settings.Designer.cs

@@ -107,9 +107,20 @@ namespace UAS_MES.Properties {
             }
         }
         
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false" +
+            ";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180." +
+            "218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
+        public string MES {
+            get {
+                return ((string)(this["MES"]));
+            }
+        }
+        
         [global::System.Configuration.UserScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("\\\\172.16.66.51\\lable")]
+        [global::System.Configuration.DefaultSettingValueAttribute("\\\\172.16.11.99\\ShareTest")]
         public string FTPAddress {
             get {
                 return ((string)(this["FTPAddress"]));
@@ -118,16 +129,5 @@ namespace UAS_MES.Properties {
                 this["FTPAddress"] = value;
             }
         }
-        
-        [global::System.Configuration.ApplicationScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false" +
-            ";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230" +
-            ".200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
-        public string MES {
-            get {
-                return ((string)(this["MES"]));
-            }
-        }
     }
 }

+ 4 - 4
UAS-MES/Properties/Settings.settings

@@ -23,11 +23,11 @@
     <Setting Name="BaudRate" Type="System.String" Scope="User">
       <Value Profile="(Default)" />
     </Setting>
-    <Setting Name="FTPAddress" Type="System.String" Scope="User">
-      <Value Profile="(Default)">\\172.16.66.51\lable</Value>
-    </Setting>
     <Setting Name="MES" Type="System.String" Scope="Application">
-      <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230.200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
+      <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
+    </Setting>
+    <Setting Name="FTPAddress" Type="System.String" Scope="User">
+      <Value Profile="(Default)">\\172.16.11.99\ShareTest</Value>
     </Setting>
   </Settings>
 </SettingsFile>

+ 12 - 0
UAS-出货标签管理(泽天)/UAS-出货标签管理(泽天).csproj

@@ -100,6 +100,18 @@
     <Reference Include="Analysis">
       <HintPath>tool\Analysis.dll</HintPath>
     </Reference>
+    <Reference Include="FastReport, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=db7e5ce63278458c, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>tool\FastReport.dll</HintPath>
+    </Reference>
+    <Reference Include="FastReport.Bars, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=db7e5ce63278458c, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>tool\FastReport.Bars.dll</HintPath>
+    </Reference>
+    <Reference Include="FastReport.Editor, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=db7e5ce63278458c, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>tool\FastReport.Editor.dll</HintPath>
+    </Reference>
     <Reference Include="Interop.LabelManager2">
       <HintPath>..\..\..\UAS_WinForm\UAS-出货标签管理\bin\Debug\Interop.LabelManager2.dll</HintPath>
       <EmbedInteropTypes>False</EmbedInteropTypes>

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

@@ -78,6 +78,7 @@
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
             this.label1 = new System.Windows.Forms.Label();
             this.Pack = new System.Windows.Forms.Button();
+            this.PrintStatus = new System.Windows.Forms.Button();
             this.DCCheck = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.GridPrcode = new UAS_LabelMachine.CustomControl.DataGridViewWithSerialNum();
             this.pd_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -100,6 +101,24 @@
             this.label7 = new System.Windows.Forms.Label();
             this.Input = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.LabelInf = new UAS_LabelMachine.CustomControl.DataGridViewWithSerialNum();
+            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_ifprint = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_id1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pjd_orispeccode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_zxbzs = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_custbarcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_custmidboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_custoutboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_pocode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_outboxcode2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pi_inoutno = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.SingleLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
             this.SingleLabelPrinter = new UAS_LabelMachine.CustomControl.PrinterCombox();
@@ -123,28 +142,7 @@
             this.OutBoxPrinter = new UAS_LabelMachine.CustomControl.PrinterCombox();
             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();
-            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_ifprint = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_id1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_vendprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_madein = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_zxbzs = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_custbarcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_custmidboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_custoutboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_pocode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_custprodspec = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_outboxcode2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridPrcode)).BeginInit();
@@ -180,7 +178,7 @@
             // LabelMainTain
             // 
             this.LabelMainTain.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.LabelMainTain.Location = new System.Drawing.Point(392, 15);
+            this.LabelMainTain.Location = new System.Drawing.Point(381, 15);
             this.LabelMainTain.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.LabelMainTain.Name = "LabelMainTain";
             this.LabelMainTain.Size = new System.Drawing.Size(68, 26);
@@ -192,7 +190,7 @@
             // CleanDetail
             // 
             this.CleanDetail.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CleanDetail.Location = new System.Drawing.Point(320, 15);
+            this.CleanDetail.Location = new System.Drawing.Point(309, 15);
             this.CleanDetail.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.CleanDetail.Name = "CleanDetail";
             this.CleanDetail.Size = new System.Drawing.Size(68, 26);
@@ -477,7 +475,7 @@
             // AttachInfo
             // 
             this.AttachInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AttachInfo.Location = new System.Drawing.Point(392, 48);
+            this.AttachInfo.Location = new System.Drawing.Point(381, 48);
             this.AttachInfo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.AttachInfo.Name = "AttachInfo";
             this.AttachInfo.Size = new System.Drawing.Size(68, 26);
@@ -509,7 +507,7 @@
             // ExportData
             // 
             this.ExportData.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ExportData.Location = new System.Drawing.Point(320, 48);
+            this.ExportData.Location = new System.Drawing.Point(309, 48);
             this.ExportData.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.ExportData.Name = "ExportData";
             this.ExportData.Size = new System.Drawing.Size(68, 26);
@@ -521,7 +519,7 @@
             // PrintFooter
             // 
             this.PrintFooter.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintFooter.Location = new System.Drawing.Point(465, 15);
+            this.PrintFooter.Location = new System.Drawing.Point(454, 15);
             this.PrintFooter.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.PrintFooter.Name = "PrintFooter";
             this.PrintFooter.Size = new System.Drawing.Size(68, 26);
@@ -563,7 +561,7 @@
             // Pack
             // 
             this.Pack.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Pack.Location = new System.Drawing.Point(465, 48);
+            this.Pack.Location = new System.Drawing.Point(454, 48);
             this.Pack.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Pack.Name = "Pack";
             this.Pack.Size = new System.Drawing.Size(68, 26);
@@ -572,6 +570,18 @@
             this.Pack.UseVisualStyleBackColor = true;
             this.Pack.Click += new System.EventHandler(this.Pack_Click);
             // 
+            // PrintStatus
+            // 
+            this.PrintStatus.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.PrintStatus.Location = new System.Drawing.Point(525, 15);
+            this.PrintStatus.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.PrintStatus.Name = "PrintStatus";
+            this.PrintStatus.Size = new System.Drawing.Size(68, 26);
+            this.PrintStatus.TabIndex = 97;
+            this.PrintStatus.Text = "打印状态";
+            this.PrintStatus.UseVisualStyleBackColor = true;
+            this.PrintStatus.Click += new System.EventHandler(this.PrintStatus_Click);
+            // 
             // DCCheck
             // 
             this.DCCheck.ID = null;
@@ -704,7 +714,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(68, 110);
+            this.label18.Location = new System.Drawing.Point(67, 109);
             this.label18.Name = "label18";
             this.label18.Size = new System.Drawing.Size(13, 17);
             this.label18.TabIndex = 90;
@@ -738,7 +748,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(67, 47);
+            this.label16.Location = new System.Drawing.Point(66, 46);
             this.label16.Name = "label16";
             this.label16.Size = new System.Drawing.Size(13, 17);
             this.label16.TabIndex = 87;
@@ -772,7 +782,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, 75);
+            this.label12.Location = new System.Drawing.Point(8, 74);
             this.label12.Name = "label12";
             this.label12.Size = new System.Drawing.Size(56, 17);
             this.label12.TabIndex = 77;
@@ -782,7 +792,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(9, 18);
+            this.label7.Location = new System.Drawing.Point(8, 17);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(56, 17);
             this.label7.TabIndex = 76;
@@ -815,9 +825,8 @@
             this.pib_id1,
             this.pib_pdno,
             this.pib_prodcode,
-            this.pr_vendprodcode,
+            this.pjd_orispeccode,
             this.pib_brand,
-            this.pib_madein,
             this.pr_zxbzs,
             this.pib_lotno,
             this.pib_datecode,
@@ -826,7 +835,6 @@
             this.pib_custmidboxcode,
             this.pib_custoutboxcode,
             this.pd_pocode,
-            this.pd_custprodspec,
             this.pr_spec,
             this.pib_outboxcode1,
             this.pib_outboxcode2});
@@ -839,6 +847,152 @@
             this.LabelInf.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.LabelInf_CellValueChanged);
             this.LabelInf.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.LabelInf_DataError);
             // 
+            // Choose
+            // 
+            this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.Choose.HeaderText = "勾选";
+            this.Choose.Name = "Choose";
+            this.Choose.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.Choose.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.Choose.Width = 55;
+            // 
+            // pib_ifprint
+            // 
+            this.pib_ifprint.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_ifprint.DataPropertyName = "pib_ifprint";
+            this.pib_ifprint.HeaderText = "已打印";
+            this.pib_ifprint.Name = "pib_ifprint";
+            this.pib_ifprint.Width = 60;
+            // 
+            // pib_id1
+            // 
+            this.pib_id1.DataPropertyName = "pib_id";
+            this.pib_id1.HeaderText = "pib_id";
+            this.pib_id1.Name = "pib_id1";
+            this.pib_id1.Visible = false;
+            this.pib_id1.Width = 66;
+            // 
+            // pib_pdno
+            // 
+            this.pib_pdno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_pdno.DataPropertyName = "pib_pdno";
+            this.pib_pdno.HeaderText = "明细序号";
+            this.pib_pdno.Name = "pib_pdno";
+            this.pib_pdno.ReadOnly = true;
+            this.pib_pdno.Width = 96;
+            // 
+            // pib_prodcode
+            // 
+            this.pib_prodcode.DataPropertyName = "pib_prodcode";
+            this.pib_prodcode.HeaderText = "物料编号";
+            this.pib_prodcode.Name = "pib_prodcode";
+            this.pib_prodcode.ReadOnly = true;
+            this.pib_prodcode.Width = 78;
+            // 
+            // pjd_orispeccode
+            // 
+            this.pjd_orispeccode.DataPropertyName = "pjd_orispeccode";
+            this.pjd_orispeccode.HeaderText = "MPN";
+            this.pjd_orispeccode.Name = "pjd_orispeccode";
+            this.pjd_orispeccode.ReadOnly = true;
+            this.pjd_orispeccode.Width = 48;
+            // 
+            // pib_brand
+            // 
+            this.pib_brand.DataPropertyName = "pib_brand";
+            this.pib_brand.HeaderText = "品牌";
+            this.pib_brand.Name = "pib_brand";
+            this.pib_brand.ReadOnly = true;
+            this.pib_brand.Width = 54;
+            // 
+            // pr_zxbzs
+            // 
+            this.pr_zxbzs.DataPropertyName = "pr_zxbzs";
+            this.pr_zxbzs.HeaderText = "最小包装数";
+            this.pr_zxbzs.Name = "pr_zxbzs";
+            this.pr_zxbzs.Visible = false;
+            this.pr_zxbzs.Width = 90;
+            // 
+            // pib_lotno
+            // 
+            this.pib_lotno.DataPropertyName = "pib_lotno";
+            this.pib_lotno.HeaderText = "LotNo";
+            this.pib_lotno.Name = "pib_lotno";
+            this.pib_lotno.ReadOnly = true;
+            this.pib_lotno.Width = 60;
+            // 
+            // pib_datecode
+            // 
+            this.pib_datecode.DataPropertyName = "pib_datecode";
+            this.pib_datecode.HeaderText = "DateCode";
+            this.pib_datecode.Name = "pib_datecode";
+            this.pib_datecode.ReadOnly = true;
+            this.pib_datecode.Width = 78;
+            // 
+            // pib_qty
+            // 
+            this.pib_qty.DataPropertyName = "pib_qty";
+            this.pib_qty.HeaderText = "数量";
+            this.pib_qty.Name = "pib_qty";
+            this.pib_qty.ReadOnly = true;
+            this.pib_qty.Width = 54;
+            // 
+            // pib_custbarcode
+            // 
+            this.pib_custbarcode.DataPropertyName = "pib_custbarcode";
+            this.pib_custbarcode.HeaderText = "料盘条码";
+            this.pib_custbarcode.Name = "pib_custbarcode";
+            this.pib_custbarcode.ReadOnly = true;
+            this.pib_custbarcode.Width = 78;
+            // 
+            // pib_custmidboxcode
+            // 
+            this.pib_custmidboxcode.DataPropertyName = "pib_custmidboxcode";
+            this.pib_custmidboxcode.HeaderText = "中盒条码";
+            this.pib_custmidboxcode.Name = "pib_custmidboxcode";
+            this.pib_custmidboxcode.Width = 78;
+            // 
+            // pib_custoutboxcode
+            // 
+            this.pib_custoutboxcode.DataPropertyName = "pib_custoutboxcode";
+            this.pib_custoutboxcode.HeaderText = "外箱条码";
+            this.pib_custoutboxcode.Name = "pib_custoutboxcode";
+            this.pib_custoutboxcode.ReadOnly = true;
+            this.pib_custoutboxcode.Width = 78;
+            // 
+            // pd_pocode
+            // 
+            this.pd_pocode.DataPropertyName = "pd_pocode";
+            this.pd_pocode.HeaderText = "客户PO";
+            this.pd_pocode.Name = "pd_pocode";
+            this.pd_pocode.ReadOnly = true;
+            this.pd_pocode.Width = 66;
+            // 
+            // pr_spec
+            // 
+            this.pr_spec.DataPropertyName = "pr_spec";
+            this.pr_spec.HeaderText = "规格";
+            this.pr_spec.Name = "pr_spec";
+            this.pr_spec.ReadOnly = true;
+            this.pr_spec.Visible = false;
+            this.pr_spec.Width = 54;
+            // 
+            // pib_outboxcode1
+            // 
+            this.pib_outboxcode1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_outboxcode1.DataPropertyName = "pib_outboxcode1";
+            this.pib_outboxcode1.HeaderText = "中盒号";
+            this.pib_outboxcode1.Name = "pib_outboxcode1";
+            this.pib_outboxcode1.Width = 90;
+            // 
+            // pib_outboxcode2
+            // 
+            this.pib_outboxcode2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_outboxcode2.DataPropertyName = "pib_outboxcode2";
+            this.pib_outboxcode2.HeaderText = "外箱号";
+            this.pib_outboxcode2.Name = "pib_outboxcode2";
+            this.pib_outboxcode2.Width = 90;
+            // 
             // pi_inoutno
             // 
             this.pi_inoutno.ID = null;
@@ -881,7 +1035,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(80, 156);
+            this.SingleLabelPrint.Location = new System.Drawing.Point(80, 158);
             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);
@@ -896,7 +1050,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(7, 94);
             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);
@@ -949,7 +1103,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(76, 124);
+            this.label2.Location = new System.Drawing.Point(75, 123);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(32, 17);
             this.label2.TabIndex = 92;
@@ -972,7 +1126,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, 124);
+            this.label5.Location = new System.Drawing.Point(3, 123);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(32, 17);
             this.label5.TabIndex = 50;
@@ -1002,13 +1156,15 @@
             // MidLabelAutoPrint
             // 
             this.MidLabelAutoPrint.AutoSize = true;
+            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(6, 94);
+            this.MidLabelAutoPrint.Location = new System.Drawing.Point(7, 93);
             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);
             this.MidLabelAutoPrint.TabIndex = 41;
-            this.MidLabelAutoPrint.Text = "自动打印";
+            this.MidLabelAutoPrint.Text = "打印尾数";
             this.MidLabelAutoPrint.UseVisualStyleBackColor = true;
             // 
             // MidLabelCombox
@@ -1032,7 +1188,6 @@
             this.OutBoxLabel.Controls.Add(this.OutBoxPrinter);
             this.OutBoxLabel.Controls.Add(this.OutboxCapacity);
             this.OutBoxLabel.Controls.Add(this.OutBoxLabelPrint);
-            this.OutBoxLabel.Controls.Add(this.OutBoxLabelAutoPrint);
             this.OutBoxLabel.Controls.Add(this.OutBoxCombox);
             this.OutBoxLabel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.OutBoxLabel.Location = new System.Drawing.Point(1075, 6);
@@ -1047,7 +1202,7 @@
             // LogingOut
             // 
             this.LogingOut.AutoSize = true;
-            this.LogingOut.Location = new System.Drawing.Point(111, 8);
+            this.LogingOut.Location = new System.Drawing.Point(110, 7);
             this.LogingOut.Name = "LogingOut";
             this.LogingOut.Size = new System.Drawing.Size(42, 21);
             this.LogingOut.TabIndex = 77;
@@ -1073,7 +1228,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(83, 126);
+            this.label10.Location = new System.Drawing.Point(82, 125);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(32, 17);
             this.label10.TabIndex = 90;
@@ -1083,7 +1238,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(4, 125);
+            this.label6.Location = new System.Drawing.Point(3, 124);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(32, 17);
             this.label6.TabIndex = 87;
@@ -1120,18 +1275,6 @@
             this.OutBoxLabelPrint.UseVisualStyleBackColor = true;
             this.OutBoxLabelPrint.Click += new System.EventHandler(this.OutBoxLabelPrint_Click);
             // 
-            // OutBoxLabelAutoPrint
-            // 
-            this.OutBoxLabelAutoPrint.AutoSize = true;
-            this.OutBoxLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxLabelAutoPrint.Location = new System.Drawing.Point(10, 96);
-            this.OutBoxLabelAutoPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.OutBoxLabelAutoPrint.Name = "OutBoxLabelAutoPrint";
-            this.OutBoxLabelAutoPrint.Size = new System.Drawing.Size(75, 21);
-            this.OutBoxLabelAutoPrint.TabIndex = 79;
-            this.OutBoxLabelAutoPrint.Text = "自动打印";
-            this.OutBoxLabelAutoPrint.UseVisualStyleBackColor = true;
-            // 
             // OutBoxCombox
             // 
             this.OutBoxCombox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@@ -1144,173 +1287,13 @@
             this.OutBoxCombox.TabIndex = 78;
             this.OutBoxCombox.SelectedIndexChanged += new System.EventHandler(this.OutBoxCombox_SelectedIndexChanged);
             // 
-            // Choose
-            // 
-            this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.Choose.HeaderText = "勾选";
-            this.Choose.Name = "Choose";
-            this.Choose.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.Choose.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
-            this.Choose.Width = 55;
-            // 
-            // pib_ifprint
-            // 
-            this.pib_ifprint.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_ifprint.DataPropertyName = "pib_ifprint";
-            this.pib_ifprint.HeaderText = "已打印";
-            this.pib_ifprint.Name = "pib_ifprint";
-            this.pib_ifprint.Width = 60;
-            // 
-            // pib_id1
-            // 
-            this.pib_id1.DataPropertyName = "pib_id";
-            this.pib_id1.HeaderText = "pib_id";
-            this.pib_id1.Name = "pib_id1";
-            this.pib_id1.Visible = false;
-            this.pib_id1.Width = 66;
-            // 
-            // pib_pdno
-            // 
-            this.pib_pdno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_pdno.DataPropertyName = "pib_pdno";
-            this.pib_pdno.HeaderText = "明细序号";
-            this.pib_pdno.Name = "pib_pdno";
-            this.pib_pdno.ReadOnly = true;
-            this.pib_pdno.Width = 96;
-            // 
-            // pib_prodcode
-            // 
-            this.pib_prodcode.DataPropertyName = "pib_prodcode";
-            this.pib_prodcode.HeaderText = "物料编号";
-            this.pib_prodcode.Name = "pib_prodcode";
-            this.pib_prodcode.ReadOnly = true;
-            this.pib_prodcode.Width = 78;
-            // 
-            // pr_vendprodcode
-            // 
-            this.pr_vendprodcode.DataPropertyName = "pr_vendprodcode";
-            this.pr_vendprodcode.HeaderText = "MPN";
-            this.pr_vendprodcode.Name = "pr_vendprodcode";
-            this.pr_vendprodcode.ReadOnly = true;
-            this.pr_vendprodcode.Width = 48;
-            // 
-            // pib_brand
-            // 
-            this.pib_brand.DataPropertyName = "pib_brand";
-            this.pib_brand.HeaderText = "品牌";
-            this.pib_brand.Name = "pib_brand";
-            this.pib_brand.ReadOnly = true;
-            this.pib_brand.Width = 54;
-            // 
-            // pib_madein
-            // 
-            this.pib_madein.DataPropertyName = "pib_madein";
-            this.pib_madein.HeaderText = "产地";
-            this.pib_madein.Name = "pib_madein";
-            this.pib_madein.Width = 54;
-            // 
-            // pr_zxbzs
-            // 
-            this.pr_zxbzs.DataPropertyName = "pr_zxbzs";
-            this.pr_zxbzs.HeaderText = "最小包装数";
-            this.pr_zxbzs.Name = "pr_zxbzs";
-            this.pr_zxbzs.Visible = false;
-            this.pr_zxbzs.Width = 90;
-            // 
-            // pib_lotno
-            // 
-            this.pib_lotno.DataPropertyName = "pib_lotno";
-            this.pib_lotno.HeaderText = "LotNo";
-            this.pib_lotno.Name = "pib_lotno";
-            this.pib_lotno.ReadOnly = true;
-            this.pib_lotno.Width = 60;
-            // 
-            // pib_datecode
-            // 
-            this.pib_datecode.DataPropertyName = "pib_datecode";
-            this.pib_datecode.HeaderText = "DateCode";
-            this.pib_datecode.Name = "pib_datecode";
-            this.pib_datecode.ReadOnly = true;
-            this.pib_datecode.Width = 78;
-            // 
-            // pib_qty
-            // 
-            this.pib_qty.DataPropertyName = "pib_qty";
-            this.pib_qty.HeaderText = "数量";
-            this.pib_qty.Name = "pib_qty";
-            this.pib_qty.ReadOnly = true;
-            this.pib_qty.Width = 54;
-            // 
-            // pib_custbarcode
-            // 
-            this.pib_custbarcode.DataPropertyName = "pib_custbarcode";
-            this.pib_custbarcode.HeaderText = "料盘条码";
-            this.pib_custbarcode.Name = "pib_custbarcode";
-            this.pib_custbarcode.ReadOnly = true;
-            this.pib_custbarcode.Width = 78;
-            // 
-            // pib_custmidboxcode
-            // 
-            this.pib_custmidboxcode.DataPropertyName = "pib_custmidboxcode";
-            this.pib_custmidboxcode.HeaderText = "中盒条码";
-            this.pib_custmidboxcode.Name = "pib_custmidboxcode";
-            this.pib_custmidboxcode.Width = 78;
-            // 
-            // pib_custoutboxcode
-            // 
-            this.pib_custoutboxcode.DataPropertyName = "pib_custoutboxcode";
-            this.pib_custoutboxcode.HeaderText = "外箱条码";
-            this.pib_custoutboxcode.Name = "pib_custoutboxcode";
-            this.pib_custoutboxcode.ReadOnly = true;
-            this.pib_custoutboxcode.Width = 78;
-            // 
-            // pd_pocode
-            // 
-            this.pd_pocode.DataPropertyName = "pd_pocode";
-            this.pd_pocode.HeaderText = "客户PO";
-            this.pd_pocode.Name = "pd_pocode";
-            this.pd_pocode.ReadOnly = true;
-            this.pd_pocode.Width = 66;
-            // 
-            // pd_custprodspec
-            // 
-            this.pd_custprodspec.DataPropertyName = "pd_custprodspec";
-            this.pd_custprodspec.HeaderText = "客户型号";
-            this.pd_custprodspec.Name = "pd_custprodspec";
-            this.pd_custprodspec.ReadOnly = true;
-            this.pd_custprodspec.Width = 78;
-            // 
-            // pr_spec
-            // 
-            this.pr_spec.DataPropertyName = "pr_spec";
-            this.pr_spec.HeaderText = "规格";
-            this.pr_spec.Name = "pr_spec";
-            this.pr_spec.ReadOnly = true;
-            this.pr_spec.Visible = false;
-            this.pr_spec.Width = 54;
-            // 
-            // pib_outboxcode1
-            // 
-            this.pib_outboxcode1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_outboxcode1.DataPropertyName = "pib_outboxcode1";
-            this.pib_outboxcode1.HeaderText = "中盒号";
-            this.pib_outboxcode1.Name = "pib_outboxcode1";
-            this.pib_outboxcode1.Width = 90;
-            // 
-            // pib_outboxcode2
-            // 
-            this.pib_outboxcode2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_outboxcode2.DataPropertyName = "pib_outboxcode2";
-            this.pib_outboxcode2.HeaderText = "外箱号";
-            this.pib_outboxcode2.Name = "pib_outboxcode2";
-            this.pib_outboxcode2.Width = 90;
-            // 
             // UAS_出货标签打印
             // 
             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, 711);
+            this.Controls.Add(this.PrintStatus);
             this.Controls.Add(this.Pack);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.DCCheck);
@@ -1394,7 +1377,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn15;
         private System.Windows.Forms.Label label6;
         private System.Windows.Forms.NumericUpDown OutboxCapacity;
-        private System.Windows.Forms.CheckBox OutBoxLabelAutoPrint;
         private System.Windows.Forms.ComboBox MidLabelCombox;
         private System.Windows.Forms.CheckBox MidLabelAutoPrint;
         private System.Windows.Forms.Button MidLabelPrint;
@@ -1463,14 +1445,14 @@
         private System.Windows.Forms.NumericUpDown MidboxCapacity;
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Button Pack;
+        private System.Windows.Forms.Button PrintStatus;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
         private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifprint;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_id1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_pdno;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_prodcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pr_vendprodcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pjd_orispeccode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_brand;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pib_madein;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_zxbzs;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_lotno;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_datecode;
@@ -1479,7 +1461,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_custmidboxcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_custoutboxcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_pocode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_custprodspec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;

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

@@ -76,10 +76,6 @@ namespace UAS_LabelMachine
         /// </summary>
         List<string> SingleBoxArgument = new List<string>();
         /// <summary>
-        /// 存放中盒的ID和盒号
-        /// </summary>
-        Dictionary<string, string> MidIDAndOutboxcode = new Dictionary<string, string>();
-        /// <summary>
         /// 中盒的打印参数
         /// </summary>
         List<string> MidBoxArgument = new List<string>();
@@ -155,7 +151,6 @@ namespace UAS_LabelMachine
             dh = SystemInf.dh;
             CheckForIllegalCrossThreadCalls = false;
             pi_inoutno.Focus();
-
             Point pt = new Point();
             //禁止所有列的排序
             foreach (DataGridViewColumn dgv in LabelInf.Columns)
@@ -251,17 +246,7 @@ namespace UAS_LabelMachine
         {
             if (Input.Text == "SC")
             {
-                EnablePrint = !EnablePrint;
-                if (EnablePrint)
-                {
-                    SetPrintStatus_label.ForeColor = Color.Green;
-                    SetPrintStatus_label.Text = "可打印";
-                }
-                else
-                {
-                    SetPrintStatus_label.ForeColor = Color.Red;
-                    SetPrintStatus_label.Text = "暂停打印";
-                }
+                PrintStatus.PerformClick();
                 Input.Text = "";
                 return;
             }
@@ -390,13 +375,13 @@ namespace UAS_LabelMachine
             }
             sql.Clear();
             sql.Append("insert into prodiobarcode(PIB_ID,PIB_PRODCODE,PIB_INDATE,PIB_INOUTNO,PIB_PIID,PIB_PDNO, PIB_PDID,PIB_PICLASS,");
-            sql.Append("PIB_BARCODE,PIB_CUSTBARCODE,PIB_QTY,PIB_OUTBOXCODE1,pib_datecode,pib_lotno,PIB_OUTBOXCODE2,pib_inman,PIB_IFPRINT,PIB_ORDERCODE,PIB_CUSTPO) ");
+            sql.Append("PIB_BARCODE,PIB_CUSTBARCODE,PIB_QTY,pib_brand,pib_datecode,pib_lotno,PIB_OUTBOXCODE2,pib_inman,PIB_IFPRINT,PIB_ORDERCODE,PIB_CUSTPO) ");
             sql.Append("select :PIB_ID,pd_prodcode,sysdate,pi_inoutno,pi_id,pd_pdno,pd_id,pi_class,");
-            sql.Append("'" + pib_barcode + "',:PIB_CUSTBARCODE,'" + CurrentZXBZ + "','','" + Data["DATECODE"] + "','" + Data["LOTNO"] + "','" + pib_outboxcode2 + "','" + User.UserCode + "','" + (EnablePrint ? 1 : 0).ToString() + "',pd_ordercode,pd_pocode ");
-            sql.Append("from prodinout left join prodiodetail on pi_id=pd_piid where pi_id='" + PI_ID + "' and pd_prodcode='" + CurrentPrCode + "' and pd_pdno='" + CurrentPDNO + "'");
+            sql.Append("'" + pib_barcode + "',:PIB_CUSTBARCODE,'" + CurrentZXBZ + "',pjd_brand,'" + Data["DATECODE"] + "','" + Data["LOTNO"] + "','" + pib_outboxcode2 + "','" + User.UserCode + "','" + (EnablePrint ? 1 : 0).ToString() + "',pd_ordercode,pd_pocode ");
+            sql.Append("from prodinout left join prodiodetail on pi_id=pd_piid left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode where pi_id='" + PI_ID + "' and pd_prodcode='" + CurrentPrCode + "' and pd_pdno='" + CurrentPDNO + "'");
             dh.BatchInsert(sql.ToString(), new string[] { "PIB_ID", "PIB_CUSTBARCODE" }, PIBID, CustBarCode.ToArray());
             //更新流水号
-            dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + CodeCount) + "'", "rmn_nrcode='" + pi_cardcode.Text + "' and rmn_prefix='" + Prefix + "'");
+            dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum) + "'", "rmn_nrcode='" + pi_cardcode.Text + "' and rmn_prefix='" + Prefix + "'");
             LoadGridData(new object(), new EventArgs());
             //加载完数据之后进行容量的判断
             int BoxNum = LabelInfDataTable.Select("pib_outboxcode2='" + OutBoxNum.Text + "'").Length;
@@ -448,6 +433,19 @@ namespace UAS_LabelMachine
         {
             if (EnablePrint)
             {
+                try
+                {
+                    if (SingleDoc.Variables.FreeVariables.Count == 0)
+                    {
+                        MessageBox.Show("单盘标签未维护参数", "提示");
+                        return;
+                    }
+                }
+                catch (Exception)
+                {
+                    MessageBox.Show("单盘标签未维护参数", "提示");
+                    return;
+                }
                 //用标签本身的变量作为最外层的循环条件去匹配;
                 string[] arg = SingleBoxArgument.ToArray();
                 StringBuilder ParamLog = new StringBuilder();
@@ -463,7 +461,7 @@ namespace UAS_LabelMachine
                     }
                     LogManager.DoLog(ParamLog.ToString());
                     //保存参数打印
-
+                    Console.WriteLine(SingleDoc.Database.GetType());
                     SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
                     SingleDoc.PrintDocument();
                     Properties.Settings.Default.SPrinter = SingleLabelPrinter.Text;
@@ -700,7 +698,6 @@ namespace UAS_LabelMachine
                     //重新输入单号后清除缓存
                     MidBoxArgument.Clear();
                     SingleBoxArgument.Clear();
-                    MidIDAndOutboxcode.Clear();
                     SingleID.Clear();
                     Input.Focus();
                     //从后往前找未采集的行
@@ -730,27 +727,20 @@ namespace UAS_LabelMachine
             {
                 try
                 {
-                    if (SingleDoc.Variables.FreeVariables.Count == 0) { }
+                    if (SingleDoc.Variables.FreeVariables.Count == 0)
+                    {
+                        MessageBox.Show("单盘标签未维护参数", "提示");
+                        return;
+                    }
                 }
                 catch (Exception)
                 {
                     MessageBox.Show("单盘标签未维护参数", "提示");
-                }
-                if (MidLabelAutoPrint.Checked)
-                {
-                    try
-                    {
-                        if (MidDoc.Variables.FreeVariables.Count == 0) { }
-                    }
-                    catch (Exception)
-                    {
-                        MessageBox.Show("中盘标签未维护参数", "提示");
-                    }
+                    return;
                 }
                 if (SingleLabelParam.Rows.Count > 0 && LabelInf.Rows.Count > 0)
                 {
                     //每次打印清除之前缓存的行号和ID,后面会判断需要打印的数据重新加载
-                    MidIDAndOutboxcode.Clear();
                     SingleID.Clear();
                     //获取全部的中盒号
                     Dictionary<string, bool> outboxcode1 = new Dictionary<string, bool>();
@@ -760,14 +750,6 @@ namespace UAS_LabelMachine
                     {
                         if (!SingleID.Contains(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString()))
                             SingleID.Add(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString());
-                        if (LabelInf.Rows[i].Cells["Choose"].FormattedValue.ToString().ToLower() == "true" && LabelInf.Rows[i].Cells["pib_ifprint"].FormattedValue.ToString() != "true")
-                        {
-                            //如果不存在中盒号则进行添加
-                            if (!MidIDAndOutboxcode.ContainsValue(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()))
-                            {
-                                MidIDAndOutboxcode.Add(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString(), LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString());
-                            }
-                        }
                     }
                     if (SingleID.ToArray().Length == 0)
                     {
@@ -813,22 +795,6 @@ namespace UAS_LabelMachine
                                 SingleDoc.PrintDocument();
                                 Properties.Settings.Default.SPrinter = SingleLabelPrinter.Text;
                                 Properties.Settings.Default.Save();
-                                if (MidLabelAutoPrint.Checked)
-                                {
-                                    //判断当前行的盒号和下一行不相等或者已经是最后一行了
-                                    if (i + 1 == LabelInf.RowCount || LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString() != LabelInf.Rows[i + 1 == LabelInf.RowCount ? i : i + 1].Cells["pib_outboxcode1"].Value.ToString())
-                                    {
-                                        if (outboxcode1[LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()])
-                                        {
-                                            if (MidLabelCombox.SelectedValue != null)
-                                            {
-                                                string la_id_mid = MidLabelCombox.SelectedValue.ToString().Split('#')[0];
-                                                MidBoxCodePrint(la_id_mid, i);
-                                            }
-                                        }
-                                    }
-                                }
-                                //勾选为已打印
                                 LabelInf.Rows[i].Cells["pib_ifprint"].Value = true;
                             }
                             catch (Exception ex) { LogManager.DoLog(ex.StackTrace); }
@@ -939,8 +905,6 @@ namespace UAS_LabelMachine
                 string la_id = MidLabelCombox.SelectedValue.ToString().Split('#')[0];
                 for (int i = (begin == 0 ? 0 : begin); i <= (end == 0 ? LabelInf.Rows.Count - 1 : end); i++)
                 {
-                    if (!MidIDAndOutboxcode.ContainsValue(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()))
-                        MidIDAndOutboxcode.Add(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString(), LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString());
                     if (!MidOutBoxCode.Contains(int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())))
                     {
                         MidOutBoxCode.Add(int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()));
@@ -1005,7 +969,7 @@ namespace UAS_LabelMachine
             string la_id = OutBoxCombox.SelectedValue.ToString().Split('#')[0];
             string cl_labelname = OutBoxCombox.Text;
             string LabelUrl = dh.getFieldDataByCondition("label left join customerlabel on la_code=cl_labelcode", "cl_labelurl", "la_id='" + la_id + "' and cl_labelname='" + cl_labelname + "'").ToString();
-            if (OutBoxNum.Text == "")
+            if (OutBoxNum.Text == "" || OutBoxNum.Text == "新增")
             {
                 for (int i = 0; i < LabelInf.RowCount; i++)
                 {
@@ -1205,11 +1169,11 @@ namespace UAS_LabelMachine
         {
             AllChecked = false;
             sql.Clear();
-            sql.Append("select pd_custprodcode,pd_custprodspec,pib_custmidboxcode,pd_pocode,pib_madein,pib_custbarcode,pib_custoutboxcode,pib_id,pib_datecode1,pib_pdid,pib_piid,");
+            sql.Append("select pd_custprodcode,pd_custprodspec,pib_custmidboxcode,pd_pocode,pjd_orispeccode,pib_madein,pib_custbarcode,pib_custoutboxcode,pib_id,pib_datecode1,pib_pdid,pib_piid,");
             sql.Append("pib_pdno,pib_prodcode,nvl(nvl(pd_brand,pib_brand),pr_brand)pib_brand,pr_vendprodcode,pib_lotno,pib_datecode,pib_qty,pr_spec,");
             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 where pib_piid='" + PI_ID + "' ");
+            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 + "' ");
             sql.Append(" order by to_number(pib_outboxcode2),pib_id,pd_prodcode");
             LabelInfDataTable = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             if (OutBoxNum.Text != "新增")
@@ -1722,6 +1686,7 @@ namespace UAS_LabelMachine
             {
                 //生成中盒条码
                 int pib_outboxcode1 = 0;
+                CurrentMaxNum = CurrentMaxNum - 1;
                 for (int i = 0; i < dt.Rows.Count; i++)
                 {
                     List<string> MidBoxCode = new List<string>();
@@ -1734,9 +1699,9 @@ namespace UAS_LabelMachine
                         if (j % 10 == 0)
                         {
                             pib_outboxcode1 = pib_outboxcode1 + 1;
-                            MaxNum = MaxNum + 1;
+                            CurrentMaxNum = CurrentMaxNum + 1;
                         }
-                        string serialcode = BaseUtil.DToAny(MaxNum, Radix);
+                        string serialcode = BaseUtil.DToAny(CurrentMaxNum, Radix);
                         for (int k = serialcode.ToString().Length; k < NumLength; k++)
                         {
                             serialcode = "0" + serialcode;
@@ -1747,25 +1712,40 @@ namespace UAS_LabelMachine
                     }
                     dh.BatchInsert("update prodiobarcode set pib_custmidboxcode=:pib_custmidboxcode,pib_outboxcode1=:pib_outboxcode1 where pib_id=:pib_id and pib_custmidboxcode is null", new string[] { "pib_custmidboxcode", "pib_outboxcode1", "pib_id" }, MidBoxCode.ToArray(), PIBOUTBOXCODE1.ToArray(), PIBID.ToArray());
                 }
-                MaxNum = MaxNum + 1;
+                CurrentMaxNum = CurrentMaxNum + 1;
                 //生成外箱条码
                 for (int i = 0; i < dt.Rows.Count; i++)
                 {
                     List<string> OutBoxCode = new List<string>();
                     List<string> PIBOUTBOXCODE2 = new List<string>();
-                    string serialcode = BaseUtil.DToAny(MaxNum, Radix);
+                    string serialcode = BaseUtil.DToAny(CurrentMaxNum, Radix);
                     for (int k = serialcode.ToString().Length; k < NumLength; k++)
                     {
                         serialcode = "0" + serialcode;
                     }
                     OutBoxCode.Add(Prefix + serialcode + Suffix);
                     PIBOUTBOXCODE2.Add(dt.Rows[i]["pib_outboxcode2"].ToString());
-                    MaxNum = MaxNum + 1;
+                    CurrentMaxNum = CurrentMaxNum + 1;
                     dh.BatchInsert("update prodiobarcode set pib_custoutboxcode=:pib_custoutboxcode where pib_outboxcode2=:pib_outboxcode2 and pib_custoutboxcode is null", new string[] { "pib_custoutboxcode", "pib_outboxcode2" }, OutBoxCode.ToArray(), PIBOUTBOXCODE2.ToArray());
                 }
-                dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + MaxNum + "'", "rmn_nrcode='" + pi_cardcode.Text + "' and rmn_prefix='" + Prefix + "'");
+                dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + CurrentMaxNum + "'", "rmn_nrcode='" + pi_cardcode.Text + "' and rmn_prefix='" + Prefix + "'");
             }
             LoadGridData(sender, e);
         }
+
+        private void PrintStatus_Click(object sender, EventArgs e)
+        {
+            EnablePrint = !EnablePrint;
+            if (EnablePrint)
+            {
+                SetPrintStatus_label.ForeColor = Color.Green;
+                SetPrintStatus_label.Text = "可打印";
+            }
+            else
+            {
+                SetPrintStatus_label.ForeColor = Color.Red;
+                SetPrintStatus_label.Text = "暂停打印";
+            }
+        }
     }
 }

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

@@ -153,9 +153,6 @@
   <metadata name="pjd_zxbzs_user.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pib_madein.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="pr_zxbzs.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
@@ -168,9 +165,6 @@
   <metadata name="pib_custoutboxcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pd_custprodspec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="pr_spec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

BIN
UAS-出货标签管理(泽天)/tool/FastReport.Bars.dll


BIN
UAS-出货标签管理(泽天)/tool/FastReport.Editor.dll


BIN
UAS-出货标签管理(泽天)/tool/FastReport.dll


+ 20 - 20
UAS-出货标签管理/PublicMethod/DataHelper.cs

@@ -11,16 +11,16 @@ namespace UAS_LabelMachine
     public class DataHelper
     {
 
-        ////富为外网地址
-        //private readonly string ConnectionStrings = "Data Source=richwellgroup.com.cn/orcl;User ID=DATACENTER;PassWord=select!#%*(";
-        ////富为ERP地址
-        //public static readonly string ERPAddesss = "http://richwellgroup.com.cn:8099/ERP/";
-        ////富为FTP
-        //public static readonly string FTPAdress = "ftp://richwellgroup.com.cn|printuser|printuser";
-        ////Oracle端口
-        //public static readonly string OraclePort = "1521";
-        ////需要显示的账套
-        //public static readonly string Masters = "JDTSY,FW_JDT,N_DATACENTER,FY_TEST,JD_TEST,XY_TEST,FW_TEST,DATACENTER,FW,XY,FY";
+        //富为外网地址
+        private readonly string ConnectionStrings = "Data Source=richwellgroup.com.cn/orcl;User ID=DATACENTER;PassWord=select!#%*(";
+        //富为ERP地址
+        public static readonly string ERPAddesss = "http://richwellgroup.com.cn:8099/ERP/";
+        //富为FTP
+        public static readonly string FTPAdress = "ftp://richwellgroup.com.cn|printuser|printuser";
+        //Oracle端口
+        public static readonly string OraclePort = "1521";
+        //需要显示的账套
+        public static readonly string Masters = "JDTSY,FW_JDT,N_DATACENTER,FY_TEST,JD_TEST,XY_TEST,FW_TEST,DATACENTER,FW,XY,FY";
 
         ////怡海能达外网地址
         //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=sz.hi-mantech.com)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
@@ -44,16 +44,16 @@ namespace UAS_LabelMachine
         ////需要显示的账套
         //public static readonly string Masters = "XSQ,N_YITOA_YWC,ZXN,N_YITOA_LHCT,N_YITOA_CT,N_CHL,N_YITOA_HK,N_HUASL_SHTL,N_WILICHK,N_WILIC,N_E_SHINE_SH,N_SHBJ,N_BJKG,N_HUASL,N_HUASL_QD,N_HUASL_XM,N_HUASL_SZ";
 
-        //泽天外网地址
-        private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=ZT_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=183.47.41.2)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-        //泽天ERP地址
-        public static readonly string ERPAddesss = "http://183.47.41.2:8099/ERP/";
-        //泽天FTP
-        public static readonly string FTPAdress = "ftp://183.47.41.3:21|uas|Zt2018";
-        //Oracle端口
-        public static readonly string OraclePort = "1521";
-        //需要显示的账套
-        public static readonly string Masters = "ZT_TEST";
+        ////泽天外网地址
+        //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=ZT_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=183.47.41.2)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        ////泽天ERP地址
+        //public static readonly string ERPAddesss = "http://183.47.41.2:8099/ERP/";
+        ////泽天FTP
+        //public static readonly string FTPAdress = "ftp://183.47.41.3:21|uas|Zt2018";
+        ////Oracle端口
+        //public static readonly string OraclePort = "1521";
+        ////需要显示的账套
+        //public static readonly string Masters = "ZT_TEST";
         //用户选择的数据库的连接字符串
         public static string DBConnectionString;
         static OracleConnection connection = null;

+ 1 - 0
UAS-出货标签管理/UAS_出货标签管理.Designer.cs

@@ -771,6 +771,7 @@
             this.AttachInfo.TabIndex = 85;
             this.AttachInfo.Text = "附加信息设置";
             this.AttachInfo.UseVisualStyleBackColor = true;
+            this.AttachInfo.Visible = false;
             this.AttachInfo.Click += new System.EventHandler(this.AttachInfo_Click);
             // 
             // pi_date

+ 8 - 1
UAS-出货标签管理/生成条码.cs

@@ -553,9 +553,16 @@ namespace UAS_LabelMachine
                 //查询出入库的类型
                 dt = (DataTable)dh.ExecuteSql("select ds_inorout from documentsetup where ds_name='" + pi_class.Text + "'", "select");
                 sql.Clear();
-                sql.Append("select * from prodiobarcode_view where  pd_piid='" + pi_id + "'");
+                sql.Append("select pd_piid,pd_id,pr_id,pr_brand,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty pd_totalqty,pd_ordercode,pd_orderdetno,pd_pdno,pd_prodcode,pd_piclass,pd_qty from (select ");
+                sql.Append("pd_piid,pd_id,pr_id,pr_brand,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty,pd_ordercode,pd_orderdetno,pd_pdno,pd_prodcode,pd_piclass,");
+                sql.Append("outqty-nvl((select sum(nvl(pib_qty,0)) from PRODIOBARCODE where PIB_PIID=pd_piid and pib_ordercode=pd_ordercode ");
+                sql.Append("and pib_orderdetno=pd_orderdetno),0)pd_qty from (select pd_piid,min(pd_id) pd_id,sum(pd_outqty)outqty,");
+                sql.Append("pd_ordercode,pd_orderdetno,pd_pdno,max(pd_prodcode)pd_prodcode,max(pd_piclass)pd_piclass ");
+                sql.Append("from prodiodetail where pd_piclass='出货单' group by pd_piid,pd_ordercode,pd_orderdetno,pd_pdno)T left join product on pr_code=pd_prodcode ");
+                sql.Append("where nvl(pr_zxbzs,0)>0)  where  pd_piid='" + pi_id + "'");
                 dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                 BaseUtil.FillDgvWithDataTable(ProdIoInfDGV, dt);
+                BaseUtil.FillDgvWithDataTable(ProdIoInfDGV, dt);
             }
             else
             {

+ 1 - 1
UAS_AutoPass/UAS_AutoPass.csproj

@@ -67,7 +67,7 @@
     <GenerateManifests>true</GenerateManifests>
   </PropertyGroup>
   <PropertyGroup>
-    <SignManifests>true</SignManifests>
+    <SignManifests>false</SignManifests>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="BenQGuru.eMES.DLLService">

+ 8 - 31
UAS_DeviceMonitor/DataOperate/DataHelper.cs

@@ -3,6 +3,7 @@ using System;
 using System.Collections.Generic;
 using System.Data;
 using System.Text;
+using UAS_DeviceMonitor.PublicMethod;
 
 namespace UAS_DeviceMonitor.DataOperate
 {
@@ -11,7 +12,7 @@ namespace UAS_DeviceMonitor.DataOperate
         //系统默认的的连接字符串
         private string ConnectionStrings = Properties.Settings.Default.Properties["MES"].DefaultValue.ToString();
         //用户选择的数据库的连接字符串
-        public static string DBConnectionString;
+        public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=UAS_MES_PROD;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.253.6)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
         public static OracleConnection connection = null;
         OracleCommand command = null;
         /// <summary>
@@ -38,7 +39,6 @@ namespace UAS_DeviceMonitor.DataOperate
         {
             DataTable dt = new DataTable();
             command = new OracleCommand("select Column_Name,Data_Type from cols where TABLE_name=upper('" + TableName + "')", connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
@@ -53,16 +53,17 @@ namespace UAS_DeviceMonitor.DataOperate
         {
             DataTable dt = new DataTable();
             string sql = "select " + Field + " from " + TableName + " where " + Condition;
+            Console.WriteLine(sql);
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter();
             ad.SelectCommand = command;
             try
             {
                 ad.Fill(dt);
             }
-            catch (Exception)
+            catch (Exception e) 
             {
+                LogManager.DoLog(e.StackTrace + e.Message);
                 connection = new OracleConnection(DBConnectionString);
                 connection.Open();
                 command = new OracleCommand(sql, connection);
@@ -126,7 +127,6 @@ namespace UAS_DeviceMonitor.DataOperate
             DataTable dt = new DataTable();
             string sql = "select count(1) from " + TableName + " where " + Condition;
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
@@ -144,7 +144,6 @@ namespace UAS_DeviceMonitor.DataOperate
             DataTable dt = new DataTable();
             string sql = "select count(1) from " + TableName;
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
 
             ad.Fill(dt);
@@ -163,7 +162,6 @@ namespace UAS_DeviceMonitor.DataOperate
             sql += AddField(Fields);
             sql += " from " + TableName + " where " + Condition + " and rownum=1";
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             try
             {
@@ -228,7 +226,6 @@ namespace UAS_DeviceMonitor.DataOperate
                     sql.Append(" from " + TableName + ") A where ROWNUM <= " + CurrentPage * PageSize + ") where RN> " + (CurrentPage - 1) * PageSize);
             }
             command = new OracleCommand(sql.ToString(), connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
@@ -253,7 +250,6 @@ namespace UAS_DeviceMonitor.DataOperate
             sql += " from " + TableName + " where " + Condition;
 
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             try
             {
@@ -283,7 +279,6 @@ namespace UAS_DeviceMonitor.DataOperate
             sql += Fields;
             sql += " from " + TableName;
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.SelectCommand = command;
             try
@@ -475,7 +470,6 @@ namespace UAS_DeviceMonitor.DataOperate
         {
             string sql = "select count(1) from " + TableName + " where " + Condition;
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             DataTable dt = new DataTable();
             try
@@ -506,7 +500,6 @@ namespace UAS_DeviceMonitor.DataOperate
         {
             object result = null;
             command = new OracleCommand(SQL, connection);
-            Reconnect(command);
             //用来拼接参数的
             if (names.Length > 0)
             {
@@ -543,8 +536,9 @@ namespace UAS_DeviceMonitor.DataOperate
                     {
                         ad.Fill((DataTable)result);
                     }
-                    catch (Exception)
+                    catch (Exception e)
                     {
+                        LogManager.DoLog(e.StackTrace + e.Message);
                         connection = new OracleConnection(DBConnectionString);
                         connection.Open();
                         command = new OracleCommand(SQL, connection);
@@ -611,7 +605,6 @@ namespace UAS_DeviceMonitor.DataOperate
             DataTable dt = new DataTable();
             string sql = "select distinct count('" + Field + "') from " + TableName;
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             try
             {
@@ -649,12 +642,10 @@ namespace UAS_DeviceMonitor.DataOperate
         /// <param name="TableName">表名</param>
         /// <param name="ID">主键</param>
         /// <param name="DeleteID">需要删除主键ID的数组</param>
-        public void DeleteDataByID(string TableName, string ID, string[] DeleteID)
+        public void DeleteDataByID(string TableName, string ID, int[] DeleteID)
         {
             string sql = "delete from " + TableName + " where " + ID + " =:DeleteID";
-
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             command.ArrayBindCount = DeleteID.Length;
             command.Parameters.Add(new OracleParameter("DeleteID", OracleDbType.Long, DeleteID, ParameterDirection.Input));
             try
@@ -806,7 +797,6 @@ namespace UAS_DeviceMonitor.DataOperate
         public void BatchInsert(string sql, params object[][] names)
         {
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             command.ArrayBindCount = names[1].Length;
             if (names[1].Length == 0)
             {
@@ -834,7 +824,6 @@ namespace UAS_DeviceMonitor.DataOperate
         public void BatchInsertDataTable(string sql, string[] param, params object[][] param1)
         {
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             command.ArrayBindCount = param1[0].Length;
             //因为第一个数组保存的是参数的名称,所以循环从1而不是0开始
             //将第一个数组的下标固定为0作为循环添加的参数的名称
@@ -921,8 +910,6 @@ namespace UAS_DeviceMonitor.DataOperate
         {
             string sql = "update " + TableName + " set " + update + " where " + condition;
             command = new OracleCommand(sql, connection);
-
-            Reconnect(command);
             try
             {
                 command.ExecuteNonQuery();
@@ -946,7 +933,6 @@ namespace UAS_DeviceMonitor.DataOperate
         {
             command = new OracleCommand(ProcedureName);
             command.Connection = connection;
-            Reconnect(command);
             command.CommandText = ProcedureName;
             command.CommandType = CommandType.StoredProcedure;
             for (int i = 0; i < param.Length; i++)
@@ -1054,7 +1040,6 @@ namespace UAS_DeviceMonitor.DataOperate
         {
             DataTable dt = new DataTable();
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter();
             ad.SelectCommand = command;
             try
@@ -1118,13 +1103,5 @@ namespace UAS_DeviceMonitor.DataOperate
         {
 
         }
-
-        private void Reconnect(OracleCommand cmd)
-        {
-            if (cmd.Connection.State == ConnectionState.Closed)
-            {
-                cmd.Connection.Open();
-            }
-        }
     }
 }

+ 3 - 3
UAS_DeviceMonitor/Main.cs

@@ -141,7 +141,7 @@ namespace UAS_DeviceMonitor
         }
         #endregion
 
-        #region PageCommandSet业务代码
+        #region PageCommandSet业务代码(指令设置)
         /// <summary>
         /// 新增指令弹窗
         /// </summary>
@@ -187,7 +187,7 @@ namespace UAS_DeviceMonitor
 
         #endregion
 
-        #region PagePolling业务代码
+        #region PagePolling业务代码(轮询业务定义)
         private void GridPolling_VisibleChanged(object sender, EventArgs e)
         {
             DataTable dt = (DataTable)SystemInf.dh.ExecuteSql("select dc_name,dc_code from devicecommand ", "select");
@@ -197,7 +197,7 @@ namespace UAS_DeviceMonitor
         }
         #endregion
 
-        #region PagePollingSetting业务代码
+        #region PagePollingSetting业务代码(轮询配置)
 
         PollingTask pt = new PollingTask();
         /// <summary>

+ 8 - 0
UAS_DeviceMonitor/Properties/licenses.licx

@@ -0,0 +1,8 @@
+DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.Repository.RepositoryItemComboBox, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.Repository.RepositoryItemSearchLookUpEdit, DevExpress.XtraGrid.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

+ 2 - 0
UAS_MES_NEW/Properties/licenses.licx

@@ -0,0 +1,2 @@
+DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.Repository.RepositoryItemTextEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

+ 131 - 0
UAS_MES_NEW/PublicMethod/GetDataFromDevice.cs

@@ -0,0 +1,131 @@
+using System;
+using System.Net;
+using System.Net.Sockets;
+using System.Threading;
+using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+
+namespace UAS_MES_NEW.PublicMethod
+{
+    class GetDataFromDevice
+    {
+
+        DataHelper dh = SystemInf.dh;
+
+        public GetDataFromDevice()
+        {
+
+        }
+
+        private bool isOpen = false;
+
+        Thread threadWatch = null; //负责监听客户端的线程
+        Socket socketWatch = null; //负责监听客户端的套接字
+        Socket socConnection;
+
+        public bool IsOpen
+        {
+            get
+            {
+                return isOpen;
+            }
+
+            set
+            {
+                isOpen = value;
+            }
+        }
+
+        public string IP
+        {
+            get
+            {
+                return iP;
+            }
+
+            set
+            {
+                iP = value;
+            }
+        }
+
+        public string Port
+        {
+            get
+            {
+                return port;
+            }
+
+            set
+            {
+                port = value;
+            }
+        }
+
+        private string iP;
+
+        private string port;
+
+        public bool Open()
+        {
+            try
+            {
+                //定义一个套接字用于监听客户端发来的信息  包含3个参数(IP4寻址协议,流式连接,TCP协议)
+                socketWatch = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+                //服务端发送信息 需要1个IP地址和端口号
+                IPAddress ipaddress = IPAddress.Parse(iP);
+                //将IP地址和端口号绑定到网络节点endpoint上 
+                IPEndPoint endpoint = new IPEndPoint(ipaddress, int.Parse(port));
+                //监听绑定的网络节点
+                socketWatch.Bind(endpoint);
+                //将套接字的监听队列长度限制为20
+                socketWatch.Listen(20);
+                //创建一个监听线程 
+                threadWatch = new Thread(WatchConnecting);
+                //将窗体线程设置为与后台同步
+                threadWatch.IsBackground = true;
+                //启动线程
+                threadWatch.Start();
+                isOpen = true;
+                return true;
+            }
+            catch (Exception e)
+            {
+                MessageBox.Show(e.Message);
+                return false;
+            }
+        }
+
+        private void WatchConnecting()
+        {
+            socConnection = socketWatch.Accept();
+            while (true)  //持续不断监听客户端发来的请求
+            {
+                byte[] data = new byte[1024];
+                socConnection.Receive(data);
+                //获取发送客户端的IP地址
+                string clientIP = socConnection.RemoteEndPoint.ToString();
+                int length = data[5];
+                byte[] datashow = new byte[length + 6];
+                for (int i = 0; i <= length + 5; i++)
+                {
+                    datashow[i] = data[i];
+                }
+                string stringdata = BitConverter.ToString(datashow);//把数组转换成16进制字符串
+            }
+        }
+
+        public void Close()
+        {
+            threadWatch.Abort();
+            socketWatch.Close();
+            isOpen = false;
+        }
+
+        public void SendOrder(string Code)
+        {
+            //socConnection.Send(null);
+        }
+    }
+}

+ 57 - 1
UAS_WinForm.sln

@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 14
-VisualStudioVersion = 14.0.23107.0
+VisualStudioVersion = 14.0.25420.1
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS-MES", "UAS-MES\UAS-MES.csproj", "{411DEE44-B893-47E0-A0C2-797A3DAE2466}"
 EndProject
@@ -21,6 +21,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS_MesDllService(3.5)", "U
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS_AutoUpdate", "UAS_AutoUpdate\UAS_AutoUpdate.csproj", "{C360004D-8D2C-4633-B8B8-3DD1C2D4AAB6}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS_DeviceMonitor", "UAS_DeviceMonitor\UAS_DeviceMonitor.csproj", "{F65E07C6-E843-45F2-872F-6C7F6428332E}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProject", "TestProject\TestProject.csproj", "{92488A73-91D7-4797-9794-67C4D9D86D09}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS_Web", "UAS_Web\UAS_Web.csproj", "{7293045C-D6EE-4454-B822-E296AD9E758B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS-出货标签管理(泽天)", "UAS-出货标签管理(泽天)\UAS-出货标签管理(泽天).csproj", "{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -139,6 +147,54 @@ Global
 		{C360004D-8D2C-4633-B8B8-3DD1C2D4AAB6}.Release|x64.Build.0 = Release|Any CPU
 		{C360004D-8D2C-4633-B8B8-3DD1C2D4AAB6}.Release|x86.ActiveCfg = Release|Any CPU
 		{C360004D-8D2C-4633-B8B8-3DD1C2D4AAB6}.Release|x86.Build.0 = Release|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Debug|x64.Build.0 = Debug|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Debug|x86.Build.0 = Debug|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Release|x64.ActiveCfg = Release|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Release|x64.Build.0 = Release|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Release|x86.ActiveCfg = Release|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Release|x86.Build.0 = Release|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Debug|x64.Build.0 = Debug|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Debug|x86.Build.0 = Debug|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Release|Any CPU.Build.0 = Release|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Release|x64.ActiveCfg = Release|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Release|x64.Build.0 = Release|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Release|x86.ActiveCfg = Release|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Release|x86.Build.0 = Release|Any CPU
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Debug|x64.ActiveCfg = Debug|x64
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Debug|x64.Build.0 = Debug|x64
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Debug|x86.ActiveCfg = Debug|x86
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Debug|x86.Build.0 = Debug|x86
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Release|x64.ActiveCfg = Release|x64
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Release|x64.Build.0 = Release|x64
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Release|x86.ActiveCfg = Release|x86
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Release|x86.Build.0 = Release|x86
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Debug|x64.Build.0 = Debug|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Debug|x86.Build.0 = Debug|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Release|Any CPU.Build.0 = Release|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Release|x64.ActiveCfg = Release|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Release|x64.Build.0 = Release|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Release|x86.ActiveCfg = Release|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE