|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Thread.Sleep(2200); | 
|---|
|  |  |  | CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); | 
|---|
|  |  |  | if (commonStackerCrane != null) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | WriteError(commonStackerCrane.DeviceCode, $"绉诲簱鎺ュ彛璋冪敤閿欒"); | 
|---|
|  |  |  | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒"); | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (task.TaskNum == taskDTO.TaskNum) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | Dt_Task reloTask = _mapper.Map<Dt_Task>(taskDTO); | 
|---|
|  |  |  | //鍒ゆ柇绉诲簱璐т綅浠诲姟鏄惁宸插瓨鍦紝濡傚瓨鍦ㄥ厛鎵ц | 
|---|
|  |  |  | Dt_Task existTask = _taskService.QueryStackerExistTask(reloTask.PalletCode, reloTask.SourceAddress); | 
|---|
|  |  |  | if (existTask != null) | 
|---|
|  |  |  | if (existTask != null && existTask.TaskState == (int)TaskStatusEnum.SC_Execute) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => (x.StationCode == task.NextAddress || x.StackerCraneStationCode == task.NextAddress) && x.StackerCraneCode == task.DeviceCode); | 
|---|
|  |  |  | existTask.NextAddress = stationManger.StackerCraneStationCode; | 
|---|
|  |  |  | _taskRepository.UpdateData(existTask); | 
|---|
|  |  |  | return existTask; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else if (existTask != null && existTask.TaskState != (int)TaskStatusEnum.SC_Execute) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | reloTask.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); | 
|---|