| | |
| | | using System.Reflection; |
| | | using System.Reflection.Metadata; |
| | | using System.Security.Policy; |
| | | using System.Text; |
| | | using System.Text.RegularExpressions; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Cache; |
| | |
| | | Quantity = g.Sum(item => item.Quantity), |
| | | }) |
| | | .ToList(); |
| | | return new DtStockInfo() |
| | | { |
| | | PalletCode = task.PalletCode, |
| | | LocationCode = task.TargetAddress, |
| | | CreateDate = DateTime.Now, |
| | | Creater = "system", |
| | | IsFullExit = boxingInfo.IsFullExit, |
| | | StockInfoDetails = mergedDetails, |
| | | StockStatus = (int)StockStateEmun.å·²å
¥åº |
| | | }; |
| | | return new DtStockInfo() |
| | | { |
| | | PalletCode = task.PalletCode, |
| | | LocationCode = task.TargetAddress, |
| | | CreateDate = DateTime.Now, |
| | | Creater = "system", |
| | | IsFullExit = boxingInfo.IsFullExit, |
| | | StockInfoDetails = mergedDetails, |
| | | StockStatus = (int)StockStateEmun.å·²å
¥åº |
| | | }; |
| | | } |
| | | #endregion å
¥åºä»»å¡å®æ |
| | | |
| | |
| | | case 4: |
| | | case 5: |
| | | case 6: |
| | | case 7: |
| | | taskNew = InboundAGVCacheArea(taskDto, StartAddress, area); |
| | | break; |
| | | default: |
| | |
| | | |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | | { |
| | | if (taskDto.AreaId == 3 || taskDto.AreaId == 7) |
| | | { |
| | | var result2 = UpdateLocationStatus(taskNew.TargetAddress, LocationEnum.Lock, taskNew.TaskNum.Value, (int)StatusChangeTypeEnum.AutomaticInbound); |
| | | await _locationStatusChangeRecordRepository.AddDataAsync(result2.Item1); |
| | | await _locationRepository.UpdateDataAsync(result2.Item2); |
| | | } |
| | | await _locationStatusChangeRecordRepository.AddDataAsync(result.Item1); |
| | | await _locationRepository.UpdateDataAsync(result.Item2); |
| | | BaseDal.AddData(taskNew); |
| | |
| | | }); |
| | | |
| | | var taskDto = CreateListTaskDTO(taskNew); |
| | | var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound); |
| | | var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound, location); |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | | { |
| | | await BaseDal.AddDataAsync(taskNew); |
| | |
| | | stock.StockInfoDetails = details; |
| | | |
| | | var taskDto = CreateListTaskDTO(taskNew); |
| | | var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound); |
| | | var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound, stock.LocationInfo); |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | | { |
| | | await BaseDal.AddDataAsync(taskNew); |
| | |
| | | stock.StockInfoDetails = details; |
| | | |
| | | var taskDto = CreateListTaskDTO(taskNew); |
| | | var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound); |
| | | var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound, stock.LocationInfo); |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | | { |
| | | await BaseDal.AddDataAsync(taskNew); |
| | |
| | | } |
| | | } |
| | | |
| | | public (List<DtLocationStatusChangeRecord>,List<DtLocationInfo>) GetlcoationState(Dt_Task task, StatusChangeTypeEnum StatusChangeTypeEnum) |
| | | public (List<DtLocationStatusChangeRecord>,List<DtLocationInfo>) GetlcoationState(Dt_Task task, StatusChangeTypeEnum StatusChangeTypeEnum, DtLocationInfo location) |
| | | { |
| | | List<DtLocationStatusChangeRecord> locationStatusChangeRecords = new List<DtLocationStatusChangeRecord>(); |
| | | List<DtLocationInfo> locations = new List<DtLocationInfo>(); |
| | | var result = UpdateLocationStatus(task.SourceAddress, LocationEnum.InStockDisable, task.TaskNum.Value, (int)StatusChangeTypeEnum); |
| | | locationStatusChangeRecords.AddRange(result.Item1); |
| | | locations.AddRange(result.Item2); |
| | | |
| | | if(location.AreaId ==3|| location.AreaId == 7) |
| | | { |
| | | var result2 = UpdateLocationStatus(task.TargetAddress, LocationEnum.Lock, task.TaskNum.Value, (int)StatusChangeTypeEnum); |
| | | locationStatusChangeRecords.AddRange(result2.Item1); |
| | | locations.AddRange(result2.Item2); |
| | | } |
| | | |
| | | return (locationStatusChangeRecords,locations); |
| | | } |
| | |
| | | case 4: |
| | | case 5: |
| | | case 6: |
| | | case 7: |
| | | return OutboundAGVCacheArea(taskDto, StartAddress, area); |
| | | default: |
| | | throw new Exception("è¯·éæ©æ£ç¡®çåºåä¿¡æ¯"); |
| | |
| | | switch (location.AreaId) |
| | | { |
| | | case 2: |
| | | case 7: |
| | | locationInfos = _locationRepository.QueryData(x => x.Row == location.Row && x.Column > location.Column && x.Remark == location.Remark && x.AreaId == location.AreaId); |
| | | break; |
| | | case 5: |
| | |
| | | case 4: |
| | | case 5: |
| | | case 6: |
| | | case 7: |
| | | locationInfo = await GetAGVEmptyCacheLocation(areaInfo.AreaID, location); |
| | | break; |
| | | default: |
| | |
| | | return (changeRecordDto, locations); |
| | | } |
| | | |
| | | public (DtLocationStatusChangeRecord, DtLocationInfo) UpdateEndLocationStatus(string locationCode, LocationEnum locationStatus, int taskNum, StatusChangeTypeEnum StatusChangeType) |
| | | { |
| | | var location = _locationRepository.QueryFirst(x => x.LocationCode == locationCode); |
| | | |
| | | if (location != null && (location.AreaId == 3 || location.AreaId == 7)) |
| | | { |
| | | int Beforelocation = location.LocationStatus; |
| | | |
| | | location.LocationStatus = (int)locationStatus; |
| | | |
| | | DtLocationStatusChangeRecord dtLocationStatusChangeRecord = new DtLocationStatusChangeRecord() |
| | | { |
| | | ChangeType = (int)StatusChangeType, |
| | | LocationCode = locationCode, |
| | | LocationId = location.Id, |
| | | Creater = "System", |
| | | TaskNum = taskNum, |
| | | AfterStatus = location.LocationStatus, |
| | | BeforeStatus = Beforelocation, |
| | | }; |
| | | |
| | | return (dtLocationStatusChangeRecord, location); |
| | | } |
| | | return (null, null); |
| | | } |
| | | |
| | | public (DtLocationStatusChangeRecord, DtLocationInfo) UpdateLocationStatus(string locationCode, LocationEnum locationStatus, int taskNum, StatusChangeTypeEnum StatusChangeType) |
| | | { |
| | | var location = _locationRepository.QueryFirst(x => x.LocationCode == locationCode); |
| | |
| | | switch (AreaId) |
| | | { |
| | | case 2: |
| | | case 7: |
| | | return await FromShallowToDeep(AreaId, loc); |
| | | case 3: |
| | | return await AGVLIKU(AreaId); |