From 75b59f8bd0ce2610f8c77e3188926cab20c933a9 Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期五, 27 六月 2025 17:00:02 +0800 Subject: [PATCH] 1 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesProductService.cs | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 42 insertions(+), 2 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesProductService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesProductService.cs" index 6a41a2b..67ccd59 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesProductService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesProductService.cs" @@ -20,6 +20,7 @@ using System.Text.RegularExpressions; using WIDESEA_Common.CommonEnum; using WIDESEA_Core.CodeConfigEnum; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; namespace WIDESEA_TaskInfoService { @@ -162,7 +163,9 @@ TaskType = TaskTypeEnum.InProduct.ObjToInt(), TaskStatus = TaskStatusEnum.New.ObjToInt(), WarehouseId = warehouse.WarehouseId, - PalletType = proStockInfo.PalletType + PalletType = proStockInfo.PalletType, + MaterielCode = proStockInfo.proStockInfoDetails.Where(x => x.ProStockId == proStockInfo.Id).FirstOrDefault()?.ProductCode, + Quantity = (float)proStockInfo.proStockInfoDetails.Where(x => x.ProStockId == proStockInfo.Id).Sum(x => x.StockPcsQty) }; _unitOfWorkManage.BeginTran(); int taskId = BaseDal.AddData(newTask); @@ -478,7 +481,44 @@ } return content; } - + /// <summary> + /// WMS鍚屾鎴愬搧鍑哄簱鑷矼ES澶栧寘瑁呮満 + /// </summary> + public WebResponseContent ShipmentOrderMESSync(MesShipmentOrderSync model) + { + WebResponseContent content = new WebResponseContent(); + try + { + Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.AnhuaitcShipmentOrderSync.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> /// MES鎴愬搧杩斿伐鎻愬簱 /// </summary> -- Gitblit v1.9.3