| | |
| | | public WebResponseContent CreateKLSNewInTask(TaskDTO taskDTO, int taskType) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | Dt_KLSLocationInfo? kLSLocationInfo = null; |
| | | try |
| | | { |
| | | int containerType = taskDTO.containerCode.Contains("LLM") ? (int)LocationTypeEnum.LargePallet : (int)LocationTypeEnum.SmallPallet; |
| | | #region ç¹å°ç¹ |
| | | if (!string.IsNullOrEmpty(taskDTO.toLocationCode)) |
| | | { |
| | | var LocationInfo = _kLSLocationInfoService.Repository.QueryFirst(x => x.LocationCode == taskDTO.toLocationCode) ?? throw new Exception($"æªæ¾å°ç»ç¹è´§ä½ã{taskDTO.toLocationCode}ã"); |
| | | if (LocationInfo.LocationStatus != (int)LocationStatusEnum.Free) throw new Exception($"ç»ç¹è´§ä½ã{taskDTO.toLocationCode}ãè´§ä½ç¶æä¸ä¸ºç©ºè´§ä½"); |
| | | kLSLocationInfo = _kLSLocationInfoService.Repository.QueryFirst(x => x.LocationCode == taskDTO.toLocationCode) ?? throw new Exception($"æªæ¾å°ç»ç¹è´§ä½ã{taskDTO.toLocationCode}ã"); |
| | | if (kLSLocationInfo.LocationStatus != (int)LocationStatusEnum.Free) throw new Exception($"ç»ç¹è´§ä½ã{taskDTO.toLocationCode}ãè´§ä½ç¶æä¸ä¸ºç©ºè´§ä½"); |
| | | } |
| | | #endregion |
| | | //è·åè´§ä½ä¿¡æ¯ |
| | | Dt_KLSLocationInfo? kLSLocationInfo = _kLSLocationInfoService.GetFreeLocationInfo(taskDTO.toAreaCode, containerType) ?? throw new Exception($"æªæ¾å°ç»ç¹åºåºã{taskDTO.toAreaCode}ãå¯ç¨ç©ºè´§ä½ï¼"); |
| | | else |
| | | kLSLocationInfo = _kLSLocationInfoService.GetFreeLocationInfo(taskDTO.toAreaCode, containerType) ?? throw new Exception($"æªæ¾å°ç»ç¹åºåºã{taskDTO.toAreaCode}ãå¯ç¨ç©ºè´§ä½ï¼"); |
| | | Dt_Task dt_Task = new() |
| | | { |
| | | TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | |
| | | content = SendKLSTask(dt_Task); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | dt_Task.TaskState = (int)TaskStatusEnum.Execut; |
| | | dt_Task.Dispatchertime=DateTime.Now; |
| | | #endregion |
| | | try |
| | | { |
| | |
| | | content = SendKLSTask(dt_Task); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | dt_Task.TaskState = (int)TaskStatusEnum.Execut; |
| | | dt_Task.Dispatchertime = DateTime.Now; |
| | | #endregion |
| | | try |
| | | { |