From 056326f91432db1b2ede9d821d0a463682ffd2aa Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期六, 01 三月 2025 10:30:11 +0800 Subject: [PATCH] MES成品入库单,优化 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 44 insertions(+), 6 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs" index b2875ad..f9cb2f3 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs" @@ -24,10 +24,8 @@ using WIDESEA_ITaskInfoService; using WIDESEA_Model.Models; using WIDESEA_Common.OrderEnum; -using WIDESEA_Model.Models.Outbound; using System.Diagnostics.Metrics; using System.Reflection.Metadata; -using WIDESEA_Model.Models.Inbound; using WIDESEA_DTO.Task; namespace WIDESEA_TaskInfoService @@ -467,7 +465,7 @@ OutboundQuantity = 0, SerialNumber = stockInfoDetail_Hty?.SerialNumber ?? "0", StockQuantity = model.Quantity, - Status = StockStatusEmun.MES閫�搴�.ObjToInt(), + Status = model.Quantity <= 0.0 ? StockStatusEmun.MES绌烘墭閫�搴�.ObjToInt() : StockStatusEmun.MES閫�搴�.ObjToInt(), Unit = model.Unit }; Dt_StockInfo stockInfo = new Dt_StockInfo() @@ -475,8 +473,9 @@ PalletCode = model.CarrierCode, PalletType = palletTypeInfo.PalletType, WarehouseId = warehouse.WarehouseId, - StockStatus = StockStatusEmun.MES閫�搴�.ObjToInt(), - Details = new List<Dt_StockInfoDetail> { stockInfoDetail } + StockStatus = stockInfoDetail.StockQuantity<=0.0? StockStatusEmun.MES绌烘墭閫�搴�.ObjToInt():StockStatusEmun.MES閫�搴�.ObjToInt(), + Details = new List<Dt_StockInfoDetail> { stockInfoDetail }, + Remark= stockInfoDetail.StockQuantity <= 0.0 ? StockStatusEmun.MES绌烘墭閫�搴�.ToString() : StockStatusEmun.MES閫�搴�.ToString() }; //Dt_Task task = new Dt_Task() //{ @@ -911,7 +910,6 @@ content.BSucc = true; content.StrCode = "0000"; content.StrMsg = "鎵ц鎴愬姛"; - content.DataTime = DateTime.Now; content.MaterialCode = stock.MaterielCode; content.Quantity = stock.StockQuantity; content.Unit = stock.Unit; @@ -928,6 +926,46 @@ return MesResponseContent.Instance.Error(ex.Message); } } + /// <summary> + /// MES鎴愬搧鍏ュ簱鍗曟帴鏀� + /// </summary> + /// <returns></returns> + public MesResponseContent BagInfoSync(MesBagInfoModel bagInfoModel) + { + MesResponseContent content = new MesResponseContent(); + try + { + Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x=>x.WarehouseCode==bagInfoModel.WarehouseCode); + if (warehouse==null) + { + return content.Error("鏈壘鍒颁粨搴撲俊鎭�"); + } + List<Dt_MesProInOrderDetail> mesProInOrderDetails = new List<Dt_MesProInOrderDetail>(); + foreach (var item in bagInfoModel.BagDetails) + { + mesProInOrderDetails.Add(_mapper.Map<Dt_MesProInOrderDetail>(item)); + } + mesProInOrderDetails.ForEach(x => + { + x.OverInQuantity = 0; + }); + Dt_MesProInOrder mesProInOrder = new Dt_MesProInOrder() + { + WarehouseId = warehouse.WarehouseId, + BatchNo = bagInfoModel.BatchNo, + MesProStatus = InOrderStatusEnum.鏈紑濮�.ObjToInt(), + UnPackStock=bagInfoModel.UnPackStock, + Details= mesProInOrderDetails + }; + Db.InsertNav(mesProInOrder).Include(x=>x.Details).ExecuteCommand(); + return content.OK("鎺ユ敹鎴愬姛"); + } + catch (Exception ex) + { + content.Error(ex.Message); + } + return content; + } } } -- Gitblit v1.9.3