| | |
| | | */ |
| | | @Override |
| | | public String insertArdRouteInfo(ArdRouteInfo ardRouteInfo) { |
| | | checkRouteMissionStatus(ardRouteInfo,"1"); |
| | | checkRouteMissionStatus(ardRouteInfo,"2"); |
| | | if ("3".equals(ardRouteInfo.getType())) { |
| | | checkRouteMissionStatus(ardRouteInfo,"1"); |
| | | checkRouteMissionStatus(ardRouteInfo,"2"); |
| | | } |
| | | ardRouteInfo.setId(IdUtils.simpleUUID()); |
| | | ardRouteInfo.setCreateTime(DateUtils.getNowDate()); |
| | | ardRouteInfo.setUpdateTime(DateUtils.getNowDate()); // 修改时间,用于排序 |
| | |
| | | */ |
| | | private void checkRouteMissionStatus(ArdRouteInfo ardRouteInfo,String type){ |
| | | ArdRouteMission mission = ardRouteMissionMapper.selectArdRouteMissionById(ardRouteInfo.getMissionId()); |
| | | switch(type){ |
| | | case "1": |
| | | validateForCreate(mission); |
| | | break; |
| | | case "2": |
| | | bindRoute(mission, ardRouteInfo); |
| | | break; |
| | | case "3": |
| | | executeMission(mission); |
| | | break; |
| | | default: |
| | | throw new RuntimeException("不支持的操作类型!!!"); |
| | | if (mission != null){ |
| | | switch(type){ |
| | | case "1": |
| | | validateForCreate(mission); |
| | | break; |
| | | case "2": |
| | | bindRoute(mission, ardRouteInfo); |
| | | break; |
| | | case "3": |
| | | executeMission(mission); |
| | | break; |
| | | default: |
| | | throw new RuntimeException("不支持的操作类型!!!"); |
| | | } |
| | | }else { |
| | | throw new RuntimeException("航线任务不存在!!!"); |
| | | } |
| | | } |
| | | |
| | |
| | | // 判断是否循环航线 |
| | | if (null != route && "0".equals(route.getIsLoop())){ |
| | | deleteArdRouteInfoById(id); |
| | | checkRouteMissionStatus(route,"3"); |
| | | if ("3".equals(route.getType())) { |
| | | checkRouteMissionStatus(route,"3"); |
| | | } |
| | | } |
| | | WayLineBeginDTO wayLineBeginDTO = new WayLineBeginDTO(boxSn); |
| | | tyService.wayLineBegin(wayLineBeginDTO); |