| | |
| | | import com.zy.asrs.service.RcsService; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.common.properties.StationProperties; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private RcsService rcsService; |
| | | @Autowired |
| | | private StationProperties stationProperties; |
| | | |
| | | |
| | | public ReturnT<String> start(Task task) { |
| | |
| | | }else if(task.getIoType()==5){ |
| | | SourceStaNoType = "ZONE"; |
| | | } |
| | | String taskType = "PP"; |
| | | Boolean flag1 = false; |
| | | Boolean flag2 = false; |
| | | |
| | | if(stationProperties.getStation().contains(task.getStaNo())){ |
| | | taskType = "YLIN"; |
| | | flag1 = true; |
| | | } |
| | | if (stationProperties.getStation().contains(task.getSourceStaNo())){ |
| | | taskType = "YLOUT"; |
| | | flag2 = true; |
| | | } |
| | | if(flag1&&flag2){ |
| | | taskType = "YLBOTH"; |
| | | } |
| | | //AGV区域中无法用- |
| | | String StaNo = task.getStaNo(); |
| | | String SourceStaNo = task.getSourceStaNo(); |
| | | if (task.getStaNo().split("-")[0].equals("Q")) { |
| | | String[] split = task.getStaNo().split("-"); |
| | | StaNo = split[0]+split[1]; |
| | | } |
| | | if (task.getSourceStaNo().split("-")[0].equals("Q")) { |
| | | String[] split = task.getSourceStaNo().split("-"); |
| | | SourceStaNo = split[0]+split[1]; |
| | | } |
| | | |
| | | // 下发给RCS |
| | | RcsTaskSubmit rcsTaskSubmit = new RcsTaskSubmit(); |
| | | rcsTaskSubmit.setRobotTaskCode(task.getTaskNo()); |
| | | rcsTaskSubmit.setTaskType(taskType); |
| | | rcsTaskSubmit.setRobotTaskCode(task.getTaskNo()+"-"+task.getCtnType()); |
| | | rcsTaskSubmit.setInitPriority(10); //默认10 |
| | | List<RcsTaskTargetRoute> targetRouteList = new ArrayList<>(); |
| | | RcsTaskTargetRoute startRoute = new RcsTaskTargetRoute(); |
| | | startRoute.setSeq(0); |
| | | startRoute.setType(SourceStaNoType); |
| | | startRoute.setCode(task.getSourceStaNo()); |
| | | startRoute.setCode(SourceStaNo); |
| | | startRoute.setOperation("COLLECT"); |
| | | targetRouteList.add(startRoute); |
| | | RcsTaskTargetRoute endRoute = new RcsTaskTargetRoute(); |
| | | endRoute.setSeq(1); |
| | | endRoute.setType(TargetStaNoType); |
| | | endRoute.setCode(task.getStaNo()); |
| | | endRoute.setCode(StaNo); |
| | | endRoute.setOperation("DELIVERY"); |
| | | targetRouteList.add(endRoute); |
| | | rcsTaskSubmit.setTargetRoute(targetRouteList); |