From 2f8a8a7b31c7e311d1824c76e2a67e2a128bc65b Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期四, 06 三月 2025 17:34:04 +0800 Subject: [PATCH] 成品入库任务,货位 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs | 37 +++++++++++++++++++++++++++++++------ 1 files changed, 31 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 519fc8e..5039413 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" @@ -29,6 +29,7 @@ using WIDESEA_DTO.Task; using WIDESEA_DTO.Stock; using SqlSugar; +using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; namespace WIDESEA_TaskInfoService { @@ -975,7 +976,12 @@ { return content.Error("鏈壘鍒颁粨搴撲俊鎭�"); } - //鍒ゆ柇鏄惁MES鍐呭寘淇℃伅鏄惁閲嶅 + Dt_LocationInfo locationInfo = _basicRepository.LocationInfoRepository.QueryFirst(x => x.WarehouseId == warehouse.WarehouseId); + if (locationInfo==null) + { + return content.Error($"鏈壘鍒皗warehouse.WarehouseCode}璐т綅淇℃伅"); + } + //鍐呭寘淇℃伅缁勭洏 List<Dt_MesProInOrderDetail> mesProInOrderDetails = new List<Dt_MesProInOrderDetail>(); foreach (var item in bagInfoModel.BagDetails) { @@ -1020,13 +1026,36 @@ PalletCode = bagInfoModel.BatchNo, PalletType = 1, WarehouseId = warehouse.WarehouseId, - StockStatus = StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt(), + StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt(), proStockInfoDetails = proStockInfoDetails }; + //鍒嗛厤璐т綅 + locationInfo = _basicService.LocationInfoService.AssignLocation(locationInfo.RoadwayNo, ((PalletTypeEnum)proStockInfo.PalletType).ObjToInt(), proStockInfo.WarehouseId); + Dt_Task newTask = new Dt_Task() + { + CurrentAddress = bagInfoModel.WorkCenter, + Grade = 0, + NextAddress = locationInfo.LocationCode, + PalletCode = proStockInfo.PalletCode, + Roadway = locationInfo.RoadwayNo, + SourceAddress = bagInfoModel.WorkCenter, + TargetAddress = locationInfo.LocationCode, + TaskType = TaskTypeEnum.InProduct.ObjToInt(), + TaskStatus = TaskStatusEnum.New.ObjToInt(), + WarehouseId = warehouse.WarehouseId, + PalletType = proStockInfo.PalletType + }; + locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt(); + _unitOfWorkManage.BeginTran(); + int taskId = BaseDal.AddData(newTask); + newTask.TaskId = taskId; + _basicRepository.LocationInfoRepository.UpdateData(locationInfo); Db.InsertNav(mesProInOrder).Include(x => x.Details).ExecuteCommand(); Db.InsertNav(proStockInfo).Include(x => x.proStockInfoDetails).ExecuteCommand(); _unitOfWorkManage.CommitTran(); + //鎺ㄩ�佷换鍔� + PushTasksToWCS(new List<Dt_Task> { newTask }); return content.OK("鎺ユ敹鎴愬姛"); } catch (Exception ex) @@ -1618,9 +1647,5 @@ return WebResponseContent.Instance.Error(ex.Message); } } - - - - } } -- Gitblit v1.9.3