|  |  |  | 
|---|
|  |  |  | #endregion << ç æ¬ æ³¨ é >> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | using AutoMapper; | 
|---|
|  |  |  | using Microsoft.AspNetCore.Mvc.ApiExplorer; | 
|---|
|  |  |  | using Newtonsoft.Json; | 
|---|
|  |  |  | using SqlSugar; | 
|---|
|  |  |  | using System.Reflection.Emit; | 
|---|
|  |  |  | 
|---|
|  |  |  | using WIDESEA_Core.Enums; | 
|---|
|  |  |  | using WIDESEA_Core.Helper; | 
|---|
|  |  |  | using WIDESEA_DTO.Inbound; | 
|---|
|  |  |  | using WIDESEA_DTO.MES; | 
|---|
|  |  |  | using WIDESEA_DTO.Stock; | 
|---|
|  |  |  | using WIDESEA_DTO.Task; | 
|---|
|  |  |  | using WIDESEA_External.ERPService; | 
|---|
|  |  |  | 
|---|
|  |  |  | private readonly IInvokeERPService _invokeERPService; | 
|---|
|  |  |  | private readonly IInboundRepository _inboundRepository; | 
|---|
|  |  |  | private readonly IInboundOrderService _inboundOrderService; | 
|---|
|  |  |  | private readonly IPalletTypeInfoRepository _palletTypeInfoRepository; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public ITaskRepository Repository => BaseDal; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockRepository stockRepository, IBasicService basicService, IRecordService recordService, IOutboundService outboundService, IStockService stockService, IBasicRepository basicRepository, IApiInfoRepository apiInfoRepository, IInvokeERPService invokeERPService, IInboundRepository inboundRepository, IInboundOrderService inboundOrderService) : base(BaseDal) | 
|---|
|  |  |  | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockRepository stockRepository, IBasicService basicService, IRecordService recordService, IOutboundService outboundService, IStockService stockService, IBasicRepository basicRepository, IApiInfoRepository apiInfoRepository, IInvokeERPService invokeERPService, IInboundRepository inboundRepository, IInboundOrderService inboundOrderService, IPalletTypeInfoRepository palletTypeInfoRepository) : base(BaseDal) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | _mapper = mapper; | 
|---|
|  |  |  | _unitOfWorkManage = unitOfWorkManage; | 
|---|
|  |  |  | 
|---|
|  |  |  | _invokeERPService = invokeERPService; | 
|---|
|  |  |  | _inboundRepository = inboundRepository; | 
|---|
|  |  |  | _inboundOrderService = inboundOrderService; | 
|---|
|  |  |  | _palletTypeInfoRepository = palletTypeInfoRepository; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | x.AGVArea = agvDescription; | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | string response = HttpHelper.Post("http://127.0.0.1:9291/api/Task/ReceiveTask", taskDTOs.Serialize()); | 
|---|
|  |  |  | string url = AppSettings.Get("WCS"); | 
|---|
|  |  |  | if (string.IsNullOrEmpty(url)) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return WebResponseContent.Instance.Error($"æªæ¾å°WCSApiå°å,è¯·æ£æ¥é
ç½®æä»¶"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | string response = HttpHelper.Post($"{url}/api/Task/ReceiveTask", taskDTOs.Serialize()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("è¿åé误"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception ex) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return WebResponseContent.Instance.Error(ex.Message); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// æ¾è´§å®æ | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | /// <param name="code"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public WebResponseContent PutFinish(string code) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | string url = AppSettings.Get("WCS"); | 
|---|
|  |  |  | if (string.IsNullOrEmpty(url)) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return WebResponseContent.Instance.Error($"æªæ¾å°WCSAApiå°å,è¯·æ£æ¥é
ç½®æä»¶"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | string response = HttpHelper.Post($"{url}/api/CTU_AGV/PutFinish", code); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("è¿åé误"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | return WebResponseContent.Instance.Error($"该æçå·²ç»å®è´§ä½"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (stockInfo.Details.Count == 0) | 
|---|
|  |  |  | if (stockInfo.Details.Count == 0 && stockInfo.PalletType != PalletTypeEnum.Empty.ObjToInt()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥æçåºåæç»ä¿¡æ¯"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == task.WarehouseId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | stockInfo.LocationCode = locationInfo.LocationCode; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #region ç©ºç®±å
¥åº/æ£éååº | 
|---|
|  |  |  | if (task.TaskType == TaskTypeEnum.InEmpty.ObjToInt() || task.TaskType == TaskTypeEnum.InPick.ObjToInt()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | stockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); | 
|---|
|  |  |  | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); | 
|---|
|  |  |  | _unitOfWorkManage.BeginTran(); | 
|---|
|  |  |  | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); | 
|---|
|  |  |  | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); | 
|---|
|  |  |  | _stockRepository.StockInfoRepository.UpdateData(stockInfo); | 
|---|
|  |  |  | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationStatusEnum.InStock, LocationChangeType.InboundCompleted); | 
|---|
|  |  |  | _unitOfWorkManage.CommitTran(); | 
|---|
|  |  |  | return WebResponseContent.Instance.OK(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Dt_InboundOrder? inboundOrder = _inboundRepository.InboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == stockInfo.Details.FirstOrDefault().OrderNo).Includes(x => x.Details).First(); | 
|---|
|  |  |  | List<Dt_InboundOrderDetail> inboundOrderDetails = new List<Dt_InboundOrderDetail>(); | 
|---|
|  |  |  | List<ERPInboundDetailModel> detailModels = new List<ERPInboundDetailModel>(); | 
|---|
|  |  |  | if (stockInfo.StockStatus == StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //æ¨éå
¥åºå®æç»Erp | 
|---|
|  |  |  | if (inboundOrder == null) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return WebResponseContent.Instance.Error($"对åºå
¥åºåä¸åå¨"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<ERPInboundDetailModel> detailModels = new List<ERPInboundDetailModel>(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | foreach (var item in stockInfo.Details) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Dt_InboundOrderDetail? inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.RowNo == item.InboundOrderRowNo); | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | inboundOrder.OrderStatus = InOrderStatusEnum.å
¥åºå®æ.ObjToInt(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!_inboundOrderService.FeedbackInboundOrder(stockInfo, inboundOrder, detailModels).Status)//todo ä¿®æ¹å¤ç | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if ((stockInfo.StockStatus == StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt() || stockInfo.StockStatus == StockStatusEmun.æå¨ç»çå
¥åºç¡®è®¤.ObjToInt()) && warehouse.WarehouseCode == WarehouseEnum.HA64.ToString()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | foreach (var model in stockInfo.Details) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return WebResponseContent.Instance.Error($"å
¥åºåæ¥Erp失败"); | 
|---|
|  |  |  | TestSynStock(new TestToolSynInfo() { ToolCode = model.BatchNo, MaterialName = model.MaterielName, Life = int.TryParse(model.Remark, out int val) ? val : 1000 }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //æµè¯æ¶å
¥åºåºåç¶æ | 
|---|
|  |  |  | if (task.TaskType == TaskTypeEnum.Inbound.ObjToInt() && warehouse.WarehouseCode == WarehouseEnum.HA64.ToString() && stockInfo.StockStatus != StockStatusEmun.æå¨ç»çå
¥åºç¡®è®¤.ObjToInt()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | x.Status = StockStatusEmun.å
¥åºå®æ.ObjToInt(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | //æ´æ°ä»»å¡ç¶æ | 
|---|
|  |  |  | task.TaskStatus = (int)TaskStatusEnum.Finish; | 
|---|
|  |  |  | _unitOfWorkManage.BeginTran(); | 
|---|
|  |  |  | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); | 
|---|
|  |  |  | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, (PalletTypeEnum)stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); | 
|---|
|  |  |  | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); | 
|---|
|  |  |  | _stockRepository.StockInfoRepository.UpdateData(stockInfo); | 
|---|
|  |  |  | _stockRepository.StockInfoDetailRepository.UpdateData(stockInfo.Details); | 
|---|
|  |  |  | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationChangeType.InboundCompleted); | 
|---|
|  |  |  | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationStatusEnum.InStock, LocationChangeType.InboundCompleted); | 
|---|
|  |  |  | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, stockInfo.Details.Sum(x => x.StockQuantity), stockInfo.Details.Sum(x => x.StockQuantity), StockChangeTypeEnum.Inbound, taskNum); | 
|---|
|  |  |  | if (inboundOrder != null) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | _unitOfWorkManage.CommitTran(); | 
|---|
|  |  |  | if (stockInfo.StockStatus == StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | _inboundOrderService.FeedbackInboundOrder(stockInfo, inboundOrder, detailModels); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return WebResponseContent.Instance.OK(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception ex) | 
|---|
|  |  |  | 
|---|
|  |  |  | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == task.WarehouseId); | 
|---|
|  |  |  | List<Dt_OutStockLockInfo> outStockLockInfos = _outboundService.OutboundStockLockInfoService.Repository.QueryData(x => x.TaskNum == taskNum); | 
|---|
|  |  |  | List<Dt_OutboundOrderDetail> outboundOrderDetails = new List<Dt_OutboundOrderDetail>(); | 
|---|
|  |  |  | List<Dt_MesOutboundOrder> mesOutboundOrders = new List<Dt_MesOutboundOrder>(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if ((outStockLockInfos == null || outStockLockInfos.Count == 0) && warehouse.WarehouseCode != WarehouseEnum.HA64.ToString()) | 
|---|
|  |  |  | if ((outStockLockInfos == null || outStockLockInfos.Count == 0) && warehouse.WarehouseCode != WarehouseEnum.HA64.ToString() && task.TaskType != TaskTypeEnum.OutEmpty.ObjToInt()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return WebResponseContent.Instance.Error($"æªæ¾å°åºåºè¯¦æ
ä¿¡æ¯"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | for (int i = 0; i < outStockLockInfos.Count; i++) | 
|---|
|  |  |  | foreach (var item in outStockLockInfos) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.Id == outStockLockInfos[i].OrderDetailId); | 
|---|
|  |  |  | if (outboundOrderDetail != null) | 
|---|
|  |  |  | if (task.TaskType == TaskTypeEnum.MesOutbound.ObjToInt()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | outboundOrderDetail.OverOutQuantity = outboundOrderDetail.LockQuantity; | 
|---|
|  |  |  | if (outboundOrderDetail.LockQuantity == outboundOrderDetail.OrderQuantity) | 
|---|
|  |  |  | Dt_MesOutboundOrder mesOutboundOrder = _outboundService.MesOutboundOrderService.Repository.QueryFirst(x => x.TaskNo == item.OrderNo); | 
|---|
|  |  |  | if (mesOutboundOrder != null) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | outboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt(); | 
|---|
|  |  |  | mesOutboundOrder.OverOutQuantity = item.AssignQuantity; | 
|---|
|  |  |  | if (mesOutboundOrder.OverOutQuantity == mesOutboundOrder.OrderQuantity) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | mesOutboundOrder.OrderStatus = OrderDetailStatusEnum.Over.ObjToInt(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | mesOutboundOrders.Add(mesOutboundOrder); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | outboundOrderDetails.Add(outboundOrderDetail); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.Id == item.OrderDetailId); | 
|---|
|  |  |  | if (outboundOrderDetail != null) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | outboundOrderDetail.OverOutQuantity = item.AssignQuantity; | 
|---|
|  |  |  | if (outboundOrderDetail.OverOutQuantity == outboundOrderDetail.OrderQuantity) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | outboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | outboundOrderDetails.Add(outboundOrderDetail); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | item.Status = OutLockStockStatusEnum.åºåºå®æ.ObjToInt(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (warehouse.WarehouseCode != WarehouseEnum.HA64.ToString()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //æ¨éåºåºå®æ | 
|---|
|  |  |  | WebResponseContent webResponse = _outboundService.OutboundOrderService.TestOutUpload(outboundOrderDetails.FirstOrDefault().Id, stockInfo); | 
|---|
|  |  |  | if (!webResponse.Status) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return webResponse; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); | 
|---|
|  |  |  | _unitOfWorkManage.BeginTran(); | 
|---|
|  |  |  | if (outboundOrderDetails.Count > 0) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | _outboundService.OutboundOrderDetailService.Repository.UpdateData(outboundOrderDetails); | 
|---|
|  |  |  | if (outboundOrderDetails.Count > 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | _outboundService.OutboundOrderDetailService.Repository.UpdateData(outboundOrderDetails); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | stockInfo.LocationCode = ""; | 
|---|
|  |  |  | stockInfo.StockStatus = StockStatusEmun.åºåºå®æ.ObjToInt(); | 
|---|
|  |  |  | _stockService.StockInfoService.Repository.UpdateData(stockInfo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | stockInfo.LocationCode = ""; | 
|---|
|  |  |  | stockInfo.StockStatus = StockStatusEmun.åºåºå®æ.ObjToInt(); | 
|---|
|  |  |  | _stockService.StockInfoService.Repository.UpdateData(stockInfo); | 
|---|
|  |  |  | else if (task.TaskType == TaskTypeEnum.OutEmpty.ObjToInt()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId); | 
|---|
|  |  |  | _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else if (task.TaskType == TaskTypeEnum.MesOutbound.ObjToInt()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | _outboundService.MesOutboundOrderService.Repository.UpdateData(mesOutboundOrders); | 
|---|
|  |  |  | _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); | 
|---|
|  |  |  | _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | _outboundService.OutboundStockLockInfoService.Repository.UpdateData(outStockLockInfos); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int beforeStatus = locationInfo.LocationStatus; | 
|---|
|  |  |  | locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); | 
|---|
|  |  |  | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, (PalletTypeEnum)stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId); | 
|---|
|  |  |  | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, (LocationStatusEnum)beforeStatus, LocationChangeType.OutboundCompleted, stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); | 
|---|
|  |  |  | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, (LocationStatusEnum)beforeStatus, LocationStatusEnum.Free, LocationChangeType.OutboundCompleted, stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); | 
|---|
|  |  |  | _unitOfWorkManage.CommitTran(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (warehouse.WarehouseCode != WarehouseEnum.HA64.ToString() && task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | _outboundService.OutboundOrderService.TestOutUpload(outboundOrderDetails.FirstOrDefault().OrderId, outStockLockInfos); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (task.TaskType == TaskTypeEnum.MesOutbound.ObjToInt()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | MesMaterialLotaAceptModel model = GetMesMaterialLotaAceptModel(stockInfo, stockInfo.Details.FirstOrDefault(), mesOutboundOrders.FirstOrDefault().TaskNo, warehouse.WarehouseCode, mesOutboundOrders.FirstOrDefault().OrderQuantity); | 
|---|
|  |  |  | UploadMesMaterialLotaAcept(model); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return WebResponseContent.Instance.OK(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception ex) | 
|---|