|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (location == null) throw new Exception("未知库位"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (_taskRepository.QueryFirst(x => x.SourceAddress == result.LocationID && x.Roadway == location.RoadwayNo) != null) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | throw new Exception("当前库位已存在任务"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Dt_StationManager stationManager; | 
|---|
|  |  |  | if (result.IsNG == 1) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | CreateDate = DateTime.Now, | 
|---|
|  |  |  | Creater = "HK", | 
|---|
|  |  |  | CurrentAddress = result.LocationID, | 
|---|
|  |  |  | Grade = 1, | 
|---|
|  |  |  | Grade = result.IsNG == 1 ? 1 : 2, | 
|---|
|  |  |  | Dispatchertime = DateTime.Now, | 
|---|
|  |  |  | PalletCode = result.PalletBarcode, | 
|---|
|  |  |  | Roadway = location.RoadwayNo, | 
|---|
|  |  |  | 
|---|
|  |  |  | WMSTaskDTO taskDTO = new WMSTaskDTO() | 
|---|
|  |  |  | { | 
|---|
|  |  |  | TaskNum = task.TaskNum.Value, | 
|---|
|  |  |  | Grade = 1, | 
|---|
|  |  |  | Grade = result.IsNG == 1 ? 1 : 2, | 
|---|
|  |  |  | PalletCode = task.PalletCode, | 
|---|
|  |  |  | RoadWay = task.Roadway, | 
|---|
|  |  |  | SourceAddress = task.SourceAddress, | 
|---|
|  |  |  | 
|---|
|  |  |  | if (respone.Status) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | var taskId = _taskRepository.AddData(task); | 
|---|
|  |  |  | location.LocationStatus = (int) LocationEnum.InStockDisable; | 
|---|
|  |  |  | _locationRepository.UpdateData(location); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { taskDTO.PalletCode }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | else | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | throw new Exception("WCS处理失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //WMSTaskDTO taskDTO = new WMSTaskDTO | 
|---|
|  |  |  | //{ | 
|---|
|  |  |  | //    Id = 0, | 
|---|