| | |
| | | MES_parameter mES_Parameter = AbnormalStorageLocation(task.PalletCode, task.SourceAddress, task.TargetAddress); |
| | | if (mES_Parameter.Result == "Y") |
| | | { |
| | | Dt_Task dtOutWit=BaseDal.QueryData(x=>x.PalletCode==task.PalletCode && x.TaskStatus== (int)OutTaskStatusEnum.OutWait).FirstOrDefault(); |
| | | |
| | | Dt_LocationInfo OriginalLocation = _locationInfoService.Repository.QueryData(x => x.LocationCode == task.SourceAddress).FirstOrDefault(); |
| | | Dt_LocationInfo NewLocation = _locationInfoService.Repository.QueryData(x => x.LocationCode == task.TargetAddress).FirstOrDefault(); |
| | | Dt_StockInfo dt_StockInfo = _stockInfoService.Repository.QueryData(x => x.LocationCode == task.SourceAddress).FirstOrDefault(); |
| | |
| | | List<Dt_LocationInfo> dt_Locations = new List<Dt_LocationInfo>(); |
| | | |
| | | OriginalLocation.LocationStatus = (int)LocationStatusEnum.Free; |
| | | NewLocation.LocationStatus = (int)LocationStatusEnum.InStock; |
| | | NewLocation.LocationStatus = dtOutWit != null? (int)LocationStatusEnum.Lock:(int)LocationStatusEnum.InStock; |
| | | dt_StockInfo.LocationCode = NewLocation.LocationCode; |
| | | dt_StockInfo.StockStatus = (int)StockStatusEmun.å·²å
¥åº; |
| | | dt_StockInfo.StockStatus = dtOutWit != null? (int)StockStatusEmun.åºåºä¸:(int)StockStatusEmun.å·²å
¥åº; |
| | | task.TaskStatus = (int)RelocationTaskStatusEnum.RelocationFinish; |
| | | |
| | | if(dtOutWit != null) |
| | | { |
| | | dtOutWit.TaskStatus = (int)OutTaskStatusEnum.OutNew; |
| | | dtOutWit.SourceAddress = NewLocation.LocationCode; |
| | | dtOutWit.CurrentAddress = NewLocation.LocationCode; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | dt_Locations.Add(OriginalLocation); |
| | | dt_Locations.Add(NewLocation); |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | if(dtOutWit!=null) BaseDal.UpdateData(dtOutWit); |
| | | |
| | | _locationInfoService.UpdateData(dt_Locations); |
| | | _stockInfoService.UpdateData(dt_StockInfo); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | |
| | | TaskNum = t.TaskId, |
| | | TaskType = t.TaskType, |
| | | CreateDate = t.CreateDate, |
| | | TaskStatus = t.TaskStatus |
| | | TaskStatus = t.TaskStatus, |
| | | TargetAddress = t.TargetAddress |
| | | }) |
| | | .ToList(); |
| | | return WebResponseContent.Instance.OK("æå", tasks); |
| | |
| | | /// </summary> |
| | | return _task_HtyService.GetWarehouseOperationStatistics(); |
| | | } |
| | | |
| | | public WebResponseContent GetTaskDestination(string targetAddress) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | // åæ°æ ¡éª |
| | | if (string.IsNullOrWhiteSpace(targetAddress)) |
| | | { |
| | | return content.Error("ç®æ å°åä¸è½ä¸ºç©º"); |
| | | } |
| | | try |
| | | { |
| | | // æ¥è¯¢æ°æ® |
| | | var queryResult = BaseDal.QueryData(x => x.TargetAddress == targetAddress); |
| | | // 夿æ¥è¯¢ç»æ |
| | | if (queryResult == null || !queryResult.Any()) |
| | | { |
| | | return content.Error($"æªæ¾å°ç®æ å°å为[{targetAddress}]çä»»å¡"); |
| | | } |
| | | return content.OK($"æç®æ å°å为[{targetAddress}]çä»»å¡ï¼è¯·æ¦æª"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return content.Error($"è·åä»»å¡ç®çå°å¤±è´¥: {ex.Message}"); |
| | | } |
| | | } |
| | | } |
| | | } |