| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.manager.controller.params.LocToTaskParams; |
| | | import com.vincent.rsf.server.manager.entity.BasContainer; |
| | | import com.vincent.rsf.server.manager.entity.Loc; |
| | | import com.vincent.rsf.server.manager.entity.WarehouseAreas; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.LocStsType; |
| | | import com.vincent.rsf.server.manager.enums.StationTypeEnum; |
| | | import com.vincent.rsf.server.manager.enums.TaskStsType; |
| | | import com.vincent.rsf.server.manager.enums.TaskType; |
| | | import com.vincent.rsf.server.manager.service.LocItemService; |
| | | import com.vincent.rsf.server.manager.service.LocService; |
| | | import com.vincent.rsf.server.manager.service.TaskService; |
| | | import com.vincent.rsf.server.manager.service.impl.BasContainerServiceImpl; |
| | | import com.vincent.rsf.server.manager.service.impl.WarehouseAreasServiceImpl; |
| | | import com.vincent.rsf.server.system.constant.GlobalConfigCode; |
| | | import com.vincent.rsf.server.system.entity.Config; |
| | | import com.vincent.rsf.server.system.entity.*; |
| | | import com.vincent.rsf.server.system.service.ConfigService; |
| | | import com.vincent.rsf.server.system.service.impl.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import routeR.calculationR.RouteWmsStepFlow; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | private LocItemService locItemService; |
| | | @Autowired |
| | | private BasContainerServiceImpl basContainerService; |
| | | @Autowired |
| | | private TaskPathTemplateServiceImpl taskPathTemplateService; |
| | | @Autowired |
| | | private TaskPathTemplateNodeServiceImpl taskPathTemplateNodeService; |
| | | @Autowired |
| | | private TaskInstanceServiceImpl taskInstanceService; |
| | | @Autowired |
| | | private TaskInstanceNodeServiceImpl taskInstanceNodeService; |
| | | @Autowired |
| | | private SubsystemFlowTemplateServiceImpl subsystemFlowTemplateService; |
| | | @Autowired |
| | | private FlowStepLogServiceImpl flowStepLogService; |
| | | @Autowired |
| | | private FlowStepTemplateServiceImpl flowStepTemplateService; |
| | | @Autowired |
| | | private FlowStepInstanceServiceImpl flowStepInstanceService; |
| | | @Autowired |
| | | private FlowInstanceServiceImpl flowInstanceService; |
| | | |
| | | /** |
| | | * @author Munch D. Luffy |
| | |
| | | return; |
| | | } |
| | | |
| | | |
| | | List<Task> taskList = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getTaskStatus, TaskStsType.MISSION_INITIAL.id)); |
| | | if (Objects.isNull(taskList)) { |
| | | return; |
| | | } |
| | | taskList.forEach(task -> { |
| | | String sou = null; |
| | | String end = null; |
| | | if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_IN.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_EMPTY_IN.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_IN.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_LOC_MOVE.type)) { |
| | | sou = task.getOrgSite(); |
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getTargLoc())); |
| | | end = loc.getAreaId().toString(); |
| | | } else if (task.getTaskType().equals(TaskType.TASK_TYPE_OUT.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_AGAIN_OUT.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_OUT.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_OUT.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_EMPTY_OUT.type)) { |
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getOrgLoc())); |
| | | sou = loc.getAreaId().toString(); |
| | | end = task.getTargSite(); |
| | | } |
| | | List<TaskPathTemplate> taskPathTemplates = taskPathTemplateService.list(new LambdaQueryWrapper<TaskPathTemplate>().eq(TaskPathTemplate::getSourceType, sou).eq(TaskPathTemplate::getTargetType, end)); |
| | | if (Objects.isNull(taskPathTemplates) || taskPathTemplates.isEmpty()) { |
| | | List<TaskPathTemplate> list = taskPathTemplateService.list(new LambdaQueryWrapper<>()); |
| | | if (!Cools.isEmpty(list)) { |
| | | List<String[]> stationList = new ArrayList<>(); |
| | | list.forEach(taskPathTemplate -> { |
| | | stationList.add(taskPathTemplate.route()); |
| | | }); |
| | | List<Long> longs = RouteWmsStepFlow.routeGet(stationList, sou, end); |
| | | if (longs != null && !longs.isEmpty()) { |
| | | TaskPathTemplate taskPathTemplate = new TaskPathTemplate(); |
| | | taskPathTemplate.setTemplateCode(sou+"===>"+end); |
| | | taskPathTemplate.setTemplateName(sou+"===>"+end); |
| | | taskPathTemplate.setSourceType(sou); |
| | | taskPathTemplate.setTargetType(end); |
| | | taskPathTemplateService.save(taskPathTemplate); |
| | | } |
| | | System.out.println("任务:"+task.getTaskCode()+"查询步序为:"+longs); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |