From b8782b72160d7cf1ec5b58576e149df929dc35d2 Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期三, 05 三月 2025 17:25:14 +0800 Subject: [PATCH] 1 --- 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock | 0 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/b00cc2d5-7651-4699-bf6e-2eed65682db1.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs | 140 ++++++++++++++++++++++++++++++++++ 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/09cfc190-80e7-4be3-bf3e-9a6eaa1e00d1.vsidx | 0 /dev/null | 0 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/f4e55e4a-0dd0-4664-8aa1-102eb9ecc34b.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/6072017d-30e1-411f-8eb8-c9979222f9ad.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs | 7 + 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/d2077ed1-2f92-49f2-afd2-f41f86f5fc2f.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b0d9df61-c024-49b0-a172-a97184dd622b.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e4d78ad4-62c0-46d7-8770-62e00cb5d23f.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock | 0 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs | 18 ++++ 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MES/MesController.cs | 39 +++++++-- 14 files changed, 190 insertions(+), 14 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/53944191-d3e3-4dc3-a3d3-f76da5a49529.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/53944191-d3e3-4dc3-a3d3-f76da5a49529.vsidx" deleted file mode 100644 index 4e1871c..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/53944191-d3e3-4dc3-a3d3-f76da5a49529.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/b00cc2d5-7651-4699-bf6e-2eed65682db1.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/b00cc2d5-7651-4699-bf6e-2eed65682db1.vsidx" new file mode 100644 index 0000000..5144359 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/b00cc2d5-7651-4699-bf6e-2eed65682db1.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/c4ebba94-b522-42e2-9e35-4d78739b7bd8.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/c4ebba94-b522-42e2-9e35-4d78739b7bd8.vsidx" deleted file mode 100644 index a368323..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/c4ebba94-b522-42e2-9e35-4d78739b7bd8.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/d2077ed1-2f92-49f2-afd2-f41f86f5fc2f.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/d2077ed1-2f92-49f2-afd2-f41f86f5fc2f.vsidx" new file mode 100644 index 0000000..6a30d6a --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/d2077ed1-2f92-49f2-afd2-f41f86f5fc2f.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/dabe2c19-7075-4f3e-b4b4-ad475717f014.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/dabe2c19-7075-4f3e-b4b4-ad475717f014.vsidx" deleted file mode 100644 index 1ea4f2f..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/dabe2c19-7075-4f3e-b4b4-ad475717f014.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/f4e55e4a-0dd0-4664-8aa1-102eb9ecc34b.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/f4e55e4a-0dd0-4664-8aa1-102eb9ecc34b.vsidx" new file mode 100644 index 0000000..4730b2c --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/f4e55e4a-0dd0-4664-8aa1-102eb9ecc34b.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock" new file mode 100644 index 0000000..e69de29 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock" diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/042147bb-52cb-4805-9b14-80f5cec0e226.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/042147bb-52cb-4805-9b14-80f5cec0e226.vsidx" deleted file mode 100644 index b0f62dc..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/042147bb-52cb-4805-9b14-80f5cec0e226.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/09cfc190-80e7-4be3-bf3e-9a6eaa1e00d1.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/09cfc190-80e7-4be3-bf3e-9a6eaa1e00d1.vsidx" new file mode 100644 index 0000000..ce1cf8b --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/09cfc190-80e7-4be3-bf3e-9a6eaa1e00d1.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/0f3806e6-14d4-496b-9b44-cf2ad051b337.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/0f3806e6-14d4-496b-9b44-cf2ad051b337.vsidx" deleted file mode 100644 index c70ac53..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/0f3806e6-14d4-496b-9b44-cf2ad051b337.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/19f2ce5e-ac6e-4a83-a8d8-de666adbd753.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/19f2ce5e-ac6e-4a83-a8d8-de666adbd753.vsidx" deleted file mode 100644 index 909024c..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/19f2ce5e-ac6e-4a83-a8d8-de666adbd753.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/6072017d-30e1-411f-8eb8-c9979222f9ad.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/6072017d-30e1-411f-8eb8-c9979222f9ad.vsidx" new file mode 100644 index 0000000..e237bcb --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/6072017d-30e1-411f-8eb8-c9979222f9ad.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b0d9df61-c024-49b0-a172-a97184dd622b.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b0d9df61-c024-49b0-a172-a97184dd622b.vsidx" new file mode 100644 index 0000000..e066d37 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b0d9df61-c024-49b0-a172-a97184dd622b.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b697bc68-cc10-4945-8b22-efceeb7bf056.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b697bc68-cc10-4945-8b22-efceeb7bf056.vsidx" deleted file mode 100644 index cbb3d35..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b697bc68-cc10-4945-8b22-efceeb7bf056.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e4d78ad4-62c0-46d7-8770-62e00cb5d23f.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e4d78ad4-62c0-46d7-8770-62e00cb5d23f.vsidx" new file mode 100644 index 0000000..b9331c9 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e4d78ad4-62c0-46d7-8770-62e00cb5d23f.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock" new file mode 100644 index 0000000..e69de29 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock" diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" index 64f434b..214bf41 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" @@ -330,5 +330,23 @@ /// </summary> /// <returns></returns> WebResponseContent ShipmentOrderSync(MesShipmentOrderSync model); + /// <summary> + /// 鐢熸垚MESPP澶у嵎鍑哄簱浠诲姟 + /// </summary> + /// <param name="keys"></param> + /// <returns></returns> + WebResponseContent MESPPGenerateOutboundTasks(int[] keys); + + /// <summary> + /// 鐢熸垚MESPP灏忓嵎鍑哄簱浠诲姟 + /// </summary> + /// <param name="keys"></param> + /// <returns></returns> + //WebResponseContent PPCutOutGenerateOutboundTasks(int[] keys); + + WebResponseContent PPCutOutGenerateOutboundTasks(int orderDetailId, List<PPStockSelectViewDTO> stockSelectViews); + + WebResponseContent PPGeneratePKOutboundTask(int orderDetailId, List<PPStockSelectViewDTO> stockSelectViews); + } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs" index 034efde..d8f706f 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs" @@ -24,8 +24,11 @@ public IMesPPCutOutboundOrderService MesPPCutOutboundOrderService { get; } public IMesPPCutOutboundOrderDetailService MesPPCutOutboundOrderDetailService { get; } + public IProOutOrderService ProOutOrderService { get; } + public IProOutOrderDetailService ProOutOrderDetailService { get; } - public OutboundService(IOutboundOrderDetailService outboundOrderDetailService, IMesPPOutboundOrderDetailService mesPPOutboundOrderDetailService, IMesPPCutOutboundOrderDetailService mesPPCutOutboundOrderDetailService, IMesPPCutOutboundOrderService mesPPCutOutboundOrderService, IMesPPOutboundOrderService mesPPOutboundOrderService, IOutboundOrderService outboundOrderService, IOutStockLockInfoService outboundStockLockInfoService, IMesOutboundOrderService mesOutboundOrderService) + + public OutboundService(IOutboundOrderDetailService outboundOrderDetailService, IMesPPOutboundOrderDetailService mesPPOutboundOrderDetailService, IMesPPCutOutboundOrderDetailService mesPPCutOutboundOrderDetailService, IMesPPCutOutboundOrderService mesPPCutOutboundOrderService, IMesPPOutboundOrderService mesPPOutboundOrderService, IOutboundOrderService outboundOrderService, IOutStockLockInfoService outboundStockLockInfoService, IMesOutboundOrderService mesOutboundOrderService,IProOutOrderService proOutOrderService, IProOutOrderDetailService proOutOrderDetailService) { OutboundOrderDetailService = outboundOrderDetailService; OutboundOrderService = outboundOrderService; @@ -35,6 +38,8 @@ MesPPCutOutboundOrderService = mesPPCutOutboundOrderService; MesPPCutOutboundOrderDetailService = mesPPCutOutboundOrderDetailService; MesPPOutboundOrderDetailService = mesPPOutboundOrderDetailService; + ProOutOrderService = proOutOrderService; + ProOutOrderDetailService = proOutOrderDetailService; } } } 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 9fce273..aee204f 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" @@ -293,7 +293,46 @@ } return content; } - + /// <summary> + /// WMS鍚屾鎴愬搧鍑哄簱鑷矼ES + /// </summary> + /// <param name="model"></param> + /// <returns></returns> + public WebResponseContent ShipmentOrderSync(MesShipmentOrderSync model) + { + WebResponseContent content = new WebResponseContent(); + try + { + Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.WMS_MES_ShipmentOrderSync.ToString()); + MESRoot<MesShipmentOrderSync> root = new MESRoot<MesShipmentOrderSync>() + { + From = "WMS", + DateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), + Content = model + }; + JsonSerializerSettings settings = new JsonSerializerSettings + { + ContractResolver = new CamelCasePropertyNamesContractResolver() + }; + string request = JsonConvert.SerializeObject(root, settings); + string response = HttpMesHelper.Post(apiInfo.ApiAddress, request); + MesResponseContent mesResponseContent = response.DeserializeObject<MesResponseContent>(); + //璋冪敤鎺ュ彛 + if (mesResponseContent.BSucc == true) + { + content.OK(mesResponseContent.StrMsg); + } + else + { + content.Error(mesResponseContent.StrMsg); + } + } + catch (Exception ex) + { + content.Error(ex.Message); + } + return content; + } /// <summary> /// /// </summary> @@ -936,21 +975,117 @@ { return content.Error("鏈壘鍒颁粨搴撲俊鎭�"); } + //鍒ゆ柇鏄惁MES鍐呭寘淇℃伅鏄惁閲嶅 List<Dt_MesProInOrderDetail> mesProInOrderDetails = new List<Dt_MesProInOrderDetail>(); foreach (var item in bagInfoModel.BagDetails) { - mesProInOrderDetails.Add(_mapper.Map<Dt_MesProInOrderDetail>(item)); + foreach (var child in item.BagItems) + { + Dt_MesProInOrderDetail mesProInOrderDetail = new Dt_MesProInOrderDetail() + { + BagNo = item.BagNo, + ProductCode = item.ProductCode, + ProductVersion = item.ProductVersion, + SETQty = child.SETQty, + OKPCSQTY = child.OKPCSQTY, + DateCode = item.DateCode, + XQty = child.XQty, + XSite = child.XSite, + Weight = item.Weight, + PackingDate = item.PackingDate, + LotNumber = child.LotNumber, + ERPOrder = child.ERPOrder, + SaleOrder = child.SaleOrder, + MoNumber = child.MoNumber, + }; + mesProInOrderDetails.Add(mesProInOrderDetail); + } + } + List<Dt_ProStockInfoDetail> proStockInfoDetails = new List<Dt_ProStockInfoDetail>(); + foreach (var item in mesProInOrderDetails) + { + proStockInfoDetails.Add(_mapper.Map<Dt_ProStockInfoDetail>(item)); } Dt_MesProInOrder mesProInOrder = new Dt_MesProInOrder() { WarehouseId = warehouse.WarehouseId, BatchNo = bagInfoModel.BatchNo, + WorkCenter = bagInfoModel.WorkCenter, MesProStatus = InOrderStatusEnum.鏈紑濮�.ObjToInt(), UnPackStock = bagInfoModel.UnPackStock, Details = mesProInOrderDetails }; + Dt_ProStockInfo proStockInfo = new Dt_ProStockInfo() + { + PalletCode = bagInfoModel.BatchNo, + PalletType = 1, + WarehouseId = warehouse.WarehouseId, + StockStatus = StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt(), + proStockInfoDetails = proStockInfoDetails + }; + _unitOfWorkManage.BeginTran(); Db.InsertNav(mesProInOrder).Include(x => x.Details).ExecuteCommand(); + Db.InsertNav(proStockInfo).Include(x => x.proStockInfoDetails).ExecuteCommand(); + _unitOfWorkManage.CommitTran(); return content.OK("鎺ユ敹鎴愬姛"); + } + catch (Exception ex) + { + _unitOfWorkManage.RollbackTran(); + content.Error(ex.Message); + } + return content; + } + public MesResponseContent BoxStockin(MesBoxInfoModel boxInfoModel) + { + MesResponseContent content = new MesResponseContent(); + try + { + Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA101.ToString()); + //鑾峰彇MES鍐呭寘淇℃伅 + List<Dt_MesProInOrderDetail> mesProInOrderDetails = new List<Dt_MesProInOrderDetail>(); + foreach (var item in boxInfoModel.Bags) + { + foreach (var child in item.BagItems) + { + Dt_MesProInOrderDetail mesProInOrderDetail = new Dt_MesProInOrderDetail() + { + BagNo = item.BagNo, + ProductCode = item.ProductCode, + ProductVersion = item.ProductVersion, + SETQty = child.SETQty, + OKPCSQTY = child.OKPCSQTY, + DateCode = item.DateCode, + XQty = child.XQty, + XSite = child.XSite, + Weight = item.Weight, + PackingDate = item.PackingDate, + LotNumber = child.LotNumber, + ERPOrder = child.ERPOrder, + SaleOrder = child.SaleOrder, + MoNumber = child.MoNumber, + }; + mesProInOrderDetails.Add(mesProInOrderDetail); + } + } + List<Dt_ProStockInfoDetail> proStockInfoDetails = new List<Dt_ProStockInfoDetail>(); + foreach (var item in mesProInOrderDetails) + { + proStockInfoDetails.Add(_mapper.Map<Dt_ProStockInfoDetail>(item)); + } + Dt_ProStockInfo proStockInfo = new Dt_ProStockInfo() + { + PalletCode = boxInfoModel.BoxNo, + PalletType = 0, + WarehouseId = warehouse.WarehouseId, + ShipmentOrder = boxInfoModel.ShipmentOrder, + StockStatus = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt(), + proStockInfoDetails = proStockInfoDetails + }; + _unitOfWorkManage.BeginTran(); + Db.InsertNav(proStockInfo).Include(x => x.proStockInfoDetails).ExecuteCommand(); + _unitOfWorkManage.CommitTran(); + return content.OK("澶栧寘鎺ユ敹鎴愬姛"); } catch (Exception ex) { @@ -958,7 +1093,6 @@ } return content; } - /// <summary> /// 鎴愬搧杩斿伐鎻愬簱 /// </summary> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MES/MesController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MES/MesController.cs" index 18d085b..8ccb89d 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MES/MesController.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MES/MesController.cs" @@ -152,6 +152,35 @@ return _taskService.UploadMesMaterialLotaAcept(model); } /// <summary> + /// MES鎴愬搧鍐呭寘淇℃伅鎺ユ敹 + /// </summary> + /// <param name="model"></param> + /// <returns></returns> + [HttpPost, Route("BagInfoSync"), AllowAnonymous] + public MesResponseContent BagInfoSync([FromBody] Root<MesBagInfoModel> model) + { + return _taskService.BagInfoSync(model.Content); + } + /// <summary> + /// MES鎴愬搧澶栧寘淇℃伅鎺ユ敹 + /// </summary> + /// <param name="model"></param> + /// <returns></returns> + [HttpPost, Route("BoxStockin"), AllowAnonymous] + public MesResponseContent BoxStockin([FromBody] Root<MesBoxInfoModel> model) + { + return _taskService.BoxStockin(model.Content); + } + /// <summary> + /// MES鎴愬搧鍑哄簱鎺ュ彛璋冪敤 + /// </summary> + /// <returns></returns> + [HttpPost, Route("ShipmentOrderSync"), AllowAnonymous] + public WebResponseContent ShipmentOrderSync([FromBody] MesShipmentOrderSync model) + { + return _taskService.ShipmentOrderSync(model); + } + /// <summary> /// 鎴愬搧杩斿伐鎻愬簱 /// </summary> /// <param name="model"></param> @@ -160,16 +189,6 @@ public MesResponseContent RworkTask([FromBody] RworkTaskModel model) { return _taskService.RworkTask(model); - } - /// <summary> - /// MES鎴愬搧鍏ュ簱鍗曟帴鏀� - /// </summary> - /// <param name="model"></param> - /// <returns></returns> - [HttpPost, Route("BagInfoSync"), AllowAnonymous] - public MesResponseContent BagInfoSync([FromBody] Root<MesBagInfoModel> model) - { - return _taskService.BagInfoSync(model.Content); } /// <summary> /// 鐢熸垚MESPP浠撳ぇ鍗峰嚭搴撲换鍔� -- Gitblit v1.9.3