Browse Source

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

caosy 6 years ago
parent
commit
36f4858a08

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

@@ -1261,7 +1261,7 @@ namespace UAS_LabelMachine
             }
             sql.Append(" order by to_number(pib_outboxcode2),pib_id,pd_prodcode");
             LabelInfDataTable = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-            BoxCount.Text = LabelInfDataTable.Compute("sum(pib_qty)", "1=1").ToString()+"KPCS";
+            BoxCount.Text = LabelInfDataTable.Compute("sum(pib_qty)", "1=1").ToString() + "KPCS";
             bindingsource(LabelInf, LabelInfDataTable);
             if (LabelInf.Rows.Count > 0)
             {
@@ -1838,12 +1838,14 @@ namespace UAS_LabelMachine
                             string FWhcode = LabelInf.Rows[i].Cells["pib_brand"].Value.ToString();
                             string FDC = LabelInf.Rows[i].Cells["pib_datecode"].Value.ToString();
                             string FLOTNO = LabelInf.Rows[i].Cells["pib_lotno"].Value.ToString();
+                            string FPDCustProdCode = LabelInf.Rows[i].Cells["pd_custprodcode"].Value.ToString();
                             string BPrcode = LabelInf.Rows[i + 1].Cells["pib_prodcode"].Value.ToString();
                             string BPocode = LabelInf.Rows[i + 1].Cells["pd_pocode"].Value.ToString();
                             string BWhcode = LabelInf.Rows[i + 1].Cells["pib_brand"].Value.ToString();
                             string BDC = LabelInf.Rows[i + 1].Cells["pib_datecode"].Value.ToString();
                             string BLOTNO = LabelInf.Rows[i + 1].Cells["pib_lotno"].Value.ToString();
-                            if (FPrcode != BPrcode || FPocode != BPocode || FWhcode != BWhcode || (DiffDC.Checked && FDC != BDC) || (DiffLotNo.Checked && FLOTNO != BLOTNO))
+                            string BPDCustProdCode = LabelInf.Rows[i + 1].Cells["pd_custprodcode"].Value.ToString();
+                            if (FPDCustProdCode != BPDCustProdCode || FPrcode != BPrcode || FPocode != BPocode || FWhcode != BWhcode || (DiffDC.Checked && FDC != BDC) || (DiffLotNo.Checked && FLOTNO != BLOTNO))
                             {
                                 GetNumCount = GetNumCount + 1;
                             }

+ 35 - 45
UAS-出货标签管理(贸易版)/PublicMethod/DataHelper.cs

@@ -11,30 +11,30 @@ namespace UAS_LabelMachine
     public class DataHelper
     {
 
-        ////海创外网地址
-        //private readonly string ConnectionStrings = "Data Source=cmityj.gicp.net/orcl;User ID=HC_TEST;PassWord=select!#%*(";
-        ////海创ERP地址
-        //public static readonly string ERPAddesss = "http://cmityj.gicp.net:8099/ERP/";
-        ////海创FTP
-        //public static readonly string FTPAddress = "ftp://cmityj.gicp.net|HCFTP|Admin1@#";
+        //海创外网地址
+        private readonly string ConnectionStrings = "Data Source=cmityj.gicp.net/orcl;User ID=HC_TEST;PassWord=select!#%*(";
+        //海创ERP地址
+        public static readonly string ERPAddesss = "http://cmityj.gicp.net:8099/ERP/";
+        //海创FTP
+        public static readonly string FTPAddress = "ftp://cmityj.gicp.net:21|HCFTP|Admin1@#";
 
-        //public static readonly string InnerFTPAddress = "ftp://192.168.1.8|HCFTP|Admin1@#";
-        ////Oracle端口
-        //public static readonly string OraclePort = "1521";
-        ////需要显示的账套
-        //public static readonly string Masters = "HC_TEST";
-
-        //凯而高地址
-        private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=KRG_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=112.25.154.186)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-        //凯而高ERP地址
-        public static readonly string ERPAddesss = "http://112.25.154.186:8099/ERP/";
-        //凯而高FTP
-        public static readonly string FTPAddress = "ftp://112.25.154.186:21|KEGFTP|Admin1@#";
-        public static readonly string InnerFTPAddress = "ftp://112.25.154.186:21|HCFTP|Admin1@#";
+        public static readonly string InnerFTPAddress = "ftp://192.168.1.8|HCFTP|Admin1@#";
         //Oracle端口
         public static readonly string OraclePort = "1521";
         //需要显示的账套
-        public static readonly string Masters = "GOLDEN";
+        public static readonly string Masters = "HC_TEST";
+
+        ////凯而高地址
+        //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=KRG_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=112.25.154.186)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        ////凯而高ERP地址
+        //public static readonly string ERPAddesss = "http://112.25.154.186:8099/ERP/";
+        ////凯而高FTP
+        //public static readonly string FTPAddress = "ftp://112.25.154.186:21|KEGFTP|Admin1@#";
+        //public static readonly string InnerFTPAddress = "ftp://112.25.154.186:21|KEGFTP|Admin1@#";
+        ////Oracle端口
+        //public static readonly string OraclePort = "1521";
+        ////需要显示的账套
+        //public static readonly string Masters = "GOLDEN";
 
         ////凯而高
         //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=KRG_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.12)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
@@ -49,11 +49,23 @@ namespace UAS_LabelMachine
         //public static readonly string Masters = "GOLDEN";
 
         ////高登地址
-        //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=183.238.39.179)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        //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=192.168.0.158)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
         ////高登ERP地址
         //public static readonly string ERPAddesss = "http://183.238.39.179:8099/ERP/";
-        ////高登TP
+        ////高登FTP
         //public static readonly string InnerFTPAddress = "ftp://192.168.0.158:21|GOLDENMES|Admin1@#";
+        //public static readonly string FTPAddress = "ftp://192.168.0.158:21|GOLDENMES|Admin1@#";
+        ////Oracle端口
+        //public static readonly string OraclePort = "1521";
+        ////需要显示的账套
+        //public static readonly string Masters = "GOLDEN";
+
+        ////高登地址
+        //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=183.238.39.179)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        ////高登ERP地址
+        //public static readonly string ERPAddesss = "http://183.238.39.179:8099/ERP/";
+        ////高登FTP
+        //public static readonly string InnerFTPAddress = "ftp://183.238.39.179:21|GOLDENMES|Admin1@#";
         //public static readonly string FTPAddress = "ftp://183.238.39.179:21|GOLDENMES|Admin1@#";
         ////Oracle端口
         //public static readonly string OraclePort = "1521";
@@ -71,27 +83,6 @@ namespace UAS_LabelMachine
         ////需要显示的账套
         //public static readonly string Masters = "YHND_SZ,YHND_HK,DATACENTER";
 
-        ////华商龙外网地址
-        //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=YITOA_DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=218.18.115.198)(PORT=1523)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-        ////华商龙ERP地址
-        //public static readonly string ERPAddesss = "http://218.18.115.198:8888/ERP/";
-        ////华商龙FTP
-        //public static readonly string FTPAddress = "ftp://218.18.115.198:21|Print|Administrator1@#";
-        ////Oracle端口
-        //public static readonly string OraclePort = "1523";
-        ////需要显示的账套
-        //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";
-
-        ////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 FTPAddress = "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;
@@ -839,7 +830,6 @@ namespace UAS_LabelMachine
         {
             object result = null;
             command = new OracleCommand(SQL, connection);
-            Console.WriteLine(SQL);
             //用来拼接参数的
             if (names.Length > 0)
             {
@@ -1134,7 +1124,7 @@ namespace UAS_LabelMachine
             command.CommandText = ProcedureName;
             command.CommandType = CommandType.StoredProcedure;
             for (int i = 0; i < param.Length; i++)
-                command.Parameters.Add(new OracleParameter(param[i].ToString(), OracleDbType.Varchar2, 1000, param[i], ParameterDirection.InputOutput));
+                command.Parameters.Add(new OracleParameter(param[i].ToString(), OracleDbType.Varchar2, 2000, param[i], ParameterDirection.InputOutput));
             try
             {
                 command.ExecuteNonQuery();

+ 12 - 4
UAS-出货标签管理(贸易版)/PublicMethod/Print.cs

@@ -109,7 +109,7 @@ namespace UAS_LabelMachine.PublicMethod
                 MidDoc.PrintDocument();
             }
 
-            public static void OutPrint(Document OutBoxDoc, DataTable OutLabelParam, string pi_inoutno, string pib_id, string pib_outboxcode2, bool iCustProdCode, bool iCustPo, bool iDC, bool iLotNo)
+            public static void OutPrint(Document OutBoxDoc, DataTable OutLabelParam, string pi_inoutno, string pib_id, string pib_outboxcode2, bool iCustProdCode, bool iCustPo, bool iOrderCode, bool iDC, bool iLotNo)
             {
                 StringBuilder sql = new StringBuilder();
                 sql.Clear();
@@ -139,7 +139,11 @@ namespace UAS_LabelMachine.PublicMethod
                 {
                     GroupByCondition += "pib_lotno,";
                 }
-                if (iCustProdCode || iCustPo || iDC || iLotNo)
+                if (iOrderCode)
+                {
+                    GroupByCondition += "pd_ordercode,";
+                }
+                if (iCustProdCode || iCustPo || iDC || iLotNo || iOrderCode)
                 {
                     GroupByCondition = " group by " + (GroupByCondition.Substring(0, GroupByCondition.Length - 1));
                 }
@@ -322,7 +326,7 @@ namespace UAS_LabelMachine.PublicMethod
                 MidFormat.Print();
             }
 
-            public static void OutPrint(LabelFormatDocument OutFormat, DataTable OutLabelParam, string pi_inoutno, string pib_id, string pib_outboxcode2, bool iCustProdCode, bool iCustPo, bool iDC, bool iLotNo)
+            public static void OutPrint(LabelFormatDocument OutFormat, DataTable OutLabelParam, string pi_inoutno, string pib_id, string pib_outboxcode2, bool iCustProdCode, bool iCustPo, bool iOrderCode, bool iDC, bool iLotNo)
             {
                 StringBuilder sql = new StringBuilder();
                 sql.Clear();
@@ -352,7 +356,11 @@ namespace UAS_LabelMachine.PublicMethod
                 {
                     GroupByCondition += "pib_lotno,";
                 }
-                if (iCustProdCode || iCustPo || iDC || iLotNo)
+                if (iOrderCode)
+                {
+                    GroupByCondition += "pd_ordercode,";
+                }
+                if (iCustProdCode || iCustPo || iDC || iLotNo || iOrderCode)
                 {
                     GroupByCondition = " group by " + (GroupByCondition.Substring(0, GroupByCondition.Length - 1));
                 }

+ 70 - 45
UAS-出货标签管理(贸易版)/UAS_出货标签管理.Designer.cs

@@ -142,6 +142,7 @@
             this.SingleLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.SingleLabelCombox = new System.Windows.Forms.ComboBox();
             this.MidLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.GetMidBoxCode = new System.Windows.Forms.Button();
             this.label9 = new System.Windows.Forms.Label();
             this.MidDocRefresh = new System.Windows.Forms.LinkLabel();
             this.MidLabelNum = new UAS_LabelMachine.CustomControl.EnterTextBox();
@@ -155,6 +156,7 @@
             this.MidLabelCombox = new System.Windows.Forms.ComboBox();
             this.OutBoxLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
             this.groupBoxWithBorder2 = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.cu_print_ordercode = new System.Windows.Forms.CheckBox();
             this.cu_print_outpo = new System.Windows.Forms.CheckBox();
             this.cu_print_outdc = new System.Windows.Forms.CheckBox();
             this.cu_print_outlotno = new System.Windows.Forms.CheckBox();
@@ -178,6 +180,7 @@
             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.pd_ordercode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_orispeccode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_madein = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -198,7 +201,6 @@
             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.GetMidBoxCode = new System.Windows.Forms.Button();
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             this.Menu.SuspendLayout();
@@ -725,7 +727,7 @@
             // ChooseAll
             // 
             this.ChooseAll.Location = new System.Drawing.Point(4, 252);
-            this.ChooseAll.Margin = new System.Windows.Forms.Padding(2);
+            this.ChooseAll.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.ChooseAll.Name = "ChooseAll";
             this.ChooseAll.Size = new System.Drawing.Size(38, 22);
             this.ChooseAll.TabIndex = 84;
@@ -894,9 +896,9 @@
             this.groupBoxWithBorder1.Controls.Add(this.label12);
             this.groupBoxWithBorder1.Controls.Add(this.label7);
             this.groupBoxWithBorder1.Location = new System.Drawing.Point(598, 6);
-            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
-            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.groupBoxWithBorder1.Size = new System.Drawing.Size(151, 238);
             this.groupBoxWithBorder1.TabIndex = 81;
             this.groupBoxWithBorder1.TabStop = false;
@@ -1025,9 +1027,9 @@
             this.CollectionProcess.Controls.Add(this.Installed);
             this.CollectionProcess.Controls.Add(this.Process);
             this.CollectionProcess.Location = new System.Drawing.Point(464, 6);
-            this.CollectionProcess.Margin = new System.Windows.Forms.Padding(2);
+            this.CollectionProcess.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.CollectionProcess.Name = "CollectionProcess";
-            this.CollectionProcess.Padding = new System.Windows.Forms.Padding(2);
+            this.CollectionProcess.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.CollectionProcess.Size = new System.Drawing.Size(130, 155);
             this.CollectionProcess.TabIndex = 80;
             this.CollectionProcess.TabStop = false;
@@ -1226,6 +1228,7 @@
             this.pib_id1,
             this.pib_pdno,
             this.pib_prodcode,
+            this.pd_ordercode,
             this.pr_orispeccode,
             this.pib_brand,
             this.pib_madein,
@@ -1265,7 +1268,7 @@
             this.pi_inoutno.Location = new System.Drawing.Point(76, 10);
             this.pi_inoutno.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.pi_inoutno.Name = "pi_inoutno";
-            this.pi_inoutno.Size = new System.Drawing.Size(150, 21);
+            this.pi_inoutno.Size = new System.Drawing.Size(150, 10);
             this.pi_inoutno.TabIndex = 2;
             this.pi_inoutno.TableName = null;
             this.pi_inoutno.Value = null;
@@ -1284,7 +1287,7 @@
             this.SingleLabel.Location = new System.Drawing.Point(754, 6);
             this.SingleLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SingleLabel.Name = "SingleLabel";
-            this.SingleLabel.Padding = new System.Windows.Forms.Padding(2);
+            this.SingleLabel.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.SingleLabel.Size = new System.Drawing.Size(156, 238);
             this.SingleLabel.TabIndex = 77;
             this.SingleLabel.TabStop = false;
@@ -1325,7 +1328,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, 202);
+            this.SingleLabelPrint.Location = new System.Drawing.Point(32, 202);
             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);
@@ -1376,12 +1379,24 @@
             this.MidLabel.Location = new System.Drawing.Point(912, 6);
             this.MidLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.MidLabel.Name = "MidLabel";
-            this.MidLabel.Padding = new System.Windows.Forms.Padding(2);
+            this.MidLabel.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.MidLabel.Size = new System.Drawing.Size(158, 238);
             this.MidLabel.TabIndex = 78;
             this.MidLabel.TabStop = false;
             this.MidLabel.Text = "内盒标签";
             // 
+            // GetMidBoxCode
+            // 
+            this.GetMidBoxCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.GetMidBoxCode.Location = new System.Drawing.Point(10, 201);
+            this.GetMidBoxCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.GetMidBoxCode.Name = "GetMidBoxCode";
+            this.GetMidBoxCode.Size = new System.Drawing.Size(68, 26);
+            this.GetMidBoxCode.TabIndex = 119;
+            this.GetMidBoxCode.Text = "获取盒号";
+            this.GetMidBoxCode.UseVisualStyleBackColor = true;
+            this.GetMidBoxCode.Click += new System.EventHandler(this.GetMidBoxCode_Click);
+            // 
             // label9
             // 
             this.label9.AutoSize = true;
@@ -1519,9 +1534,9 @@
             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);
-            this.OutBoxLabel.Margin = new System.Windows.Forms.Padding(2);
+            this.OutBoxLabel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.OutBoxLabel.Name = "OutBoxLabel";
-            this.OutBoxLabel.Padding = new System.Windows.Forms.Padding(2);
+            this.OutBoxLabel.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.OutBoxLabel.Size = new System.Drawing.Size(178, 238);
             this.OutBoxLabel.TabIndex = 79;
             this.OutBoxLabel.TabStop = false;
@@ -1529,25 +1544,38 @@
             // 
             // groupBoxWithBorder2
             // 
+            this.groupBoxWithBorder2.Controls.Add(this.cu_print_ordercode);
             this.groupBoxWithBorder2.Controls.Add(this.cu_print_outpo);
             this.groupBoxWithBorder2.Controls.Add(this.cu_print_outdc);
             this.groupBoxWithBorder2.Controls.Add(this.cu_print_outlotno);
             this.groupBoxWithBorder2.Controls.Add(this.cu_print_outprod);
             this.groupBoxWithBorder2.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.groupBoxWithBorder2.Location = new System.Drawing.Point(5, 108);
-            this.groupBoxWithBorder2.Margin = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder2.Location = new System.Drawing.Point(5, 102);
+            this.groupBoxWithBorder2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.groupBoxWithBorder2.Name = "groupBoxWithBorder2";
-            this.groupBoxWithBorder2.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBoxWithBorder2.Size = new System.Drawing.Size(87, 124);
+            this.groupBoxWithBorder2.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.groupBoxWithBorder2.Size = new System.Drawing.Size(87, 134);
             this.groupBoxWithBorder2.TabIndex = 91;
             this.groupBoxWithBorder2.TabStop = false;
             this.groupBoxWithBorder2.Text = "区分";
             // 
+            // cu_print_ordercode
+            // 
+            this.cu_print_ordercode.AutoSize = true;
+            this.cu_print_ordercode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.cu_print_ordercode.Location = new System.Drawing.Point(7, 64);
+            this.cu_print_ordercode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.cu_print_ordercode.Name = "cu_print_ordercode";
+            this.cu_print_ordercode.Size = new System.Drawing.Size(75, 21);
+            this.cu_print_ordercode.TabIndex = 95;
+            this.cu_print_ordercode.Text = "订单编号";
+            this.cu_print_ordercode.UseVisualStyleBackColor = true;
+            // 
             // cu_print_outpo
             // 
             this.cu_print_outpo.AutoSize = true;
             this.cu_print_outpo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_outpo.Location = new System.Drawing.Point(7, 47);
+            this.cu_print_outpo.Location = new System.Drawing.Point(8, 44);
             this.cu_print_outpo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cu_print_outpo.Name = "cu_print_outpo";
             this.cu_print_outpo.Size = new System.Drawing.Size(75, 21);
@@ -1559,7 +1587,7 @@
             // 
             this.cu_print_outdc.AutoSize = true;
             this.cu_print_outdc.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_outdc.Location = new System.Drawing.Point(7, 97);
+            this.cu_print_outdc.Location = new System.Drawing.Point(8, 110);
             this.cu_print_outdc.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cu_print_outdc.Name = "cu_print_outdc";
             this.cu_print_outdc.Size = new System.Drawing.Size(44, 21);
@@ -1571,7 +1599,7 @@
             // 
             this.cu_print_outlotno.AutoSize = true;
             this.cu_print_outlotno.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_outlotno.Location = new System.Drawing.Point(7, 72);
+            this.cu_print_outlotno.Location = new System.Drawing.Point(8, 86);
             this.cu_print_outlotno.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cu_print_outlotno.Name = "cu_print_outlotno";
             this.cu_print_outlotno.Size = new System.Drawing.Size(63, 21);
@@ -1583,7 +1611,7 @@
             // 
             this.cu_print_outprod.AutoSize = true;
             this.cu_print_outprod.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_print_outprod.Location = new System.Drawing.Point(7, 22);
+            this.cu_print_outprod.Location = new System.Drawing.Point(8, 20);
             this.cu_print_outprod.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cu_print_outprod.Name = "cu_print_outprod";
             this.cu_print_outprod.Size = new System.Drawing.Size(75, 21);
@@ -1652,7 +1680,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(91, 139);
+            this.label10.Location = new System.Drawing.Point(92, 140);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(32, 17);
             this.label10.TabIndex = 90;
@@ -1662,7 +1690,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(91, 112);
+            this.label6.Location = new System.Drawing.Point(92, 112);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(32, 17);
             this.label6.TabIndex = 87;
@@ -1709,7 +1737,7 @@
             // 
             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(9, 106);
+            this.OutBoxLabelAutoPrint.Location = new System.Drawing.Point(10, 106);
             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);
@@ -1788,6 +1816,13 @@
             this.pib_prodcode.ReadOnly = true;
             this.pib_prodcode.Width = 78;
             // 
+            // pd_ordercode
+            // 
+            this.pd_ordercode.DataPropertyName = "pd_ordercode";
+            this.pd_ordercode.HeaderText = "订单编号";
+            this.pd_ordercode.Name = "pd_ordercode";
+            this.pd_ordercode.Width = 78;
+            // 
             // pr_orispeccode
             // 
             this.pr_orispeccode.DataPropertyName = "pr_orispeccode";
@@ -1946,24 +1981,12 @@
             this.pib_outboxcode2.Name = "pib_outboxcode2";
             this.pib_outboxcode2.Width = 90;
             // 
-            // GetMidBoxCode
-            // 
-            this.GetMidBoxCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.GetMidBoxCode.Location = new System.Drawing.Point(10, 201);
-            this.GetMidBoxCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.GetMidBoxCode.Name = "GetMidBoxCode";
-            this.GetMidBoxCode.Size = new System.Drawing.Size(68, 26);
-            this.GetMidBoxCode.TabIndex = 119;
-            this.GetMidBoxCode.Text = "获取盒号";
-            this.GetMidBoxCode.UseVisualStyleBackColor = true;
-            this.GetMidBoxCode.Click += new System.EventHandler(this.GetMidBoxCode_Click);
-            // 
             // 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(1258, 715);
+            this.ClientSize = new System.Drawing.Size(1258, 530);
             this.Controls.Add(this.CustBarCode);
             this.Controls.Add(this.pi_class);
             this.Controls.Add(this.MenuSetting);
@@ -2016,23 +2039,23 @@
             this.SizeChanged += new System.EventHandler(this.贴标机条码打印_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).EndInit();
-            this.Menu.ResumeLayout(false);
-            this.groupBoxWithBorder1.ResumeLayout(false);
+            this.Menu.ResumeLayout(true);
+            this.groupBoxWithBorder1.ResumeLayout(true);
             this.groupBoxWithBorder1.PerformLayout();
-            this.CollectionProcess.ResumeLayout(false);
+            this.CollectionProcess.ResumeLayout(true);
             this.CollectionProcess.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.LabelInf)).EndInit();
-            this.SingleLabel.ResumeLayout(false);
+            this.SingleLabel.ResumeLayout(true);
             this.SingleLabel.PerformLayout();
-            this.MidLabel.ResumeLayout(false);
+            this.MidLabel.ResumeLayout(true);
             this.MidLabel.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.MidBoxCapacity)).EndInit();
-            this.OutBoxLabel.ResumeLayout(false);
+            this.OutBoxLabel.ResumeLayout(true);
             this.OutBoxLabel.PerformLayout();
-            this.groupBoxWithBorder2.ResumeLayout(false);
+            this.groupBoxWithBorder2.ResumeLayout(true);
             this.groupBoxWithBorder2.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.OutboxCapacity)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }
@@ -2179,6 +2202,8 @@
         private System.Windows.Forms.ToolStripMenuItem 客户合并规则ToolStripMenuItem;
         private System.Windows.Forms.Button CustBarCode;
         private System.Windows.Forms.ToolStripMenuItem 流水调整ToolStripMenuItem;
+        private System.Windows.Forms.Button GetMidBoxCode;
+        private System.Windows.Forms.CheckBox cu_print_ordercode;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_midboxcapacity_user;
         private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifpick;
@@ -2186,6 +2211,7 @@
         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 pd_ordercode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_orispeccode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_brand;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_madein;
@@ -2206,6 +2232,5 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
-        private System.Windows.Forms.Button GetMidBoxCode;
     }
 }

+ 22 - 7
UAS-出货标签管理(贸易版)/UAS_出货标签管理.cs

@@ -1492,9 +1492,9 @@ namespace UAS_LabelMachine
             string pib_id = LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString();
             string pib_outboxcode2 = LabelInf.Rows[rowindex].Cells["pib_outboxcode2"].Value.ToString();
             if (PrintMethod == "CodeSoft")
-                Print.CodeSoft.OutPrint(OutBoxDoc, OutLabelParam, pi_inoutno.Text, pib_id, pib_outboxcode2, cu_print_outprod.Checked, cu_print_outpo.Checked, cu_print_outdc.Checked, cu_print_outlotno.Checked);
+                Print.CodeSoft.OutPrint(OutBoxDoc, OutLabelParam, pi_inoutno.Text, pib_id, pib_outboxcode2, cu_print_outprod.Checked, cu_print_outpo.Checked, cu_print_ordercode.Checked, cu_print_outdc.Checked, cu_print_outlotno.Checked);
             else
-                Print.BarTender.OutPrint(OutFormat, OutLabelParam, pi_inoutno.Text, pib_id, pib_outboxcode2, cu_print_outprod.Checked, cu_print_outpo.Checked, cu_print_outdc.Checked, cu_print_outlotno.Checked);
+                Print.BarTender.OutPrint(OutFormat, OutLabelParam, pi_inoutno.Text, pib_id, pib_outboxcode2, cu_print_outprod.Checked, cu_print_outpo.Checked, cu_print_ordercode.Checked, cu_print_outdc.Checked, cu_print_outlotno.Checked);
         }
 
         private void CleanDetail_Click(object sender, EventArgs e)
@@ -1898,6 +1898,13 @@ namespace UAS_LabelMachine
                                 BoxCode = BoxCode + 1;
                             }
                         }
+                        else if (cu_print_ordercode.Checked)
+                        {
+                            if (LabelInf.Rows[i].Cells["pd_ordercode"].Value.ToString() != LabelInf.Rows[i + 1].Cells["pd_ordercode"].Value.ToString())
+                            {
+                                BoxCode = BoxCode + 1;
+                            }
+                        }
                     }
                 }
                 sdh.BatchInsert("prodiobarcode", LabelInf.DataSource as DataTable);
@@ -2553,6 +2560,7 @@ namespace UAS_LabelMachine
                 ArrayList<string> madein = new ArrayList<string>();
                 ArrayList<string> size = new ArrayList<string>();
                 ArrayList<string> weight = new ArrayList<string>();
+                ArrayList<string> prdetail = new ArrayList<string>();
                 //用于数量的校验
                 Dictionary<string, decimal> sumqty = new Dictionary<string, decimal>();
                 Dictionary<string, Dictionary<string, decimal>> outsumqty = new Dictionary<string, Dictionary<string, decimal>>();
@@ -2597,6 +2605,7 @@ namespace UAS_LabelMachine
                     string 产地 = dt.Rows[i]["产地"].ToString().Trim();
                     string 尺寸 = dt.Rows[i]["尺寸"].ToString().Trim();
                     string 重量 = dt.Rows[i]["重量"].ToString().Trim();
+                    string 名称 = dt.Rows[i]["产品名称"].ToString().Trim();
                     if (pr_spec.Trim() == "")
                     {
                         break;
@@ -2649,6 +2658,7 @@ namespace UAS_LabelMachine
                         string pd_piclass = dr[k]["pd_piclass"].ToString();
                         string pr_id = dr[k]["pr_id"].ToString();
                         string pr_madein = dr[k]["pr_madein"].ToString();
+                        string pr_detail = dr[k]["pr_detail"].ToString();
                         //已导入数量
                         decimal zxbzs = decimal.Parse(dr[k]["pr_zxbzs"].ToString());
                         decimal pd_outqty = 0;
@@ -2691,6 +2701,7 @@ namespace UAS_LabelMachine
                                 size.Add(尺寸);
                                 weight.Add(重量);
                                 pdprodcode.Add(pd_prodcode);
+                                prdetail.Add(名称 == "" ? pr_detail : 名称);
                             }
                             custbarcode.Add(BarcodeMethod1(PrefixFixed, Suffix, SerialNumIndex, SerialNumLength, Radix));
                             pib_custoutboxcode.Add(pib_outboxcode2);
@@ -2708,6 +2719,7 @@ namespace UAS_LabelMachine
                             size.Add(尺寸);
                             weight.Add(重量);
                             pdprodcode.Add(pd_prodcode);
+                            prdetail.Add(名称 == "" ? pr_detail : 名称);
                         }
                         else
                         {
@@ -2730,9 +2742,14 @@ namespace UAS_LabelMachine
                                 size.Add(尺寸);
                                 weight.Add(重量);
                                 pdprodcode.Add(pd_prodcode);
+                                prdetail.Add(名称 == "" ? pr_detail : 名称);
                             }
                         }
                         outqty -= outsumqty[pr_spec][pd_pdno];
+                        if (outqty <= 0)
+                        {
+                            outqty = 0;
+                        }
                         outsumqty[pr_spec][pd_pdno] -= pd_outqty;
                     }
                 }
@@ -2784,10 +2801,10 @@ namespace UAS_LabelMachine
                         sql.Clear();
                         sql.Append("insert into prodiobarcode (PIB_ID,PIB_PRODCODE,pib_inman,PIB_INDATE,PIB_INOUTNO,PIB_PIID,pib_brand,PIB_BARCODE,PIB_PDNO,");
                         sql.Append("PIB_PDID,PIB_PICLASS,PIB_QTY,pib_datecode,pib_lotno,PIB_IFPRINT,PIB_IFPICK,PIB_ORDERCODE,pib_orderdetno,");
-                        sql.Append("pib_outboxcode2,pib_custbarcode,pib_custoutboxcode,pib_madein,pib_size,pib_weight)values(prodiobarcode_seq.nextval,:pd_prodcode,'" + User.UserName + "',sysdate,");
+                        sql.Append("pib_outboxcode2,pib_custbarcode,pib_custoutboxcode,pib_madein,pib_size,pib_weight,pib_prdetail)values(prodiobarcode_seq.nextval,:pd_prodcode,'" + User.UserName + "',sysdate,");
                         sql.Append("'" + pi_inoutno.Text + "'," + PI_ID + ",:pr_brand,:barcode,:pd_pdno,:pd_id,'" + pi_class.Text + "',:pib_inqty,");
-                        sql.Append(":pib_datecode,:pib_lotno,0,-1,:pd_ordercode,:pd_orderdetno,:outboxcode,:custbarcode,:pib_custoutboxcode,:pib_madein,:pib_size,:pib_weight)");
-                        dh.BatchInsert(sql.ToString(), new string[] { "pd_prodcode", "pr_brand", "barcode", "pd_pdno", "pd_id", "pib_inqty", "pib_datecode", "pib_lotno", "pd_ordercode", "pd_orderdetno", "outboxcode", "custbarcode", "pib_custoutboxcode", "pib_madein" , "pib_size", "pib_weight" }, pdprodcode.ToArray(), prbrand.ToArray(), barcode.ToArray(), pdpdno.ToArray(), pdid.ToArray(), pib_inqty.ToArray(), datecode.ToArray(), lotno.ToArray(), pdordercode.ToArray(), pdorderdetno.ToArray(), piboutboxcode2.ToArray(), custbarcode.ToArray(), custoutboxcode.ToArray(), madein.ToArray(),size.ToArray(),weight.ToArray());
+                        sql.Append(":pib_datecode,:pib_lotno,0,-1,:pd_ordercode,:pd_orderdetno,:outboxcode,:custbarcode,:pib_custoutboxcode,:pib_madein,:pib_size,:pib_weight,:pib_prdetail)");
+                        dh.BatchInsert(sql.ToString(), new string[] { "pd_prodcode", "pr_brand", "barcode", "pd_pdno", "pd_id", "pib_inqty", "pib_datecode", "pib_lotno", "pd_ordercode", "pd_orderdetno", "outboxcode", "custbarcode", "pib_custoutboxcode", "pib_madein", "pib_size", "pib_weight", "pib_prdetail" }, pdprodcode.ToArray(), prbrand.ToArray(), barcode.ToArray(), pdpdno.ToArray(), pdid.ToArray(), pib_inqty.ToArray(), datecode.ToArray(), lotno.ToArray(), pdordercode.ToArray(), pdorderdetno.ToArray(), piboutboxcode2.ToArray(), custbarcode.ToArray(), custoutboxcode.ToArray(), madein.ToArray(), size.ToArray(), weight.ToArray(), prdetail.ToArray());
                         //更新流水
                         dh.UpdateByCondition("RuleMaxNum", "rmn_maxnumber='" + custserialnum + "'", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'");
                         LoadGridData();
@@ -2916,7 +2933,5 @@ namespace UAS_LabelMachine
             sdh.ExecuteSql(SQL, "update");
             LoadGridData();
         }
-
-
     }
 }

+ 3 - 0
UAS-出货标签管理(贸易版)/UAS_出货标签管理.resx

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