From 7d173d42cba04b4243f13c6ce013b04e1be4dc95 Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期五, 07 三月 2025 16:59:34 +0800 Subject: [PATCH] 成品输送线 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs | 51 +++++++++++++++++++++++++++++++-------------------- 1 files changed, 31 insertions(+), 20 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 5039413..cc46e19 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" @@ -654,11 +654,14 @@ //} #endregion + _unitOfWorkManage.BeginTran(); Db.InsertNav(mesOutboundOrder).Include(x => x.Details).ExecuteCommand(); + _unitOfWorkManage.CommitTran(); return MesResponseContent.Instance.OK(); } catch (Exception ex) { + _unitOfWorkManage.RollbackTran(); return MesResponseContent.Instance.Error(ex.Message); } @@ -774,6 +777,7 @@ { try { + //涓�娆″彧鍙戜竴鍗风墿鏂欏叆搴撴槑缁� foreach (var item in model.MaterialLotInfo) { //鑾峰彇鐗╂枡淇℃伅 @@ -1029,28 +1033,23 @@ 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, + NextAddress = "", PalletCode = proStockInfo.PalletCode, Roadway = locationInfo.RoadwayNo, SourceAddress = bagInfoModel.WorkCenter, - TargetAddress = locationInfo.LocationCode, + TargetAddress = "", 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(); @@ -1129,28 +1128,40 @@ /// <returns></returns> public MesResponseContent RworkTask(RworkTaskModel model) { + MesResponseContent content = new MesResponseContent(); try { Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA72.ToString()); - //鑾峰彇搴撳瓨璁板綍 - List<Dt_StockInfo> stockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => - x.WarehouseId == warehouse.WarehouseId && - x.StockStatus == (int)StockStatusEmun.鍏ュ簱瀹屾垚).Includes(x => x.Details).ToList(); - Dt_StockInfo? stockInfo = stockInfos.FirstOrDefault(x => x.Details.Any(x => x.BatchNo == model.ProductVersion)); - if (stockInfo == null) + if (warehouse==null) { - return MesResponseContent.Instance.Error($"灏炬暟浠�:{model.ProductVersion}鏃犲彲鐢ㄥ簱瀛�"); + return MesResponseContent.Instance.Error("鏈壘鍒版浠撳簱"); } - Dt_Task exsit2 = Repository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode); - - + Dt_MesRworkOutboundOrder mesRworkOutboundOrder = new Dt_MesRworkOutboundOrder() + { + WarehouseId=warehouse.WarehouseId, + TaskNo=model.TaskNo, + OrderStatus = InOrderStatusEnum.鏈紑濮�.ObjToInt(), + CreateType = OrderCreateTypeEnum.UpperSystemPush.ObjToInt(), + ProductCode=model.ProductCode, + ProductName=model.ProductName, + ProductVersion=model.ProductVersion, + DateCode=model.DateCode, + RequiredQuantity=model.RequiredQuantity, + FactoryCode= model.FactoryCode, + SaleOrder=model.SaleOrder, + InventoryType=model.InventoryType, + }; + _unitOfWorkManage.BeginTran(); + _outboundService.RworkOutboundOrderService.AddData(mesRworkOutboundOrder); + _unitOfWorkManage.CommitTran(); + return content.OK("鎻愪緵杩斿簱鍗曟帴鏀舵垚鍔�"); } catch (Exception ex) { - - throw; + _unitOfWorkManage.RollbackTran(); + content.Error(ex.Message); } - return MesResponseContent.Instance.OK(); + return content; } -- Gitblit v1.9.3