StandardPda/MES.Service/service/Warehouse/MesItemQtManager.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
StandardPda/MES.Service/service/Warehouse/MesItemQtrkManager.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
StandardPda/MES.Service/service/Warehouse/MesItemQtManager.cs
@@ -299,6 +299,21 @@ } string mesUnit = ""; if (mesItems.ItemUnit != null && mesItems.ItemUnit != "") { var mesUnitDb = Db.Queryable<MesUnit>() .Where(s => s.Id == Decimal.Parse(mesItems.ItemUnit)) .First(); if (mesUnitDb == null) { throw new NotImplementedException("[" + ItemQtRKList.SupplierCode + "]单位不存在,请同步给MES"); } mesUnit = mesUnitDb.Fnumber; } //var mesInvItemInCItems = Db.Queryable<MesInvItemInCItems>() // .Where(s => s.ItemInId == mesInvItemIns.Id // && s.ItemNo == mesItems.ItemNo @@ -331,7 +346,7 @@ Qd006 = ItemQtRKList.PlannedQuantity, Qd007 = ItemQtRKList.AppliedQuantity, Qd008 = 0, // 已入数量默认为0 Qd009 = mesItems.ItemUnit, Qd009 = mesUnit, Qd010 = ItemQtRKList.Remark, Qd012 = mesItems.Id, // 物料内码 LineNumber = ItemQtRKList.LineNumber, @@ -353,6 +368,27 @@ }); } var itemDB = mesItemQtDetail .Where(x => x.Qd002 != null) // 过滤掉 null 值 .GroupBy(x => x.Qd002) // 按 Qd002 分组 .Select(g => new { no = g.Key, count = g.Count() }) .ToList(); // 输出统计结果 foreach (var item in itemDB) { if (item.count > 1) { throw new Exception($"明细行物料:{item.no}重复,请检查后重试!"); } //Console.WriteLine($"物料编号: {item.物料编号}, 出现次数: {item.出现次数}"); } var outItemCommand = Db.Insertable(mesItemQtDetail) .PageSize(1).IgnoreColumnsNull().ExecuteCommand(); if (outItemCommand <= 0) StandardPda/MES.Service/service/Warehouse/MesItemQtrkManager.cs
@@ -293,7 +293,22 @@ } supplierCode = mesSupplier.SuppNo; } string mesUnit = ""; if (mesItems.ItemUnit != null && mesItems.ItemUnit != "") { var mesUnitDb = Db.Queryable<MesUnit>() .Where(s => s.Id == Decimal.Parse(mesItems.ItemUnit)) .First(); if (mesUnitDb == null) { throw new NotImplementedException("[" + ItemQtRKList.SupplierCode + "]单位不存在,请同步给MES"); } mesUnit = mesUnitDb.Fnumber; } //var mesInvItemInCItems = Db.Queryable<MesInvItemInCItems>() // .Where(s => s.ItemInId == mesInvItemIns.Id @@ -327,7 +342,7 @@ Qd006= ItemQtRKList.PlannedQuantity, Qd007= ItemQtRKList.AppliedQuantity, Qd008=0, // 已入数量默认为0 Qd009= mesItems.ItemUnit, Qd009= mesUnit, Qd010= ItemQtRKList.Remark, Qd012= mesItems.Id, // 物料内码 LineNumber= ItemQtRKList.LineNumber, @@ -347,6 +362,27 @@ }); } var itemDB = mesItemQtrrDetail .Where(x => x.Qd002 != null) // 过滤掉 null 值 .GroupBy(x => x.Qd002) // 按 Qd002 分组 .Select(g => new { no = g.Key, count = g.Count() }) .ToList(); // 输出统计结果 foreach (var item in itemDB) { if (item.count>1) { throw new Exception($"明细行物料:{item.no}重复,请检查后重试!"); } //Console.WriteLine($"物料编号: {item.物料编号}, 出现次数: {item.出现次数}"); } var outItemCommand = Db.Insertable(mesItemQtrrDetail) .PageSize(1).IgnoreColumnsNull().ExecuteCommand(); if (outItemCommand <= 0)