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 | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 40 insertions(+), 3 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 2be269b..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 @@ -912,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; @@ -929,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