| | |
| | | _task_HtyService = task_HtyService; |
| | | } |
| | | |
| | | public async Task TaskStatusChange(string taskNum,TaskStatusEnum taskStatusEnum) |
| | | public async Task TaskStatusChange(string taskNum, TaskStatusEnum taskStatusEnum) |
| | | { |
| | | if (int.TryParse(taskNum, out var newTaskNum)) |
| | | { |
| | | await Db.Updateable<Dt_Task>().SetColumns(it => new Dt_Task { |
| | | TaskStatus = taskStatusEnum.ObjToInt() |
| | | }) |
| | | await Db.Updateable<Dt_Task>().SetColumns(it => new Dt_Task |
| | | { |
| | | TaskStatus = taskStatusEnum.ObjToInt() |
| | | }) |
| | | .Where(it => it.TaskNum == newTaskNum) |
| | | .ExecuteCommandAsync(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | await Db.Deleteable(task).ExecuteCommandAsync(); |
| | | } |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum); |
| | | |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, WIDESEA_Common.StockEnum.StockChangeType.MaterielGroup); |
| | | try |
| | | { |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum); |
| | | |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, WIDESEA_Common.StockEnum.StockChangeType.MaterielGroup); |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | _logger.LogInformation($"InboundTaskCompleted AddLocationStatusChangeRecord : {ex.Message} " ); |
| | | } |
| | | try |
| | | { |
| | | foreach (var inboundOrder in inboundOrders) |
| | | { |
| | |
| | | var feedbackresult = await _invokeMESService.FeedbackInbound(feedmodel); |
| | | if (feedbackresult != null && feedbackresult.code == 200) |
| | | { |
| | | _inboundOrderService.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 }) |
| | | _inboundOrderService.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1, Remark = "" }) |
| | | .Where(it => it.Id == inboundOrder.Id).ExecuteCommand(); |
| | | _inboundOrderDetailService.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 }) |
| | | .Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand(); |
| | | } |
| | | else |
| | | { |
| | | _inboundOrderService.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 2, Remark = feedbackresult.message }) |
| | | .Where(it => it.Id == inboundOrder.Id).ExecuteCommand(); |
| | | _inboundOrderDetailService.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 2 }) |
| | | .Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand(); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | await Db.Deleteable(task).ExecuteCommandAsync(); |
| | | } |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforelocationStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum); |
| | | |
| | | try |
| | | { |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforelocationStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum); |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | _logger.LogInformation($"InEmptyTaskCompleted AddLocationStatusChangeRecord : {ex.Message} "); |
| | | } |
| | | |
| | | if (outboundOrder != null) |
| | | { |
| | |
| | | _logger.LogInformation($"TaskService InPickTaskCompleted: {task.TaskNum}"); |
| | | |
| | | try |
| | | { |
| | | { |
| | | // æ¥åºå |
| | | Dt_StockInfo stockInfo = await _stockRepository.Db.Queryable<Dt_StockInfo>() |
| | | .Includes(x => x.Details) |
| | |
| | | // æ´æ°åºåºéå®è®°å½ç¶æä¸ºååºå®æ |
| | | foreach (var lockInfo in returnLocks) |
| | | { |
| | | lockInfo.Status = (int)OutLockStockStatusEnum.å·²ååº; |
| | | lockInfo.Status = (int)OutLockStockStatusEnum.å·²ååº; |
| | | } |
| | | |
| | | if (returnLocks.Any()) |
| | |
| | | { |
| | | await Db.Deleteable(task).ExecuteCommandAsync(); |
| | | } |
| | | // è®°å½è´§ä½ç¶æåæ´ |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord( |
| | | locationInfo, |
| | | beforelocationStatus, |
| | | StockChangeType.Inbound.ObjToInt(), |
| | | "", |
| | | task.TaskNum |
| | | ); |
| | | |
| | | await RecalculateOrderStatus(task.OrderNo); |
| | | try |
| | | { |
| | | // è®°å½è´§ä½ç¶æåæ´ |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord( |
| | | locationInfo, |
| | | beforelocationStatus, |
| | | StockChangeType.Inbound.ObjToInt(), |
| | | "", |
| | | task.TaskNum |
| | | ); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _logger.LogInformation($"InPickTaskCompleted AddLocationStatusChangeRecord : {ex.Message} "); |
| | | } |
| | | |
| | | |
| | | _logger.LogInformation($"æçååºå®æå¤çæå - ä»»å¡å·: {task.TaskNum}, æç: {task.PalletCode}, 订å: {task.OrderNo}"); |
| | | _ = Task.Run(async () => |
| | | { |
| | |
| | | await _outboundOrderService.Db.Updateable<Dt_OutboundOrder>() |
| | | .SetColumns(x => new Dt_OutboundOrder |
| | | { |
| | | OrderStatus = newStatus, |
| | | OrderStatus = newStatus, |
| | | }) |
| | | .Where(x => x.OrderNo == orderNo) |
| | | .ExecuteCommandAsync(); |
| | |
| | | await _outboundOrderService.Db.Updateable<Dt_OutboundOrder>() |
| | | .SetColumns(x => new Dt_OutboundOrder |
| | | { |
| | | ReturnToMESStatus = 1, |
| | | ReturnToMESStatus = 1, |
| | | }).Where(x => x.OrderNo == orderNo).ExecuteCommandAsync(); |
| | | } |
| | | } |
| | |
| | | .ExecuteCommandAsync(); |
| | | |
| | | await _outboundOrderService.Db.Updateable<Dt_OutboundOrder>() |
| | | .SetColumns(x => x.ReturnToMESStatus == 1) |
| | | .SetColumns(it => new Dt_OutboundOrder { ReturnToMESStatus = 2, Remark = "" }) |
| | | .Where(x => x.OrderNo == orderNo) |
| | | .ExecuteCommandAsync(); |
| | | } |
| | | else |
| | | { |
| | | await _outboundOrderDetailService.Db.Updateable<Dt_OutboundOrderDetail>() |
| | | .SetColumns(x => x.ReturnToMESStatus == 2) |
| | | .Where(x => x.OrderId == outboundOrder.Id) |
| | | .ExecuteCommandAsync(); |
| | | |
| | | await _outboundOrderService.Db.Updateable<Dt_OutboundOrder>() |
| | | .SetColumns(it => new Dt_OutboundOrder { ReturnToMESStatus = 2, Remark = result.message }) |
| | | .Where(x => x.OrderNo == orderNo) |
| | | .ExecuteCommandAsync(); |
| | | } |
| | | } |
| | |
| | | |
| | | var stockresult = _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | if (!stockresult) |
| | | { |
| | | { |
| | | _stockRepository.Db.Deleteable(stockInfo).ExecuteCommand(); |
| | | } |
| | | _stockService.StockInfoService.DeleteData(stockInfo); |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | |
| | | try |
| | | { |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo?.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _logger.LogError($"TaskService OutEmptyTaskCompleted AddLocationStatusChangeRecord: {ex.Message} "); |
| | | } |
| | | return await Task.FromResult(WebResponseContent.Instance.OK()); |
| | | |
| | | } |