| | |
| | | import com.xiaopeng.operation.mapper.*; |
| | | import com.xiaopeng.operation.query.PricingPageListQuery; |
| | | import com.xiaopeng.operation.service.IXpGeoQueryEntityService; |
| | | import com.xiaopeng.operation.service.XpPointService; |
| | | import com.xiaopeng.operation.service.XpPricingService; |
| | | import com.xiaopeng.operation.utils.XpPricingUtil; |
| | | import com.xiaopeng.operation.utils.holiday.HolidayUtil; |
| | |
| | | import javax.annotation.PreDestroy; |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.util.*; |
| | | import java.util.concurrent.*; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | |
| | | |
| | | |
| | | @Resource |
| | | private XpPointMapper xpPointMapper; |
| | | |
| | | @Resource |
| | | private XpWhitelistMapper xpWhitelistMapper; |
| | | |
| | | @Resource |
| | |
| | | |
| | | @Autowired |
| | | private XpElectronicFenceMapper xpElectronicFenceMapper; |
| | | |
| | | @Autowired |
| | | private XpPointService xpPointService; |
| | | |
| | | |
| | | // 自定义线程池用于并行执行任务 |
| | |
| | | |
| | | @Override |
| | | public Long saveOrder(XpOrderDto dto, String uid) { |
| | | |
| | | |
| | | |
| | | // 是否在运营区域时间内 |
| | | XpElectronicFenceArea xpElectronicFenceArea = xpElectronicFenceAreaMapper.selectById(dto.getXpElectronicFenceAreaId()); |
| | | XpElectronicFence xpElectronicFence = xpElectronicFenceMapper.selectById(xpElectronicFenceArea.getElectronicId()); |
| | |
| | | } |
| | | |
| | | // 获取起点经纬度 |
| | | XpPoint xpPoint = xpPointMapper.selectById(dto.getStartPointId()); |
| | | XpPoint xpPoint = xpPointService.getById(dto.getStartPointId()); |
| | | |
| | | // 终点 |
| | | XpPoint endXpPoint = xpPointMapper.selectById(dto.getStartPointId()); |
| | | XpPoint endXpPoint = xpPointService.getById(dto.getStartPointId()); |
| | | |
| | | // 判断点位是否在运营区域内 |
| | | LocalTime now = LocalTime.now(); |
| | | boolean inTime = xpPointService.getInTime(now, xpPoint.getEffectivePeriod(), xpPoint.getEffectiveTimePeriod()); |
| | | if(!inTime){ |
| | | throw new ServiceException("当前点位未开通服务", I18nKeyConstant.NO_CURRENT_REGION); |
| | | } |
| | | inTime = xpPointService.getInTime(now, endXpPoint.getEffectivePeriod(), endXpPoint.getEffectiveTimePeriod()); |
| | | if(!inTime){ |
| | | throw new ServiceException("当前点位未开通服务", I18nKeyConstant.NO_CURRENT_REGION); |
| | | } |
| | | |
| | | // 判断当天取消的次数 后台配置 redis 查询 |
| | | Object cancelOrder = redisService.getCacheObject("CANCEL_ORDER_" + uid); |