ソースを参照

修改日志上传功能

callm 6 ヶ月 前
コミット
cc3d7cf311

+ 9 - 14
FileWatcher/AutoAnalysisXml.cs

@@ -221,8 +221,8 @@ namespace FileWatcher
                 string stepcode = "";
                 string oErrMessage = "";
                 string oMSID = "";
-                isource = "SMT_01_AOI";
-                iusercode = "SMT_01_AOI";
+                isource = "ZZ_TEST2";
+                iusercode = "HUAG_26";
                 DataTable dt = (DataTable)dh.ExecuteSql("select sc_linecode,sc_stepcode,st_badgroupcode from source left join step on sc_stepcode=st_code where sc_code='" + isource + "'", "select");
                 if (dt.Rows.Count > 0)
                 {
@@ -265,7 +265,7 @@ namespace FileWatcher
                                 {
                                     OperateResult.AppendText(oErrMessage + "\n");
                                     tipform.startthread(oErrMessage, Result);
-                                    File.Delete(FileName);
+                                    SafeDeleteFile(FileName);
                                 }
                                 tipform.startthread("序列号 " + SN + "通过检测", Result);
                                 OperateResult.AppendText("序列号 " + SN + "通过检测" + "\n");
@@ -277,7 +277,7 @@ namespace FileWatcher
                                 {
                                     OperateResult.AppendText(oErrMessage + "\n");
                                     tipform.startthread(oErrMessage, Result);
-                                    File.Delete(FileName);
+                                    SafeDeleteFile(FileName);
                                 }
                                 tipform.startthread("序列号 " + SN + "未通过检测", Result);
                                 OperateResult.AppendText("序列号 " + SN + "未通过检测" + "\n");
@@ -291,7 +291,6 @@ namespace FileWatcher
                 {
                     OperateResult.AppendText(oErrMessage + "\n");
                     tipform.startthread(oErrMessage, Result);
-                    // File.Delete(FileName);
                 }
             }
             else if (Device.Text == "测试设备")
@@ -310,8 +309,8 @@ namespace FileWatcher
                             string oErrMessage = "";
                             string oMSID = "";
                             string ms_sncode = dh.getFieldDataByCondition("makeserial", "ms_sncode", "substr(ms_sncode,0,12)='" + SN + "' order by ms_id").ToString();
-                            isource = "SMT_01_TEST01";
-                            iusercode = "SMT_01_TEST01";
+                            isource = "ZZ_TEST2";
+                            iusercode = "HUAG_26";
                             DataTable dt = (DataTable)dh.ExecuteSql("select sc_linecode,sc_stepcode,st_badgroupcode from source left join step on sc_stepcode=st_code where sc_code='" + isource + "'", "select");
                             if (dt.Rows.Count > 0)
                             {
@@ -333,7 +332,6 @@ namespace FileWatcher
                                         {
                                             OperateResult.AppendText("序列号:" + SN + "上传成功\n");
                                             SafeDeleteFile(FileName);
-                                            //File.Delete(FileName);
                                         }
                                         else
                                         {
@@ -356,7 +354,6 @@ namespace FileWatcher
                             }
                             else
                             {
-                                //File.Delete(FileName);
                                 OperateResult.AppendText(oErrMessage + "\n");
                                 tipform.startthread(oErrMessage, Result);
                             }
@@ -368,8 +365,8 @@ namespace FileWatcher
                             string oErrMessage = "";
                             string oMSID = "";
                             string ms_sncode = dh.getFieldDataByCondition("makeserial", "ms_sncode", "ms_sncode='" + SN + "' order by ms_id").ToString();
-                            isource = "SMT_01_TEST01";
-                            iusercode = "SMT_01_TEST01";
+                            isource = "ZZ_TEST2";
+                            iusercode = "HUAG_26";
                             DataTable dt = (DataTable)dh.ExecuteSql("select sc_linecode,sc_stepcode,st_badgroupcode from source left join step on sc_stepcode=st_code where sc_code='" + isource + "'", "select");
                             if (dt.Rows.Count > 0)
                             {
@@ -390,7 +387,7 @@ namespace FileWatcher
                                         if (num > 0)
                                         {
                                             OperateResult.AppendText("序列号:" + SN + "上传成功\n");
-                                            File.Delete(FileName);
+                                            SafeDeleteFile(FileName);
                                         }
                                         else
                                         {
@@ -414,7 +411,6 @@ namespace FileWatcher
                             }
                             else
                             {
-                                // File.Delete(FileName);
                                 OperateResult.AppendText(oErrMessage + "\n");
                                 tipform.startthread(oErrMessage, Result);
                             }
@@ -435,7 +431,6 @@ namespace FileWatcher
             {
                 // 先移除只读属性(如果有)
                 File.SetAttributes(filePath, FileAttributes.Normal);
-
                 // 尝试删除
                 File.Delete(filePath);
             }

+ 8 - 8
FileWatcher/DataHelper.cs

@@ -14,16 +14,16 @@ namespace FileWatcher
         //public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=YD_CYZZ;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.81.208)(PORT=11701)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
 
 
-        //PNE
-        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.1.81.208)(PORT=11665)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-        //用户选择的数据库的连接字符串
-        public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.81.208)(PORT=11665)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        ////PNE
+        //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.1.81.208)(PORT=11665)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        ////用户选择的数据库的连接字符串
+        //public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.81.208)(PORT=11665)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
 
 
-        ////HG
-        //private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=HUAG;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=113.98.196.181)(PORT=1520)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-        ////用户选择的数据库的连接字符串
-        //public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=HUAG;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=113.98.196.181)(PORT=1520)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        //HG
+        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=HUAG;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=113.98.196.181)(PORT=1520)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        //用户选择的数据库的连接字符串
+        public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=HUAG;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=113.98.196.181)(PORT=1520)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
 
 
         ////HY

+ 2 - 2
FileWatcher/Program.cs

@@ -47,9 +47,9 @@ namespace FileWatcher
                 if (principal.IsInRole(WindowsBuiltInRole.Administrator))
                 {
                     //Application.Run(new AutoAnalysisDeviceKS());
-                    //Application.Run(new Form4());
+                    Application.Run(new AutoAnalysisXml());
                     //Application.Run(new AutoAnalysisXmlByStep());
-                    Application.Run(new SOP_PNE("", ""));
+                    //Application.Run(new SOP_PNE("", ""));
                     //Application.Run(new AutoMakeQTY());
                 }
                 else

+ 1 - 1
FileWatcher/ftpOperater.cs

@@ -23,7 +23,7 @@ namespace FileWatcher
         {
             //string[] FTPInf = "ftp://172.16.51.3|vsftpd|vsftpd3cd79014ef".Split('|');
             //次元FTP
-            string[] FTPInf = "ftp://113.98.196.181:8097|vsftpd|Az789***".Split('|');
+            string[] FTPInf = "ftp://113.98.196.181:8098|vsftpd|Az789***".Split('|');
             this.ftpServerIP = FTPInf[0];
             this.ftpUser = FTPInf[1];
             this.ftpPwd = FTPInf[2];