Parcourir la source

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

caosy il y a 6 ans
Parent
commit
642c3ff4c8

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

@@ -14,6 +14,7 @@ using FastReport;
 using System.Linq;
 using System.Linq;
 using System.Reflection;
 using System.Reflection;
 using UAS_LabelMachine.CustomControl;
 using UAS_LabelMachine.CustomControl;
+using System.ComponentModel;
 
 
 namespace UAS_LabelMachine
 namespace UAS_LabelMachine
 {
 {
@@ -2052,6 +2053,18 @@ namespace UAS_LabelMachine
 
 
         private void UAS_出货标签打印_Click(object sender, EventArgs e)
         private void UAS_出货标签打印_Click(object sender, EventArgs e)
         {
         {
+            if (Com.IsOpen && Com.PortName == cis.Controls["PortName"].Text)
+            {
+                MessageBox.Show("串口" + Com.PortName + "已打开");
+                return;
+            }
+            else
+            {
+                if (Com.IsOpen)
+                {
+                    Com.Close();
+                }
+            }
             int BaudRate = 0;
             int BaudRate = 0;
             Com.PortName = cis.Controls["PortName"].Text;
             Com.PortName = cis.Controls["PortName"].Text;
             if (int.TryParse(cis.Controls["BaudRate"].Text, out BaudRate))
             if (int.TryParse(cis.Controls["BaudRate"].Text, out BaudRate))
@@ -2068,10 +2081,23 @@ namespace UAS_LabelMachine
 
 
         private void Com_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
         private void Com_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
         {
         {
-            int len = Com.BytesToRead;
-            byte[] readBuffer = new byte[len];
-            Com.Read(readBuffer, 0, len); //将数据读入缓存
-            Weight.Text = reg.Match(Encoding.ASCII.GetString(readBuffer, 0, len)).Value; //获取出入库产品编号
+            try
+            {
+                int len = Com.BytesToRead;
+                byte[] readBuffer = new byte[len];
+                Com.Read(readBuffer, 0, len); //将数据读入缓存
+                Weight.Text = reg.Match(Encoding.ASCII.GetString(readBuffer, 0, len)).Value;
+                //读不到数据的时间删掉
+                if (Weight.Text == "")
+                {
+                    Com.DataReceived -= Com_DataReceived;
+                    return;
+                }
+            }
+            catch (Exception)
+            {
+                return;
+            }
         }
         }
     }
     }
 }
 }

+ 42 - 1
UAS-出货标签管理(贸易版)/PublicMethod/LogicHandler.cs

@@ -6,6 +6,19 @@ namespace UAS_LabelMachine.PublicMethod
     {
     {
         public static DataHelper dh = SystemInf.dh;
         public static DataHelper dh = SystemInf.dh;
 
 
+        /// <summary>
+        /// 特殊业务过滤逻辑,目前只有海创在使用
+        /// </summary>
+        /// <param name="iCustCode"></param>
+        /// <param name="iBrand"></param>
+        /// <param name="iSpec"></param>
+        /// <param name="iQty"></param>
+        /// <param name="iDateCode"></param>
+        /// <param name="iLotno"></param>
+        /// <param name="oSpec"></param>
+        /// <param name="oQty"></param>
+        /// <param name="oDatecode"></param>
+        /// <param name="oLotno"></param>
         public static void FilterData(string iCustCode, string iBrand, string iSpec, string iQty, string iDateCode, string iLotno, out string oSpec, out string oQty, out string oDatecode, out string oLotno)
         public static void FilterData(string iCustCode, string iBrand, string iSpec, string iQty, string iDateCode, string iLotno, out string oSpec, out string oQty, out string oDatecode, out string oLotno)
         {
         {
             oSpec = "";
             oSpec = "";
@@ -20,6 +33,15 @@ namespace UAS_LabelMachine.PublicMethod
             oLotno = param[9];
             oLotno = param[9];
         }
         }
 
 
+        /// <summary>
+        /// 通用方法,日期格式转换,转换成指定的年月日
+        /// </summary>
+        /// <param name="iDatecode"></param>
+        /// <param name="iCustcode"></param>
+        /// <param name="oYear"></param>
+        /// <param name="oMonth"></param>
+        /// <param name="oDay"></param>
+        /// <param name="oDate"></param>
         public static void GetTimeFromDatecode(string iDatecode, string iCustcode, out string oYear, out string oMonth, out string oDay, out string oDate)
         public static void GetTimeFromDatecode(string iDatecode, string iCustcode, out string oYear, out string oMonth, out string oDay, out string oDate)
         {
         {
             oYear = "0";
             oYear = "0";
@@ -34,12 +56,31 @@ namespace UAS_LabelMachine.PublicMethod
             oDate = param[5];
             oDate = param[5];
         }
         }
 
 
-        public static void CustBarCode(string iInoutno,out string oSQL)
+        /// <summary>
+        /// 特殊业务条码处理,目前针对海创长城客户
+        /// </summary>
+        /// <param name="iInoutno"></param>
+        /// <param name="oSQL"></param>
+        public static void CustBarCode(string iInoutno, out string oSQL)
         {
         {
             oSQL = "";
             oSQL = "";
             string[] param = new string[] { iInoutno, oSQL };
             string[] param = new string[] { iInoutno, oSQL };
             dh.CallProcedure("SP_CUSTBARCODE", ref param);
             dh.CallProcedure("SP_CUSTBARCODE", ref param);
             oSQL = param[1];
             oSQL = param[1];
         }
         }
+
+        /// <summary>
+        /// 获取生成条码的SQL,目前添加用户海创和凯而高,凯而高有特殊定制逻辑
+        /// </summary>
+        /// <param name="iPiid"></param>
+        /// <param name="iCustCode"></param>
+        /// <param name="oSQL"></param>
+        public static void GenerateBarCode(string iPiid, string iCustCode, out string oSQL)
+        {
+            oSQL = "";
+            string[] param = new string[] { iPiid, iCustCode, oSQL };
+            dh.CallProcedure("sp_GenerateBarCode", ref param);
+            oSQL = param[2];
+        }
     }
     }
 }
 }

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

@@ -109,7 +109,7 @@ namespace UAS_LabelMachine.PublicMethod
                 MidDoc.PrintDocument();
                 MidDoc.PrintDocument();
             }
             }
 
 
-            public static void OutPrint(Document OutBoxDoc, DataTable OutLabelParam, string pi_inoutno, string pib_id, string pib_outboxcode2)
+            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)
             {
             {
                 StringBuilder sql = new StringBuilder();
                 StringBuilder sql = new StringBuilder();
                 sql.Clear();
                 sql.Clear();
@@ -121,8 +121,30 @@ namespace UAS_LabelMachine.PublicMethod
                         sql.Append(dr1[0]["lp_sql"].ToString() + ",");
                         sql.Append(dr1[0]["lp_sql"].ToString() + ",");
                     }
                     }
                 }
                 }
+                //界面设定的分组条件
+                string GroupByCondition = "";
+                if (iCustProdCode)
+                {
+                    GroupByCondition += "pd_custprodcode,";
+                }
+                if (iCustPo)
+                {
+                    GroupByCondition += "pd_pocode,";
+                }
+                if (iDC)
+                {
+                    GroupByCondition += "pib_datecode,";
+                }
+                if (iLotNo)
+                {
+                    GroupByCondition += "pib_lotno,";
+                }
+                if (iCustProdCode || iCustPo || iDC || iLotNo)
+                {
+                    GroupByCondition = " group by " + (GroupByCondition.Substring(0, GroupByCondition.Length - 1));
+                }
                 sql.Append("1,");
                 sql.Append("1,");
-                DataTable dt = (DataTable)SystemInf.sdh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno + "' and pib_outboxcode2=" + (pib_outboxcode2 == "" ? "0" : pib_outboxcode2), "select");
+                DataTable dt = (DataTable)SystemInf.sdh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno + "' and pib_outboxcode2=" + (pib_outboxcode2 == "" ? "0" : pib_outboxcode2) + GroupByCondition, "select");
                 if (dt.Rows.Count > 0)
                 if (dt.Rows.Count > 0)
                 {
                 {
                     for (int j = 0; j < OutBoxDoc.Variables.FormVariables.Count; j++)
                     for (int j = 0; j < OutBoxDoc.Variables.FormVariables.Count; j++)
@@ -300,7 +322,7 @@ namespace UAS_LabelMachine.PublicMethod
                 MidFormat.Print();
                 MidFormat.Print();
             }
             }
 
 
-            public static void OutPrint(LabelFormatDocument OutFormat, DataTable OutLabelParam, string pi_inoutno, string pib_id, string pib_outboxcode2)
+            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)
             {
             {
                 StringBuilder sql = new StringBuilder();
                 StringBuilder sql = new StringBuilder();
                 sql.Clear();
                 sql.Clear();
@@ -312,16 +334,38 @@ namespace UAS_LabelMachine.PublicMethod
                         sql.Append(dr1[0]["lp_sql"].ToString() + ",");
                         sql.Append(dr1[0]["lp_sql"].ToString() + ",");
                     }
                     }
                 }
                 }
+                //界面设定的分组条件
+                string GroupByCondition = "";
+                if (iCustProdCode)
+                {
+                    GroupByCondition += "pd_custprodcode,";
+                }
+                if (iCustPo)
+                {
+                    GroupByCondition += "pd_pocode,";
+                }
+                if (iDC)
+                {
+                    GroupByCondition += "pib_datecode,";
+                }
+                if (iLotNo)
+                {
+                    GroupByCondition += "pib_lotno,";
+                }
+                if (iCustProdCode || iCustPo || iDC || iLotNo)
+                {
+                    GroupByCondition = " group by "+(GroupByCondition.Substring(0, GroupByCondition.Length - 1));
+                }
                 sql.Append("1,");
                 sql.Append("1,");
-                DataTable dt = (DataTable)SystemInf.sdh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno + "' and pib_outboxcode2=" + (pib_outboxcode2 == "" ? "0" : pib_outboxcode2) + " limit 0,1", "select");
-                if (dt.Rows.Count > 0)
+                DataTable dt = (DataTable)SystemInf.sdh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno + "' and pib_outboxcode2=" + (pib_outboxcode2 == "" ? "0" : pib_outboxcode2) + GroupByCondition, "select");
+                for (int m = 0; m < dt.Rows.Count; m++)
                 {
                 {
                     for (int j = 0; j < OutFormat.SubStrings.Count; j++)
                     for (int j = 0; j < OutFormat.SubStrings.Count; j++)
                     {
                     {
                         DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutFormat.SubStrings[j].Name + "'");
                         DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutFormat.SubStrings[j].Name + "'");
                         if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串" && dr1[0]["lp_sql"].ToString() != "")
                         if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串" && dr1[0]["lp_sql"].ToString() != "")
                         {
                         {
-                            OutFormat.SubStrings[j].Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
+                            OutFormat.SubStrings[j].Value = dt.Rows[m][dr1[0]["lp_sql"].ToString()].ToString();
                         }
                         }
                         //SQL判断多个值的时候
                         //SQL判断多个值的时候
                         if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "SQL值")
                         if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "SQL值")

+ 92 - 0
UAS-出货标签管理(贸易版)/ReSetMaxNum.Designer.cs

@@ -0,0 +1,92 @@
+namespace UAS_LabelMachine
+{
+    partial class ReSetMaxNum
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.pi_inoutno_label = new System.Windows.Forms.Label();
+            this.SingleLabelPrint = new System.Windows.Forms.Button();
+            this.Number = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.SuspendLayout();
+            // 
+            // pi_inoutno_label
+            // 
+            this.pi_inoutno_label.AutoSize = true;
+            this.pi_inoutno_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pi_inoutno_label.Location = new System.Drawing.Point(52, 64);
+            this.pi_inoutno_label.Name = "pi_inoutno_label";
+            this.pi_inoutno_label.Size = new System.Drawing.Size(65, 20);
+            this.pi_inoutno_label.TabIndex = 5;
+            this.pi_inoutno_label.Text = "当前流水";
+            // 
+            // SingleLabelPrint
+            // 
+            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(136, 108);
+            this.SingleLabelPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.SingleLabelPrint.Name = "SingleLabelPrint";
+            this.SingleLabelPrint.Size = new System.Drawing.Size(53, 26);
+            this.SingleLabelPrint.TabIndex = 37;
+            this.SingleLabelPrint.Text = "确认";
+            this.SingleLabelPrint.UseVisualStyleBackColor = true;
+            this.SingleLabelPrint.Click += new System.EventHandler(this.SingleLabelPrint_Click);
+            // 
+            // Number
+            // 
+            this.Number.ID = null;
+            this.Number.Location = new System.Drawing.Point(123, 64);
+            this.Number.Name = "Number";
+            this.Number.Size = new System.Drawing.Size(83, 21);
+            this.Number.Str = null;
+            this.Number.Str1 = null;
+            this.Number.Str2 = null;
+            this.Number.TabIndex = 38;
+            // 
+            // ReSetMaxNum
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(320, 163);
+            this.Controls.Add(this.Number);
+            this.Controls.Add(this.SingleLabelPrint);
+            this.Controls.Add(this.pi_inoutno_label);
+            this.Name = "ReSetMaxNum";
+            this.Text = "流水设置";
+            this.Load += new System.EventHandler(this.ReSetMaxNum_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label pi_inoutno_label;
+        private System.Windows.Forms.Button SingleLabelPrint;
+        private CustomControl.EnterTextBox Number;
+    }
+}

+ 142 - 0
UAS-出货标签管理(贸易版)/ReSetMaxNum.cs

@@ -0,0 +1,142 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Windows.Forms;
+using UAS_LabelMachine.Entity;
+
+namespace UAS_LabelMachine
+{
+    public partial class ReSetMaxNum : Form
+    {
+        DataHelper dh = SystemInf.dh;
+
+        string custcode;
+
+        public ReSetMaxNum(string iCustCode)
+        {
+            custcode = iCustCode;
+            InitializeComponent();
+        }
+        //前缀
+        string Prefix = "";
+        //后缀
+        string Suffix = "";
+        //编码规则编号
+        string NrCode = "";
+
+        string PrefixFixed = "";
+        //流水号的索引
+        int SerialNumIndex = 0;
+        //流水长度
+        int SerialNumLength = 0;
+        //存放键值对
+        int Radix = 10;
+        //客户的流水号
+        int custserialnum = 0;
+
+        private void ReSetMaxNum_Load(object sender, EventArgs e)
+        {
+
+            DataTable Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_type,nrd_radix,nrd_sql,nrd_length,nr_code,nvl(nrd_iscombine,-1)nrd_iscombine from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode='" + custcode + "' order by nrd_detno", "select");
+            //如果没有则取公共规则
+            if (Nr.Rows.Count == 0)
+                Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_radix,nrd_type,nrd_sql,nrd_length,nr_code,nvl(nrd_iscombine,-1)nrd_iscombine from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode is null and nr_isdefault <> 0 order by nrd_detno", "select");
+            //用于过滤参数的正则表达式
+            if (Nr.Rows.Count > 0)
+            {
+                NrCode = Nr.Rows[0]["nr_code"].ToString();
+            }
+            Regex match = new Regex("{\\w+}");
+            //用于存放每一项的明细的数据
+            string[] NrData = new string[Nr.Rows.Count];
+
+            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();
+                        Prefix += NrData[m];
+                        Suffix += 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(), "'" + this.Number.Text + "'");
+                            }
+                            Temp = (DataTable)dh.ExecuteSql(SQL, "select");
+                        }
+                        if (Temp.Rows.Count > 0)
+                        {
+                            NrData[m] = Temp.Rows[0][0].ToString();
+                            Prefix += NrData[m];
+                            Suffix += NrData[m];
+                        }
+                        else
+                        {
+                            NrData[m] = "";
+                            Prefix += NrData[m];
+                            Suffix += NrData[m];
+                        }
+                        break;
+                    //流水需要通过MaxNumber去取
+                    case "流水":
+                        NrData[m] = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + NrCode + "'").ToString();
+                        Suffix = "";
+                        PrefixFixed = Prefix;
+                        //设置当前流水
+                        custserialnum = int.Parse(NrData[m] == "" ? "0" : NrData[m]);
+                        SerialNumIndex = m;
+                        SerialNumLength = int.Parse(Nr.Rows[m]["nrd_length"].ToString());
+                        Radix = int.Parse(Nr.Rows[m]["nrd_radix"].ToString());
+                        break;
+                    default:
+                        break;
+                }
+            }
+            string maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'").ToString();
+            if (maxnum == "")
+            {
+                dh.ExecuteSql("insert into RuleMaxNum(rmn_id,rmn_nrcode,rmn_prefix,rmn_maxnumber) values(RuleMaxNum_seq.nextval,'" + NrCode + "','" + Prefix + "','1')", "insert");
+                maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'").ToString();
+                custserialnum = int.Parse(maxnum);
+            }//如果流水号不为空则取当前流水
+            else
+            {
+                custserialnum = int.Parse(maxnum);
+            }
+            Number.Text = custserialnum.ToString();
+        }
+
+        private void SingleLabelPrint_Click(object sender, EventArgs e)
+        {
+            int num = 0;
+            if (int.TryParse(Number.Text, out num))
+            {
+                dh.UpdateByCondition("RuleMaxNum", "rmn_maxnumber='" + num + "'", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'");
+                MessageBox.Show("流水修改成功");
+                Close();
+            }
+            else
+            {
+                MessageBox.Show("请填写正确的数字");
+            }
+        }
+    }
+}

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

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 9 - 0
UAS-出货标签管理(贸易版)/UAS-出货标签管理(贸易版).csproj

@@ -270,6 +270,12 @@
     <Compile Include="PublicMethod\LogManager.cs" />
     <Compile Include="PublicMethod\LogManager.cs" />
     <Compile Include="PublicMethod\Print.cs" />
     <Compile Include="PublicMethod\Print.cs" />
     <Compile Include="PublicMethod\SqliteDBHelper.cs" />
     <Compile Include="PublicMethod\SqliteDBHelper.cs" />
+    <Compile Include="ReSetMaxNum.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="ReSetMaxNum.Designer.cs">
+      <DependentUpon>ReSetMaxNum.cs</DependentUpon>
+    </Compile>
     <Compile Include="Service References\Vivo_BoxReelRelation\Reference.cs">
     <Compile Include="Service References\Vivo_BoxReelRelation\Reference.cs">
       <AutoGen>True</AutoGen>
       <AutoGen>True</AutoGen>
       <DesignTime>True</DesignTime>
       <DesignTime>True</DesignTime>
@@ -361,6 +367,9 @@
     <EmbeddedResource Include="PowerSetting.resx">
     <EmbeddedResource Include="PowerSetting.resx">
       <DependentUpon>PowerSetting.cs</DependentUpon>
       <DependentUpon>PowerSetting.cs</DependentUpon>
     </EmbeddedResource>
     </EmbeddedResource>
+    <EmbeddedResource Include="ReSetMaxNum.resx">
+      <DependentUpon>ReSetMaxNum.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="SetLoadingWindow.resx">
     <EmbeddedResource Include="SetLoadingWindow.resx">
       <DependentUpon>SetLoadingWindow.cs</DependentUpon>
       <DependentUpon>SetLoadingWindow.cs</DependentUpon>
     </EmbeddedResource>
     </EmbeddedResource>

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

@@ -196,6 +196,7 @@
             this.OutBoxLabelPrint = new System.Windows.Forms.Button();
             this.OutBoxLabelPrint = new System.Windows.Forms.Button();
             this.OutBoxLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.OutBoxLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.OutBoxCombox = new System.Windows.Forms.ComboBox();
             this.OutBoxCombox = new System.Windows.Forms.ComboBox();
+            this.流水调整ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             this.Menu.SuspendLayout();
             this.Menu.SuspendLayout();
@@ -773,10 +774,11 @@
             this.toolStripMenuItem5,
             this.toolStripMenuItem5,
             this.toolStripMenuItem6,
             this.toolStripMenuItem6,
             this.下载模板ToolStripMenuItem,
             this.下载模板ToolStripMenuItem,
-            this.客户合并规则ToolStripMenuItem});
+            this.客户合并规则ToolStripMenuItem,
+            this.流水调整ToolStripMenuItem});
             this.Menu.Name = "Menu";
             this.Menu.Name = "Menu";
             this.Menu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
             this.Menu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
-            this.Menu.Size = new System.Drawing.Size(149, 180);
+            this.Menu.Size = new System.Drawing.Size(149, 202);
             this.Menu.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.Menu_ItemClicked);
             this.Menu.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.Menu_ItemClicked);
             // 
             // 
             // toolStripMenuItem1
             // toolStripMenuItem1
@@ -1737,7 +1739,7 @@
             this.groupBoxWithBorder2.Size = new System.Drawing.Size(87, 124);
             this.groupBoxWithBorder2.Size = new System.Drawing.Size(87, 124);
             this.groupBoxWithBorder2.TabIndex = 91;
             this.groupBoxWithBorder2.TabIndex = 91;
             this.groupBoxWithBorder2.TabStop = false;
             this.groupBoxWithBorder2.TabStop = false;
-            this.groupBoxWithBorder2.Text = "合并条件";
+            this.groupBoxWithBorder2.Text = "区分";
             // 
             // 
             // cu_print_outpo
             // cu_print_outpo
             // 
             // 
@@ -1926,6 +1928,12 @@
             this.OutBoxCombox.TabIndex = 78;
             this.OutBoxCombox.TabIndex = 78;
             this.OutBoxCombox.SelectedIndexChanged += new System.EventHandler(this.OutBoxCombox_SelectedIndexChanged);
             this.OutBoxCombox.SelectedIndexChanged += new System.EventHandler(this.OutBoxCombox_SelectedIndexChanged);
             // 
             // 
+            // 流水调整ToolStripMenuItem
+            // 
+            this.流水调整ToolStripMenuItem.Name = "流水调整ToolStripMenuItem";
+            this.流水调整ToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
+            this.流水调整ToolStripMenuItem.Text = "流水调整";
+            // 
             // UAS_出货标签打印
             // UAS_出货标签打印
             // 
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -2172,5 +2180,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
         private System.Windows.Forms.Button CustBarCode;
         private System.Windows.Forms.Button CustBarCode;
+        private System.Windows.Forms.ToolStripMenuItem 流水调整ToolStripMenuItem;
     }
     }
 }
 }

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

@@ -1488,9 +1488,9 @@ namespace UAS_LabelMachine
             string pib_id = LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString();
             string pib_id = LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString();
             string pib_outboxcode2 = LabelInf.Rows[rowindex].Cells["pib_outboxcode2"].Value.ToString();
             string pib_outboxcode2 = LabelInf.Rows[rowindex].Cells["pib_outboxcode2"].Value.ToString();
             if (PrintMethod == "CodeSoft")
             if (PrintMethod == "CodeSoft")
-                Print.CodeSoft.OutPrint(OutBoxDoc, OutLabelParam, pi_inoutno.Text, pib_id, pib_outboxcode2);
+                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);
             else
             else
-                Print.BarTender.OutPrint(OutFormat, OutLabelParam, pi_inoutno.Text, pib_id, pib_outboxcode2);
+                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);
         }
         }
 
 
         private void CleanDetail_Click(object sender, EventArgs e)
         private void CleanDetail_Click(object sender, EventArgs e)
@@ -2186,8 +2186,7 @@ namespace UAS_LabelMachine
         {
         {
             Menu.Show(new Point(MenuSetting.Location.X, MenuSetting.Location.Y + 20));
             Menu.Show(new Point(MenuSetting.Location.X, MenuSetting.Location.Y + 20));
         }
         }
-        //客户的流水号
-        int custserialnum = 0;
+
         private void Menu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
         private void Menu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
         {
         {
             Menu.Close();
             Menu.Close();
@@ -2301,6 +2300,18 @@ namespace UAS_LabelMachine
                     BaseUtil.SetFormCenter(cust);
                     BaseUtil.SetFormCenter(cust);
                     cust.ShowDialog();
                     cust.ShowDialog();
                     break;
                     break;
+                case "流水调整":
+                    if (cu_code.Text != "")
+                    {
+                        ReSetMaxNum reset = new ReSetMaxNum(cu_code.Text);
+                        BaseUtil.SetFormCenter(reset);
+                        reset.ShowDialog();
+                    }
+                    else
+                    {
+                        MessageBox.Show("请先输入出货单号");
+                    }
+                    break;
                 default:
                 default:
                     break;
                     break;
             }
             }
@@ -2322,101 +2333,127 @@ namespace UAS_LabelMachine
             return str;
             return str;
         }
         }
 
 
+        //前缀
+        string Prefix = "";
+        //后缀
+        string Suffix = "";
+        //编码规则编号
+        string NrCode = "";
+
+        string PrefixFixed = "";
+        //流水号的索引
+        int SerialNumIndex = 0;
+        //流水长度
+        int SerialNumLength = 0;
+        //存放键值对
+        int Radix = 10;
+        //客户的流水号
+        int custserialnum = 0;
+
+        public void GetCustRule()
+        {
+            //前缀
+            Prefix = "";
+            //后缀
+            Suffix = "";
+            //编码规则编号
+            NrCode = "";
+
+            PrefixFixed = "";
+            //流水号的索引
+            SerialNumIndex = 0;
+            //流水长度
+            SerialNumLength = 0;
+            //存放键值对
+            Radix = 10;
+            DataTable Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_type,nrd_radix,nrd_sql,nrd_length,nr_code,nvl(nrd_iscombine,-1)nrd_iscombine from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode='" + cu_code.Text + "' order by nrd_detno", "select");
+            //如果没有则取公共规则
+            if (Nr.Rows.Count == 0)
+                Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_radix,nrd_type,nrd_sql,nrd_length,nr_code,nvl(nrd_iscombine,-1)nrd_iscombine from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode is null and nr_isdefault <> 0 order by nrd_detno", "select");
+            //用于过滤参数的正则表达式
+            if (Nr.Rows.Count > 0)
+            {
+                NrCode = Nr.Rows[0]["nr_code"].ToString();
+            }
+            Regex match = new Regex("{\\w+}");
+            //用于存放每一项的明细的数据
+            string[] NrData = new string[Nr.Rows.Count];
+
+            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();
+                        Prefix += NrData[m];
+                        Suffix += 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();
+                            Prefix += NrData[m];
+                            Suffix += NrData[m];
+                        }
+                        else
+                        {
+                            NrData[m] = "";
+                            Prefix += NrData[m];
+                            Suffix += NrData[m];
+                        }
+                        break;
+                    //流水需要通过MaxNumber去取
+                    case "流水":
+                        NrData[m] = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + NrCode + "'").ToString();
+                        Suffix = "";
+                        PrefixFixed = Prefix;
+                        //设置当前流水
+                        custserialnum = int.Parse(NrData[m] == "" ? "0" : NrData[m]);
+                        SerialNumIndex = m;
+                        SerialNumLength = int.Parse(Nr.Rows[m]["nrd_length"].ToString());
+                        Radix = int.Parse(Nr.Rows[m]["nrd_radix"].ToString());
+                        break;
+                    default:
+                        break;
+                }
+            }
+            string maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'").ToString();
+            if (maxnum == "")
+            {
+                dh.ExecuteSql("insert into RuleMaxNum(rmn_id,rmn_nrcode,rmn_prefix,rmn_maxnumber) values(RuleMaxNum_seq.nextval,'" + NrCode + "','" + Prefix + "','1')", "insert");
+                maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'").ToString();
+                custserialnum = int.Parse(maxnum);
+            }//如果流水号不为空则取当前流水
+            else
+            {
+                custserialnum = int.Parse(maxnum);
+            }
+        }
+
         public void ImportBarcode()
         public void ImportBarcode()
         {
         {
             try
             try
             {
             {
-                string Prefix = "";
-
-                string Suffix = "";
-                //编码规则编号
-                string NrCode = "";
-                DataTable Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_type,nrd_radix,nrd_sql,nrd_length,nr_code,nvl(nrd_iscombine,-1)nrd_iscombine from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode='" + cu_code.Text + "' order by nrd_detno", "select");
-                //如果没有则取公共规则
-                if (Nr.Rows.Count == 0)
-                    Nr = (DataTable)dh.ExecuteSql("select nrd_detno,nrd_name,nrd_radix,nrd_type,nrd_sql,nrd_length,nr_code,nvl(nrd_iscombine,-1)nrd_iscombine from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode is null and nr_isdefault <> 0 order by nrd_detno", "select");
-                //用于过滤参数的正则表达式
-                if (Nr.Rows.Count > 0)
-                {
-                    NrCode = Nr.Rows[0]["nr_code"].ToString();
-                }
-                Regex match = new Regex("{\\w+}");
-                //用于存放每一项的明细的数据
-                string[] NrData = new string[Nr.Rows.Count];
-                //流水号的索引
-                int SerialNumIndex = 0;
-                //流水长度
-                int SerialNumLength = 0;
-                //存放键值对
-                int Radix = 10;
-                string PrefixFixed = "";
-                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();
-                            Prefix += NrData[m];
-                            Suffix += 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();
-                                Prefix += NrData[m];
-                                Suffix += NrData[m];
-                            }
-                            else
-                            {
-                                NrData[m] = "";
-                                Prefix += NrData[m];
-                                Suffix += NrData[m];
-                            }
-                            break;
-                        //流水需要通过MaxNumber去取
-                        case "流水":
-                            NrData[m] = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + NrCode + "'").ToString();
-                            Suffix = "";
-                            PrefixFixed = Prefix;
-                            //设置当前流水
-                            custserialnum = int.Parse(NrData[m] == "" ? "0" : NrData[m]);
-                            SerialNumIndex = m;
-                            SerialNumLength = int.Parse(Nr.Rows[m]["nrd_length"].ToString());
-                            Radix = int.Parse(Nr.Rows[m]["nrd_radix"].ToString());
-                            break;
-                        default:
-                            break;
-                    }
-                }
+                GetCustRule();
                 //获取最大的流水号
                 //获取最大的流水号
-                string maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'").ToString();
-                if (maxnum == "")
-                {
-                    dh.ExecuteSql("insert into RuleMaxNum(rmn_id,rmn_nrcode,rmn_prefix,rmn_maxnumber) values(RuleMaxNum_seq.nextval,'" + NrCode + "','" + Prefix + "','1')", "insert");
-                    maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'").ToString();
-                    custserialnum = int.Parse(maxnum);
-                }//如果流水号不为空则取当前流水
-                else
-                {
-                    custserialnum = int.Parse(maxnum);
-                }
+
                 DataTable dt = ExcelHandler.ExcelToDataTable(ImportExcel.FileName, true);
                 DataTable dt = ExcelHandler.ExcelToDataTable(ImportExcel.FileName, true);
                 if (dt == null)
                 if (dt == null)
                 {
                 {
@@ -2767,7 +2804,10 @@ namespace UAS_LabelMachine
             sdh.ExecuteSql(sql, "update");
             sdh.ExecuteSql(sql, "update");
             for (int i = 0; i < pibid_dt.Rows.Count; i++)
             for (int i = 0; i < pibid_dt.Rows.Count; i++)
             {
             {
-                Print.BarTender.SinglePrint(SingleFormat, SingleLabelParam, pibid_dt.Rows[i]["pib_id"].ToString());
+                if (PrintMethod == "CodeSoft")
+                    Print.CodeSoft.SinglePrint(SingleDoc, SingleLabelParam, pibid_dt.Rows[i]["pib_id"].ToString());
+                else
+                    Print.BarTender.SinglePrint(SingleFormat, SingleLabelParam, pibid_dt.Rows[i]["pib_id"].ToString());
             }
             }
             setvalueandprint.FindForm().Close();
             setvalueandprint.FindForm().Close();
         }
         }

+ 3 - 33
UAS-出货标签管理(贸易版)/生成条码.cs

@@ -500,8 +500,10 @@ namespace UAS_LabelMachine
                 switch (pi_class.Text)
                 switch (pi_class.Text)
                 {
                 {
                     case "出货单":
                     case "出货单":
+                        string outsql = "";
+                        LogicHandler.GenerateBarCode(pi_id, CustCode, out outsql);
                         sql.Clear();
                         sql.Clear();
-                        sql.Append(CustomerBarCode());
+                        sql.Append(outsql);
                         break;
                         break;
                     case "完工入库单":
                     case "完工入库单":
                         sql.Clear();
                         sql.Clear();
@@ -544,37 +546,5 @@ namespace UAS_LabelMachine
                 pi_inoutno.Text = "";
                 pi_inoutno.Text = "";
             }
             }
         }
         }
-
-        private string CustomerBarCode()
-        {
-            DataTable custrule = (DataTable)dh.ExecuteSql("select CU_PRINT_MIDSPEC,CU_PRINT_MIDPO,cu_print_midprod from customer where cu_code='" + CustCode + "'", "select");
-            string condition = "";
-            if (custrule.Rows.Count > 0)
-            {
-                string cu_print_midspec = custrule.Rows[0]["cu_print_midspec"].ToString();
-                string cu_print_midpo = custrule.Rows[0]["cu_print_midpo"].ToString();
-                string cu_print_midprod = custrule.Rows[0]["cu_print_midprod"].ToString();
-                if (cu_print_midspec == "-1")
-                {
-                    condition += ",pd_vespec_user";
-                }
-                if (cu_print_midpo == "-1")
-                {
-                    condition += ",pd_pocode";
-                }
-                if (cu_print_midprod == "-1")
-                {
-                    condition += ",pd_custprodcode";
-                }
-            }
-            string sql = "";
-            sql += ("select pd_piid,pd_id,pr_id,pr_brand,pr_orispeccode,pr_madein,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty pd_totalqty,pd_pocode,pd_ordercode,pd_orderdetno,pd_pdno,pd_prodcode,pd_custprodcode,");
-            sql += ("pd_piclass,pd_qty from (select pd_piid,pd_id,pr_id,pr_brand,nvl(pd_vespec_user,pr_orispeccode)pr_orispeccode,pr_madein,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty,pd_pocode,pd_ordercode,pd_orderdetno,pd_pdno,");
-            sql += ("pd_prodcode,pd_custprodcode,pd_piclass,outqty-nvl((select sum(nvl(pib_qty,0)) from PRODIOBARCODE where PIB_PIID=pd_piid and pib_pdno=pd_pdno ),0)pd_qty ");
-            sql += ("from (select pd_piid,min(pd_id)pd_id,max(nvl(pd_vespecprint_user,pd_vespec_user))pd_vespec_user,sum(pd_outqty)outqty,min(pd_pocode)pd_pocode,min(pd_ordercode)pd_ordercode,min(pd_orderdetno)pd_orderdetno,min(pd_pdno)pd_pdno,max(pd_custprodcode)pd_custprodcode,max(pd_prodcode)pd_prodcode,max(pd_piclass)pd_piclass ");
-            sql += ("from prodiodetail group by pd_piid" + condition + ")T left join product ");
-            sql += ("on pr_code=pd_prodcode)  where  pd_piid='" + pi_id + "' order by pd_pdno");
-            return sql;
-        }
     }
     }
 }
 }

+ 167 - 27
UAS-出货标签管理(贸易版)/附件内容打印.Designer.cs

@@ -54,12 +54,22 @@
             this.lap_id2 = new System.Windows.Forms.Label();
             this.lap_id2 = new System.Windows.Forms.Label();
             this.lap_id3 = new System.Windows.Forms.Label();
             this.lap_id3 = new System.Windows.Forms.Label();
             this.lap_id1 = new System.Windows.Forms.Label();
             this.lap_id1 = new System.Windows.Forms.Label();
+            this.lap_id6 = new System.Windows.Forms.Label();
+            this.lap_value6 = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.lap_value6_label = new System.Windows.Forms.Label();
+            this.lap_param6 = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.lap_param6_label = new System.Windows.Forms.Label();
+            this.lap_id7 = new System.Windows.Forms.Label();
+            this.lap_value7 = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.lap_value7_label = new System.Windows.Forms.Label();
+            this.lap_param7 = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.lap_param7_label = new System.Windows.Forms.Label();
             this.SuspendLayout();
             this.SuspendLayout();
             // 
             // 
             // lap_param1
             // lap_param1
             // 
             // 
             this.lap_param1.ID = null;
             this.lap_param1.ID = null;
-            this.lap_param1.Location = new System.Drawing.Point(77, 49);
+            this.lap_param1.Location = new System.Drawing.Point(77, 21);
             this.lap_param1.Name = "lap_param1";
             this.lap_param1.Name = "lap_param1";
             this.lap_param1.Size = new System.Drawing.Size(89, 21);
             this.lap_param1.Size = new System.Drawing.Size(89, 21);
             this.lap_param1.Str = null;
             this.lap_param1.Str = null;
@@ -72,7 +82,7 @@
             this.lap_param1_label.AutoSize = true;
             this.lap_param1_label.AutoSize = true;
             this.lap_param1_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_param1_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_param1_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lap_param1_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_param1_label.Location = new System.Drawing.Point(29, 49);
+            this.lap_param1_label.Location = new System.Drawing.Point(29, 21);
             this.lap_param1_label.Name = "lap_param1_label";
             this.lap_param1_label.Name = "lap_param1_label";
             this.lap_param1_label.Size = new System.Drawing.Size(42, 21);
             this.lap_param1_label.Size = new System.Drawing.Size(42, 21);
             this.lap_param1_label.TabIndex = 61;
             this.lap_param1_label.TabIndex = 61;
@@ -81,7 +91,7 @@
             // lap_value1
             // lap_value1
             // 
             // 
             this.lap_value1.ID = null;
             this.lap_value1.ID = null;
-            this.lap_value1.Location = new System.Drawing.Point(235, 49);
+            this.lap_value1.Location = new System.Drawing.Point(235, 21);
             this.lap_value1.Name = "lap_value1";
             this.lap_value1.Name = "lap_value1";
             this.lap_value1.Size = new System.Drawing.Size(89, 21);
             this.lap_value1.Size = new System.Drawing.Size(89, 21);
             this.lap_value1.Str = null;
             this.lap_value1.Str = null;
@@ -94,7 +104,7 @@
             this.lap_value1_label.AutoSize = true;
             this.lap_value1_label.AutoSize = true;
             this.lap_value1_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_value1_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_value1_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lap_value1_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_value1_label.Location = new System.Drawing.Point(187, 49);
+            this.lap_value1_label.Location = new System.Drawing.Point(187, 21);
             this.lap_value1_label.Name = "lap_value1_label";
             this.lap_value1_label.Name = "lap_value1_label";
             this.lap_value1_label.Size = new System.Drawing.Size(42, 21);
             this.lap_value1_label.Size = new System.Drawing.Size(42, 21);
             this.lap_value1_label.TabIndex = 63;
             this.lap_value1_label.TabIndex = 63;
@@ -103,7 +113,7 @@
             // lap_value3
             // lap_value3
             // 
             // 
             this.lap_value3.ID = null;
             this.lap_value3.ID = null;
-            this.lap_value3.Location = new System.Drawing.Point(235, 153);
+            this.lap_value3.Location = new System.Drawing.Point(235, 109);
             this.lap_value3.Name = "lap_value3";
             this.lap_value3.Name = "lap_value3";
             this.lap_value3.Size = new System.Drawing.Size(89, 21);
             this.lap_value3.Size = new System.Drawing.Size(89, 21);
             this.lap_value3.Str = null;
             this.lap_value3.Str = null;
@@ -116,7 +126,7 @@
             this.lap_value3_label.AutoSize = true;
             this.lap_value3_label.AutoSize = true;
             this.lap_value3_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_value3_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_value3_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lap_value3_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_value3_label.Location = new System.Drawing.Point(187, 153);
+            this.lap_value3_label.Location = new System.Drawing.Point(187, 109);
             this.lap_value3_label.Name = "lap_value3_label";
             this.lap_value3_label.Name = "lap_value3_label";
             this.lap_value3_label.Size = new System.Drawing.Size(42, 21);
             this.lap_value3_label.Size = new System.Drawing.Size(42, 21);
             this.lap_value3_label.TabIndex = 67;
             this.lap_value3_label.TabIndex = 67;
@@ -125,7 +135,7 @@
             // lap_param3
             // lap_param3
             // 
             // 
             this.lap_param3.ID = null;
             this.lap_param3.ID = null;
-            this.lap_param3.Location = new System.Drawing.Point(77, 153);
+            this.lap_param3.Location = new System.Drawing.Point(77, 109);
             this.lap_param3.Name = "lap_param3";
             this.lap_param3.Name = "lap_param3";
             this.lap_param3.Size = new System.Drawing.Size(89, 21);
             this.lap_param3.Size = new System.Drawing.Size(89, 21);
             this.lap_param3.Str = null;
             this.lap_param3.Str = null;
@@ -138,7 +148,7 @@
             this.lap_param3_labe.AutoSize = true;
             this.lap_param3_labe.AutoSize = true;
             this.lap_param3_labe.BackColor = System.Drawing.Color.Transparent;
             this.lap_param3_labe.BackColor = System.Drawing.Color.Transparent;
             this.lap_param3_labe.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lap_param3_labe.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_param3_labe.Location = new System.Drawing.Point(29, 153);
+            this.lap_param3_labe.Location = new System.Drawing.Point(29, 109);
             this.lap_param3_labe.Name = "lap_param3_labe";
             this.lap_param3_labe.Name = "lap_param3_labe";
             this.lap_param3_labe.Size = new System.Drawing.Size(42, 21);
             this.lap_param3_labe.Size = new System.Drawing.Size(42, 21);
             this.lap_param3_labe.TabIndex = 65;
             this.lap_param3_labe.TabIndex = 65;
@@ -147,7 +157,7 @@
             // lap_value2
             // lap_value2
             // 
             // 
             this.lap_value2.ID = null;
             this.lap_value2.ID = null;
-            this.lap_value2.Location = new System.Drawing.Point(235, 102);
+            this.lap_value2.Location = new System.Drawing.Point(235, 64);
             this.lap_value2.Name = "lap_value2";
             this.lap_value2.Name = "lap_value2";
             this.lap_value2.Size = new System.Drawing.Size(89, 21);
             this.lap_value2.Size = new System.Drawing.Size(89, 21);
             this.lap_value2.Str = null;
             this.lap_value2.Str = null;
@@ -160,7 +170,7 @@
             this.lap_value2_label.AutoSize = true;
             this.lap_value2_label.AutoSize = true;
             this.lap_value2_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_value2_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_value2_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lap_value2_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_value2_label.Location = new System.Drawing.Point(187, 102);
+            this.lap_value2_label.Location = new System.Drawing.Point(187, 64);
             this.lap_value2_label.Name = "lap_value2_label";
             this.lap_value2_label.Name = "lap_value2_label";
             this.lap_value2_label.Size = new System.Drawing.Size(42, 21);
             this.lap_value2_label.Size = new System.Drawing.Size(42, 21);
             this.lap_value2_label.TabIndex = 71;
             this.lap_value2_label.TabIndex = 71;
@@ -169,7 +179,7 @@
             // lap_param2
             // lap_param2
             // 
             // 
             this.lap_param2.ID = null;
             this.lap_param2.ID = null;
-            this.lap_param2.Location = new System.Drawing.Point(77, 102);
+            this.lap_param2.Location = new System.Drawing.Point(77, 64);
             this.lap_param2.Name = "lap_param2";
             this.lap_param2.Name = "lap_param2";
             this.lap_param2.Size = new System.Drawing.Size(89, 21);
             this.lap_param2.Size = new System.Drawing.Size(89, 21);
             this.lap_param2.Str = null;
             this.lap_param2.Str = null;
@@ -182,7 +192,7 @@
             this.lap_param2_label.AutoSize = true;
             this.lap_param2_label.AutoSize = true;
             this.lap_param2_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_param2_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_param2_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lap_param2_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_param2_label.Location = new System.Drawing.Point(29, 102);
+            this.lap_param2_label.Location = new System.Drawing.Point(29, 64);
             this.lap_param2_label.Name = "lap_param2_label";
             this.lap_param2_label.Name = "lap_param2_label";
             this.lap_param2_label.Size = new System.Drawing.Size(42, 21);
             this.lap_param2_label.Size = new System.Drawing.Size(42, 21);
             this.lap_param2_label.TabIndex = 69;
             this.lap_param2_label.TabIndex = 69;
@@ -191,7 +201,7 @@
             // lap_value5
             // lap_value5
             // 
             // 
             this.lap_value5.ID = null;
             this.lap_value5.ID = null;
-            this.lap_value5.Location = new System.Drawing.Point(235, 247);
+            this.lap_value5.Location = new System.Drawing.Point(235, 204);
             this.lap_value5.Name = "lap_value5";
             this.lap_value5.Name = "lap_value5";
             this.lap_value5.Size = new System.Drawing.Size(89, 21);
             this.lap_value5.Size = new System.Drawing.Size(89, 21);
             this.lap_value5.Str = null;
             this.lap_value5.Str = null;
@@ -204,7 +214,7 @@
             this.lap_value5_label.AutoSize = true;
             this.lap_value5_label.AutoSize = true;
             this.lap_value5_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_value5_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_value5_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lap_value5_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_value5_label.Location = new System.Drawing.Point(187, 247);
+            this.lap_value5_label.Location = new System.Drawing.Point(187, 204);
             this.lap_value5_label.Name = "lap_value5_label";
             this.lap_value5_label.Name = "lap_value5_label";
             this.lap_value5_label.Size = new System.Drawing.Size(42, 21);
             this.lap_value5_label.Size = new System.Drawing.Size(42, 21);
             this.lap_value5_label.TabIndex = 75;
             this.lap_value5_label.TabIndex = 75;
@@ -213,7 +223,7 @@
             // lap_param5
             // lap_param5
             // 
             // 
             this.lap_param5.ID = null;
             this.lap_param5.ID = null;
-            this.lap_param5.Location = new System.Drawing.Point(77, 247);
+            this.lap_param5.Location = new System.Drawing.Point(77, 204);
             this.lap_param5.Name = "lap_param5";
             this.lap_param5.Name = "lap_param5";
             this.lap_param5.Size = new System.Drawing.Size(89, 21);
             this.lap_param5.Size = new System.Drawing.Size(89, 21);
             this.lap_param5.Str = null;
             this.lap_param5.Str = null;
@@ -226,7 +236,7 @@
             this.lap_param5_label.AutoSize = true;
             this.lap_param5_label.AutoSize = true;
             this.lap_param5_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_param5_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_param5_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lap_param5_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_param5_label.Location = new System.Drawing.Point(29, 247);
+            this.lap_param5_label.Location = new System.Drawing.Point(29, 204);
             this.lap_param5_label.Name = "lap_param5_label";
             this.lap_param5_label.Name = "lap_param5_label";
             this.lap_param5_label.Size = new System.Drawing.Size(42, 21);
             this.lap_param5_label.Size = new System.Drawing.Size(42, 21);
             this.lap_param5_label.TabIndex = 73;
             this.lap_param5_label.TabIndex = 73;
@@ -235,7 +245,7 @@
             // lap_value4
             // lap_value4
             // 
             // 
             this.lap_value4.ID = null;
             this.lap_value4.ID = null;
-            this.lap_value4.Location = new System.Drawing.Point(235, 197);
+            this.lap_value4.Location = new System.Drawing.Point(235, 155);
             this.lap_value4.Name = "lap_value4";
             this.lap_value4.Name = "lap_value4";
             this.lap_value4.Size = new System.Drawing.Size(89, 21);
             this.lap_value4.Size = new System.Drawing.Size(89, 21);
             this.lap_value4.Str = null;
             this.lap_value4.Str = null;
@@ -248,7 +258,7 @@
             this.lap_value4_label.AutoSize = true;
             this.lap_value4_label.AutoSize = true;
             this.lap_value4_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_value4_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_value4_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lap_value4_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_value4_label.Location = new System.Drawing.Point(187, 197);
+            this.lap_value4_label.Location = new System.Drawing.Point(187, 155);
             this.lap_value4_label.Name = "lap_value4_label";
             this.lap_value4_label.Name = "lap_value4_label";
             this.lap_value4_label.Size = new System.Drawing.Size(42, 21);
             this.lap_value4_label.Size = new System.Drawing.Size(42, 21);
             this.lap_value4_label.TabIndex = 79;
             this.lap_value4_label.TabIndex = 79;
@@ -257,7 +267,7 @@
             // lap_param4
             // lap_param4
             // 
             // 
             this.lap_param4.ID = null;
             this.lap_param4.ID = null;
-            this.lap_param4.Location = new System.Drawing.Point(77, 197);
+            this.lap_param4.Location = new System.Drawing.Point(77, 155);
             this.lap_param4.Name = "lap_param4";
             this.lap_param4.Name = "lap_param4";
             this.lap_param4.Size = new System.Drawing.Size(89, 21);
             this.lap_param4.Size = new System.Drawing.Size(89, 21);
             this.lap_param4.Str = null;
             this.lap_param4.Str = null;
@@ -270,7 +280,7 @@
             this.lap_param4_label.AutoSize = true;
             this.lap_param4_label.AutoSize = true;
             this.lap_param4_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_param4_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_param4_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lap_param4_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_param4_label.Location = new System.Drawing.Point(29, 197);
+            this.lap_param4_label.Location = new System.Drawing.Point(29, 155);
             this.lap_param4_label.Name = "lap_param4_label";
             this.lap_param4_label.Name = "lap_param4_label";
             this.lap_param4_label.Size = new System.Drawing.Size(42, 21);
             this.lap_param4_label.Size = new System.Drawing.Size(42, 21);
             this.lap_param4_label.TabIndex = 77;
             this.lap_param4_label.TabIndex = 77;
@@ -278,7 +288,7 @@
             // 
             // 
             // Confirm
             // Confirm
             // 
             // 
-            this.Confirm.Location = new System.Drawing.Point(148, 308);
+            this.Confirm.Location = new System.Drawing.Point(143, 360);
             this.Confirm.Name = "Confirm";
             this.Confirm.Name = "Confirm";
             this.Confirm.Size = new System.Drawing.Size(75, 23);
             this.Confirm.Size = new System.Drawing.Size(75, 23);
             this.Confirm.TabIndex = 81;
             this.Confirm.TabIndex = 81;
@@ -291,7 +301,7 @@
             this.lap_id4.AutoSize = true;
             this.lap_id4.AutoSize = true;
             this.lap_id4.BackColor = System.Drawing.Color.Transparent;
             this.lap_id4.BackColor = System.Drawing.Color.Transparent;
             this.lap_id4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lap_id4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_id4.Location = new System.Drawing.Point(139, 197);
+            this.lap_id4.Location = new System.Drawing.Point(139, 155);
             this.lap_id4.Name = "lap_id4";
             this.lap_id4.Name = "lap_id4";
             this.lap_id4.Size = new System.Drawing.Size(0, 21);
             this.lap_id4.Size = new System.Drawing.Size(0, 21);
             this.lap_id4.TabIndex = 86;
             this.lap_id4.TabIndex = 86;
@@ -302,7 +312,7 @@
             this.lap_id5.AutoSize = true;
             this.lap_id5.AutoSize = true;
             this.lap_id5.BackColor = System.Drawing.Color.Transparent;
             this.lap_id5.BackColor = System.Drawing.Color.Transparent;
             this.lap_id5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lap_id5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_id5.Location = new System.Drawing.Point(139, 247);
+            this.lap_id5.Location = new System.Drawing.Point(139, 204);
             this.lap_id5.Name = "lap_id5";
             this.lap_id5.Name = "lap_id5";
             this.lap_id5.Size = new System.Drawing.Size(0, 21);
             this.lap_id5.Size = new System.Drawing.Size(0, 21);
             this.lap_id5.TabIndex = 85;
             this.lap_id5.TabIndex = 85;
@@ -313,7 +323,7 @@
             this.lap_id2.AutoSize = true;
             this.lap_id2.AutoSize = true;
             this.lap_id2.BackColor = System.Drawing.Color.Transparent;
             this.lap_id2.BackColor = System.Drawing.Color.Transparent;
             this.lap_id2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lap_id2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_id2.Location = new System.Drawing.Point(139, 102);
+            this.lap_id2.Location = new System.Drawing.Point(139, 64);
             this.lap_id2.Name = "lap_id2";
             this.lap_id2.Name = "lap_id2";
             this.lap_id2.Size = new System.Drawing.Size(0, 21);
             this.lap_id2.Size = new System.Drawing.Size(0, 21);
             this.lap_id2.TabIndex = 84;
             this.lap_id2.TabIndex = 84;
@@ -324,7 +334,7 @@
             this.lap_id3.AutoSize = true;
             this.lap_id3.AutoSize = true;
             this.lap_id3.BackColor = System.Drawing.Color.Transparent;
             this.lap_id3.BackColor = System.Drawing.Color.Transparent;
             this.lap_id3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lap_id3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_id3.Location = new System.Drawing.Point(139, 153);
+            this.lap_id3.Location = new System.Drawing.Point(139, 109);
             this.lap_id3.Name = "lap_id3";
             this.lap_id3.Name = "lap_id3";
             this.lap_id3.Size = new System.Drawing.Size(0, 21);
             this.lap_id3.Size = new System.Drawing.Size(0, 21);
             this.lap_id3.TabIndex = 83;
             this.lap_id3.TabIndex = 83;
@@ -335,17 +345,137 @@
             this.lap_id1.AutoSize = true;
             this.lap_id1.AutoSize = true;
             this.lap_id1.BackColor = System.Drawing.Color.Transparent;
             this.lap_id1.BackColor = System.Drawing.Color.Transparent;
             this.lap_id1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lap_id1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_id1.Location = new System.Drawing.Point(139, 49);
+            this.lap_id1.Location = new System.Drawing.Point(139, 21);
             this.lap_id1.Name = "lap_id1";
             this.lap_id1.Name = "lap_id1";
             this.lap_id1.Size = new System.Drawing.Size(0, 21);
             this.lap_id1.Size = new System.Drawing.Size(0, 21);
             this.lap_id1.TabIndex = 82;
             this.lap_id1.TabIndex = 82;
             this.lap_id1.Visible = false;
             this.lap_id1.Visible = false;
             // 
             // 
+            // lap_id6
+            // 
+            this.lap_id6.AutoSize = true;
+            this.lap_id6.BackColor = System.Drawing.Color.Transparent;
+            this.lap_id6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.lap_id6.Location = new System.Drawing.Point(139, 251);
+            this.lap_id6.Name = "lap_id6";
+            this.lap_id6.Size = new System.Drawing.Size(0, 21);
+            this.lap_id6.TabIndex = 91;
+            this.lap_id6.Visible = false;
+            // 
+            // lap_value6
+            // 
+            this.lap_value6.ID = null;
+            this.lap_value6.Location = new System.Drawing.Point(235, 251);
+            this.lap_value6.Name = "lap_value6";
+            this.lap_value6.Size = new System.Drawing.Size(89, 21);
+            this.lap_value6.Str = null;
+            this.lap_value6.Str1 = null;
+            this.lap_value6.Str2 = null;
+            this.lap_value6.TabIndex = 88;
+            // 
+            // lap_value6_label
+            // 
+            this.lap_value6_label.AutoSize = true;
+            this.lap_value6_label.BackColor = System.Drawing.Color.Transparent;
+            this.lap_value6_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.lap_value6_label.Location = new System.Drawing.Point(187, 251);
+            this.lap_value6_label.Name = "lap_value6_label";
+            this.lap_value6_label.Size = new System.Drawing.Size(42, 21);
+            this.lap_value6_label.TabIndex = 90;
+            this.lap_value6_label.Text = "内容";
+            // 
+            // lap_param6
+            // 
+            this.lap_param6.ID = null;
+            this.lap_param6.Location = new System.Drawing.Point(77, 251);
+            this.lap_param6.Name = "lap_param6";
+            this.lap_param6.Size = new System.Drawing.Size(89, 21);
+            this.lap_param6.Str = null;
+            this.lap_param6.Str1 = null;
+            this.lap_param6.Str2 = null;
+            this.lap_param6.TabIndex = 87;
+            // 
+            // lap_param6_label
+            // 
+            this.lap_param6_label.AutoSize = true;
+            this.lap_param6_label.BackColor = System.Drawing.Color.Transparent;
+            this.lap_param6_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.lap_param6_label.Location = new System.Drawing.Point(29, 251);
+            this.lap_param6_label.Name = "lap_param6_label";
+            this.lap_param6_label.Size = new System.Drawing.Size(42, 21);
+            this.lap_param6_label.TabIndex = 89;
+            this.lap_param6_label.Text = "参数";
+            // 
+            // lap_id7
+            // 
+            this.lap_id7.AutoSize = true;
+            this.lap_id7.BackColor = System.Drawing.Color.Transparent;
+            this.lap_id7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.lap_id7.Location = new System.Drawing.Point(139, 300);
+            this.lap_id7.Name = "lap_id7";
+            this.lap_id7.Size = new System.Drawing.Size(0, 21);
+            this.lap_id7.TabIndex = 96;
+            this.lap_id7.Visible = false;
+            // 
+            // lap_value7
+            // 
+            this.lap_value7.ID = null;
+            this.lap_value7.Location = new System.Drawing.Point(235, 300);
+            this.lap_value7.Name = "lap_value7";
+            this.lap_value7.Size = new System.Drawing.Size(89, 21);
+            this.lap_value7.Str = null;
+            this.lap_value7.Str1 = null;
+            this.lap_value7.Str2 = null;
+            this.lap_value7.TabIndex = 93;
+            // 
+            // lap_value7_label
+            // 
+            this.lap_value7_label.AutoSize = true;
+            this.lap_value7_label.BackColor = System.Drawing.Color.Transparent;
+            this.lap_value7_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.lap_value7_label.Location = new System.Drawing.Point(187, 300);
+            this.lap_value7_label.Name = "lap_value7_label";
+            this.lap_value7_label.Size = new System.Drawing.Size(42, 21);
+            this.lap_value7_label.TabIndex = 95;
+            this.lap_value7_label.Text = "内容";
+            // 
+            // lap_param7
+            // 
+            this.lap_param7.ID = null;
+            this.lap_param7.Location = new System.Drawing.Point(77, 300);
+            this.lap_param7.Name = "lap_param7";
+            this.lap_param7.Size = new System.Drawing.Size(89, 21);
+            this.lap_param7.Str = null;
+            this.lap_param7.Str1 = null;
+            this.lap_param7.Str2 = null;
+            this.lap_param7.TabIndex = 92;
+            // 
+            // lap_param7_label
+            // 
+            this.lap_param7_label.AutoSize = true;
+            this.lap_param7_label.BackColor = System.Drawing.Color.Transparent;
+            this.lap_param7_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.lap_param7_label.Location = new System.Drawing.Point(29, 300);
+            this.lap_param7_label.Name = "lap_param7_label";
+            this.lap_param7_label.Size = new System.Drawing.Size(42, 21);
+            this.lap_param7_label.TabIndex = 94;
+            this.lap_param7_label.Text = "参数";
+            // 
             // 附件内容打印
             // 附件内容打印
             // 
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(364, 359);
+            this.ClientSize = new System.Drawing.Size(364, 395);
+            this.Controls.Add(this.lap_id7);
+            this.Controls.Add(this.lap_value7);
+            this.Controls.Add(this.lap_value7_label);
+            this.Controls.Add(this.lap_param7);
+            this.Controls.Add(this.lap_param7_label);
+            this.Controls.Add(this.lap_id6);
+            this.Controls.Add(this.lap_value6);
+            this.Controls.Add(this.lap_value6_label);
+            this.Controls.Add(this.lap_param6);
+            this.Controls.Add(this.lap_param6_label);
             this.Controls.Add(this.lap_id4);
             this.Controls.Add(this.lap_id4);
             this.Controls.Add(this.lap_id5);
             this.Controls.Add(this.lap_id5);
             this.Controls.Add(this.lap_id2);
             this.Controls.Add(this.lap_id2);
@@ -409,5 +539,15 @@
         private System.Windows.Forms.Label lap_id2;
         private System.Windows.Forms.Label lap_id2;
         private System.Windows.Forms.Label lap_id3;
         private System.Windows.Forms.Label lap_id3;
         private System.Windows.Forms.Label lap_id1;
         private System.Windows.Forms.Label lap_id1;
+        private System.Windows.Forms.Label lap_id6;
+        private CustomControl.EnterTextBox lap_value6;
+        private System.Windows.Forms.Label lap_value6_label;
+        private CustomControl.EnterTextBox lap_param6;
+        private System.Windows.Forms.Label lap_param6_label;
+        private System.Windows.Forms.Label lap_id7;
+        private CustomControl.EnterTextBox lap_value7;
+        private System.Windows.Forms.Label lap_value7_label;
+        private CustomControl.EnterTextBox lap_param7;
+        private System.Windows.Forms.Label lap_param7_label;
     }
     }
 }
 }

+ 1 - 1
UAS-出货标签管理(贸易版)/附件内容打印.cs

@@ -37,7 +37,7 @@ namespace UAS_LabelMachine
         private void Confirm_Click(object sender, EventArgs e)
         private void Confirm_Click(object sender, EventArgs e)
         {
         {
             string SQL = "";
             string SQL = "";
-            for (int i = 1; i < 6; i++)
+            for (int i = 1; i < 8; i++)
             {
             {
                 if (Controls["lap_id" + i].Text == "")
                 if (Controls["lap_id" + i].Text == "")
                 {
                 {

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

@@ -11,17 +11,17 @@ namespace UAS_LabelMachine
     public class DataHelper
     public class DataHelper
     {
     {
 
 
-        //富为外网地址
-        private readonly string ConnectionStrings = "Data Source=richwellgroup.com.cn/orcl;User ID=DATACENTER;PassWord=select!#%*(";
-        private readonly string InnerConnectionStrings = "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!#%*(";
+        //private readonly string InnerConnectionStrings = "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=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=183.238.39.179)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
@@ -36,18 +36,18 @@ namespace UAS_LabelMachine
         //public static readonly string Masters = "GOLDEN";
         //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=sz.hi-mantech.com)(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=sz.hi-mantech.com)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
 
 
-        //private readonly string InnerConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        private readonly string InnerConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
 
 
-        ////怡海能达ERP地址
-        //public static readonly string ERPAddesss = "http://sz.hi-mantech.com:8099/ERP/";
-        ////怡海能达FTP
-        //public static readonly string FTPAdress = "ftp://sz.hi-mantech.com:46688|yhndftp|Stga28ytG8";
-        ////Oracle端口
-        //public static readonly string OraclePort = "1521";
-        ////需要显示的账套
-        //public static readonly string Masters = "YHND_SZ,YHND_HK,DATACENTER,YITOA_ZX,T_YHND_HK";
+        //怡海能达ERP地址
+        public static readonly string ERPAddesss = "http://sz.hi-mantech.com:8099/ERP/";
+        //怡海能达FTP
+        public static readonly string FTPAdress = "ftp://sz.hi-mantech.com:46688|yhndftp|Stga28ytG8";
+        //Oracle端口
+        public static readonly string OraclePort = "1521";
+        //需要显示的账套
+        public static readonly string Masters = "YHND_SZ,YHND_HK,DATACENTER,YITOA_ZX,T_YHND_HK";
 
 
         ////华商龙外网地址
         ////华商龙外网地址
         //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)));";
         //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)));";
@@ -91,17 +91,20 @@ namespace UAS_LabelMachine
                     try
                     try
                     {
                     {
                         connection = new OracleConnection(ConnectionStrings);
                         connection = new OracleConnection(ConnectionStrings);
+                        connection.Open();
                     }
                     }
                     catch (Exception)
                     catch (Exception)
                     {
                     {
                         connection = new OracleConnection(InnerConnectionStrings);
                         connection = new OracleConnection(InnerConnectionStrings);
+                        connection.Open();
                     }
                     }
                 }
                 }
                 else
                 else
                 {
                 {
                     connection = new OracleConnection(DBConnectionString);
                     connection = new OracleConnection(DBConnectionString);
+                    connection.Open();
                 }
                 }
-                connection.Open();
+              
             }
             }
             catch (Exception e) { LogManager.DoLog(e.Message); }
             catch (Exception e) { LogManager.DoLog(e.Message); }
         }
         }