章政 7 年之前
父节点
当前提交
09ecc8d4e0

+ 1 - 1
UAS-MES/App.config

@@ -44,7 +44,7 @@
   <applicationSettings>
     <UAS_MES.Properties.Settings>
       <setting name="MES" serializeAs="String">
-        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230.200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
+        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
       </setting>
     </UAS_MES.Properties.Settings>
   </applicationSettings>

+ 1 - 1
UAS-MES/Login.cs

@@ -106,7 +106,7 @@ namespace UAS_MES
             //设置选中数据库的链接
             string DBUser = DB.SelectedValue.ToString().Split('#')[0];
             string Address = DB.SelectedValue.ToString().Split('#')[1];
-            DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" + Address + ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.CurrentDB = DBUser;
             //设置屏幕的宽高信息
             SystemInf.ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;

+ 12 - 12
UAS-MES/Properties/Settings.Designer.cs

@@ -107,9 +107,20 @@ namespace UAS_MES.Properties {
             }
         }
         
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false" +
+            ";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180." +
+            "218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
+        public string MES {
+            get {
+                return ((string)(this["MES"]));
+            }
+        }
+        
         [global::System.Configuration.UserScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("\\\\172.16.66.51\\lable")]
+        [global::System.Configuration.DefaultSettingValueAttribute("\\\\172.16.11.99\\ShareTest")]
         public string FTPAddress {
             get {
                 return ((string)(this["FTPAddress"]));
@@ -118,16 +129,5 @@ namespace UAS_MES.Properties {
                 this["FTPAddress"] = value;
             }
         }
-        
-        [global::System.Configuration.ApplicationScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false" +
-            ";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230" +
-            ".200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
-        public string MES {
-            get {
-                return ((string)(this["MES"]));
-            }
-        }
     }
 }

+ 4 - 4
UAS-MES/Properties/Settings.settings

@@ -23,11 +23,11 @@
     <Setting Name="BaudRate" Type="System.String" Scope="User">
       <Value Profile="(Default)" />
     </Setting>
-    <Setting Name="FTPAddress" Type="System.String" Scope="User">
-      <Value Profile="(Default)">\\172.16.66.51\lable</Value>
-    </Setting>
     <Setting Name="MES" Type="System.String" Scope="Application">
-      <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230.200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
+      <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
+    </Setting>
+    <Setting Name="FTPAddress" Type="System.String" Scope="User">
+      <Value Profile="(Default)">\\172.16.11.99\ShareTest</Value>
     </Setting>
   </Settings>
 </SettingsFile>

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

@@ -11,16 +11,16 @@ namespace UAS_LabelMachine
     public class DataHelper
     {
 
-        ////富为外网地址
-        //private readonly string ConnectionStrings = "Data Source=richwellgroup.com.cn/orcl;User ID=DATACENTER;PassWord=select!#%*(";
-        ////富为ERP地址
-        //public static readonly string ERPAddesss = "http://richwellgroup.com.cn:8099/ERP/";
-        ////富为FTP
-        //public static readonly string FTPAdress = "ftp://richwellgroup.com.cn|printuser|printuser";
-        ////Oracle端口
-        //public static readonly string OraclePort = "1521";
-        ////需要显示的账套
-        //public static readonly string Masters = "JDTSY,FW_JDT,N_DATACENTER,FY_TEST,JD_TEST,XY_TEST,FW_TEST,DATACENTER,FW,XY,FY";
+        //富为外网地址
+        private readonly string ConnectionStrings = "Data Source=richwellgroup.com.cn/orcl;User ID=DATACENTER;PassWord=select!#%*(";
+        //富为ERP地址
+        public static readonly string ERPAddesss = "http://richwellgroup.com.cn:8099/ERP/";
+        //富为FTP
+        public static readonly string FTPAdress = "ftp://richwellgroup.com.cn|printuser|printuser";
+        //Oracle端口
+        public static readonly string OraclePort = "1521";
+        //需要显示的账套
+        public static readonly string Masters = "JDTSY,FW_JDT,N_DATACENTER,FY_TEST,JD_TEST,XY_TEST,FW_TEST,DATACENTER,FW,XY,FY";
 
         ////怡海能达外网地址
         //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=sz.hi-mantech.com)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
@@ -44,16 +44,16 @@ namespace UAS_LabelMachine
         ////需要显示的账套
         //public static readonly string Masters = "XSQ,N_YITOA_YWC,ZXN,N_YITOA_LHCT,N_YITOA_CT,N_CHL,N_YITOA_HK,N_HUASL_SHTL,N_WILICHK,N_WILIC,N_E_SHINE_SH,N_SHBJ,N_BJKG,N_HUASL,N_HUASL_QD,N_HUASL_XM,N_HUASL_SZ";
 
-        //泽天外网地址
-        private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=ZT_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=183.47.41.2)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-        //泽天ERP地址
-        public static readonly string ERPAddesss = "http://183.47.41.2:8099/ERP/";
-        //泽天FTP
-        public static readonly string FTPAdress = "ftp://183.47.41.3:21|uas|Zt2018";
-        //Oracle端口
-        public static readonly string OraclePort = "1521";
-        //需要显示的账套
-        public static readonly string Masters = "ZT_TEST";
+        ////泽天外网地址
+        //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=ZT_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=183.47.41.2)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        ////泽天ERP地址
+        //public static readonly string ERPAddesss = "http://183.47.41.2:8099/ERP/";
+        ////泽天FTP
+        //public static readonly string FTPAdress = "ftp://183.47.41.3:21|uas|Zt2018";
+        ////Oracle端口
+        //public static readonly string OraclePort = "1521";
+        ////需要显示的账套
+        //public static readonly string Masters = "ZT_TEST";
         //用户选择的数据库的连接字符串
         public static string DBConnectionString;
         static OracleConnection connection = null;

+ 1 - 0
UAS-出货标签管理/UAS_出货标签管理.Designer.cs

@@ -771,6 +771,7 @@
             this.AttachInfo.TabIndex = 85;
             this.AttachInfo.Text = "附加信息设置";
             this.AttachInfo.UseVisualStyleBackColor = true;
+            this.AttachInfo.Visible = false;
             this.AttachInfo.Click += new System.EventHandler(this.AttachInfo_Click);
             // 
             // pi_date

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

@@ -553,9 +553,16 @@ namespace UAS_LabelMachine
                 //查询出入库的类型
                 dt = (DataTable)dh.ExecuteSql("select ds_inorout from documentsetup where ds_name='" + pi_class.Text + "'", "select");
                 sql.Clear();
-                sql.Append("select * from prodiobarcode_view where  pd_piid='" + pi_id + "'");
+                sql.Append("select pd_piid,pd_id,pr_id,pr_brand,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty pd_totalqty,pd_ordercode,pd_orderdetno,pd_pdno,pd_prodcode,pd_piclass,pd_qty from (select ");
+                sql.Append("pd_piid,pd_id,pr_id,pr_brand,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty,pd_ordercode,pd_orderdetno,pd_pdno,pd_prodcode,pd_piclass,");
+                sql.Append("outqty-nvl((select sum(nvl(pib_qty,0)) from PRODIOBARCODE where PIB_PIID=pd_piid and pib_ordercode=pd_ordercode ");
+                sql.Append("and pib_orderdetno=pd_orderdetno),0)pd_qty from (select pd_piid,min(pd_id) pd_id,sum(pd_outqty)outqty,");
+                sql.Append("pd_ordercode,pd_orderdetno,pd_pdno,max(pd_prodcode)pd_prodcode,max(pd_piclass)pd_piclass ");
+                sql.Append("from prodiodetail where pd_piclass='出货单' group by pd_piid,pd_ordercode,pd_orderdetno,pd_pdno)T left join product on pr_code=pd_prodcode ");
+                sql.Append("where nvl(pr_zxbzs,0)>0)  where  pd_piid='" + pi_id + "'");
                 dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                 BaseUtil.FillDgvWithDataTable(ProdIoInfDGV, dt);
+                BaseUtil.FillDgvWithDataTable(ProdIoInfDGV, dt);
             }
             else
             {

+ 1 - 1
UAS_AutoPass/UAS_AutoPass.csproj

@@ -67,7 +67,7 @@
     <GenerateManifests>true</GenerateManifests>
   </PropertyGroup>
   <PropertyGroup>
-    <SignManifests>true</SignManifests>
+    <SignManifests>false</SignManifests>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="BenQGuru.eMES.DLLService">

+ 8 - 31
UAS_DeviceMonitor/DataOperate/DataHelper.cs

@@ -3,6 +3,7 @@ using System;
 using System.Collections.Generic;
 using System.Data;
 using System.Text;
+using UAS_DeviceMonitor.PublicMethod;
 
 namespace UAS_DeviceMonitor.DataOperate
 {
@@ -11,7 +12,7 @@ namespace UAS_DeviceMonitor.DataOperate
         //系统默认的的连接字符串
         private string ConnectionStrings = Properties.Settings.Default.Properties["MES"].DefaultValue.ToString();
         //用户选择的数据库的连接字符串
-        public static string DBConnectionString;
+        public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=UAS_MES_PROD;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.253.6)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
         public static OracleConnection connection = null;
         OracleCommand command = null;
         /// <summary>
@@ -38,7 +39,6 @@ namespace UAS_DeviceMonitor.DataOperate
         {
             DataTable dt = new DataTable();
             command = new OracleCommand("select Column_Name,Data_Type from cols where TABLE_name=upper('" + TableName + "')", connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
@@ -53,16 +53,17 @@ namespace UAS_DeviceMonitor.DataOperate
         {
             DataTable dt = new DataTable();
             string sql = "select " + Field + " from " + TableName + " where " + Condition;
+            Console.WriteLine(sql);
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter();
             ad.SelectCommand = command;
             try
             {
                 ad.Fill(dt);
             }
-            catch (Exception)
+            catch (Exception e) 
             {
+                LogManager.DoLog(e.StackTrace + e.Message);
                 connection = new OracleConnection(DBConnectionString);
                 connection.Open();
                 command = new OracleCommand(sql, connection);
@@ -126,7 +127,6 @@ namespace UAS_DeviceMonitor.DataOperate
             DataTable dt = new DataTable();
             string sql = "select count(1) from " + TableName + " where " + Condition;
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
@@ -144,7 +144,6 @@ namespace UAS_DeviceMonitor.DataOperate
             DataTable dt = new DataTable();
             string sql = "select count(1) from " + TableName;
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
 
             ad.Fill(dt);
@@ -163,7 +162,6 @@ namespace UAS_DeviceMonitor.DataOperate
             sql += AddField(Fields);
             sql += " from " + TableName + " where " + Condition + " and rownum=1";
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             try
             {
@@ -228,7 +226,6 @@ namespace UAS_DeviceMonitor.DataOperate
                     sql.Append(" from " + TableName + ") A where ROWNUM <= " + CurrentPage * PageSize + ") where RN> " + (CurrentPage - 1) * PageSize);
             }
             command = new OracleCommand(sql.ToString(), connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
@@ -253,7 +250,6 @@ namespace UAS_DeviceMonitor.DataOperate
             sql += " from " + TableName + " where " + Condition;
 
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             try
             {
@@ -283,7 +279,6 @@ namespace UAS_DeviceMonitor.DataOperate
             sql += Fields;
             sql += " from " + TableName;
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.SelectCommand = command;
             try
@@ -475,7 +470,6 @@ namespace UAS_DeviceMonitor.DataOperate
         {
             string sql = "select count(1) from " + TableName + " where " + Condition;
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             DataTable dt = new DataTable();
             try
@@ -506,7 +500,6 @@ namespace UAS_DeviceMonitor.DataOperate
         {
             object result = null;
             command = new OracleCommand(SQL, connection);
-            Reconnect(command);
             //用来拼接参数的
             if (names.Length > 0)
             {
@@ -543,8 +536,9 @@ namespace UAS_DeviceMonitor.DataOperate
                     {
                         ad.Fill((DataTable)result);
                     }
-                    catch (Exception)
+                    catch (Exception e)
                     {
+                        LogManager.DoLog(e.StackTrace + e.Message);
                         connection = new OracleConnection(DBConnectionString);
                         connection.Open();
                         command = new OracleCommand(SQL, connection);
@@ -611,7 +605,6 @@ namespace UAS_DeviceMonitor.DataOperate
             DataTable dt = new DataTable();
             string sql = "select distinct count('" + Field + "') from " + TableName;
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             try
             {
@@ -649,12 +642,10 @@ namespace UAS_DeviceMonitor.DataOperate
         /// <param name="TableName">表名</param>
         /// <param name="ID">主键</param>
         /// <param name="DeleteID">需要删除主键ID的数组</param>
-        public void DeleteDataByID(string TableName, string ID, string[] DeleteID)
+        public void DeleteDataByID(string TableName, string ID, int[] DeleteID)
         {
             string sql = "delete from " + TableName + " where " + ID + " =:DeleteID";
-
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             command.ArrayBindCount = DeleteID.Length;
             command.Parameters.Add(new OracleParameter("DeleteID", OracleDbType.Long, DeleteID, ParameterDirection.Input));
             try
@@ -806,7 +797,6 @@ namespace UAS_DeviceMonitor.DataOperate
         public void BatchInsert(string sql, params object[][] names)
         {
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             command.ArrayBindCount = names[1].Length;
             if (names[1].Length == 0)
             {
@@ -834,7 +824,6 @@ namespace UAS_DeviceMonitor.DataOperate
         public void BatchInsertDataTable(string sql, string[] param, params object[][] param1)
         {
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             command.ArrayBindCount = param1[0].Length;
             //因为第一个数组保存的是参数的名称,所以循环从1而不是0开始
             //将第一个数组的下标固定为0作为循环添加的参数的名称
@@ -921,8 +910,6 @@ namespace UAS_DeviceMonitor.DataOperate
         {
             string sql = "update " + TableName + " set " + update + " where " + condition;
             command = new OracleCommand(sql, connection);
-
-            Reconnect(command);
             try
             {
                 command.ExecuteNonQuery();
@@ -946,7 +933,6 @@ namespace UAS_DeviceMonitor.DataOperate
         {
             command = new OracleCommand(ProcedureName);
             command.Connection = connection;
-            Reconnect(command);
             command.CommandText = ProcedureName;
             command.CommandType = CommandType.StoredProcedure;
             for (int i = 0; i < param.Length; i++)
@@ -1054,7 +1040,6 @@ namespace UAS_DeviceMonitor.DataOperate
         {
             DataTable dt = new DataTable();
             command = new OracleCommand(sql, connection);
-            Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter();
             ad.SelectCommand = command;
             try
@@ -1118,13 +1103,5 @@ namespace UAS_DeviceMonitor.DataOperate
         {
 
         }
-
-        private void Reconnect(OracleCommand cmd)
-        {
-            if (cmd.Connection.State == ConnectionState.Closed)
-            {
-                cmd.Connection.Open();
-            }
-        }
     }
 }

+ 3 - 3
UAS_DeviceMonitor/Main.cs

@@ -141,7 +141,7 @@ namespace UAS_DeviceMonitor
         }
         #endregion
 
-        #region PageCommandSet业务代码
+        #region PageCommandSet业务代码(指令设置)
         /// <summary>
         /// 新增指令弹窗
         /// </summary>
@@ -187,7 +187,7 @@ namespace UAS_DeviceMonitor
 
         #endregion
 
-        #region PagePolling业务代码
+        #region PagePolling业务代码(轮询业务定义)
         private void GridPolling_VisibleChanged(object sender, EventArgs e)
         {
             DataTable dt = (DataTable)SystemInf.dh.ExecuteSql("select dc_name,dc_code from devicecommand ", "select");
@@ -197,7 +197,7 @@ namespace UAS_DeviceMonitor
         }
         #endregion
 
-        #region PagePollingSetting业务代码
+        #region PagePollingSetting业务代码(轮询配置)
 
         PollingTask pt = new PollingTask();
         /// <summary>

+ 8 - 0
UAS_DeviceMonitor/Properties/licenses.licx

@@ -0,0 +1,8 @@
+DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.Repository.RepositoryItemComboBox, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.Repository.RepositoryItemSearchLookUpEdit, DevExpress.XtraGrid.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

+ 2 - 0
UAS_MES_NEW/Properties/licenses.licx

@@ -0,0 +1,2 @@
+DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.Repository.RepositoryItemTextEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

+ 131 - 0
UAS_MES_NEW/PublicMethod/GetDataFromDevice.cs

@@ -0,0 +1,131 @@
+using System;
+using System.Net;
+using System.Net.Sockets;
+using System.Threading;
+using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+
+namespace UAS_MES_NEW.PublicMethod
+{
+    class GetDataFromDevice
+    {
+
+        DataHelper dh = SystemInf.dh;
+
+        public GetDataFromDevice()
+        {
+
+        }
+
+        private bool isOpen = false;
+
+        Thread threadWatch = null; //负责监听客户端的线程
+        Socket socketWatch = null; //负责监听客户端的套接字
+        Socket socConnection;
+
+        public bool IsOpen
+        {
+            get
+            {
+                return isOpen;
+            }
+
+            set
+            {
+                isOpen = value;
+            }
+        }
+
+        public string IP
+        {
+            get
+            {
+                return iP;
+            }
+
+            set
+            {
+                iP = value;
+            }
+        }
+
+        public string Port
+        {
+            get
+            {
+                return port;
+            }
+
+            set
+            {
+                port = value;
+            }
+        }
+
+        private string iP;
+
+        private string port;
+
+        public bool Open()
+        {
+            try
+            {
+                //定义一个套接字用于监听客户端发来的信息  包含3个参数(IP4寻址协议,流式连接,TCP协议)
+                socketWatch = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+                //服务端发送信息 需要1个IP地址和端口号
+                IPAddress ipaddress = IPAddress.Parse(iP);
+                //将IP地址和端口号绑定到网络节点endpoint上 
+                IPEndPoint endpoint = new IPEndPoint(ipaddress, int.Parse(port));
+                //监听绑定的网络节点
+                socketWatch.Bind(endpoint);
+                //将套接字的监听队列长度限制为20
+                socketWatch.Listen(20);
+                //创建一个监听线程 
+                threadWatch = new Thread(WatchConnecting);
+                //将窗体线程设置为与后台同步
+                threadWatch.IsBackground = true;
+                //启动线程
+                threadWatch.Start();
+                isOpen = true;
+                return true;
+            }
+            catch (Exception e)
+            {
+                MessageBox.Show(e.Message);
+                return false;
+            }
+        }
+
+        private void WatchConnecting()
+        {
+            socConnection = socketWatch.Accept();
+            while (true)  //持续不断监听客户端发来的请求
+            {
+                byte[] data = new byte[1024];
+                socConnection.Receive(data);
+                //获取发送客户端的IP地址
+                string clientIP = socConnection.RemoteEndPoint.ToString();
+                int length = data[5];
+                byte[] datashow = new byte[length + 6];
+                for (int i = 0; i <= length + 5; i++)
+                {
+                    datashow[i] = data[i];
+                }
+                string stringdata = BitConverter.ToString(datashow);//把数组转换成16进制字符串
+            }
+        }
+
+        public void Close()
+        {
+            threadWatch.Abort();
+            socketWatch.Close();
+            isOpen = false;
+        }
+
+        public void SendOrder(string Code)
+        {
+            //socConnection.Send(null);
+        }
+    }
+}

+ 57 - 1
UAS_WinForm.sln

@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 14
-VisualStudioVersion = 14.0.23107.0
+VisualStudioVersion = 14.0.25420.1
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS-MES", "UAS-MES\UAS-MES.csproj", "{411DEE44-B893-47E0-A0C2-797A3DAE2466}"
 EndProject
@@ -21,6 +21,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS_MesDllService(3.5)", "U
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS_AutoUpdate", "UAS_AutoUpdate\UAS_AutoUpdate.csproj", "{C360004D-8D2C-4633-B8B8-3DD1C2D4AAB6}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS_DeviceMonitor", "UAS_DeviceMonitor\UAS_DeviceMonitor.csproj", "{F65E07C6-E843-45F2-872F-6C7F6428332E}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProject", "TestProject\TestProject.csproj", "{92488A73-91D7-4797-9794-67C4D9D86D09}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS_Web", "UAS_Web\UAS_Web.csproj", "{7293045C-D6EE-4454-B822-E296AD9E758B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS-出货标签管理(泽天)", "UAS-出货标签管理(泽天)\UAS-出货标签管理(泽天).csproj", "{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -139,6 +147,54 @@ Global
 		{C360004D-8D2C-4633-B8B8-3DD1C2D4AAB6}.Release|x64.Build.0 = Release|Any CPU
 		{C360004D-8D2C-4633-B8B8-3DD1C2D4AAB6}.Release|x86.ActiveCfg = Release|Any CPU
 		{C360004D-8D2C-4633-B8B8-3DD1C2D4AAB6}.Release|x86.Build.0 = Release|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Debug|x64.Build.0 = Debug|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Debug|x86.Build.0 = Debug|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Release|x64.ActiveCfg = Release|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Release|x64.Build.0 = Release|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Release|x86.ActiveCfg = Release|Any CPU
+		{F65E07C6-E843-45F2-872F-6C7F6428332E}.Release|x86.Build.0 = Release|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Debug|x64.Build.0 = Debug|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Debug|x86.Build.0 = Debug|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Release|Any CPU.Build.0 = Release|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Release|x64.ActiveCfg = Release|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Release|x64.Build.0 = Release|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Release|x86.ActiveCfg = Release|Any CPU
+		{92488A73-91D7-4797-9794-67C4D9D86D09}.Release|x86.Build.0 = Release|Any CPU
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Debug|x64.ActiveCfg = Debug|x64
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Debug|x64.Build.0 = Debug|x64
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Debug|x86.ActiveCfg = Debug|x86
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Debug|x86.Build.0 = Debug|x86
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Release|x64.ActiveCfg = Release|x64
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Release|x64.Build.0 = Release|x64
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Release|x86.ActiveCfg = Release|x86
+		{7293045C-D6EE-4454-B822-E296AD9E758B}.Release|x86.Build.0 = Release|x86
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Debug|x64.Build.0 = Debug|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Debug|x86.Build.0 = Debug|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Release|Any CPU.Build.0 = Release|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Release|x64.ActiveCfg = Release|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Release|x64.Build.0 = Release|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Release|x86.ActiveCfg = Release|Any CPU
+		{8F565F5E-3C9C-4CDD-8DDB-96B1247D1B47}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE