章政 7 жил өмнө
parent
commit
a8336470a5

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

@@ -49,7 +49,7 @@ namespace UAS_LabelMachine
         //泽天ERP地址
         public static readonly string ERPAddesss = "http://183.47.41.2:8099/ERP/";
         //泽天FTP
-        public static readonly string FTPAdress = "ftp://10.2.10.241|uas|Lz201478c";
+        public static readonly string FTPAdress = "ftp://183.47.41.3:21|uas|Zt2018";
         //Oracle端口
         public static readonly string OraclePort = "1521";
         //需要显示的账套
@@ -830,7 +830,6 @@ namespace UAS_LabelMachine
                     command.Parameters.Add(new OracleParameter(addpar[i].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
                 }
             }
-            Console.WriteLine(SQL);
             switch (Type.ToUpper())
             {
                 case "SELECT":

+ 6 - 65
UAS-出货标签管理/UAS_出货标签管理.Designer.cs

@@ -172,10 +172,6 @@
             this.GetOutBoxCode = new System.Windows.Forms.Button();
             this.OutBoxNum = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.label10 = new System.Windows.Forms.Label();
-            this.WeightNet = new UAS_LabelMachine.CustomControl.EnterTextBox();
-            this.label9 = new System.Windows.Forms.Label();
-            this.WeightGross = new UAS_LabelMachine.CustomControl.EnterTextBox();
-            this.label8 = new System.Windows.Forms.Label();
             this.label6 = new System.Windows.Forms.Label();
             this.OutBoxPrinter = new UAS_LabelMachine.CustomControl.PrinterCombox();
             this.OutboxCapacity = new System.Windows.Forms.NumericUpDown();
@@ -771,7 +767,6 @@
             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
@@ -1588,10 +1583,6 @@
             this.OutBoxLabel.Controls.Add(this.GetOutBoxCode);
             this.OutBoxLabel.Controls.Add(this.OutBoxNum);
             this.OutBoxLabel.Controls.Add(this.label10);
-            this.OutBoxLabel.Controls.Add(this.WeightNet);
-            this.OutBoxLabel.Controls.Add(this.label9);
-            this.OutBoxLabel.Controls.Add(this.WeightGross);
-            this.OutBoxLabel.Controls.Add(this.label8);
             this.OutBoxLabel.Controls.Add(this.label6);
             this.OutBoxLabel.Controls.Add(this.OutBoxPrinter);
             this.OutBoxLabel.Controls.Add(this.OutboxCapacity);
@@ -1623,7 +1614,7 @@
             // GetOutBoxCode
             // 
             this.GetOutBoxCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.GetOutBoxCode.Location = new System.Drawing.Point(89, 146);
+            this.GetOutBoxCode.Location = new System.Drawing.Point(89, 167);
             this.GetOutBoxCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.GetOutBoxCode.Name = "GetOutBoxCode";
             this.GetOutBoxCode.Size = new System.Drawing.Size(76, 26);
@@ -1636,7 +1627,7 @@
             // 
             this.OutBoxNum.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.OutBoxNum.ID = null;
-            this.OutBoxNum.Location = new System.Drawing.Point(46, 180);
+            this.OutBoxNum.Location = new System.Drawing.Point(46, 201);
             this.OutBoxNum.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OutBoxNum.Name = "OutBoxNum";
             this.OutBoxNum.Size = new System.Drawing.Size(37, 23);
@@ -1649,63 +1640,17 @@
             // 
             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(6, 178);
+            this.label10.Location = new System.Drawing.Point(6, 204);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(32, 17);
             this.label10.TabIndex = 90;
             this.label10.Text = "箱号";
             // 
-            // WeightNet
-            // 
-            this.WeightNet.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.WeightNet.ID = null;
-            this.WeightNet.Location = new System.Drawing.Point(128, 210);
-            this.WeightNet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.WeightNet.Name = "WeightNet";
-            this.WeightNet.Size = new System.Drawing.Size(37, 23);
-            this.WeightNet.Str = null;
-            this.WeightNet.Str1 = null;
-            this.WeightNet.Str2 = null;
-            this.WeightNet.TabIndex = 89;
-            // 
-            // label9
-            // 
-            this.label9.AutoSize = true;
-            this.label9.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label9.Location = new System.Drawing.Point(86, 210);
-            this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(32, 17);
-            this.label9.TabIndex = 88;
-            this.label9.Text = "净重";
-            // 
-            // WeightGross
-            // 
-            this.WeightGross.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.WeightGross.ID = null;
-            this.WeightGross.Location = new System.Drawing.Point(46, 210);
-            this.WeightGross.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.WeightGross.Name = "WeightGross";
-            this.WeightGross.Size = new System.Drawing.Size(37, 23);
-            this.WeightGross.Str = null;
-            this.WeightGross.Str1 = null;
-            this.WeightGross.Str2 = null;
-            this.WeightGross.TabIndex = 85;
-            // 
-            // label8
-            // 
-            this.label8.AutoSize = true;
-            this.label8.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label8.Location = new System.Drawing.Point(6, 210);
-            this.label8.Name = "label8";
-            this.label8.Size = new System.Drawing.Size(32, 17);
-            this.label8.TabIndex = 83;
-            this.label8.Text = "毛重";
-            // 
             // label6
             // 
             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(6, 148);
+            this.label6.Location = new System.Drawing.Point(6, 172);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(32, 17);
             this.label6.TabIndex = 87;
@@ -1723,7 +1668,7 @@
             // OutboxCapacity
             // 
             this.OutboxCapacity.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutboxCapacity.Location = new System.Drawing.Point(46, 147);
+            this.OutboxCapacity.Location = new System.Drawing.Point(46, 168);
             this.OutboxCapacity.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OutboxCapacity.Name = "OutboxCapacity";
             this.OutboxCapacity.Size = new System.Drawing.Size(38, 23);
@@ -1750,7 +1695,7 @@
             // OutBoxLabelPrint
             // 
             this.OutBoxLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxLabelPrint.Location = new System.Drawing.Point(90, 178);
+            this.OutBoxLabelPrint.Location = new System.Drawing.Point(90, 199);
             this.OutBoxLabelPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OutBoxLabelPrint.Name = "OutBoxLabelPrint";
             this.OutBoxLabelPrint.Size = new System.Drawing.Size(76, 26);
@@ -1863,10 +1808,6 @@
         private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder OutBoxLabel;
         private CustomControl.EnterTextBox OutBoxNum;
         private System.Windows.Forms.Label label10;
-        private CustomControl.EnterTextBox WeightNet;
-        private System.Windows.Forms.Label label9;
-        private CustomControl.EnterTextBox WeightGross;
-        private System.Windows.Forms.Label label8;
         private CustomControl.PrinterCombox OutBoxPrinter;
         private System.Windows.Forms.Button OutBoxLabelPrint;
         private System.Windows.Forms.ComboBox OutBoxCombox;

+ 22 - 36
UAS-出货标签管理/UAS_出货标签管理.cs

@@ -1850,47 +1850,33 @@ namespace UAS_LabelMachine
                         //名称相等的时候,取SQL进行值的查询
                         if (OutBoxDoc.Variables.FreeVariables.Item(j + 1).Name == OutLabelParam.Rows[k]["lp_name"].ToString())
                         {
-                            //如果毛重填写的是毛重或者净重
-                            if (OutLabelParam.Rows[k]["lp_valuetype"].ToString() == "字符串" && OutLabelParam.Rows[k]["lp_sql"].ToString() == "GW")
-                            {
-                                OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = WeightGross.Text;
-                                LogManager.DoLog("打印参数【毛重】赋值," + WeightGross.Text);
-                            }
-                            else if (OutLabelParam.Rows[k]["lp_valuetype"].ToString() == "字符串" && OutLabelParam.Rows[k]["lp_sql"].ToString() == "NW")
-                            {
-                                OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = WeightNet.Text;
-                                LogManager.DoLog("打印参数【净重】赋值," + WeightNet.Text);
-                            }
-                            else
+                            //获取对应行的pib_id
+                            string pib_id = LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString();
+                            string pib_outboxcode2 = LabelInf.Rows[rowindex].Cells["pib_outboxcode2"].Value.ToString();
+                            //获取打印执行的SQL
+                            string sql = OutLabelParam.Rows[k]["lp_sql"].ToString();
+                            //select * from productiobarcode where pib_id={pib_id} and pib_outboxcode1={pib_outboxcode1}
+                            try
                             {
-                                //获取对应行的pib_id
-                                string pib_id = LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString();
-                                string pib_outboxcode2 = LabelInf.Rows[rowindex].Cells["pib_outboxcode2"].Value.ToString();
-                                //获取打印执行的SQL
-                                string sql = OutLabelParam.Rows[k]["lp_sql"].ToString();
-                                //select * from productiobarcode where pib_id={pib_id} and pib_outboxcode1={pib_outboxcode1}
-                                try
+                                string ExeSQL = "";
+                                ExeSQL = sql.ToLower().Replace("{pib_id}", "'" + pib_id + "'");
+                                ExeSQL = ExeSQL.Replace("{pib_outboxcode2}", "'" + pib_outboxcode2 + "'");
+                                OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = dh.GetLabelParam(ExeSQL).ToString();
+                                if (OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value == "")
                                 {
-                                    string ExeSQL = "";
-                                    ExeSQL = sql.ToLower().Replace("{pib_id}", "'" + pib_id + "'");
-                                    ExeSQL = ExeSQL.Replace("{pib_outboxcode2}", "'" + pib_outboxcode2 + "'");
-                                    OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = dh.GetLabelParam(ExeSQL).ToString();
-                                    if (OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value == "")
+                                    DataRow[] dr1 = Attach.Select("lp_name='" + OutBoxDoc.Variables.FreeVariables.Item(j + 1).Name + "'");
+                                    if (dr1.Length > 0)
                                     {
-                                        DataRow[] dr1 = Attach.Select("lp_name='" + OutBoxDoc.Variables.FreeVariables.Item(j + 1).Name + "'");
-                                        if (dr1.Length > 0)
-                                        {
-                                            OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
-                                        }
+                                        OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
                                     }
-                                    LogManager.DoLog("打印参数【" + OutBoxDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + ExeSQL + ",取到值" + OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value);
-                                }
-                                catch (Exception)
-                                {
-                                    LogManager.DoLog("SQL维护不正确,请检查SQL语句" + sql);
-                                    MessageBox.Show("SQL维护不正确,请检查SQL语句\n" + sql);
-                                    return;
                                 }
+                                LogManager.DoLog("打印参数【" + OutBoxDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + ExeSQL + ",取到值" + OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value);
+                            }
+                            catch (Exception)
+                            {
+                                LogManager.DoLog("SQL维护不正确,请检查SQL语句" + sql);
+                                MessageBox.Show("SQL维护不正确,请检查SQL语句\n" + sql);
+                                return;
                             }
                         }
                     }