| | |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEAWCS_DTO.WCSInfo; |
| | | using WIDESEA_DTO.WCSInfo; |
| | | using WIDESEA_Common.TaskEnum; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | |
| | | BaseDal.UpdateData(task); |
| | | return content; |
| | | } |
| | | if (task.TaskType != TaskTypeEnum.Inbound.ObjToInt()) throw new Exception($"æªæ¾å°æçå·[{lineDTO.Barcode}]çå
¥åºä»»å¡"); |
| | | if (task.TaskType != TaskTypeEnum.Inbound.ObjToInt() && task.TaskType != TaskTypeEnum.InQuality.ObjToInt()) throw new Exception($"æªæ¾å°æçå·[{lineDTO.Barcode}]çå
¥åºä»»å¡"); |
| | | |
| | | //if (task.TaskState != (int)InTaskStatusEnum.AGV_InFinish) throw new Exception($"æçå·[{lineDTO.Barcode}]çå
¥åºä»»å¡ç¶æä¸å¹é
"); |
| | | #region 夿åºåç¶æ |
| | | Dt_InventoryInfo inventoryInfo = _stockService.InventoryInfoService.Repository.QueryFirst(x => x.PalletCode == lineDTO.Barcode); |
| | | if (inventoryInfo == null) throw new Exception("æªæ¾å°ç»çä¿¡æ¯"); |
| | | if (inventoryInfo.StockStatus != StockStatusEmun.ç»çæå.ObjToInt()) throw new Exception("该ç»çç¶æä¸å¯å
¥åº"); |
| | | if (!string.IsNullOrEmpty(inventoryInfo.LocationCode)) throw new Exception("该æçå·²ç»å®è´§ä½"); |
| | | |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(lineDTO.Barcode); |
| | | (bool, string) result = CheckRequestInbound(lineDTO.stationCode, lineDTO.Barcode, true, stockInfo); |
| | | if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2); |
| | | |
| | | Dt_StockInfoDetail? stockInfoDetail = stockInfo.Details.FirstOrDefault(); |
| | | |
| | | if (/*lineDTO.Spec != 1 ||*/ lineDTO.Weight > 1500)//æ£æµæ¡ä»¶éæ´æ¹ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ |
| | | { |
| | | //task.NextAddress = "101"; |
| | | //task.TaskState = (int)InTaskStatusEnum.InException; |
| | | task.Remark = $"æç[{lineDTO.Barcode}]è¶
é"; |
| | | //task.Remark = $"æç[{lineDTO.Barcode}]ä¿¡æ¯ä¸åæ ¼"; |
| | | //stockInfo.StockStatus = StockStatusEmun.å
¥åºæ¤é.ObjToInt(); |
| | | } |
| | | if (lineDTO.Weight > 1500) task.Remark = $"æç[{lineDTO.Barcode}]è¶
é"; |
| | | else |
| | | { |
| | | task.NextAddress = "1004"; |
| | | task.CurrentAddress = lineDTO.stationCode; |
| | | task.Remark = string.Empty; |
| | | task.TaskState = (int)InTaskStatusEnum.Line_InExecuting; |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | | if (stockInfoDetail != null) stockInfoDetail.Status = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | | inventoryInfo.StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | | } |
| | | #endregion |
| | | |
| | | #region äºå¡ |
| | | Db.Ado.BeginTran(); |
| | | BaseDal.UpdateData(task); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | if (stockInfoDetail != null) _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail); |
| | | //Db.Updateable(stockInfo).ExecuteCommand(); |
| | | _stockService.InventoryInfoService.Repository.UpdateData(inventoryInfo); |
| | | Db.Ado.CommitTran(); |
| | | #endregion |
| | | if (!string.IsNullOrEmpty(task.Remark)) throw new Exception(task.Remark); |