| | |
| | | } |
| | | |
| | | for (XpPoint xpPoint : list) { |
| | | |
| | | // 2非工作日 0工作日 1节假日 3调休日 |
| | | Integer holidayToday = holidayUtil.isHolidayToday(); |
| | | Integer operationType = xpPoint.getEffectivePeriod(); |
| | | if(operationType==1){ |
| | | boolean inTime = TimeRangeChecker.isCurrentTimeInRanges(now, xpPoint.getEffectiveTimePeriod()); |
| | | if (!inTime) { |
| | | continue; |
| | | } |
| | | }else if(operationType==2){ |
| | | if(holidayToday!=0){ |
| | | continue; |
| | | } |
| | | boolean inTime = TimeRangeChecker.isCurrentTimeInRanges(now, xpPoint.getEffectiveTimePeriod()); |
| | | if (!inTime) { |
| | | continue; |
| | | } |
| | | }else if(operationType==3){ |
| | | if(holidayToday!=2){ |
| | | continue; |
| | | } |
| | | boolean inTime = TimeRangeChecker.isCurrentTimeInRanges(now, xpPoint.getEffectiveTimePeriod()); |
| | | if (!inTime) { |
| | | continue; |
| | | } |
| | | }else if(operationType==4){ |
| | | if(holidayToday!=1){ |
| | | continue; |
| | | } |
| | | boolean inTime = TimeRangeChecker.isCurrentTimeInRanges(now, xpPoint.getEffectiveTimePeriod()); |
| | | if (!inTime) { |
| | | continue; |
| | | } |
| | | // 判断是否在时间段内 |
| | | boolean intime = getInTime(now, xpPoint); |
| | | if (!intime) { |
| | | continue; |
| | | } |
| | | // 计算距离 小于的站点 |
| | | double v = FastDistanceCalculator.distanceFast(dto.getLatitude(), dto.getLongitude(), xpPoint.getPointLat(), xpPoint.getPointLon()); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | private boolean getInTime(LocalTime now,XpPoint xpPoint){ |
| | | // 2非工作日 0工作日 1节假日 3调休日 |
| | | Integer holidayToday = holidayUtil.isHolidayToday(); |
| | | Integer operationType = xpPoint.getEffectivePeriod(); |
| | | if(operationType==1){ |
| | | boolean inTime = TimeRangeChecker.isCurrentTimeInRanges(now, xpPoint.getEffectiveTimePeriod()); |
| | | if (!inTime) { |
| | | return false; |
| | | } |
| | | }else if(operationType==2){ |
| | | if(holidayToday!=0){ |
| | | return false; |
| | | } |
| | | boolean inTime = TimeRangeChecker.isCurrentTimeInRanges(now, xpPoint.getEffectiveTimePeriod()); |
| | | if (!inTime) { |
| | | return false; |
| | | } |
| | | }else if(operationType==3){ |
| | | if(holidayToday!=2){ |
| | | return false; |
| | | } |
| | | boolean inTime = TimeRangeChecker.isCurrentTimeInRanges(now, xpPoint.getEffectiveTimePeriod()); |
| | | if (!inTime) { |
| | | return false; |
| | | } |
| | | }else if(operationType==4){ |
| | | if(holidayToday!=1){ |
| | | return false; |
| | | } |
| | | boolean inTime = TimeRangeChecker.isCurrentTimeInRanges(now, xpPoint.getEffectiveTimePeriod()); |
| | | if (!inTime) { |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public List<XpPoint> pointMap(PointMapQuery query) { |
| | | List<XpPoint> list = this.baseMapper.pointMap(query); |