Browse Source

优化数据对接

yhluo 2 months ago
parent
commit
ba644e66df
1 changed files with 11 additions and 10 deletions
  1. 11 10
      UAS_MES_HYSX/FunctionCode/Make/Make_ParseLog.cs

+ 11 - 10
UAS_MES_HYSX/FunctionCode/Make/Make_ParseLog.cs

@@ -393,19 +393,21 @@ namespace UAS_MES_NEW.Make
                     }
                     else if(equiType == "CCD")
                     {
-                        string imageName = Path.GetFileName(file);
-                        SN = imageName.Split('_')[0].ToString();
+                        if (txtFiles.Length != 2) break;
 
-                        if (imageName.ToUpper().Contains("NG"))
+                        foreach (var fileItem in txtFiles)
                         {
-                            if (UploadImageToFtp(file, SN))
+                            string imageName = Path.GetFileName(fileItem);
+                            SN = imageName.Split('_')[0].ToString();
+
+                            if (imageName.ToUpper().Contains("NG"))
                             {
-                                dh.ExecuteSql($@"INSERT INTO steptestmain (sm_id, sm_sn,sm_makecode,sm_stepcode,sm_indate,sm_machinecode,sm_result) 
-                                    VALUES ( steptestmain_seq.NEXTVAL,'{SN}','{ma_code.Text}','{User.UserSourceCode}', sysdate,'CCD', 'http://192.168.1.5:8088/ftp/ccd/{SN}/{Path.GetFileName(file)}' )", "insert");
+                                if (UploadImageToFtp(fileItem, SN))
+                                {
+                                    dh.ExecuteSql($@"INSERT INTO steptestmain (sm_id, sm_sn,sm_makecode,sm_stepcode,sm_indate,sm_machinecode,sm_result) 
+                                            VALUES ( steptestmain_seq.NEXTVAL,'{SN}','{ma_code.Text}','{User.UserSourceCode}', sysdate,'CCD', 'http://192.168.1.5:8088/ftp/ccd/{SN}/{Path.GetFileName(fileItem)}' )", "insert");
+                                }
                             }
-                        }
-                        if(Array.IndexOf(txtFiles, file) == 1)
-                        {
                             string parentPath = Path.GetDirectoryName(file);
                             string changeName = Path.Combine(parentPath, SN);
 
@@ -416,7 +418,6 @@ namespace UAS_MES_NEW.Make
                             File.Move(file, changeName);
                         }
                     }
-
                 }
             }
             catch (Exception ex)