From cb3907de90eef531df10a078149b29c55ff86401 Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期四, 17 七月 2025 16:20:06 +0800 Subject: [PATCH] 1 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs | 27 ++++++++++++++++++++------- 1 files changed, 20 insertions(+), 7 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" index c5528bd..3613253 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" @@ -4,6 +4,7 @@ using Newtonsoft.Json; using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; +using Org.BouncyCastle.Asn1.Ocsp; using SqlSugar; using System; using System.Collections; @@ -912,7 +913,15 @@ WebResponseContent content = new WebResponseContent(); try { - string SerNum = materielBoxCode.Substring(0, materielBoxCode.LastIndexOf("SC:")-1); + string SerNum = ""; + if (materielBoxCode.LastIndexOf("SC:")<0) + { + SerNum = materielBoxCode; + } + else + { + SerNum = materielBoxCode.Substring(0, materielBoxCode.LastIndexOf("SC:") - 1); + } MatSerNumAnalysisModel model = CodeAnalysisHelper.CodeAnalysis<MatSerNumAnalysisModel>(AnalysisCodeEnum.MatSerNumAnalysis, SerNum); //楠岃瘉鍒ゆ柇鏃堕棿鏍煎紡 WebResponseContent IsValidContent = IsValidMCDates(new List<MatSerNumAnalysisModel>() { model }); @@ -920,7 +929,11 @@ { return content.Error(IsValidContent.Message); } - string result = materielBoxCode.Substring(materielBoxCode.LastIndexOf("SC:") + 3); + string result = ""; + if (materielBoxCode.LastIndexOf("SC:") > 0) + { + result = materielBoxCode.Substring(materielBoxCode.LastIndexOf("SC:") + 3); + } //鑾峰彇鍏ュ簱鍗曟槑缁� Dt_InboundOrderDetail inboundOrderDetail = _inboundRepository.InboundOrderDetailRepository.QueryFirst(x=>x.BatchNo== model.LotNo && x.MaterielCode== model.MaterielCode); if (inboundOrderDetail == null) @@ -968,8 +981,8 @@ PalletCode = model.LotNo, StockStatus = StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt(), WarehouseId = inboundOrder.WarehouseId, - PalletType = GetPalletTypeGMOrPP(warehouse, result.Split("*")[0]), - StockLength = result.Split("*")[0].ObjToInt(), + PalletType = GetPalletTypeGMOrPP(warehouse, result.IsNullOrEmpty() ? "" : result.Split("*")[0]), + StockLength = result.IsNullOrEmpty() ? 0 : result.Split("*")[0].ObjToInt(), Details = new List<Dt_StockInfoDetail>() }; } @@ -1058,8 +1071,8 @@ PalletCode = model.LotNo, StockStatus = StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt(), WarehouseId = warehouse.WarehouseId, - PalletType = GetPalletTypeGMOrPP(warehouse, request.Split("*")[0]), - StockLength = request.Split("*")[0].ObjToInt(), + PalletType = GetPalletTypeGMOrPP(warehouse, request.IsNullOrEmpty() ?"":request.Split("*")[0]), + StockLength = request.IsNullOrEmpty()?0:request.Split("*")[0].ObjToInt(), Details = new List<Dt_StockInfoDetail>() }; } @@ -1104,7 +1117,7 @@ if (warehouse.WarehouseCode == WarehouseEnum.HA152.ToString()) { - if (boxWidth.ObjToInt() <= 690 && boxWidth.ObjToInt()>=515) + if (boxWidth.ObjToInt() <= 690 && boxWidth.ObjToInt()>=520) { return 15; } -- Gitblit v1.9.3