Переглянути джерело

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

Hcsy 7 роки тому
батько
коміт
82a6d9ad51

+ 21 - 10
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)));";
@@ -55,6 +55,17 @@ namespace UAS_LabelMachine
         ////需要显示的账套
         //public static readonly string Masters = "ZT_TEST";
         //用户选择的数据库的连接字符串
+
+        //UAS测试地址
+        private readonly string ConnectionStrings = "Data Source=192.168.253.6/orcl;User ID=UAS_TEST;PassWord=select!#%*(";
+        //UAS测试地址
+        public static readonly string ERPAddesss = "http://192.168.253.6/uas_test/";
+        //UAS测试FTP
+        public static readonly string FTPAdress = "ftp://192.168.253.9/PrintFile|mesconfig|Administrator1@#";
+        //Oracle端口
+        public static readonly string OraclePort = "1521";
+        //需要显示的账套
+        public static readonly string Masters = "UAS_TEST";
         public static string DBConnectionString;
         static OracleConnection connection = null;
         static OracleCommand command = null;

+ 222 - 231
UAS-出货标签管理/UAS_出货标签管理.Designer.cs

@@ -124,32 +124,6 @@
             this.sg_code = new UAS_LabelMachine.CustomControl.SearchTextBox();
             this.MessageLog = new UAS_LabelMachine.CustomControl.RichText.RichTextAutoBottom();
             this.LabelInf = new UAS_LabelMachine.CustomControl.DataGridViewWithSerialNum();
-            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_ifpick = 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.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_cusbarcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_cusoutboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_datecode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_custbarcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_custoutboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_pocode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_custprodcode = 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();
             this.pi_inoutno = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.SingleLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
             this.ViVoPlate = new System.Windows.Forms.Button();
@@ -179,6 +153,31 @@
             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_ifpick = 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.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_cusbarcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_cusoutboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_datecode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_custbarcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_pocode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_custprodcode = 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.Si_ItemDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             this.groupBoxWithBorder1.SuspendLayout();
@@ -1152,7 +1151,6 @@
             this.pib_qty,
             this.pib_barcode,
             this.pib_custbarcode,
-            this.pib_custoutboxcode,
             this.pd_pocode,
             this.pd_custprodcode,
             this.pd_custprodspec,
@@ -1170,209 +1168,6 @@
             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_ifpick
-            // 
-            this.pib_ifpick.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_ifpick.DataPropertyName = "pib_ifpick";
-            this.pib_ifpick.HeaderText = "已采集";
-            this.pib_ifpick.Name = "pib_ifpick";
-            this.pib_ifpick.Width = 60;
-            // 
-            // 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;
-            // 
-            // pr_unit
-            // 
-            this.pr_unit.DataPropertyName = "pr_unit";
-            this.pr_unit.HeaderText = "单位";
-            this.pr_unit.Name = "pr_unit";
-            this.pr_unit.Visible = false;
-            this.pr_unit.Width = 54;
-            // 
-            // pib_lotno
-            // 
-            this.pib_lotno.DataPropertyName = "pib_lotno";
-            this.pib_lotno.HeaderText = "LotNo";
-            this.pib_lotno.Name = "pib_lotno";
-            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.Width = 78;
-            // 
-            // pib_cusbarcode
-            // 
-            this.pib_cusbarcode.DataPropertyName = "pib_cusbarcode";
-            this.pib_cusbarcode.HeaderText = "ViVo条码号";
-            this.pib_cusbarcode.Name = "pib_cusbarcode";
-            this.pib_cusbarcode.Width = 90;
-            // 
-            // pib_cusoutboxcode
-            // 
-            this.pib_cusoutboxcode.DataPropertyName = "pib_cusoutboxcode";
-            this.pib_cusoutboxcode.HeaderText = "ViVo外箱";
-            this.pib_cusoutboxcode.Name = "pib_cusoutboxcode";
-            this.pib_cusoutboxcode.Width = 78;
-            // 
-            // pib_datecode1
-            // 
-            this.pib_datecode1.DataPropertyName = "pib_datecode1";
-            this.pib_datecode1.HeaderText = "DateCode1";
-            this.pib_datecode1.Name = "pib_datecode1";
-            this.pib_datecode1.Visible = false;
-            this.pib_datecode1.Width = 84;
-            // 
-            // 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_barcode
-            // 
-            this.pib_barcode.DataPropertyName = "pib_barcode";
-            this.pib_barcode.HeaderText = "唯一条码";
-            this.pib_barcode.Name = "pib_barcode";
-            this.pib_barcode.ReadOnly = true;
-            this.pib_barcode.Width = 78;
-            // 
-            // pib_custbarcode
-            // 
-            this.pib_custbarcode.DataPropertyName = "pib_custbarcode";
-            this.pib_custbarcode.HeaderText = "客户条码";
-            this.pib_custbarcode.Name = "pib_custbarcode";
-            this.pib_custbarcode.Width = 78;
-            // 
-            // pib_custoutboxcode
-            // 
-            this.pib_custoutboxcode.DataPropertyName = "pib_custoutboxcode";
-            this.pib_custoutboxcode.HeaderText = "外箱条码";
-            this.pib_custoutboxcode.Name = "pib_custoutboxcode";
-            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_custprodcode
-            // 
-            this.pd_custprodcode.DataPropertyName = "pd_custprodcode";
-            this.pd_custprodcode.HeaderText = "客户料号";
-            this.pd_custprodcode.Name = "pd_custprodcode";
-            this.pd_custprodcode.ReadOnly = true;
-            this.pd_custprodcode.Width = 78;
-            // 
-            // 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.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;
@@ -1732,6 +1527,203 @@
             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_ifpick
+            // 
+            this.pib_ifpick.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_ifpick.DataPropertyName = "pib_ifpick";
+            this.pib_ifpick.HeaderText = "已采集";
+            this.pib_ifpick.Name = "pib_ifpick";
+            this.pib_ifpick.Width = 60;
+            // 
+            // 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;
+            // 
+            // pr_unit
+            // 
+            this.pr_unit.DataPropertyName = "pr_unit";
+            this.pr_unit.HeaderText = "单位";
+            this.pr_unit.Name = "pr_unit";
+            this.pr_unit.Visible = false;
+            this.pr_unit.Width = 54;
+            // 
+            // pib_lotno
+            // 
+            this.pib_lotno.DataPropertyName = "pib_lotno";
+            this.pib_lotno.HeaderText = "LotNo";
+            this.pib_lotno.Name = "pib_lotno";
+            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.Width = 78;
+            // 
+            // pib_cusbarcode
+            // 
+            this.pib_cusbarcode.DataPropertyName = "pib_cusbarcode";
+            this.pib_cusbarcode.HeaderText = "ViVo条码号";
+            this.pib_cusbarcode.Name = "pib_cusbarcode";
+            this.pib_cusbarcode.Width = 90;
+            // 
+            // pib_cusoutboxcode
+            // 
+            this.pib_cusoutboxcode.DataPropertyName = "pib_cusoutboxcode";
+            this.pib_cusoutboxcode.HeaderText = "ViVo外箱";
+            this.pib_cusoutboxcode.Name = "pib_cusoutboxcode";
+            this.pib_cusoutboxcode.Width = 78;
+            // 
+            // pib_datecode1
+            // 
+            this.pib_datecode1.DataPropertyName = "pib_datecode1";
+            this.pib_datecode1.HeaderText = "DateCode1";
+            this.pib_datecode1.Name = "pib_datecode1";
+            this.pib_datecode1.Visible = false;
+            this.pib_datecode1.Width = 84;
+            // 
+            // 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_barcode
+            // 
+            this.pib_barcode.DataPropertyName = "pib_barcode";
+            this.pib_barcode.HeaderText = "唯一条码";
+            this.pib_barcode.Name = "pib_barcode";
+            this.pib_barcode.ReadOnly = true;
+            this.pib_barcode.Width = 78;
+            // 
+            // 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;
+            // 
+            // 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_custprodcode
+            // 
+            this.pd_custprodcode.DataPropertyName = "pd_custprodcode";
+            this.pd_custprodcode.HeaderText = "客户料号";
+            this.pd_custprodcode.Name = "pd_custprodcode";
+            this.pd_custprodcode.ReadOnly = true;
+            this.pd_custprodcode.Width = 78;
+            // 
+            // 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.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);
@@ -1951,7 +1943,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_qty;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_barcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_custbarcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pib_custoutboxcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_pocode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_custprodcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_custprodspec;

+ 37 - 27
UAS-出货标签管理/UAS_出货标签管理.cs

@@ -1359,39 +1359,49 @@ namespace UAS_LabelMachine
             if (!SingleBoxCacheData.Columns.Contains("pib_id"))
                 SingleBoxCacheData.Columns.Add(datacolumn);
             //获取打印的SQL
-            for (int j = 0; j < SingleDoc.Variables.FreeVariables.Count; j++)
+            try
             {
-                //将维护的模板参数和模板本身的参数名称进行比对
-                for (int k = 0; k < SingleLabelParam.Rows.Count; k++)
+                for (int j = 0; j < SingleDoc.Variables.FreeVariables.Count; j++)
                 {
-                    if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name == SingleLabelParam.Rows[k]["lp_name"].ToString())
+                    //将维护的模板参数和模板本身的参数名称进行比对
+                    for (int k = 0; k < SingleLabelParam.Rows.Count; k++)
                     {
-                        DataColumn dc = new DataColumn(SingleDoc.Variables.FreeVariables.Item(j + 1).Name);
-                        SingleBoxCacheData.Columns.Add(dc);
-                        SingleBoxArgument.Add(SingleDoc.Variables.FreeVariables.Item(j + 1).Name);
-                        string sql = SingleLabelParam.Rows[k]["lp_sql"].ToString();
-                        sql = sql.Substring(0, sql.IndexOf("{"));
-                        sql = sql.Substring(0, sql.LastIndexOf("="));
-                        DataTable temp = dh.getFieldsDatasByCondition(sql.Replace(" from ", " ,pib_id PIBID from ") + " in (select pib_id from PRODIOBARCODE where pib_inoutno='" + pi_inoutno.Text + "') ORDER by pib_id");
-                        temp.Columns[0].ColumnName = SingleDoc.Variables.FreeVariables.Item(j + 1).Name;
-                        AllSingleBoxCacheData.Add(temp);
+                        if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name == SingleLabelParam.Rows[k]["lp_name"].ToString())
+                        {
+                            DataColumn dc = new DataColumn(SingleDoc.Variables.FreeVariables.Item(j + 1).Name);
+                            SingleBoxCacheData.Columns.Add(dc);
+                            SingleBoxArgument.Add(SingleDoc.Variables.FreeVariables.Item(j + 1).Name);
+                            string sql = SingleLabelParam.Rows[k]["lp_sql"].ToString();
+                            sql = sql.Substring(0, sql.IndexOf("{"));
+                            sql = sql.Substring(0, sql.LastIndexOf("="));
+                            DataTable temp = dh.getFieldsDatasByCondition(sql.Replace(" from ", " ,pib_id PIBID from ") + " in (select pib_id from PRODIOBARCODE where pib_inoutno='" + pi_inoutno.Text + "') ORDER by pib_id");
+                            temp.Columns[0].ColumnName = SingleDoc.Variables.FreeVariables.Item(j + 1).Name;
+                            AllSingleBoxCacheData.Add(temp);
+                        }
                     }
                 }
-            }
-            DataTable[] Temp = AllSingleBoxCacheData.ToArray();
-            //将所有数据写入到CacheData中
-            if (Temp.Length > 0)
-                for (int i = 0; i < Temp[0].Rows.Count; i++)
-                {
-                    DataRow dr = SingleBoxCacheData.NewRow();
-                    dr["pib_id"] = pib_id_arr[i];
-                    //由于之前加了一个ID列,导致j从1开始
-                    for (int j = 1; j < SingleBoxCacheData.Columns.Count; j++)
+                DataTable[] Temp = AllSingleBoxCacheData.ToArray();
+                //将所有数据写入到CacheData中
+                if (Temp.Length > 0)
+                    for (int i = 0; i < Temp[0].Rows.Count; i++)
                     {
-                        dr[Temp[j - 1].Columns[0].ColumnName] = (Temp[j - 1].Select("PIBID=" + pib_id_arr[i]))[0][0];
+                        DataRow dr = SingleBoxCacheData.NewRow();
+                        dr["pib_id"] = pib_id_arr[i];
+                        //由于之前加了一个ID列,导致j从1开始
+                        for (int j = 1; j < SingleBoxCacheData.Columns.Count; j++)
+                        {
+                            dr[Temp[j - 1].Columns[0].ColumnName] = (Temp[j - 1].Select("PIBID=" + pib_id_arr[i]))[0][0];
+                        }
+                        SingleBoxCacheData.Rows.Add(dr);
                     }
-                    SingleBoxCacheData.Rows.Add(dr);
-                }
+            }
+            catch (Exception)
+            {
+
+                SingleBoxArgument.Clear();
+                SingleBoxCacheData.Clear();
+                BaseUtil.CleanDataTable(SingleBoxCacheData);
+            }
         }
 
         /// <summary>
@@ -2283,7 +2293,7 @@ namespace UAS_LabelMachine
                 for (int i = 0; i < LabelInf.Rows.Count; i++)
                 {
                     LabelInf.Rows[i].Cells["pib_outboxcode2"].Value = BoxCode;
-                    if (i + 1 < LabelInf.Rows.Count + 1)
+                    if (i + 1 < LabelInf.Rows.Count)
                     {
                         if (int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()) % OutboxCapacity.Value == 0 && (LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString() != LabelInf.Rows[i + 1].Cells["pib_outboxcode1"].Value.ToString()))
                         {

+ 0 - 3
UAS-出货标签管理/UAS_出货标签管理.resx

@@ -171,9 +171,6 @@
   <metadata name="pib_custbarcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <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_custprodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

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

@@ -26,6 +26,8 @@ namespace UAS_LabelMachine
         Dictionary<string, string> NotPass = new Dictionary<string, string>();
         //前缀条件
         string Prefix = "";
+
+        string Suffix = "";
         //生成条码的流水号
         int serialnum = 0;
         //客户的流水号
@@ -102,7 +104,7 @@ namespace UAS_LabelMachine
             int SerialNumLength = 0;
             //存放键值对
             int Radix = 10;
-            Dictionary<int, string> NrDic = new Dictionary<int, string>();
+            string PrefixFixed = "";
             for (int m = 0; m < Nr.Rows.Count; m++)
             {
                 switch (Nr.Rows[m]["nrd_type"].ToString())
@@ -110,7 +112,8 @@ namespace UAS_LabelMachine
                     //常量直接进行拼接
                     case "常量":
                         NrData[m] = Nr.Rows[m]["nrd_sql"].ToString();
-                        NrDic.Add(m, NrData[m]);
+                        Prefix += NrData[m];
+                        Suffix += NrData[m];
                         break;
                     case "SQL":
                         string SQL = Nr.Rows[m]["nrd_sql"].ToString();
@@ -132,18 +135,21 @@ namespace UAS_LabelMachine
                         if (Temp.Rows.Count > 0)
                         {
                             NrData[m] = Temp.Rows[0][0].ToString();
-                            NrDic.Add(m, NrData[m]);
+                            Prefix += NrData[m];
+                            Suffix += NrData[m];
                         }
                         else
                         {
                             NrData[m] = "";
-                            NrDic.Add(m, NrData[m]);
+                            Prefix += NrData[m];
+                            Suffix += NrData[m];
                         }
                         break;
                     //流水需要通过MaxNumber去取
                     case "流水":
                         NrData[m] = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + CustCode + "'").ToString();
-                        NrDic.Add(m, NrData[m]);
+                        Suffix ="";
+                        PrefixFixed = Prefix;
                         //设置当前流水
                         custserialnum = int.Parse(NrData[m] == "" ? "0" : NrData[m]);
                         SerialNumIndex = m;
@@ -154,31 +160,18 @@ namespace UAS_LabelMachine
                         break;
                 }
             }
-            Prefix = "";
-            for (int i = 0; i < NrDic.Count; i++)
+            //获取最大的流水号
+            string maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'").ToString();
+            //如果流水号为空则插入一条新记录,从1开始取
+            if (maxnum == "")
             {
-                //如果不是流水则正常添加
-                if (i != SerialNumIndex)
-                {
-                    Prefix += NrDic[i];
-                }
-                else
-                {
-                    //获取最大的流水号
-                    string maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'").ToString();
-                    //如果流水号为空则插入一条新记录,从1开始取
-                    if (maxnum == "")
-                    {
-                        dh.ExecuteSql("insert into RuleMaxNum(rmn_id,rmn_nrcode,rmn_prefix,rmn_maxnumber) values(RuleMaxNum_seq.nextval,'" + NrCode + "','" + Prefix + "','1')", "insert");
-                        custserialnum = 1;
-                    }
-                    //如果流水号不为空则取当前流水
-                    else
-                    {
-                        custserialnum = int.Parse(maxnum);
-                    }
-                    break;
-                }
+                dh.ExecuteSql("insert into RuleMaxNum(rmn_id,rmn_nrcode,rmn_prefix,rmn_maxnumber) values(RuleMaxNum_seq.nextval,'" + NrCode + "','" + Prefix + "','1')", "insert");
+                custserialnum = 1;
+            }
+            //如果流水号不为空则取当前流水
+            else
+            {
+                custserialnum = int.Parse(maxnum);
             }
             //有错误需要提醒的内容
             int CheckedRowCount = 0;
@@ -244,7 +237,7 @@ namespace UAS_LabelMachine
                         {
                             //将箱号添加进List
                             barcode.Add(BarcodeMethod1(pd_id, pr_id, pib_barcode));
-                            custbarcode.Add(BarcodeMethod1(NrDic, SerialNumIndex, SerialNumLength, Radix));
+                            custbarcode.Add(BarcodeMethod1(PrefixFixed, Suffix, SerialNumIndex, SerialNumLength, Radix));
                             midcode.Add(mid_code);
                             if (mid_remain % pr_zxbzs != 0 && k + 1 == count && j + 1 == mid_num)
                                 AddNum = mid_remain % pr_zxbzs;
@@ -322,27 +315,17 @@ namespace UAS_LabelMachine
         }
 
         //生成客户条码
-        public string BarcodeMethod1(Dictionary<int, string> Dic, int Index, int Length, int radix)
+        public string BarcodeMethod1(string Prefix,string Suffix,int Index, int Length, int radix)
         {
-            string str = "";
-            for (int i = 0; i < Dic.Count; i++)
+            string str = Prefix;
+            //如果是流水则需要在前面加0
+            string serialcode = BaseUtil.DToAny(custserialnum, radix);
+            for (int j = serialcode.ToString().Length; j < Length; j++)
             {
-                //如果不是流水则正常添加
-                if (i != Index)
-                {
-                    str += Dic[i];
-                }
-                else
-                {
-                    //如果是流水则需要在前面加0
-                    string serialcode = BaseUtil.DToAny(custserialnum, radix);
-                    for (int j = serialcode.ToString().Length; j < Length; j++)
-                    {
-                        serialcode = "0" + serialcode;
-                    }
-                    str += serialcode;
-                }
+                serialcode = "0" + serialcode;
             }
+            str += serialcode;
+            str += Suffix;
             custserialnum = custserialnum + 1;
             return str;
         }
@@ -456,94 +439,7 @@ namespace UAS_LabelMachine
             CustCode = dh.getFieldDataByCondition("ProdInOut", "pi_cardcode", "pi_inoutno='" + pi_inoutno.Text + "'").ToString();
             //获取编码规则编号
             NrCode = dh.getFieldDataByCondition("NoRule", "nr_code", "nr_custcode='" + CustCode + "'").ToString();
-            //获取编码规则
-            DataTable Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_type,nrd_sql,nrd_length from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode='" + CustCode + "' order by nrd_detno", "select");
-            //用于过滤参数的正则表达式
-            Regex match = new Regex("{\\w+}");
             //用于存放每一项的明细的数据
-            string[] NrData = new string[Nr.Rows.Count];
-            //流水号的索引
-            int SerialNumIndex = 0;
-            //流水长度
-            int SerialNumLength = 0;
-            //存放键值对
-            Dictionary<int, string> NrDic = new Dictionary<int, string>();
-            for (int m = 0; m < Nr.Rows.Count; m++)
-            {
-                switch (Nr.Rows[m]["nrd_type"].ToString())
-                {
-                    //常量直接进行拼接
-                    case "常量":
-                        NrData[m] = Nr.Rows[m]["nrd_sql"].ToString();
-                        NrDic.Add(m, NrData[m]);
-                        break;
-                    case "SQL":
-                        string SQL = Nr.Rows[m]["nrd_sql"].ToString();
-                        DataTable Temp;
-                        //如果不包含参数替换
-                        if (SQL.IndexOf("{") == 0)
-                        {
-                            Temp = (DataTable)dh.ExecuteSql(SQL, "select");
-                        }
-                        else
-                        {
-                            //替换参数后重新执行SQL
-                            foreach (Match mch in match.Matches(SQL))
-                            {
-                                SQL = SQL.Replace(mch.Value.Trim(), "'" + pi_inoutno.Text + "'");
-                            }
-                            Temp = (DataTable)dh.ExecuteSql(SQL, "select");
-                        }
-                        if (Temp.Rows.Count > 0)
-                        {
-                            NrData[m] = Temp.Rows[0][0].ToString();
-                            NrDic.Add(m, NrData[m]);
-                        }
-                        else
-                        {
-                            NrDic.Add(m, "");
-                        }
-                        break;
-                    //流水需要通过MaxNumber去取
-                    case "流水":
-                        NrData[m] = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + NrCode + "'").ToString();
-                        NrDic.Add(m, NrData[m]);
-                        //设置当前流水
-                        custserialnum = int.Parse(NrData[m] == "" ? "0" : NrData[m]);
-                        SerialNumIndex = m;
-                        SerialNumLength = int.Parse(Nr.Rows[m]["nrd_length"].ToString());
-                        break;
-                    default:
-                        break;
-                }
-            }
-            //流水前的前缀,查询RuleMaxNum表看是否有对应的MaxNumber记录,如果有则取MaxNumber,没有的话则进行插入
-            Prefix = "";
-            for (int i = 0; i < NrDic.Count; i++)
-            {
-                //如果不是流水则正常添加
-                if (i != SerialNumIndex)
-                {
-                    Prefix += NrDic[i];
-                }
-                else
-                {
-                    //获取最大的流水号
-                    string maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'").ToString();
-                    //如果流水号为空则插入一条新记录,从1开始取
-                    if (maxnum == "")
-                    {
-                        dh.ExecuteSql("insert into RuleMaxNum(rmn_id,rmn_nrcode,rmn_prefix,rmn_maxnumber) values(RuleMaxNum_seq.nextval,'" + NrCode + "','" + Prefix + "','1')", "insert");
-                        custserialnum = 1;
-                    }
-                    //如果流水号不为空则取当前流水
-                    else
-                    {
-                        custserialnum = int.Parse(maxnum);
-                    }
-                    break;
-                }
-            }
             dt = (DataTable)dh.ExecuteSql("select pi_class,pi_id from prodinout where pi_inoutno='" + pi_inoutno.Text + "'", "select");
             if (dt.Rows.Count > 0)
             {
@@ -561,7 +457,6 @@ namespace UAS_LabelMachine
                 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
             {