From 1e270a1329bbb77b594df2290f15caa34c56668e Mon Sep 17 00:00:00 2001 From: kyy <3283105747@qq.com> Date: 星期三, 17 九月 2025 16:23:19 +0800 Subject: [PATCH] 1、条码增加唯一判断 --- MES.Service/service/BasicData/ProductionOrderManager.cs | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/MES.Service/service/BasicData/ProductionOrderManager.cs b/MES.Service/service/BasicData/ProductionOrderManager.cs index 28b494d..aea600c 100644 --- a/MES.Service/service/BasicData/ProductionOrderManager.cs +++ b/MES.Service/service/BasicData/ProductionOrderManager.cs @@ -107,7 +107,15 @@ // 鏃堕棿鏍煎紡杞崲鍑芥暟锛孍RP鏃堕棿鏍煎紡涓� "yyyy-MM-dd HH:mm:ss.fff" DateTime? ParseDateTime(string dateStr) { - if (DateTime.TryParseExact(dateStr, "yyyy-MM-dd HH:mm:ss.fff", + + string[] formats = new string[] + { + "yyyy-MM-dd HH:mm:ss.fff", + "yyyy-MM-dd HH:mm:ss", + "yyyy-MM-dd" + }; + + if (DateTime.TryParseExact(dateStr, formats, CultureInfo.InvariantCulture, DateTimeStyles.None, out parsedDate)) @@ -183,7 +191,7 @@ var productionOrderSub = new ProductionOrderSub { SequenceNo = Convert.ToInt32(erpDto.FSEQ), - MaterialCode = erpDto.FMaterialID2, + MaterialCode = erpDto.FMaterialID, RequiredQty = Convert.ToDecimal(erpDto.FMustQty), IssuedQty = Convert.ToDecimal(erpDto.FPickedQty), LocationNo = erpDto.FPositionNO, @@ -192,11 +200,14 @@ BatchNo = erpDto.FLot, Warehouse = erpDto.FStockID, IssuingMethod = erpDto.FIssueType, - Unit = erpDto.FUnitID2, - Unit2 = erpDto.FUnitID3, + Unit = erpDto.FUnitID, + Unit2 = erpDto.FUnitID, SupplyingType = erpDto.FSupplyType, Numerator = Convert.ToDecimal(erpDto.FNumerator), Denominator = Convert.ToDecimal(erpDto.FDenominator), + CompositionQty = Convert.ToDecimal(erpDto.FNumerator) != 0 ? + Math.Round(Convert.ToDecimal(erpDto.FNumerator) / Convert.ToDecimal(erpDto.FDenominator), 2) : + 0, ErpId = erpDto.FPPOMENTRYID, ErpHeaderId = erpDto.FPPOMID, FixedLoss = Convert.ToDecimal(erpDto.FFixScrapQty), @@ -204,7 +215,7 @@ SubItemType = erpDto.FMaterialType, ItemNo = erpDto.FReplaceGroup, OwnerType = erpDto.FOwnerTypeId, - Owner = erpDto.FOwnerID2, + Owner = erpDto.FOwnerID, Fisgetscrap = erpDto.FISGETSCRAP, Fiskeycomponent = erpDto.FISKEYCOMPONENT, Fsrctransorgid = erpDto.FSRCTRANSORGID, -- Gitblit v1.9.3