|  | @@ -10,6 +10,8 @@ import com.aidex.common.core.domain.BaseEntity;
 | 
	
		
			
				|  |  |  import com.aidex.common.core.domain.R;
 | 
	
		
			
				|  |  |  import com.aidex.common.exception.SysException;
 | 
	
		
			
				|  |  |  import com.aidex.common.gps.server.IGpsService;
 | 
	
		
			
				|  |  | +import com.aidex.common.plush.domain.vo.SysShipExtendListResVO;
 | 
	
		
			
				|  |  | +import com.aidex.common.plush.domain.vo.SysShipExtendListVO;
 | 
	
		
			
				|  |  |  import com.aidex.common.plush.domain.vo.SysShipExtendVO;
 | 
	
		
			
				|  |  |  import com.aidex.common.plush.domain.vo.SysShipResVO;
 | 
	
		
			
				|  |  |  import com.aidex.common.plush.service.SysShipExtendService;
 | 
	
	
		
			
				|  | @@ -207,6 +209,49 @@ public class AppService implements IAppService {
 | 
	
		
			
				|  |  |          return sysShipResVO;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    public SysShipExtendListResVO findAllLocation(Boolean direction, String lat, String lon){
 | 
	
		
			
				|  |  | +        if(StringUtils.isEmpty(lat) || StringUtils.isEmpty(lon))
 | 
	
		
			
				|  |  | +            throw new SysException(4441,"请告诉我你在哪");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        String travel = direction?"1":"0";
 | 
	
		
			
				|  |  | +        // 离我最近的站点
 | 
	
		
			
				|  |  | +        SysWharf wharf = this.findNearestStation(lat,lon);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        if(!wharf.getStatus().equals("0"))
 | 
	
		
			
				|  |  | +            throw new SysException(4442, wharf.getWharfNanme()+" 已经停用!请更换其他站点");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        List<SysShipExtendVO> sysShipExtendVOS = sysShipExtendService.findAllonline(travel);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        if(sysShipExtendVOS.size() <= 0)
 | 
	
		
			
				|  |  | +            throw new SysException(8821,"暂无运行船只");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        List<SysShipExtendListVO> sysShipExtendListVOS = new ArrayList<>();
 | 
	
		
			
				|  |  | +        for (SysShipExtendVO sysShipExtendVO : sysShipExtendVOS) {
 | 
	
		
			
				|  |  | +            SysShipExtendListVO sysShipExtendListVO = new SysShipExtendListVO();
 | 
	
		
			
				|  |  | +            BeanUtils.copyProperties(sysShipExtendVO,sysShipExtendListVO);
 | 
	
		
			
				|  |  | +            sysShipExtendListVO.setMy(wharf);
 | 
	
		
			
				|  |  | +            // 已经停靠
 | 
	
		
			
				|  |  | +            if(sysShipExtendVO.getIsStop().equals(1L)){
 | 
	
		
			
				|  |  | +                sysShipExtendListVO.setStop(sysWharfService.get(sysShipExtendVO.getWharfStop()));
 | 
	
		
			
				|  |  | +            }else {
 | 
	
		
			
				|  |  | +                sysShipExtendListVO.setNext(sysWharfService.get(sysShipExtendVO.getNextWharf()));
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            sysShipExtendListVOS.add(sysShipExtendListVO);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        SysShipExtendListResVO resVO = new SysShipExtendListResVO();
 | 
	
		
			
				|  |  | +        resVO.setShipList(sysShipExtendListVOS);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        try {
 | 
	
		
			
				|  |  | +            SysShipResVO sysShipResVO = this.findAllLocationByNext(direction,lat,lon);
 | 
	
		
			
				|  |  | +            resVO.setShipLocation(sysShipResVO);
 | 
	
		
			
				|  |  | +        }catch (Exception e){
 | 
	
		
			
				|  |  | +            resVO.setShipLocation(null);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        return resVO;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      public SysWharfVO findNearestStation(String lat, String lon){
 | 
	
		
			
				|  |  |          if(StringUtils.isEmpty(lat) || StringUtils.isEmpty(lon))
 | 
	
		
			
				|  |  |              throw new SysException(4441,"请告诉我你在哪");
 |