From 3686a620659f73b5ef20ff031f1316506432c6bc Mon Sep 17 00:00:00 2001 From: Cloud Zhang <941187371@qq.com> Date: 星期三, 22 五月 2024 15:10:38 +0800 Subject: [PATCH] 导入验证修改 --- Tiger.Business/MES/SMT/Biz.SmtTool.cs | 52 +++++++++++++++++++++++++++++++--------------------- 1 files changed, 31 insertions(+), 21 deletions(-) diff --git a/Tiger.Business/MES/SMT/Biz.SmtTool.cs b/Tiger.Business/MES/SMT/Biz.SmtTool.cs index 2fc34f6..679f919 100644 --- a/Tiger.Business/MES/SMT/Biz.SmtTool.cs +++ b/Tiger.Business/MES/SMT/Biz.SmtTool.cs @@ -72,42 +72,52 @@ List<smtWoTableIn> currentList = new List<smtWoTableIn>(); if (paras.Count > 0) { - var duplicateWo = paras.GroupBy(p => p.鍏宠仈宸ュ崟鍙�) - .Where(g => g.Count() > 1) - .Select(g => g.Key) - .ToList(); - if (duplicateWo.Count() > 0)//瀛樺湪閲嶅鏁版嵁 - { - string WORK_ORDER = string.Empty; - foreach (var item in duplicateWo) - { - WORK_ORDER += item; - } - WORK_ORDER = WORK_ORDER.TrimEnd(';'); - result.IsSuccessed = false; - result.Message = $"瀵煎叆鐨勭墿鏂欎腑鏈夐噸澶嶆暟鎹細鍏宠仈宸ュ崟锛歿WORK_ORDER}"; - } - else + //var duplicateWo = paras.GroupBy(p => p.鍏宠仈宸ュ崟鍙�) + // .Where(g => g.Count() > 1) + // .Select(g => g.Key) + // .ToList(); + //if (duplicateWo.Count() > 0)//瀛樺湪閲嶅鏁版嵁 + //{ + // string WORK_ORDER = string.Empty; + // foreach (var item in duplicateWo) + // { + // WORK_ORDER += item; + // } + // WORK_ORDER = WORK_ORDER.TrimEnd(';'); + // result.IsSuccessed = false; + // result.Message = $"瀵煎叆鐨勭墿鏂欎腑鏈夐噸澶嶆暟鎹細鍏宠仈宸ュ崟锛歿WORK_ORDER}"; + //} + //else { foreach (var item in paras) { item.澶勭悊鏂瑰紡 = "鏂板"; item.鍘熷洜 = null; - if (item.鍏宠仈宸ュ崟鍙� == null) + if (item.鍏宠仈宸ュ崟鍙� == null|| item.鍏宠仈宸ュ崟鍙� == " ") { item.澶勭悊鏂瑰紡 = "鏁版嵁寮傚父"; item.鍘熷洜 += "宸ュ崟鍙风┖鎴栦笉瀛樺湪锛�"; } - if (item.浜у搧缂栫爜 == null) + if (item.浜у搧缂栫爜 == null || item.浜у搧缂栫爜 == " ") { item.澶勭悊鏂瑰紡 = "鏁版嵁寮傚父"; item.鍘熷洜 += $"浜у搧缂栫爜涓虹┖锛�"; } + if (item.鐗╂枡缂栫爜 == null || item.鐗╂枡缂栫爜 == " ") + { + item.澶勭悊鏂瑰紡 = "鏁版嵁寮傚父"; + item.鍘熷洜 += $"鐗╂枡缂栫爜涓虹┖锛�"; + } + if (item.绔欎綅鍙� == null || item.绔欎綅鍙� == " ") + { + item.澶勭悊鏂瑰紡 = "鏁版嵁寮傚父"; + item.鍘熷洜 += $"绔欎綅鍙蜂负绌猴紒"; + } currentList.Add(item); - if (await Db.Queryable<SMT_WO_TABLE>().AnyAsync(x => x.WORK_ORDER == item.鍏宠仈宸ュ崟鍙�)) + if (await Db.Queryable<SMT_WO_TABLE>().AnyAsync(x => x.WORK_ORDER == item.鍏宠仈宸ュ崟鍙� && x.ITEM_CODE == item.鐗╂枡缂栫爜 && x.SLOT_NO==item.绔欎綅鍙�)) { item.澶勭悊鏂瑰紡 = "淇敼"; - item.鍘熷洜 += $"宸ュ崟{item.鍏宠仈宸ュ崟鍙穧涓庢暟鎹簱閲嶅锛�"; + item.鍘熷洜 += $"宸ュ崟{item.鍏宠仈宸ュ崟鍙穧锛岀墿鏂欑紪鐮亄item.鐗╂枡缂栫爜}锛岀珯浣嶅彿{item.绔欎綅鍙穧涓庢暟鎹簱閲嶅锛�"; } } //for (int i = 0; i < item..Count; i++) @@ -121,7 +131,7 @@ } catch (Exception ex) { - result.CatchException(ex, $"楠岃瘉瀵煎叆鍙戞枡璁″垝鎺掔▼寮傚父"); + result.CatchException(ex, $"楠岃瘉瀵煎叆宸ュ崟鏂欑珯琛ㄥ紓甯�"); } return result; } -- Gitblit v1.9.3