Przeglądaj źródła

修改排位图导出功能

callm 2 miesięcy temu
rodzic
commit
146976c7ff

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

@@ -122,7 +122,7 @@ namespace UAS_MES_NEW.CustomControl
                 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=10.98.0.21)(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=10.11.28.21)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
                     DataHelper.DBConnectionString = SystemInf.ConnectionString;
                     //清除上个用户的权限信息
                     SystemInf.Caller.Clear();

+ 3 - 3
UAS_MES_LGDZ/DataOperate/DataHelper.cs

@@ -10,11 +10,11 @@ namespace UAS_MES_NEW.DataOperate
     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=10.98.0.21)(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=10.11.28.21)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
 
-        //public static readonly string ERPAddesss = "http://10.98.0.21:8099/mes/";
+        //public static readonly string ERPAddesss = "http://10.11.28.21:8099/mes/";
 
-        public static readonly string ERPAddesss = "http://10.98.0.21:8099/mes/";
+        public static readonly string ERPAddesss = "http://10.11.28.21:8099/mes/";
 
         //用户选择的数据库的连接字符串
         public static string DBConnectionString;

+ 1 - 1
UAS_MES_LGDZ/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/", "");
                                             fp_name = label.Rows[0]["fp_name"].ToString();
                                             WebClient wc = new WebClient();
-                                            wc.DownloadFile("http://10.98.0.21:8099/" + fp_path, @"C:\打印标签\" + fp_name);
+                                            wc.DownloadFile("http://10.11.28.21:8099/" + fp_path, @"C:\打印标签\" + fp_name);
                                         }
                                     }
                                 }

+ 10 - 6
UAS_MES_LGDZ/FunctionCode/Query/Query_SpecialReport.cs

@@ -85,7 +85,7 @@ namespace UAS_MES_NEW.Query
                 Stream fs = new FileStream(ExportFileDialog.SelectedPath + @"\" + time + pr_code.Text + ".txt", FileMode.CreateNew, FileAccess.ReadWrite);
                 fs.Dispose();
                 List<string> list = new List<string>();
-                for (int i = 0; i < importdata.Rows.Count; i++)
+                for (int i = importdata.Rows.Count - 1; i >= 0; i--)
                 {
                     string Refer = importdata.Rows[i]["Refer"].ToString();
                     DataTable bom = (DataTable)dh.ExecuteSql("select bd_soncode,replace(wm_concat(distinct bd_location),',',' ')||';'||replace(wm_concat(distinct bd_soncode),',',' ')||' '||replace(wm_concat(distinct PRE_REPCODE),',',' ') from BOMDetail " +
@@ -102,6 +102,10 @@ namespace UAS_MES_NEW.Query
                         }
                         importdata.Rows[i][1] = bom.Rows[0][0].ToString();
                     }
+                    else
+                    {
+                        importdata.Rows.RemoveAt(i);
+                    }
                     Process.Text = (i + 1) + "/" + importdata.Rows.Count;
                 }
                 excel.ExportExcel(importdata, ExportFileDialog.SelectedPath + @"\" + time + pr_code.Text + ".xls");
@@ -207,14 +211,14 @@ namespace UAS_MES_NEW.Query
                 //    "left join (select sum(bd_baseqty)-1 sumqty,bo_mothercode mothercode from BOMDetail LEFT JOIN bom on bd_bomid=bo_id left join Product ON bd_soncode=pr_code where bo_mothercode='" + pr_code.Text + "' group by bo_mothercode)on mothercode=bo_mothercode where stf_prodcode='" + pr_code.Text + "' order by stf_id", "select");
                 DataTable dt1 = (DataTable)dh.ExecuteSql("select * from (select STF_ID, STF_MODEL,STF_MACHINE, STF_FEEDER, STF_FEEDERNO, STF_LOCATION,replace(pr_orispeccode,' ','\n')pr_orispeccode, bo_mothercode,to_char(bd_baseqty)bd_baseqty,bd_soncode," +
                     "bd_location, STF_CODE, STF_INDATE, STF_INMAN,sumqty from SMTTRACEFILE  left join (select bo_mothercode,bd_baseqty,bd_soncode,replace(bd_location,',',' ')bd_location from BOMDetail  " +
-                    "LEFT JOIN bom on bd_bomid=bo_id left join Product ON bd_soncode=pr_code where bo_mothercode='"+pr_code.Text+"') on bo_mothercode=stf_prodcode and bd_soncode=STF_LOCATION left join product on " +
+                    "LEFT JOIN bom on bd_bomid=bo_id left join Product ON bd_soncode=pr_code where bo_mothercode='" + pr_code.Text + "') on bo_mothercode=stf_prodcode and bd_soncode=STF_LOCATION left join product on " +
                     "pr_code=STF_LOCATION  left join (select sum(bd_baseqty)-1 sumqty,bo_mothercode mothercode from BOMDetail  LEFT JOIN bom on bd_bomid=bo_id left join Product ON bd_soncode=pr_code where " +
-                    "bo_mothercode='"+pr_code.Text+"'  group by bo_mothercode)on mothercode=bo_mothercode where stf_prodcode='"+pr_code.Text+"'  union  select max(stf_id),'',max(STF_MACHINE),''," +
+                    "bo_mothercode='" + pr_code.Text + "'  group by bo_mothercode)on mothercode=bo_mothercode where stf_prodcode='" + pr_code.Text + "'  union  select max(stf_id),'',max(STF_MACHINE),''," +
                     "'代',max(pr_code),replace(max(pr_orispeccode),' ','\n')pr_orispeccode, max(bo_mothercode),'',pr_code,'',max(STF_CODE),max(STF_INDATE),max(stf_inman),0  from " +
                     " SMTTRACEFILE left join (select bd_repcode,bo_mothercode,bd_baseqty,bd_soncode,replace(bd_location,',',' ')bd_location from BOMDetail LEFT JOIN bom on bd_bomid=bo_id where " +
-                    "bo_mothercode='"+pr_code.Text+"' and bd_repcode is not null) on bo_mothercode=stf_prodcode  and bd_soncode=STF_LOCATION left join product  on instr(bd_repcode,pr_code)>0 where " +
-                    "stf_prodcode='"+pr_code.Text+ "' and bd_repcode is not null group by stf_id,bd_repcode,pr_code order by stf_id) ", "select");
-                
+                    "bo_mothercode='" + pr_code.Text + "' and bd_repcode is not null) on bo_mothercode=stf_prodcode  and bd_soncode=STF_LOCATION left join product  on instr(bd_repcode,pr_code)>0 where " +
+                    "stf_prodcode='" + pr_code.Text + "' and bd_repcode is not null group by stf_id,bd_repcode,pr_code order by stf_id) ", "select");
+
                 ExportFileDialog.Description = "选择导出的路径";
                 DialogResult result1 = ExportFileDialog.ShowDialog();
                 if (result1 == DialogResult.OK)

+ 2 - 2
UAS_MES_LGDZ/Login.cs

@@ -47,7 +47,7 @@ namespace UAS_MES_NEW
         {
             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=10.98.0.21)(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=10.11.28.21)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.ProcessesID = System.Diagnostics.Process.GetCurrentProcess().Id;
             CheckForIllegalCrossThreadCalls = false;
             LoadMasterInf = new Thread(LoadMaster);
@@ -94,7 +94,7 @@ namespace UAS_MES_NEW
             //设置选中数据库的链接
             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=10.98.0.21)(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=10.11.28.21)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.CurrentDB = DBUser;
             //设置屏幕的宽高信息
             SystemInf.ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;

+ 1 - 1
UAS_MES_LGDZ/Main.cs

@@ -357,7 +357,7 @@ namespace UAS_MES_NEW
             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=10.98.0.21)(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=10.11.28.21)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
                 DataHelper.DBConnectionString = SystemInf.ConnectionString;
                 //清除上个用户的权限信息
                 SystemInf.Caller.Clear();

+ 2 - 2
UAS_MES_LGDZ/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/", "");
                                 fp_name = label.Rows[0]["fp_name"].ToString();
                                 WebClient wc = new WebClient();
-                                wc.DownloadFile("http://10.98.0.21:8099/" + fp_path, @"C:\打印标签\" + fp_name);
+                                wc.DownloadFile("http://10.11.28.21: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/", "");
                                     fp_name = label.Rows[0]["fp_name"].ToString();
                                     WebClient wc = new WebClient();
-                                    wc.DownloadFile("http://10.98.0.21:8099/" + fp_path, @"C:\打印标签\" + fp_name);
+                                    wc.DownloadFile("http://10.11.28.21:8099/" + fp_path, @"C:\打印标签\" + fp_name);
                                     FileInfo file = new FileInfo(@"C:\打印标签\" + fp_name);
                                     file.CreationTime = Convert.ToDateTime(filelastwritetime);
                                 }