Browse Source

修改上料接口内容

callm 1 month ago
parent
commit
f63786ee69

+ 1 - 1
UAS_MES_HYSX/CustomControl/HeadBar/HeadBar.cs

@@ -122,7 +122,7 @@ namespace UAS_MES_NEW.CustomControl
                 if (logout_confirm == "Yes")
                 if (logout_confirm == "Yes")
                 {
                 {
                     //注销的时候切换回默认数据库
                     //注销的时候切换回默认数据库
-                    SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.20)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+                    SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.5)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
                     DataHelper.DBConnectionString = SystemInf.ConnectionString;
                     DataHelper.DBConnectionString = SystemInf.ConnectionString;
                     //清除上个用户的权限信息
                     //清除上个用户的权限信息
                     SystemInf.Caller.Clear();
                     SystemInf.Caller.Clear();

+ 3 - 3
UAS_MES_HYSX/DataOperate/DataHelper.cs

@@ -10,11 +10,11 @@ namespace UAS_MES_NEW.DataOperate
     class DataHelper
     class DataHelper
     {
     {
         //系统默认的的连接字符串 
         //系统默认的的连接字符串 
-        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.20)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.5)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
 
 
-        //public static readonly string ERPAddesss = "http://192.168.1.20:8099/mes/";
+        //public static readonly string ERPAddesss = "http://192.168.1.5:8099/mes/";
 
 
-        public static readonly string ERPAddesss = "http://192.168.1.20:8099/mes/";
+        public static readonly string ERPAddesss = "http://192.168.1.5:8099/mes/";
 
 
         //用户选择的数据库的连接字符串
         //用户选择的数据库的连接字符串
         public static string DBConnectionString;
         public static string DBConnectionString;

+ 1 - 1
UAS_MES_HYSX/FunctionCode/Make/Make_CustomLabelPrint.cs

@@ -167,7 +167,7 @@ namespace UAS_MES_NEW.Make
                                             string fp_path = label.Rows[0]["FP_PATH"].ToString().Replace("/app/uas/webapps/", "");
                                             string fp_path = label.Rows[0]["FP_PATH"].ToString().Replace("/app/uas/webapps/", "");
                                             fp_name = label.Rows[0]["fp_name"].ToString();
                                             fp_name = label.Rows[0]["fp_name"].ToString();
                                             WebClient wc = new WebClient();
                                             WebClient wc = new WebClient();
-                                            wc.DownloadFile("http://192.168.1.20:8099/" + fp_path, @"C:\打印标签\" + fp_name);
+                                            wc.DownloadFile("http://192.168.1.5:8099/" + fp_path, @"C:\打印标签\" + fp_name);
                                         }
                                         }
                                     }
                                     }
                                 }
                                 }

+ 5 - 3
UAS_MES_HYSX/FunctionCode/Packing/Packing_PackageCollectionZX.cs

@@ -346,8 +346,9 @@ namespace UAS_MES_NEW.Packing
                                 if (AutoGenBoxCode.Checked && (pa_status.Text == "1" || pa_status.Text == "" || pa_status.Text == "0"))
                                 if (AutoGenBoxCode.Checked && (pa_status.Text == "1" || pa_status.Text == "" || pa_status.Text == "0"))
                                 {
                                 {
                                     pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
                                     pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", ms_makecode, pr_code.Text, User.UserCode);
-                                    if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'")) {
-                                        OperateResult.AppendText(">>箱号"+ pa_outboxcode.Text + "已生成,不允许重复使用\n", Color.Red, sn_code);
+                                    if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                                    {
+                                        OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已生成,不允许重复使用\n", Color.Red, sn_code);
                                         pa_outboxcode.Text = "";
                                         pa_outboxcode.Text = "";
                                         return;
                                         return;
                                     }
                                     }
@@ -493,6 +494,7 @@ namespace UAS_MES_NEW.Packing
                                     {
                                     {
                                         dh.UpdateByCondition("package", "pa_status=1,pa_packageqty=pa_currentqty,pa_totalqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                                         dh.UpdateByCondition("package", "pa_status=1,pa_packageqty=pa_currentqty,pa_totalqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                                         OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "满箱采集完成,封箱成功\n", Color.Green);
                                         OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "满箱采集完成,封箱成功\n", Color.Green);
+                                        HttpServer.GetOutBoxInfo(pa_outboxcode.Text);
                                         pa_status.Text = "1";
                                         pa_status.Text = "1";
                                         pa_standardqty.Text = "";
                                         pa_standardqty.Text = "";
                                         if (AutoPrint.Checked)
                                         if (AutoPrint.Checked)
@@ -898,7 +900,7 @@ namespace UAS_MES_NEW.Packing
                                     dh.ExecuteSql("update package set pa_checkno='',pa_prodcode='',pa_packtype='',pa_salecode='',pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                                     dh.ExecuteSql("update package set pa_checkno='',pa_prodcode='',pa_packtype='',pa_salecode='',pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                                 pa_status.Text = "0";
                                 pa_status.Text = "0";
                                 //删除箱的明细
                                 //删除箱的明细
-                                dh.ExecuteSql("delete from labelprintlog where lpl_value='"+pa_outboxcode.Text+"'","delete");
+                                dh.ExecuteSql("delete from labelprintlog where lpl_value='" + pa_outboxcode.Text + "'", "delete");
                                 dh.ExecuteSql("delete from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "'", "delete");
                                 dh.ExecuteSql("delete from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "'", "delete");
                                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱拆解", "成功", pa_outboxcode.Text, ob_checkno.Text);
                                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱拆解", "成功", pa_outboxcode.Text, ob_checkno.Text);
                                 OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "成功拆解!\n", Color.Green);
                                 OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "成功拆解!\n", Color.Green);

+ 1 - 0
UAS_MES_HYSX/FunctionCode/Packing/Packing_PalletCollectionZX.cs

@@ -325,6 +325,7 @@ namespace UAS_MES_NEW.Packing
                                     if (pa_standardqty.Text == pa_totalqty.Text)
                                     if (pa_standardqty.Text == pa_totalqty.Text)
                                     {
                                     {
                                         dh.ExecuteSql("update package set pa_status=1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                                         dh.ExecuteSql("update package set pa_status=1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
+                                        HttpServer.GetPalletInfo(pa_outboxcode.Text);
                                         OperateResult.AppendText("栈板" + pa_outboxcode.Text + "已装满,封栈板成功\n");
                                         OperateResult.AppendText("栈板" + pa_outboxcode.Text + "已装满,封栈板成功\n");
                                         if (!AutoOutBoxCode.Checked)
                                         if (!AutoOutBoxCode.Checked)
                                         {
                                         {

+ 2 - 2
UAS_MES_HYSX/Login.cs

@@ -47,7 +47,7 @@ namespace UAS_MES_NEW
         {
         {
             BaseUtil.FormStepInOrOut(this, true);
             BaseUtil.FormStepInOrOut(this, true);
             //设置默认数据库
             //设置默认数据库
-            SystemInf.DefaultDB = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.20)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            SystemInf.DefaultDB = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.5)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.ProcessesID = System.Diagnostics.Process.GetCurrentProcess().Id;
             SystemInf.ProcessesID = System.Diagnostics.Process.GetCurrentProcess().Id;
             CheckForIllegalCrossThreadCalls = false;
             CheckForIllegalCrossThreadCalls = false;
             LoadMasterInf = new Thread(LoadMaster);
             LoadMasterInf = new Thread(LoadMaster);
@@ -94,7 +94,7 @@ namespace UAS_MES_NEW
             //设置选中数据库的链接
             //设置选中数据库的链接
             string DBUser = DB.SelectedValue.ToString().Split('#')[0];
             string DBUser = DB.SelectedValue.ToString().Split('#')[0];
             string Address = DB.SelectedValue.ToString().Split('#')[1];
             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=192.168.1.20)(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=192.168.1.5)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.CurrentDB = DBUser;
             SystemInf.CurrentDB = DBUser;
             //设置屏幕的宽高信息
             //设置屏幕的宽高信息
             SystemInf.ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;
             SystemInf.ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;

+ 1 - 1
UAS_MES_HYSX/Main.cs

@@ -357,7 +357,7 @@ namespace UAS_MES_NEW
             if (logout_confirm == "Yes")
             if (logout_confirm == "Yes")
             {
             {
                 //注销的时候切换回默认数据库
                 //注销的时候切换回默认数据库
-                SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.20)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+                SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.5)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
                 DataHelper.DBConnectionString = SystemInf.ConnectionString;
                 DataHelper.DBConnectionString = SystemInf.ConnectionString;
                 //清除上个用户的权限信息
                 //清除上个用户的权限信息
                 SystemInf.Caller.Clear();
                 SystemInf.Caller.Clear();

+ 11 - 10
UAS_MES_HYSX/PublicMethod/HttpServer.cs

@@ -6,7 +6,6 @@ using System.IO;
 using System.Net.Sockets;
 using System.Net.Sockets;
 using System.Security.Cryptography;
 using System.Security.Cryptography;
 using System.Text;
 using System.Text;
-using DevExpress.XtraSpellChecker;
 using Newtonsoft.Json;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using Newtonsoft.Json.Linq;
 using UAS_MES_NEW.DataOperate;
 using UAS_MES_NEW.DataOperate;
@@ -62,7 +61,6 @@ namespace UAS_MES_NEW.PublicMethod
         [JsonProperty("bindList")]
         [JsonProperty("bindList")]
         public List<BindItem> BindList { get; set; }
         public List<BindItem> BindList { get; set; }
     }
     }
-
     public class ZteData
     public class ZteData
     {
     {
         public string tool_name { get; set; }
         public string tool_name { get; set; }
@@ -261,24 +259,27 @@ namespace UAS_MES_NEW.PublicMethod
         //获取栈板信息
         //获取栈板信息
         public static void GetPalletInfo(string iBox)
         public static void GetPalletInfo(string iBox)
         {
         {
+            DataTable dt = (DataTable)dh.ExecuteSql("select pa_outboxcode,pa_makecode from package where  pa_mothercode='" + iBox + "'", "select");
             dynamic obj = new ExpandoObject();
             dynamic obj = new ExpandoObject();
-            obj.request = "pallet";
-            obj.packing_num = 20;
-            obj.User = "mes";
-            obj.po_sn = "250908001001";
-            obj.password = "258456";
-            obj.tool_name = "zte";
-
             var expandoDict = obj as IDictionary<string, object>;
             var expandoDict = obj as IDictionary<string, object>;
-            DataTable dt = (DataTable)dh.ExecuteSql("select pa_outboxcode from package where  pa_mothercode='" + iBox + "'", "select");
+            string makecode = "";
             for (int i = 0; i < dt.Rows.Count; i++)
             for (int i = 0; i < dt.Rows.Count; i++)
             {
             {
                 string enNoKey = $"big_box_no{i}";
                 string enNoKey = $"big_box_no{i}";
                 string enNoValue = dt.Rows[i]["pa_outboxcode"].ToString();
                 string enNoValue = dt.Rows[i]["pa_outboxcode"].ToString();
                 expandoDict[enNoKey] = enNoValue;
                 expandoDict[enNoKey] = enNoValue;
+                makecode = dt.Rows[i]["pa_makecode"].ToString();
             }
             }
+            obj.request = "pallet";
+            obj.packing_num = dt.Rows.Count;
+            obj.User = "mes";
+            obj.po_sn = makecode;
+            obj.password = "258456";
+            obj.tool_name = "zte";
+
             string json = JsonConvert.SerializeObject(obj, Formatting.Indented);
             string json = JsonConvert.SerializeObject(obj, Formatting.Indented);
             string returnstr = SendData(json);
             string returnstr = SendData(json);
+            Console.WriteLine(returnstr);
             Console.WriteLine(json);
             Console.WriteLine(json);
         }
         }
 
 

+ 2 - 2
UAS_MES_HYSX/PublicMethod/Print.cs

@@ -285,7 +285,7 @@ namespace UAS_MES_NEW.PublicMethod
                                 string fp_path = label.Rows[0]["FP_PATH"].ToString().Replace("/app/uas/webapps/", "");
                                 string fp_path = label.Rows[0]["FP_PATH"].ToString().Replace("/app/uas/webapps/", "");
                                 fp_name = label.Rows[0]["fp_name"].ToString();
                                 fp_name = label.Rows[0]["fp_name"].ToString();
                                 WebClient wc = new WebClient();
                                 WebClient wc = new WebClient();
-                                wc.DownloadFile("http://192.168.1.20:8099/" + fp_path, @"C:\打印标签\" + fp_name);
+                                wc.DownloadFile("http://192.168.1.5:8099/" + fp_path, @"C:\打印标签\" + fp_name);
                             }
                             }
                         }
                         }
                     }
                     }
@@ -314,7 +314,7 @@ namespace UAS_MES_NEW.PublicMethod
                                     string fp_path = label.Rows[0]["FP_PATH"].ToString().Replace("/app/uas/webapps/", "");
                                     string fp_path = label.Rows[0]["FP_PATH"].ToString().Replace("/app/uas/webapps/", "");
                                     fp_name = label.Rows[0]["fp_name"].ToString();
                                     fp_name = label.Rows[0]["fp_name"].ToString();
                                     WebClient wc = new WebClient();
                                     WebClient wc = new WebClient();
-                                    wc.DownloadFile("http://192.168.1.20:8099/" + fp_path, @"C:\打印标签\" + fp_name);
+                                    wc.DownloadFile("http://192.168.1.5:8099/" + fp_path, @"C:\打印标签\" + fp_name);
                                     FileInfo file = new FileInfo(@"C:\打印标签\" + fp_name);
                                     FileInfo file = new FileInfo(@"C:\打印标签\" + fp_name);
                                     file.CreationTime = Convert.ToDateTime(filelastwritetime);
                                     file.CreationTime = Convert.ToDateTime(filelastwritetime);
                                 }
                                 }