| | |
| | | @Value("${agv.containerArrivedPath}") |
| | | private String containerArrivedPath; |
| | | |
| | | @Value("${agvBasDev.maxWorkNum}") |
| | | private int maxWrokNum; |
| | | |
| | | @Autowired |
| | | AgvWrkMastMapper agvWrkMastMapper; |
| | | @Autowired |
| | |
| | | } |
| | | |
| | | public int startWrk(List<AgvWrkMast> agvWrkMastList, String taskType) throws IOException { |
| | | |
| | | //任务过滤,过滤掉已存在相同目标库位的工作档 |
| | | agvWrkMastList = filter(agvWrkMastList); |
| | | |
| | | AgvTaskCreateParam agvTaskCreateParam = new AgvTaskCreateParam(); |
| | | agvTaskCreateParam.setTaskType(taskType); |
| | |
| | | return this.selectOne(new EntityWrapper<AgvWrkMast>().eq("barcode",containerCode)); |
| | | } |
| | | |
| | | private List<AgvWrkMast> filter(List<AgvWrkMast> agvWrkMastList){ |
| | | return agvWrkMastList.stream().filter(agvWrkMast -> { |
| | | int num = this.selectCount(new EntityWrapper<AgvWrkMast>().eq("loc_no", agvWrkMast.getLocNo())); |
| | | return num <= maxWrokNum; |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | |
| | | private void getContainerMoveParam(List<AgvWrkMast> agvWrkMastList,List<Map<String,String>> positionCodeMapList){ |
| | | //往容器入场参数中放入源站点位置 |
| | | for(AgvWrkMast agvWrkMast : agvWrkMastList){ |
| | |
| | | if(agvWrkMast.getSourceLocNo().contains("CS") || agvWrkMast.getSourceLocNo().contains("SK")){ |
| | | agvTaskkDescribeParam.setFromLocationCode(agvWrkMast.getSourceLocNo()); |
| | | } |
| | | agvTaskkDescribeParam.setToLocationCode(agvWrkMast.getLocNo()); |
| | | |
| | | if(agvWrkMast.getLocNo().contains("SK")){ |
| | | agvTaskkDescribeParam.setToLocationCode(agvWrkMast.getLocNo()); |
| | | }else { |
| | | agvTaskkDescribeParam.setToStationCode(agvWrkMast.getLocNo()); |
| | | } |
| | | agvTaskkDescribeParam.setContainerCode(agvWrkMast.getBarcode()); |
| | | return agvTaskParam; |
| | | }).collect(Collectors.toList()); |