| | |
| | | @Scheduled(cron = "0/2 * * * * ? ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void missionTaskEXECUTE() { |
| | | List<String> typeList = Arrays.asList(MissionStepType.MISSION_STEP_TYPE_REQUEST.type, MissionStepType.MISSION_STEP_TYPE_OBTAIN.type,MissionStepType.MISSION_STEP_TYPE_NO_EXECUTE.type); |
| | | List<FlowStepInstance> flowStepInstanceList = flowStepInstanceService.list(new LambdaQueryWrapper<FlowStepInstance>() |
| | | .eq(FlowStepInstance::getStatus, 1).in(FlowStepInstance::getStepType,typeList)); |
| | | .eq(FlowStepInstance::getStatus, 1).in(FlowStepInstance::getStepType,MissionStepType.getTaskISSUE())); |
| | | for (FlowStepInstance flowStepInstance : flowStepInstanceList) { |
| | | FlowInstance flowInstance = flowInstanceService.getById(flowStepInstance.getFlowInstanceId()); |
| | | if (Cools.isEmpty(flowInstance)) { continue;} |
| | | List<FlowStepInstance> flowStepInstances = flowStepInstanceService.list(new LambdaQueryWrapper<FlowStepInstance>() |
| | | .eq(FlowStepInstance::getFlowInstanceId, flowInstance.getId()).eq(FlowStepInstance::getStatus, (short) 0)); |
| | | flowInstance.setStatus(flowStepInstances.isEmpty()? (short) 2:(short) 1); |
| | | TaskInstanceNode taskInstanceNode = taskInstanceNodeService.getById(flowInstance.getNodeInstanceId()); |
| | | if (Cools.isEmpty(taskInstanceNode)) { continue;} |
| | | taskInstanceNode.setStatus(flowInstance.getStatus()); |
| | | TaskInstance taskInstance = taskInstanceService.getById(flowInstance.getTaskId()); |
| | | if (Cools.isEmpty(taskInstance)) { continue;} |
| | | Task task = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getTaskCode, taskInstance.getTaskNo())); |
| | |
| | | |
| | | if (flowStepInstance.getWmsNextTaskStatus() != 9999) { |
| | | FlowStepInstance nextFlowStepInstance = flowStepInstanceService.getOne(new LambdaQueryWrapper<FlowStepInstance>() |
| | | .eq(FlowStepInstance::getFlowInstanceId, flowStepInstance.getFlowInstanceId()) |
| | | .eq(FlowStepInstance::getFlowInstanceNo, flowStepInstance.getFlowInstanceNo()) |
| | | .eq(FlowStepInstance::getStatus, (short)0) |
| | | .eq(FlowStepInstance::getStepOrder, flowStepInstance.getStepOrder() + 1) |
| | | .eq(FlowStepInstance::getWmsNowTaskStatus, flowStepInstance.getWmsNextTaskStatus())); |
| | | if (Cools.isEmpty(nextFlowStepInstance)) { |
| | | throw new CoolException("任务号"+task.getTaskCode()+"任务步骤丢失!!!"); |
| | | } |
| | | nextFlowStepInstance.setStatus((short)1); |
| | | |
| | | flowStepInstanceService.updateById(nextFlowStepInstance); |
| | | } else { |
| | | taskInstance.setStatus((short)2); |
| | | taskInstanceService.updateById(taskInstance); |
| | | } |
| | | flowInstanceService.updateById(flowInstance); |
| | | taskInstanceNodeService.updateById(taskInstanceNode); |
| | | } catch (Exception e) { |
| | | throw new CoolException(e.getMessage()); |
| | | } |
| | |
| | | |
| | | if (flowStepInstance.getWmsNextTaskStatus() != 9999) { |
| | | FlowStepInstance nextFlowStepInstance = flowStepInstanceService.getOne(new LambdaQueryWrapper<FlowStepInstance>() |
| | | .eq(FlowStepInstance::getFlowInstanceId, flowStepInstance.getFlowInstanceId()) |
| | | .eq(FlowStepInstance::getFlowInstanceNo, flowStepInstance.getFlowInstanceNo()) |
| | | .eq(FlowStepInstance::getStatus, (short)0) |
| | | .eq(FlowStepInstance::getStepOrder, flowStepInstance.getStepOrder() + 1) |
| | | .eq(FlowStepInstance::getWmsNowTaskStatus, flowStepInstance.getWmsNextTaskStatus())); |
| | | if (Cools.isEmpty(nextFlowStepInstance)) { |
| | | throw new CoolException("任务号"+task.getTaskCode()+"任务步骤丢失!!!"); |
| | | } |
| | | nextFlowStepInstance.setStatus((short)1); |
| | | |
| | | flowStepInstanceService.updateById(nextFlowStepInstance); |
| | | } else { |
| | | taskInstance.setStatus((short)2); |
| | | taskInstanceService.updateById(taskInstance); |
| | | } |
| | | } else { |
| | | flowStepInstance.setRetryTimes(flowStepInstance.getRetryTimes() + 1); |
| | |
| | | |
| | | public void completeStock9999() throws Exception { |
| | | try{ |
| | | List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getTaskStatus, TaskStsType.MISSION_TRANSFER.id).select(Task::getId)); |
| | | List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getTaskStatus, TaskStsType.MISSION_TRANSFER.id)); |
| | | if (tasks.isEmpty()) { |
| | | return; |
| | | } |
| | |
| | | } |
| | | // |
| | | // /** |
| | | // * 非光电站点任务下发 |
| | | // * 非智能站点任务下发 |
| | | // */ |
| | | // @Scheduled(cron = "0/5 * * * * ? ") |
| | | // @Transactional(rollbackFor = Exception.class) |
| | |
| | | // .eq(BasStation::getStationName, |
| | | // task.getTaskStatus().equals(TaskStsType.GENERATE_IN.id) ? task.getOrgSite() : task.getTargSite())); |
| | | // if (Cools.isEmpty(station)){ |
| | | // log.info("非光电站点任务下发:站点信息异常,任务信息:"+ JSON.toJSONString(task)); |
| | | // log.info("非智能站点任务下发:站点信息异常,任务信息:"+ JSON.toJSONString(task)); |
| | | // continue; |
| | | // } |
| | | // if (station.getType().equals(StationTypeEnum.STATION_TYPE_MUTI.type)) { |
| | |
| | | // /** |
| | | // * @author Ryan |
| | | // * @date 2025/9/4 |
| | | // * @description: 光电站点任务下发 |
| | | // * @description: 智能站点任务下发 |
| | | // * @version 1.0 |
| | | // */ |
| | | // @Scheduled(cron = "0/5 * * * * ? ") |
| | |
| | | } |
| | | |
| | | |
| | | /**判断是否光电站点,非光店站点需管控站点状态*/ //目标站点 |
| | | /**判断是否智能站点,非光店站点需管控站点状态*/ //目标站点 |
| | | if (!Objects.isNull(station) && station.getType().equals(StationTypeEnum.STATION_TYPE_NORMAL.type)) { |
| | | if (task.getTaskType() <= TaskType.TASK_TYPE_CHECK_IN.type && !task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type)) { |
| | | // if (!station.getUseStatus().equals(LocStsType.LOC_STS_TYPE_F.type)) { |