| | |
| | | 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; |
| | |
| | | |
| | | 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); |
| | | } |
| | |
| | | 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); |