| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | WriteLog.Write_Log("容å¨å
¥åºå建任å¡", $"è¾é线信æ¯", "å¼å§å
¥åº", $"æçå·{containerFlowDTO.ContainerCode}ï¼è®¾å¤{deviceCode}"); |
| | | List<Dt_LocationInfo> locationInfos = _locationInfoRepository.QueryData(); |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.PalletCode == containerFlowDTO.ContainerCode); |
| | | if (locationInfo != null) throw new Exception($"åºä½æç®±å·{containerFlowDTO.ContainerCode}å·²åå¨"); |
| | |
| | | Dt_LocationInfo? noInLocation = locationInfos.FirstOrDefault(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()); |
| | | if (noInLocation == null) throw new Exception($"å¯ç¨è´§ä½ä¸è¶³!"); |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && x.StationDeviceCode == deviceCode); |
| | | WriteLog.Write_Log("容å¨å
¥åºå建任å¡", $"ç«å°ä¿¡æ¯", "æ¥è¯¢ç«å°", $"ç«å°å·{stationManger.StationCode}ï¼è®¾å¤{stationManger.StationDeviceCode}"); |
| | | //åå»ºä»»å¡ |
| | | Dt_Task task = new Dt_Task(); |
| | | task.PalletCode = containerFlowDTO.ContainerCode; |
| | |
| | | task.TaskState = TaskStatusEnum.CL_Executing.ObjToInt(); |
| | | |
| | | //æ·»å ä»»å¡ |
| | | BaseDal.AddData(task); |
| | | int taskId = BaseDal.AddData(task); |
| | | WriteLog.Write_Log("容å¨å
¥åºå建任å¡", $"ä»»å¡ä¿¡æ¯", "å建å
¥åº", $"ä»»å¡å·ï¼{taskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | if (type > 0) |
| | | { |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(new List<int>() { task.TaskNum }, "æå¨æé®å
¥åº"); |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteLog.Write_Log("容å¨å
¥åºå建任å¡", $"ä»»å¡", "å建å
¥åº", $"失败ï¼{ex.Message}"); |
| | | content.Error($"é误信æ¯:{ex.Message}"); |
| | | } |
| | | return content; |