| | |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_OutboundRepository; |
| | | using WIDESEA_StockRepository; |
| | | using WIDESEA_TaskInfoRepository; |
| | | using WIDESEAWCS_DTO.WCSInfo; |
| | | |
| | |
| | | private readonly IInboundService _inboundService; |
| | | private readonly IRecordService _recordService; |
| | | private readonly IStockService _stockService; |
| | | private readonly IInventoryInfoRepository _inventoryInfoRepository; |
| | | private readonly IInventoryBatchRepository _inventoryBatchRepository; |
| | | private readonly IBasicRepository _basicRepository; |
| | | |
| | | public ITaskRepository Repository => BaseDal; |
| | | |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, IBasicRepository basicRepository) : base(BaseDal) |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, IInventoryInfoRepository inventoryInfoRepository, IInventoryBatchRepository inventoryBatchRepository, IBasicRepository basicRepository) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _outboundService = outboundService; |
| | | _inboundService = inboundService; |
| | | _recordService = recordService; |
| | | _inventoryInfoRepository = inventoryInfoRepository; |
| | | _inventoryBatchRepository = inventoryBatchRepository; |
| | | _stockService = stockService; |
| | | _basicRepository = basicRepository; |
| | | } |
| | |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | public WebResponseContent OutQC(string batchNo, int qty) |
| | | { |
| | | WebResponseContent webResponse = new WebResponseContent().OK(); |
| | | try |
| | | { |
| | | Dt_Inventory_Batch inventory_Batch = _inventoryBatchRepository.QueryFirst(x => x.BatchNo == batchNo); |
| | | if (inventory_Batch == null) return webResponse.Error($"æªæ¾å°æ¹å·ã{batchNo}ãçåºåæ¹æ¬¡ä¿¡æ¯"); |
| | | if (inventory_Batch.ProductStatus != ProductStatusEmun.å¾
æ£1.ObjToInt()) |
| | | return webResponse.Error($"æ¹å·ã{batchNo}ã已质æ£å
¥åº"); |
| | | List<Dt_InventoryInfo> _InventoryInfos = _inventoryInfoRepository.QueryData(x => x.BatchNo == batchNo && x.StockStatus == StockStatusEmun.å·²å
¥åº.ObjToInt()).OrderByDescending(x => x.InDate).Take(qty).ToList(); |
| | | if (_InventoryInfos.Count < 1) return webResponse.Error($"æªæ¾å°æ¹å·ã{batchNo}ãçåºå"); |
| | | Dt_LocationInfo locationInfo = _basicRepository.LocationInfoRepository.QueryFirst(x => x.LocationCode == _InventoryInfos.First().LocationCode); |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | List<Dt_OutStockLockInfo> OutStockLockInfos = new List<Dt_OutStockLockInfo>(); |
| | | #region çæè´¨æ£åºåºå |
| | | Dt_OutboundOrderDetail orderDetail = new Dt_OutboundOrderDetail() |
| | | { |
| | | BatchNo = batchNo, |
| | | Creater = "System", |
| | | OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt() |
| | | }; |
| | | Dt_OutboundOrder outboundOrder = new Dt_OutboundOrder() |
| | | { |
| | | CreateType = CreateType.CreateInSystem.ObjToInt(), |
| | | OrderStatus = OutboundStatusEnum.åºåºä¸.ObjToInt(), |
| | | OrderNo = batchNo, |
| | | OrderType = OutOrderTypeEnum.Quality.ObjToInt(), |
| | | Creater = "System", |
| | | Details = new List<Dt_OutboundOrderDetail>() { orderDetail } |
| | | }; |
| | | #endregion |
| | | foreach (var item in _InventoryInfos) |
| | | { |
| | | orderDetail.MaterielCode = item.MaterielCode; |
| | | orderDetail.MaterielName = item.MaterielName; |
| | | orderDetail.OrderQuantity += item.StockQuantity; |
| | | orderDetail.LockQuantity += item.StockQuantity; |
| | | item.OutboundQuantity = item.StockQuantity; |
| | | item.StockStatus = StockStatusEmun.åºåºä¸.ObjToInt(); |
| | | Dt_Task task = new Dt_Task() |
| | | { |
| | | CurrentAddress = item.LocationCode, |
| | | Grade = 0, |
| | | PalletCode = item.PalletCode, |
| | | SourceIsPickPlace = item.SerialNumber == locationInfo.MaxQty, |
| | | NextAddress = "1005", |
| | | Roadway = "SC01", |
| | | SourceAddress = item.LocationCode, |
| | | TargetAddress = "1005", |
| | | TaskState = OutTaskStatusEnum.OutNew.ObjToInt(), |
| | | TaskType = TaskTypeEnum.OutQuality.ObjToInt(), |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)) |
| | | }; |
| | | tasks.Add(task); |
| | | #region æ·»å åºåºè¯¦æ
|
| | | Dt_OutStockLockInfo outStockLockInfo = new Dt_OutStockLockInfo() |
| | | { |
| | | PalletCode = item.PalletCode, |
| | | AssignQuantity = item.OutboundQuantity, |
| | | MaterielCode = item.MaterielCode, |
| | | BatchNo = item.BatchNo, |
| | | LocationCode = item.LocationCode, |
| | | MaterielName = item.MaterielName, |
| | | OrderDetailId = orderDetail.Id, |
| | | OrderNo = outboundOrder.OrderNo, |
| | | OrderType = outboundOrder.OrderType, |
| | | OriginalQuantity = item.StockQuantity, |
| | | Status = OutLockStockStatusEnum.åºåºä¸.ObjToInt(), |
| | | StockId = item.Id, |
| | | TaskNum = task.TaskNum, |
| | | OrderQuantity = orderDetail.OrderQuantity |
| | | }; |
| | | OutStockLockInfos.Add(outStockLockInfo); |
| | | #endregion |
| | | } |
| | | |
| | | #region çæè´¨æ£å
¥åºå |
| | | Dt_InboundOrderDetail inboundOrderDetail = new Dt_InboundOrderDetail() |
| | | { |
| | | BatchNo = batchNo, |
| | | Creater = "System", |
| | | OrderDetailStatus = OrderDetailStatusEnum.New.ObjToInt(), |
| | | MaterielName = orderDetail.MaterielName, |
| | | MaterielCode = orderDetail.MaterielCode, |
| | | OrderQuantity = orderDetail.OrderQuantity |
| | | }; |
| | | Dt_InboundOrder inboundOrder = new Dt_InboundOrder() |
| | | { |
| | | CreateType = CreateType.CreateInSystem.ObjToInt(), |
| | | OrderStatus = InboundStatusEnum.æªå¼å§.ObjToInt(), |
| | | OrderNo = batchNo, |
| | | OrderType = InOrderTypeEnum.Quality.ObjToInt(), |
| | | Creater = "System", |
| | | Details = new List<Dt_InboundOrderDetail>() { inboundOrderDetail } |
| | | }; |
| | | #endregion |
| | | #region å¤çåºåååºåæ¹æ¬¡ä¿¡æ¯ |
| | | inventory_Batch.StockQuantity = Convert.ToInt32(inventory_Batch.StockQuantity - orderDetail.OrderQuantity); |
| | | |
| | | inventory_Batch.BoxQuantity = inventory_Batch.StockQuantity / 8; |
| | | if (inventory_Batch.StockQuantity % 8 > 0) inventory_Batch.BoxQuantity++; |
| | | inventory_Batch.OutboundQuantity = Convert.ToInt32(inventory_Batch.OutboundQuantity + orderDetail.OrderQuantity); |
| | | #endregion |
| | | #region äºå¡å¤ç |
| | | Db.Ado.BeginTran(); |
| | | BaseDal.AddData(tasks); |
| | | _outboundService.OutboundOrderService.Repository.Db.InsertNav(outboundOrder).Include(x => x.Details).ExecuteCommand(); |
| | | _outboundService.OutboundStockLockInfoService.Repository.AddData(OutStockLockInfos); |
| | | _inboundService.InbounOrderService.Repository.Db.InsertNav(inboundOrder).Include(x => x.Details).ExecuteCommand(); |
| | | _inventoryInfoRepository.UpdateData(_InventoryInfos); |
| | | _inventoryBatchRepository.UpdateData(inventory_Batch); |
| | | #region ä¸åä»»å¡ç»WCS |
| | | List<WMSTaskDTO> wMSTaskDTOs = _mapper.Map<List<WMSTaskDTO>>(tasks); |
| | | var ResultData = HttpHelper.PostAsync(WCSInterfaceAddress.ReceiveTask, wMSTaskDTOs.ToJson(), headers: new Dictionary<string, string>()); |
| | | if (ResultData.Result == null) throw new Exception($"åWCSä¸ååºåºä»»å¡è¶
æ¶"); |
| | | WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(ResultData.Result); |
| | | if (content == null) throw new Exception($"ä¸ååºåºä»»å¡WCSæ ååº"); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | #endregion |
| | | Db.Ado.CommitTran(); |
| | | #endregion |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Db.Ado.RollbackTran(); |
| | | webResponse.Error(ex.Message); |
| | | } |
| | | return webResponse; |
| | | } |
| | | public WebResponseContent ModifyQty(string palletCode, int qty) |
| | | { |
| | | WebResponseContent webResponseContent = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_InventoryInfo inventoryInfo = _inventoryInfoRepository.QueryFirst(x => x.PalletCode == palletCode); |
| | | if (inventoryInfo == null) throw new Exception("æªæ¾å°æçä¿¡æ¯"); |
| | | if (inventoryInfo.StockStatus != StockStatusEmun.ç»çæå.ObjToInt() && inventoryInfo.StockStatus != StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt() && inventoryInfo.StockStatus != StockStatusEmun.å
¥åºä¸.ObjToInt()) |
| | | throw new Exception($"æçéå
¥åºä¸,ä¸å¯ä¿®æ¹æ°é"); |
| | | Dt_InboundOrderDetail orderDetail = _inboundService.InboundOrderDetailService.Repository.QueryFirst(x => x.BatchNo == inventoryInfo.BatchNo); |
| | | var StockQty = inventoryInfo.StockQuantity; |
| | | inventoryInfo.StockQuantity = qty; |
| | | inventoryInfo.BoxQuantity = qty % 8 > 0 ? qty / 8 + 1 : qty / 8; |
| | | if (orderDetail != null) |
| | | { |
| | | orderDetail.ReceiptQuantity -= StockQty - qty; |
| | | _inboundService.InboundOrderDetailService.Repository.UpdateData(orderDetail); |
| | | } |
| | | _inventoryInfoRepository.UpdateData(inventoryInfo); |
| | | return webResponseContent.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return webResponseContent.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent ModifyBarcode(string barcode, string newBarcode) |
| | | { |
| | | WebResponseContent webResponseContent = new WebResponseContent(); |
| | |
| | | if (dt_Task == null) throw new Exception($"æªæ¾å°æçå·ä¸ºã{barcode}ãçä»»å¡ï¼"); |
| | | if (TaskEnumHelper.GetTaskTypeGroup(dt_Task.TaskType) != TaskTypeGroup.InboundGroup) |
| | | throw new Exception($"åªå¯ä¿®æ¹å
¥åºä»»å¡,å¦éä¿®æ¹å
¶ä»ä»»å¡ç±»å请è系管çåï¼"); |
| | | var stock = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == newBarcode); |
| | | if (stock != null) throw new Exception($"æçå·ã{newBarcode}ãå·²åå¨åºåä¿¡æ¯ï¼"); |
| | | stock = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == barcode); |
| | | if (stock == null) throw new Exception($"æçå·ã{barcode}ãæªæ¾å°åºåä¿¡æ¯ï¼"); |
| | | stock.PalletCode = newBarcode; |
| | | Dt_InventoryInfo inventoryInfo = _inventoryInfoRepository.QueryFirst(x => x.PalletCode == newBarcode); |
| | | if (inventoryInfo != null) throw new Exception($"æçå·ã{newBarcode}ãå·²åå¨åºåä¿¡æ¯ï¼"); |
| | | inventoryInfo = _inventoryInfoRepository.QueryFirst(x => x.PalletCode == barcode); |
| | | if (inventoryInfo == null) throw new Exception($"æçå·ã{barcode}ãæªæ¾å°åºåä¿¡æ¯ï¼"); |
| | | inventoryInfo.PalletCode = newBarcode; |
| | | |
| | | //var stock = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == newBarcode); |
| | | //if (stock != null) throw new Exception($"æçå·ã{newBarcode}ãå·²åå¨åºåä¿¡æ¯ï¼"); |
| | | //stock = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == barcode); |
| | | //if (stock == null) throw new Exception($"æçå·ã{barcode}ãæªæ¾å°åºåä¿¡æ¯ï¼"); |
| | | //stock.PalletCode = newBarcode; |
| | | dt_Task.PalletCode = newBarcode; |
| | | Db.Ado.BeginTran(); |
| | | WMSTaskDTO wMSTaskDTOs = _mapper.Map<WMSTaskDTO>(dt_Task); |
| | |
| | | if (content == null) throw new Exception($"WCSæ ååº"); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | BaseDal.UpdateData(dt_Task); |
| | | _stockService.StockInfoService.Repository.UpdateData(stock); |
| | | //_stockService.StockInfoService.Repository.UpdateData(stock); |
| | | _inventoryInfoRepository.UpdateData(inventoryInfo); |
| | | Db.Ado.CommitTran(); |
| | | webResponseContent.OK(); |
| | | } |
| | |
| | | //if (WMStask.TaskState != nextStatus) return WebResponseContent.Instance.Error($"该任å¡ç¶ææè¯¯,ä»»å¡å·:ã{task.TaskNum}ã,ä»»å¡ç¶æ:ã{task.TaskState}ã"); |
| | | //task.TaskState = nextStatus; |
| | | task.TaskState = TaskInStatusEnum.InFinish.ObjToInt(); |
| | | content = UpdateTaskStatusInFinish(task); |
| | | content = NewUpdateTaskStatusInFinish(task); |
| | | } |
| | | else if (TaskEnumHelper.GetTaskTypeGroup(task.TaskType) == TaskTypeGroup.OutbondGroup) |
| | | { |
| | |
| | | switch (task.TaskState) |
| | | { |
| | | case (int)TaskOutStatusEnum.SC_OutFinish://æ´æ°è´§ä½åºåä¿¡æ¯ |
| | | UpdateTaskStatusSC_OutFinish(task); |
| | | content = NewUpdateTaskStatusSC_OutFinish(task); |
| | | break; |
| | | case (int)TaskOutStatusEnum.AGV_OutFinish: |
| | | { |
| | | task.CurrentAddress = WMStask.CurrentAddress; |
| | | task.TargetAddress = WMStask.TargetAddress; |
| | | task.NextAddress = string.Empty; |
| | | UpdateData(task); |
| | | content = UpdateData(task); |
| | | } |
| | | break; |
| | | case (int)TaskOutStatusEnum.OutFinish: |
| | | UpdateTaskStatusOutFinish(task); |
| | | content = UpdateTaskStatusOutFinish(task); |
| | | break; |
| | | default: |
| | | UpdateData(task); |
| | | content = UpdateData(task); |
| | | break; |
| | | } |
| | | } |
| | |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | public WebResponseContent NewUpdateTaskStatusSC_OutFinish(Dt_Task task) |
| | | { |
| | | try |
| | | { |
| | | Dt_Inventory_Batch? inventory_Batch = null; |
| | | Dt_OutboundOrderDetail? orderDetail = null; |
| | | Dt_OutboundOrder? outboundOrder = null; |
| | | Dt_InventoryInfo inventoryInfo = _inventoryInfoRepository.QueryFirst(x => x.PalletCode == task.PalletCode); |
| | | if (inventoryInfo != null) |
| | | { |
| | | inventory_Batch = _inventoryBatchRepository.QueryFirst(x => x.BatchNo == inventoryInfo.BatchNo); |
| | | orderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.BatchNo == inventoryInfo.BatchNo); |
| | | } |
| | | Dt_LocationInfo Sourcelocation = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | |
| | | Dt_OutStockLockInfo outStockLockInfo = _outboundService.OutboundStockLockInfoService.Repository.QueryFirst(x => x.TaskNum == task.TaskNum && task.PalletCode == x.PalletCode); |
| | | Db.Ado.BeginTran(); |
| | | if (inventoryInfo != null) _inventoryInfoRepository.DeleteData(inventoryInfo); |
| | | |
| | | if (Sourcelocation != null) |
| | | { |
| | | if (BaseDal.QueryFirst(x => x.SourceAddress == task.SourceAddress && x.TaskState < TaskOutStatusEnum.SC_OutFinish.ObjToInt()) == null) |
| | | Sourcelocation.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | Sourcelocation.CurrentQty--; |
| | | if (Sourcelocation.CurrentQty <= 0) |
| | | { |
| | | Sourcelocation.CurrentQty = 0; |
| | | Sourcelocation.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | Sourcelocation.EnableStatus = EnableStatusEnum.Normal.ObjToInt(); |
| | | } |
| | | _basicService.LocationInfoService.Repository.UpdateData(Sourcelocation); |
| | | } |
| | | if (inventory_Batch != null) |
| | | { |
| | | //inventory_Batch.StockQuantity -= inventoryInfo.StockQuantity; |
| | | inventory_Batch.OutboundQuantity -= inventoryInfo.StockQuantity; |
| | | if (inventory_Batch.StockQuantity == 0 && inventory_Batch.OutboundQuantity == 0) |
| | | _inventoryBatchRepository.DeleteData(inventory_Batch); |
| | | else _inventoryBatchRepository.UpdateData(inventory_Batch); |
| | | } |
| | | if (orderDetail != null) |
| | | { |
| | | if (outStockLockInfo != null) |
| | | { |
| | | outStockLockInfo.OrderDetailId = orderDetail.OrderId; |
| | | _outboundService.OutboundStockLockInfoService.Repository.UpdateData(outStockLockInfo); |
| | | } |
| | | orderDetail.OverOutQuantity += inventoryInfo.StockQuantity; |
| | | if (orderDetail.OverOutQuantity == orderDetail.OrderQuantity) |
| | | { |
| | | outboundOrder = _outboundService.OutboundOrderService.Repository.QueryFirst(x => x.Id == orderDetail.OrderId); |
| | | if (outboundOrder != null) |
| | | { |
| | | outboundOrder.OrderStatus = OutboundStatusEnum.åºåºå®æ.ObjToInt(); |
| | | _outboundService.OutboundOrderService.Repository.DeleteAndMoveIntoHty(outboundOrder, OperateType.èªå¨å®æ); |
| | | } |
| | | orderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt(); |
| | | _outboundService.OutboundOrderDetailService.Repository.DeleteAndMoveIntoHty(orderDetail, OperateType.èªå¨å®æ); |
| | | } |
| | | else |
| | | _outboundService.OutboundOrderDetailService.Repository.UpdateData(orderDetail); |
| | | } |
| | | task.CurrentAddress = "1005"; |
| | | task.TargetAddress = "1008"; |
| | | task.NextAddress = "1008"; |
| | | UpdateData(task); |
| | | Db.Ado.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Db.Ado.RollbackTran(); |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// ä¿®æ¹ä»»å¡ç¶æä¸ºå åæºåºåºå®æ |
| | |
| | | try |
| | | { |
| | | Db.Ado.BeginTran(); |
| | | Dt_OutStockLockInfo? outStockLockInfo = _outboundService.OutboundStockLockInfoService.Repository.QueryFirst(x => x.TaskNum == task.TaskNum); |
| | | Dt_OutStockLockInfo? outStockLockInfo = _outboundService.OutboundStockLockInfoService.Repository.QueryFirst(x => x.TaskNum == task.TaskNum && x.PalletCode == task.PalletCode); |
| | | Dt_OutboundOrder? outboundOrder = null; |
| | | Dt_OutboundOrderDetail? outboundOrderDetail = null; |
| | | int overCount = 0; |
| | |
| | | /// <summary> |
| | | /// æ´æ°å
¥åºä»»å¡ç¶æå®æ |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent NewUpdateTaskStatusInFinish(Dt_Task task) |
| | | { |
| | | WebResponseContent content = new WebResponseContent().OK(); |
| | | try |
| | | { |
| | | Dt_InventoryInfo inventoryInfo = _inventoryInfoRepository.QueryFirst(x => x.PalletCode == task.PalletCode); |
| | | if (inventoryInfo == null) return content.Error("æªæ¾å°æçä¿¡æ¯"); |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);//è´§ä½ |
| | | if (locationInfo == null) return content.Error("æªæ¾å°è´§ä½ä¿¡æ¯"); |
| | | if (task.TaskType == TaskTypeEnum.PalletInbound.ObjToInt()) |
| | | { |
| | | return content; |
| | | } |
| | | inventoryInfo.InDate = DateTime.Now; |
| | | inventoryInfo.StockStatus = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | if (BaseDal.QueryFirst(x => x.TargetAddress == locationInfo.LocationCode && x.TaskNum != task.TaskNum) == null) |
| | | locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | task.CurrentAddress = task.NextAddress; |
| | | task.NextAddress = string.Empty; |
| | | |
| | | Dt_Inventory_Batch inventory_Batch = _inventoryBatchRepository.QueryFirst(x => x.BatchNo == inventoryInfo.BatchNo); |
| | | Db.Ado.BeginTran(); |
| | | if (inventory_Batch == null) |
| | | { |
| | | inventory_Batch = new Dt_Inventory_Batch() |
| | | { |
| | | BatchNo = inventoryInfo.BatchNo, |
| | | BoxQuantity = inventoryInfo.BoxQuantity, |
| | | MaterielCode = inventoryInfo.MaterielCode, |
| | | MaterielName = inventoryInfo.MaterielName, |
| | | OutboundQuantity = inventoryInfo.OutboundQuantity, |
| | | StockQuantity = inventoryInfo.StockQuantity, |
| | | ProductionDate = inventoryInfo.ProductionDate, |
| | | ProductStatus = inventoryInfo.ProductStatus, |
| | | ShelfLife = inventoryInfo.ShelfLife, |
| | | ValidityPeriod = inventoryInfo.ValidityPeriod, |
| | | Creater = "System" |
| | | }; |
| | | _inventoryBatchRepository.AddData(inventory_Batch); |
| | | } |
| | | else |
| | | { |
| | | inventory_Batch.BoxQuantity = inventory_Batch.BoxQuantity + inventoryInfo.BoxQuantity; |
| | | inventory_Batch.StockQuantity = inventory_Batch.StockQuantity + inventoryInfo.StockQuantity; |
| | | _inventoryBatchRepository.UpdateData(inventory_Batch); |
| | | } |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | _stockService.InventoryInfoService.Repository.UpdateData(inventoryInfo); |
| | | Db.Ado.CommitTran(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Db.Ado.RollbackTran(); |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// æ´æ°å
¥åºä»»å¡ç¶æå®æ |
| | | /// </summary> |
| | | /// <param name="WMStask"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent UpdateTaskStatusInFinish(Dt_Task task) |