| | |
| | | private readonly ISys_ConfigService _configService; |
| | | private readonly IDt_OrderOutDetailsRepository _orderOutDetailsRepository; |
| | | private readonly IDt_WareAreaInfoRepository _wareAreaInfoRepository; |
| | | private readonly IDt_InventoryRecordRepository _inventoryRecordRepository; |
| | | |
| | | public Dt_TaskService(IDt_TaskRepository BaseDal, |
| | | IUnitOfWorkManage unitOfWorkManage, |
| | |
| | | IDt_StationManagerRepository stationManagerRepository, |
| | | ISys_ConfigService configService, |
| | | IDt_OrderOutDetailsRepository orderOutDetailsRepository, |
| | | IDt_WareAreaInfoRepository wareAreaInfoRepository) : base(BaseDal) |
| | | IDt_WareAreaInfoRepository wareAreaInfoRepository, |
| | | IDt_InventoryRecordRepository inventoryRecordRepository) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _stockInfoRepository = stockInfoRepository; |
| | |
| | | _configService = configService; |
| | | _orderOutDetailsRepository = orderOutDetailsRepository; |
| | | _wareAreaInfoRepository = wareAreaInfoRepository; |
| | | _inventoryRecordRepository = inventoryRecordRepository; |
| | | } |
| | | |
| | | #region 澶栭儴鎺ュ彛鏂规硶 |
| | |
| | | return content.Error("璇ユ墭鐩樺簱瀛樺凡鍦ㄥ嚭搴撶紦瀛樺尯"); |
| | | } |
| | | |
| | | Dt_Task taskNew = await RequestOutboundTaskAsync(new RequestTaskDto { PalletCode = palletCode, AreaId = 2, Position = stcok.LocationCode, TaskType = (int)TaskOutboundTypeEnum.Outbound }); |
| | | Dt_Task taskNew = await RequestOutboundTaskAsync(new RequestTaskDto { PalletCode = palletCode, AreaId = 2, Position = stcok.LocationCode, TaskType = (int)TaskOutboundTypeEnum.Outbound }); |
| | | List<Dt_InventoryRecord> records = new List<Dt_InventoryRecord>(); |
| | | stcok.StockInfoDetails.ForEach(x => |
| | | { |
| | | records.Add(new Dt_InventoryRecord() |
| | | { |
| | | PalletCode = stcok.PalletCode, |
| | | MaterielCode = x.MaterielCode, |
| | | MaterielName = x.MaterielName, |
| | | Quantity = x.Quantity, |
| | | Status = (int)InventoryStatus.Normal, |
| | | Remark = remark, |
| | | }); |
| | | }); |
| | | |
| | | var taskDto = CreateListTaskDTO(taskNew); |
| | | var result = GetlcoationState(taskNew, (int)StatusChangeTypeEnum.AutomaticOutbound); |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | | { |
| | | BaseDal.AddData(taskNew); |
| | | _stockInfoRepository.UpdateData(stcok); |
| | | await BaseDal.AddDataAsync(taskNew); |
| | | await _inventoryRecordRepository.AddDataAsync(records); |
| | | await _stockInfoRepository.UpdateDataAsync(stcok); |
| | | await _locationStatusChangeRecordRepository.AddDataAsync(result.Item1); |
| | | await _locationRepository.UpdateDataAsync(result.Item2); |
| | | }); |