Browse Source

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

caosy 6 years ago
parent
commit
16db3f720a

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

@@ -0,0 +1,142 @@
+namespace UAS_LabelMachine
+{
+    partial class CustomerRule
+    {
+        /// <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()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CustomerRule));
+            this.cu_print_midspec = new System.Windows.Forms.CheckBox();
+            this.cu_print_midpo = new System.Windows.Forms.CheckBox();
+            this.CustomerTreeView = new System.Windows.Forms.TreeView();
+            this.Customer = new System.Windows.Forms.TextBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.ButtonSaveScanGroup = new UAS_LabelMachine.CustomControl.NormalButton();
+            this.SuspendLayout();
+            // 
+            // cu_print_midspec
+            // 
+            this.cu_print_midspec.AutoSize = true;
+            this.cu_print_midspec.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.cu_print_midspec.Location = new System.Drawing.Point(281, 191);
+            this.cu_print_midspec.Name = "cu_print_midspec";
+            this.cu_print_midspec.Size = new System.Drawing.Size(93, 25);
+            this.cu_print_midspec.TabIndex = 3;
+            this.cu_print_midspec.Tag = "QTY";
+            this.cu_print_midspec.Text = "区分型号";
+            this.cu_print_midspec.UseVisualStyleBackColor = true;
+            // 
+            // cu_print_midpo
+            // 
+            this.cu_print_midpo.AutoSize = true;
+            this.cu_print_midpo.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.cu_print_midpo.Location = new System.Drawing.Point(424, 191);
+            this.cu_print_midpo.Name = "cu_print_midpo";
+            this.cu_print_midpo.Size = new System.Drawing.Size(93, 25);
+            this.cu_print_midpo.TabIndex = 4;
+            this.cu_print_midpo.Tag = "PN";
+            this.cu_print_midpo.Text = "区分订单";
+            this.cu_print_midpo.UseVisualStyleBackColor = true;
+            // 
+            // CustomerTreeView
+            // 
+            this.CustomerTreeView.Location = new System.Drawing.Point(0, 24);
+            this.CustomerTreeView.Name = "CustomerTreeView";
+            this.CustomerTreeView.Size = new System.Drawing.Size(251, 610);
+            this.CustomerTreeView.TabIndex = 0;
+            this.CustomerTreeView.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.CustomerTreeView_NodeMouseClick);
+            // 
+            // Customer
+            // 
+            this.Customer.Location = new System.Drawing.Point(85, 1);
+            this.Customer.Name = "Customer";
+            this.Customer.Size = new System.Drawing.Size(166, 21);
+            this.Customer.TabIndex = 43;
+            this.Customer.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Brand_KeyDown);
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.Location = new System.Drawing.Point(3, 2);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(74, 21);
+            this.label1.TabIndex = 44;
+            this.label1.Text = "客户搜索";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(281, 149);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(106, 21);
+            this.label2.TabIndex = 51;
+            this.label2.Text = "中盒合并规则";
+            // 
+            // ButtonSaveScanGroup
+            // 
+            this.ButtonSaveScanGroup.Image = ((System.Drawing.Image)(resources.GetObject("ButtonSaveScanGroup.Image")));
+            this.ButtonSaveScanGroup.Location = new System.Drawing.Point(254, 4);
+            this.ButtonSaveScanGroup.Name = "ButtonSaveScanGroup";
+            this.ButtonSaveScanGroup.Size = new System.Drawing.Size(64, 23);
+            this.ButtonSaveScanGroup.TabIndex = 42;
+            this.ButtonSaveScanGroup.Text = "保存";
+            this.ButtonSaveScanGroup.UseVisualStyleBackColor = true;
+            this.ButtonSaveScanGroup.Click += new System.EventHandler(this.ButtonSaveScanGroup_Click);
+            // 
+            // CustomerRule
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1082, 634);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.Customer);
+            this.Controls.Add(this.ButtonSaveScanGroup);
+            this.Controls.Add(this.cu_print_midpo);
+            this.Controls.Add(this.cu_print_midspec);
+            this.Controls.Add(this.CustomerTreeView);
+            this.Name = "CustomerRule";
+            this.Text = "客户规则";
+            this.Load += new System.EventHandler(this.CustomerRule_Load);
+            this.SizeChanged += new System.EventHandler(this.CustomerRule_SizeChanged);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+        private System.Windows.Forms.CheckBox cu_print_midspec;
+        private System.Windows.Forms.CheckBox cu_print_midpo;
+        private System.Windows.Forms.TreeView CustomerTreeView;
+        private CustomControl.NormalButton ButtonSaveScanGroup;
+        private System.Windows.Forms.TextBox Customer;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
+    }
+}

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

@@ -0,0 +1,106 @@
+using System;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using UAS_LabelMachine.Entity;
+using UAS_LabelMachine.PublicMethod;
+
+namespace UAS_LabelMachine
+{
+    public partial class CustomerRule : Form
+    {
+
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+
+        DataHelper dh;
+
+        StringBuilder sql = new StringBuilder();
+
+        DataTable dt;
+
+        string CUCODE = "";
+
+        public CustomerRule()
+        {
+            InitializeComponent();
+        }
+
+        private void CustomerRule_Load(object sender, EventArgs e)
+        {
+            asc.controllInitializeSize(this);
+            dh = SystemInf.dh;
+            dt = (DataTable)dh.ExecuteSql("select cu_name,cu_code from customer where rownum<500 and cu_auditstatuscode<>'DISABLE'", "select");
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                TreeNode node = new TreeNode(dt.Rows[i]["cu_name"].ToString());
+                node.Tag = dt.Rows[i]["cu_code"].ToString();
+                CustomerTreeView.Nodes.Add(node);
+            }
+        }
+
+        private void CustomerRule_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+        }
+
+        private void CustomerTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
+        {
+            //点中根节点的时候查询品牌下的采集方案
+            if (e.Node.Level == 0)
+            {
+                CUCODE = e.Node.Tag.ToString();
+                sql.Clear();
+                sql.Append("select cu_print_midlotno,cu_print_midspec,cu_print_dateformat,nvl(cu_print_limiteddate,0)cu_print_limiteddate,cu_print_checkdatecode,cu_print_recheck,cu_print_midpo,cu_print_midprod,nvl(cu_print_custprodmatchmodel,'Equal')cu_print_custprodmatchmodel,cu_print_outlotno,cu_print_outspec,cu_print_outpo");
+                sql.Append(",cu_print_outprod,cu_print_checkonly,nvl(cu_print_papercount,0)cu_print_papercount,cu_print_regexpression from customer where cu_code='" + e.Node.Tag + "'");
+                dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                if (dt.Rows.Count > 0)
+                {
+                    BaseUtil.SetFormValue(this.Controls, dt);
+                }
+            }
+        }
+
+        private void ButtonSaveScanGroup_Click(object sender, EventArgs e)
+        {
+            sql.Clear();
+            sql.Append("update customer set cu_print_midspec='" + (cu_print_midspec.Checked ? -1 : 0) + "',");
+            sql.Append("cu_print_midpo='" + (cu_print_midpo.Checked ? -1 : 0) + "' ");
+            sql.Append("where cu_code='" + CUCODE + "'");
+            dh.ExecuteSql(sql.ToString(), "update");
+            MessageBox.Show("保存成功!", "提示");
+        }
+
+        /// <summary>
+        /// 模糊搜索功能
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void Brand_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                if (Customer.Text != "")
+                    dt = (DataTable)dh.ExecuteSql("select cu_name,cu_code from customer where (cu_name like '%" + Customer.Text + "%' or cu_code like '%" + Customer.Text + "%') and cu_auditstatuscode<>'DISABLE'", "select");
+                else
+                    dt = (DataTable)dh.ExecuteSql("select cu_name,cu_code from customer where rownum<500 and cu_auditstatuscode<>'DISABLE'", "select");
+                CustomerTreeView.Nodes.Clear();
+                for (int i = 0; i < dt.Rows.Count; i++)
+                {
+                    TreeNode node = new TreeNode(dt.Rows[i]["cu_name"].ToString());
+                    node.Tag = dt.Rows[i]["cu_code"].ToString();
+                    CustomerTreeView.Nodes.Add(node);
+                }
+            }
+        }
+
+        private void Equal_CheckedChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void DateFormat_CheckedChanged(object sender, EventArgs e)
+        {
+            Control ctl = sender as Control;
+        }
+    }
+}

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

@@ -0,0 +1,133 @@
+<?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>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="ButtonSaveScanGroup.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        R0lGODlhUgAXAIQAAK/G1qjB1dzn6bTK2MfZ46rE1arD1/D4+/n//d/o7/X6/ez1/K7D1tLj6+Pt9ubx
+        877S3fT09DxZeQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBF
+        Mi4wAwEBAAAh+QQAAAAAACwAAAAAUgAXAAAI/wAlCBxIsKDBgwgTKlzIsGCEhxAjSpxIsaLFixgzPhQY
+        AYHHjyBDihxJsqTJkygjcFTAsqXLlzBjypxJs6ZNlRIiHNjJs6fPn0CDCh1KtCjOCAuSKl3KtKnTp1Cj
+        Sp169IHVq1izat3KtavXr2Crgh1LtqzZrUcdqF3Ltq3bt3Djyp1L92iCu3jz6t3Lt6/fv4ADHxVAuLDh
+        w4gTK17MuLHjow0iS55MubLly5gza958lIHnz6BDix5NurTp06iPGljNurXr17Bjy55Nu/bRALhz697N
+        u7fv38CDCz9aoLjx48iTK1/OvLnz50cBSJ9Ovbr169iza9/O/eiA7+DDi0EfT768+fPo0x+FwL69+/fw
+        48ufT7++/fX28+vfzz/+UQIABijggAQWaOCBCCao4FEaNejggxBG1NCEFFZoIUIBAQA7
+</value>
+  </data>
+</root>

+ 9 - 2
UAS-出货标签管理(贸易版)/PublicMethod/BaseUtil.cs

@@ -190,7 +190,7 @@ namespace UAS_LabelMachine
                 {
                     string controlName = collection[i].Name;
                     //默认给TextBox和Label赋值
-                    if (collection[i] is TextBox || collection[i] is Label || collection[i] is SearchTextBox)
+                    if (collection[i] is TextBox || collection[i] is Label || collection[i] is SearchTextBox || collection[i] is CheckBox)
                     {
                         for (int j = 0; j < dt.Columns.Count; j++)
                         {
@@ -233,7 +233,14 @@ namespace UAS_LabelMachine
                                 }
                                 else
                                 {
-                                    collection[i].Text = dt.Rows[0][j].ToString();
+                                    if (collection[i] is CheckBox)
+                                    {
+                                        (collection[i] as CheckBox).Checked = dt.Rows[0][j].ToString() == "-1" ? true : false;
+                                    }
+                                    else
+                                    {
+                                        collection[i].Text = dt.Rows[0][j].ToString();
+                                    }
                                 }
                             }
                         }

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

@@ -11,37 +11,37 @@ namespace UAS_LabelMachine
     public class DataHelper
     {
 
-        //海创外网地址
-        private readonly string ConnectionStrings = "Data Source=cmityj.gicp.net/orcl;User ID=HC_TEST;PassWord=select!#%*(";
-        //海创ERP地址
-        public static readonly string ERPAddesss = "http://cmityj.gicp.net:8099/ERP/";
-        //海创FTP
-        public static readonly string FTPAddress = "ftp://cmityj.gicp.net|HCFTP|Admin1@#";
+        ////海创外网地址
+        //private readonly string ConnectionStrings = "Data Source=cmityj.gicp.net/orcl;User ID=HC_TEST;PassWord=select!#%*(";
+        ////海创ERP地址
+        //public static readonly string ERPAddesss = "http://cmityj.gicp.net:8099/ERP/";
+        ////海创FTP
+        //public static readonly string FTPAddress = "ftp://cmityj.gicp.net|HCFTP|Admin1@#";
 
-        public static readonly string InnerFTPAddress = "ftp://192.168.1.8|HCFTP|Admin1@#";
-        //Oracle端口
-        public static readonly string OraclePort = "1521";
-        //需要显示的账套
-        public static readonly string Masters = "HC_TEST";
-
-        ////凯而高地址
-        //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=KRG_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=112.25.154.186)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-        ////凯而高ERP地址
-        //public static readonly string ERPAddesss = "http://112.25.154.186:8099/ERP/";
-        ////凯而高FTP
-        //public static readonly string FTPAddress = "ftp://112.25.154.186:21|KEGFTP|Admin1@#";
-
-        //public static readonly string InnerFTPAddress = "ftp://112.25.154.186:21|HCFTP|Admin1@#";
+        //public static readonly string InnerFTPAddress = "ftp://192.168.1.8|HCFTP|Admin1@#";
         ////Oracle端口
         //public static readonly string OraclePort = "1521";
         ////需要显示的账套
-        //public static readonly string Masters = "GOLDEN";
+        //public static readonly string Masters = "HC_TEST";
+
+        //凯而高地址
+        private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=KRG_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=112.25.154.186)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        //凯而高ERP地址
+        public static readonly string ERPAddesss = "http://112.25.154.186:8099/ERP/";
+        //凯而高FTP
+        public static readonly string FTPAddress = "ftp://112.25.154.186:21|KEGFTP|Admin1@#";
+        public static readonly string InnerFTPAddress = "ftp://112.25.154.186:21|HCFTP|Admin1@#";
+        //Oracle端口
+        public static readonly string OraclePort = "1521";
+        //需要显示的账套
+        public static readonly string Masters = "GOLDEN";
 
         ////凯而高
         //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=KRG_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.12)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
         ////凯而高ERP地址
         //public static readonly string ERPAddesss = "http://192.168.100.11:8099/ERP/";
         ////凯而高FTP
+        //public static readonly string InnerFTPAddress = "ftp://192.168.100.11:21|KEGFTP|Admin1@#";
         //public static readonly string FTPAddress = "ftp://192.168.100.11:21|KEGFTP|Admin1@#";
         ////Oracle端口
         //public static readonly string OraclePort = "1521";
@@ -53,8 +53,8 @@ namespace UAS_LabelMachine
         ////高登ERP地址
         //public static readonly string ERPAddesss = "http://183.238.39.179:8099/ERP/";
         ////高登TP
-        //public static readonly string FTPAddress = "ftp://192.168.0.158:21|GOLDENMES|Admin1@#";
-        ////public static readonly string FTPAddress = "ftp://183.238.39.179:21|GOLDENMES|Admin1@#";
+        //public static readonly string InnerFTPAddress = "ftp://192.168.0.158:21|GOLDENMES|Admin1@#";
+        //public static readonly string FTPAddress = "ftp://183.238.39.179:21|GOLDENMES|Admin1@#";
         ////Oracle端口
         //public static readonly string OraclePort = "1521";
         ////需要显示的账套

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

@@ -208,6 +208,14 @@ namespace UAS_LabelMachine.PublicMethod
                         if (dr1.Length > 0)
                             SingleFormat.SubStrings[j].Value = dr1[0]["lp_sql"].ToString();
                     }
+                }
+                try
+                {
+                    SingleFormat.PrintSetup.IdenticalCopiesOfLabel = 1;
+                }
+                catch (Exception)
+                {
+
                 }
                 SingleFormat.Print();
             }
@@ -259,6 +267,14 @@ namespace UAS_LabelMachine.PublicMethod
                         if (dr1.Length > 0)
                             MidFormat.SubStrings[j].Value = dr1[0]["lp_sql"].ToString();
                     }
+                }
+                try
+                {
+                    MidFormat.PrintSetup.IdenticalCopiesOfLabel = 1;
+                }
+                catch (Exception)
+                {
+
                 }
                 MidFormat.Print();
             }
@@ -316,6 +332,14 @@ namespace UAS_LabelMachine.PublicMethod
                             if (dr1.Length > 0)
                                 OutFormat.SubStrings[j].Value = dr1[0]["lp_sql"].ToString();
                         }
+                    }
+                    try
+                    {
+                        OutFormat.PrintSetup.IdenticalCopiesOfLabel = 1;
+                    }
+                    catch (Exception)
+                    {
+
                     }
                     OutFormat.Print();
                 }

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

@@ -221,6 +221,12 @@
     <Compile Include="CustomControl\SearchTextBox.Designer.cs">
       <DependentUpon>SearchTextBox.cs</DependentUpon>
     </Compile>
+    <Compile Include="CustomerRule.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="CustomerRule.Designer.cs">
+      <DependentUpon>CustomerRule.cs</DependentUpon>
+    </Compile>
     <Compile Include="DateCodeSetAndPrint.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -340,6 +346,9 @@
     <EmbeddedResource Include="CustomControl\SearchTextBox.resx">
       <DependentUpon>SearchTextBox.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="CustomerRule.resx">
+      <DependentUpon>CustomerRule.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="DateCodeSetAndPrint.resx">
       <DependentUpon>DateCodeSetAndPrint.cs</DependentUpon>
     </EmbeddedResource>

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

@@ -191,6 +191,7 @@
             this.OutBoxLabelPrint = new System.Windows.Forms.Button();
             this.OutBoxLabelAutoPrint = new System.Windows.Forms.CheckBox();
             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.MidSource)).BeginInit();
             this.Menu.SuspendLayout();
@@ -767,10 +768,11 @@
             this.toolStripMenuItem4,
             this.toolStripMenuItem5,
             this.toolStripMenuItem6,
-            this.下载模板ToolStripMenuItem});
+            this.下载模板ToolStripMenuItem,
+            this.客户合并规则ToolStripMenuItem});
             this.Menu.Name = "Menu";
             this.Menu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
-            this.Menu.Size = new System.Drawing.Size(149, 158);
+            this.Menu.Size = new System.Drawing.Size(149, 180);
             this.Menu.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.Menu_ItemClicked);
             // 
             // toolStripMenuItem1
@@ -1874,6 +1876,12 @@
             this.OutBoxCombox.TabIndex = 78;
             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_出货标签打印
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -2084,6 +2092,13 @@
         private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5;
         private System.Windows.Forms.OpenFileDialog ImportExcel;
         private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem6;
+        private System.Windows.Forms.Label pi_class;
+        private System.Windows.Forms.ToolStripMenuItem 下载模板ToolStripMenuItem;
+        private System.Windows.Forms.CheckBox cu_print_outprod;
+        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder2;
+        private System.Windows.Forms.CheckBox cu_print_outdc;
+        private System.Windows.Forms.CheckBox cu_print_outlotno;
+        private System.Windows.Forms.CheckBox cu_print_outpo;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
         private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifpick;
         private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifprint;
@@ -2107,12 +2122,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
-        private System.Windows.Forms.Label pi_class;
-        private System.Windows.Forms.ToolStripMenuItem 下载模板ToolStripMenuItem;
-        private System.Windows.Forms.CheckBox cu_print_outprod;
-        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder2;
-        private System.Windows.Forms.CheckBox cu_print_outdc;
-        private System.Windows.Forms.CheckBox cu_print_outlotno;
-        private System.Windows.Forms.CheckBox cu_print_outpo;
+        private System.Windows.Forms.ToolStripMenuItem 客户合并规则ToolStripMenuItem;
     }
 }

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

@@ -1569,7 +1569,7 @@ namespace UAS_LabelMachine
             AllCollect = false;
             //查询Oracle数据库
             sql.Clear();
-            sql.Append("select t.*,rownum from prodiobarcode_view t where pib_inoutno='" + pi_inoutno.Text + "'");
+            sql.Append("select t.*,rownum from prodiobarcode_view t where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_id)");
             LabelInfDataTable = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             //查询本地数据库
             sql.Clear();
@@ -1590,7 +1590,7 @@ namespace UAS_LabelMachine
                 //sdh.BatchInsert("prodiobarcode", LabelInfDataTable);
             }
             sql.Clear();
-            sql.Append("select * from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by rownum ");
+            sql.Append("select * from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by pib_id ");
             LabelInfDataTable = (DataTable)sdh.ExecuteSql(sql.ToString(), "select");
             bindingsource(LabelInf, LabelInfDataTable);
             //有数据的话默认取第一条的品牌去取采集策略
@@ -2261,6 +2261,11 @@ namespace UAS_LabelMachine
                         System.Diagnostics.Process.Start(ExportFileDialog.SelectedPath + "\\导入模板.xls");
                     }
                     break;
+                case "客户合并规则":
+                    CustomerRule cust = new CustomerRule();
+                    BaseUtil.SetFormCenter(cust);
+                    cust.ShowDialog();
+                    break;
                 default:
                     break;
             }

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

@@ -52,7 +52,7 @@
             this.pd_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_detail = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_ordercode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_orispeccode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_totalqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -194,7 +194,7 @@
             this.pd_prodcode,
             this.pr_detail,
             this.pd_ordercode,
-            this.pr_spec,
+            this.pr_orispeccode,
             this.pr_brand,
             this.pr_unit,
             this.pd_totalqty,
@@ -311,14 +311,14 @@
             this.pd_ordercode.Name = "pd_ordercode";
             this.pd_ordercode.Width = 78;
             // 
-            // pr_spec
+            // pr_orispeccode
             // 
-            this.pr_spec.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
-            this.pr_spec.DataPropertyName = "pr_spec";
-            this.pr_spec.HeaderText = "规格描述";
-            this.pr_spec.Name = "pr_spec";
-            this.pr_spec.ReadOnly = true;
-            this.pr_spec.Width = 78;
+            this.pr_orispeccode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.pr_orispeccode.DataPropertyName = "pr_orispeccode";
+            this.pr_orispeccode.HeaderText = "型号";
+            this.pr_orispeccode.Name = "pr_orispeccode";
+            this.pr_orispeccode.ReadOnly = true;
+            this.pr_orispeccode.Width = 54;
             // 
             // pr_brand
             // 
@@ -448,7 +448,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_prodcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_ordercode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_orispeccode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_brand;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_unit;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_totalqty;

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

@@ -493,19 +493,38 @@ namespace UAS_LabelMachine
             CustCode = dh.getFieldDataByCondition("ProdInOut", "pi_cardcode", "pi_inoutno='" + pi_inoutno.Text + "'").ToString();
             //用于存放每一项的明细的数据
             dt = (DataTable)dh.ExecuteSql("select pi_class,pi_id from prodinout where pi_inoutno='" + pi_inoutno.Text + "'", "select");
+            DataTable custrule = (DataTable)dh.ExecuteSql("select CU_PRINT_MIDSPEC,CU_PRINT_MIDPO from customer where cu_code='" + CustCode + "'", "select");
             if (dt.Rows.Count > 0)
             {
                 pi_id = dt.Rows[0]["pi_id"].ToString();
                 BaseUtil.SetFormValue(this.Controls, dt);
+                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();
+                    if (CU_PRINT_MIDSPEC == "-1" && CU_PRINT_MIDPO == "-1")
+                    {
+                        condition = ",pd_vespec_user,pd_pocode";
+                    }
+                    if (CU_PRINT_MIDSPEC != "-1" && CU_PRINT_MIDPO == "-1")
+                    {
+                        condition = ",pd_pocode";
+                    }
+                    if (CU_PRINT_MIDSPEC == "-1" && CU_PRINT_MIDPO != "-1")
+                    {
+                        condition = ",pd_vespec_user";
+                    }
+                }
                 switch (pi_class.Text)
                 {
                     case "出货单":
                         sql.Clear();
-                        sql.Append("select pd_piid,pd_id,pr_id,pr_brand,pr_madein,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty pd_totalqty,pd_ordercode,pd_orderdetno,pd_pdno,pd_prodcode,");
-                        sql.Append("pd_piclass,pd_qty from (select pd_piid,pd_id,pr_id,pr_brand,pr_madein,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty,pd_ordercode,pd_orderdetno,pd_pdno,");
+                        sql.Append("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,");
+                        sql.Append("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.Append("pd_prodcode,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.Append("from (select pd_piid,min(pd_id) pd_id,sum(pd_outqty)outqty,pd_ordercode,pd_orderdetno,pd_pdno,max(pd_prodcode)pd_prodcode,max(pd_piclass)pd_piclass ");
-                        sql.Append("from prodiodetail  group by pd_piid,pd_ordercode, pd_orderdetno,pd_pdno)T left join product ");
+                        sql.Append("from (select pd_piid,min(pd_id)pd_id,max(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_prodcode)pd_prodcode,max(pd_piclass)pd_piclass ");
+                        sql.Append("from prodiodetail group by pd_piid" + condition + ")T left join product ");
                         sql.Append("on pr_code=pd_prodcode)  where  pd_piid='" + pi_id + "' order by pd_pdno");
                         break;
                     case "完工入库单":

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

@@ -178,7 +178,7 @@
   <metadata name="pd_ordercode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pr_spec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="pr_orispeccode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <metadata name="pr_brand.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">