| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | if (task.TaskState.GetTaskStateGroup() == TaskStateGroup.CarryGroup) |
| | | { |
| | | var result1 = UpdateLocationStatus(task.SourceAddress, LocationEnum.Free, task.TaskNum.Value, StatusChangeTypeEnum.AutomaticOutbound); |
| | | await _locationStatusChangeRecordRepository.AddDataAsync(result1.Item1); |
| | | await _locationRepository.UpdateDataAsync(result1.Item2); |
| | | } |
| | | |
| | | task.TaskState = (int)TaskOutStatusEnum.OutFinish; |
| | | var taskHty = task.Adapt<Dt_Task_Hty>(); |
| | | taskHty.FinishTime = DateTime.Now; |
| | |
| | | stock.ModifyDate = DateTime.Now; |
| | | stock.LocationCode = task.TargetAddress; |
| | | var result2 = UpdateLocationStatus(task.TargetAddress, LocationEnum.InStock, task.TaskNum.Value, StatusChangeTypeEnum.AutomaticOutbound); |
| | | |
| | | DtStockInfo_Hty stockInfo_Hty = stock.Adapt<DtStockInfo_Hty>(); |
| | | var orderDetails = _orderOutDetailsRepository.QueryData(x => x.PalletCode == task.PalletCode); |
| | | List<Dt_OrderOutDetails_Hty> orderdetailshtys = new List<Dt_OrderOutDetails_Hty>(); |
| | | |
| | | orderDetails.ForEach(item => |
| | | { |
| | | orderdetailshtys.Add(item.Adapt<Dt_OrderOutDetails_Hty>()); |
| | | }); |
| | | { |
| | | orderdetailshtys.Add(item.Adapt<Dt_OrderOutDetails_Hty>()); |
| | | }); |
| | | |
| | | await ERPAllocateOut(stock); |
| | | |
| | |
| | | boxingInfo.BoxingInfoDetails = mergedDetails; |
| | | } |
| | | |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | | { |
| | | //await _unitOfWorkManage.UseTranAsync(async () => |
| | | //{ |
| | | _unitOfWorkManage.BeginTran(); |
| | | await DeleteStockInfoAsync(stock.Id); |
| | | _boxingInfoRepository.UpdateDataNav(boxingInfo); |
| | | await DeleteStockInfoDetailsAsync(stock.StockInfoDetails); |
| | |
| | | |
| | | await DeleteTaskAsync(task.TaskId); |
| | | await AddTaskHtyAsync(taskHty); |
| | | }); |
| | | _unitOfWorkManage.CommitTran(); |
| | | //}); |
| | | content.OK("åºåºå®æ"); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | task.ErrorMessage = ex.Message; |
| | | await BaseDal.UpdateDataAsync(task); |
| | | return content.Error(ex.Message); |
| | |
| | | { |
| | | return content.Error("æªæ¾å°ç»çæ°æ®"); |
| | | } |
| | | await ERPAllocate(boxinfo); |
| | | |
| | | if (task.TaskState.GetTaskStateGroup() == TaskStateGroup.CarryGroup) |
| | | { |
| | | var result1 = UpdateLocationStatus(task.SourceAddress, LocationEnum.Free, task.TaskNum.Value, StatusChangeTypeEnum.AutomaticInbound); |
| | | await _locationStatusChangeRecordRepository.AddDataAsync(result1.Item1); |
| | | await _locationRepository.UpdateDataAsync(result1.Item2); |
| | | } |
| | | |
| | | |
| | | |
| | | var stock = CreateStock(boxinfo, task); |
| | | |
| | |
| | | |
| | | var result2 = UpdateLocationStatus(task.TargetAddress, LocationEnum.InStock, task.TaskNum.Value, StatusChangeTypeEnum.AutomaticInbound); |
| | | |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | | { |
| | | await _stockInfoRepository.AddDataNavAsync(stock); |
| | | //await _unitOfWorkManage.UseTranAsync(async () => |
| | | //{ |
| | | _unitOfWorkManage.BeginTran(); |
| | | await _stockInfoRepository.AddDataNavAsync(stock); |
| | | await DeleteTaskAsync(task.TaskId); |
| | | await AddTaskHtyAsync(taskHty); |
| | | await _locationStatusChangeRecordRepository.AddDataAsync(result2.Item1); |
| | | await _locationRepository.UpdateDataAsync(result2.Item2); |
| | | }); |
| | | _unitOfWorkManage.CommitTran(); |
| | | //}); |
| | | await ERPAllocate(boxinfo); |
| | | content.OK("å
¥åºå®æ"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | task.ErrorMessage = ex.Message; |
| | | await BaseDal.UpdateDataAsync(task); |
| | | return content.Error(ex.Message); |