浏览代码

Merge repos.ubtob.net:usoft/mes-client

callm 4 月之前
父节点
当前提交
3680fb87d8
共有 1 个文件被更改,包括 27 次插入12 次删除
  1. 27 12
      UAS_MES_BG/FunctionCode/Make/Make_ParseLog.cs

+ 27 - 12
UAS_MES_BG/FunctionCode/Make/Make_ParseLog.cs

@@ -739,20 +739,32 @@ namespace UAS_MES_NEW.Make
 
                             string Part_ = "",Side_="";
                             int letNoNum = 0;
-                            foreach (var item in xmlList)
+                            
+                            try
                             {
-                                MachineName.Add(item.MachineName);
-                                Part_ = item.Part.Split('.')[0].Split('-')[0];
-                                Side_ = item.Part.Split('.')[0].Split('-')[1];
-                                Station.Add(item.Station);
-                                ReelNo.Add(item.ReelNo);
-                                letNo.Add((++letNoNum).ToString());
+                                foreach (var item in xmlList)
+                                {
+                                    MachineName.Add(item.MachineName);
+                                    Part_ = item.Part.Split('.')[0].Split('-')[0];
+                                    Side_ = item.Part.Split('.')[0].Split('-')[1];
+                                    Station.Add(item.Station);
+                                    ReelNo.Add(item.ReelNo);
+                                    letNo.Add((++letNoNum).ToString());
+                                }
+                            }
+                            catch (Exception ex) 
+                            {
+                                LogMessage($"Error: 解析文件列表失败: 文件格式无面别信息,{ex.Message}");
+                                if (ConsoleLog(xmlContent, file))
+                                {
+                                    File.Delete(file);
+                                }
                             }
-                            string ps_id = "";
 
+                            string ps_id = "";
                             string lineId = dh.getFieldDataByCondition("smtlocationinto", "SLI_LANE", "SLI_MCNO='" + MachineName[0] + "'").ToString();
 
-                            if (!dh.CheckExist("productsmt", "ps_prodcode='" + Part_ + "'"))
+                            if (!dh.CheckExist("productsmt", "ps_prodcode='" + Part_ + "' and PS_LINECODE = '"+ lineId  + "'"))
                             {
                                 ps_id = dh.GetSEQ("productsmt_seq");
                                 /*dh.ExecuteSql("insert into productsmt(ps_id,ps_prodcode,ps_status,ps_statuscode,PS_LINECODE,PS_CODE,PS_TABLE,PS_INDATE,PS_AUDITDATE)" +
@@ -763,7 +775,7 @@ namespace UAS_MES_NEW.Make
                             }
                             else
                             {
-                                ps_id = dh.getFieldDataByCondition("productsmt", "ps_id", "ps_prodcode='" + Part_ + "'").ToString();
+                                ps_id = dh.getFieldDataByCondition("productsmt", "ps_id", "ps_prodcode='" + Part_ + "' and PS_LINECODE = '"+ lineId  + "'").ToString();
                             }
                             if (dh.getRowCount("productsmtlocation", "PSL_PSID='" + ps_id +"'") > 0)
                             {
@@ -919,8 +931,11 @@ namespace UAS_MES_NEW.Make
                     }
                     else if (equiType == "AOI")
                     {
-                        res = currItem[3];
-                        detail = currItem[3];
+                        if(currItem.Length > 3)
+                        {
+                            res = currItem[3];
+                            detail = currItem[3];
+                        }
 
                         if(string.IsNullOrEmpty(res) && string.IsNullOrEmpty(detail))
                         {