Pu Zhibing
9 天以前 6209aee60fd4a4a0253a701659c411e4dc35063b
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
@@ -41,6 +41,9 @@
    private SystemPriceMapper systemPriceMapper;
    @Autowired
    private ISystemPriceCityService systemPriceCityService;
    @Autowired
    private IDriverService driverService;
    @Autowired
@@ -103,11 +106,13 @@
    
    @Resource
    private RedisTemplate<String, Object> redisTemplate;
    @Resource
    private IOpenCityService openCityService;
    /**
     * 获取司机端首页订单列表
     *
@@ -372,9 +377,9 @@
    private Integer isPromotion(Integer userId){
        UserInfo userInfo = userInfoMapper.selectById(userId);
        if(userInfo.getBindDriverId()!=null && userInfo.getBindExpireDate().getTime()<=System.currentTimeMillis()){
        if(userInfo.getBindDriverId()!=null && userInfo.getBindExpireDate().getTime()>System.currentTimeMillis()){
            String registAreaCode = userInfo.getRegistAreaCode();
            TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("state",1).eq("districtCode", registAreaCode).ge("startTime", new Date()).lt("endTime", new Date()).last("AND FIND_IN_SET(" + 1 + ", bizType) limit 1"));
            TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("state",1).eq("districtCode", registAreaCode).last(" and between now() startTime and endTime AND FIND_IN_SET(" + 1 + ", bizType) limit 1"));
            if(tDriverPromotionActivity!=null){
                return userInfo.getBindDriverId();
            }
@@ -403,7 +408,7 @@
            if(order!=null){
                orders.addAll(order);
            }
            String value = (String) redisTemplate.opsForValue().get("DRIVER" + String.valueOf(orderPrivateCar.getDriverId()));
            String value = (String) redisTemplate.opsForValue().get("dache:DRIVER" + String.valueOf(orderPrivateCar.getDriverId()));
            order = this.baseMapper.queryOrderInfo(orderId,5,value.split(",")[0],value.split(",")[1]);
            if(order!=null){
                orders.addAll(order);
@@ -418,7 +423,7 @@
            if(order!=null){
                orders.addAll(order);
            }
            String value = (String) redisTemplate.opsForValue().get("DRIVER" + String.valueOf(orderPrivateCar.getDriverId()));
            String value = (String) redisTemplate.opsForValue().get("dache:DRIVER" + String.valueOf(orderPrivateCar.getDriverId()));
            order = this.baseMapper.queryOrderInfo(orderPrivateCar.getPid(),5,value.split(",")[0],value.split(",")[1]);
            if(order!=null){
                orders.addAll(order);
@@ -452,7 +457,7 @@
            orders.addAll(order);
        }
        OrderPrivateCar orderPrivateCar = this.baseMapper.selectById(orderId);
        String value = redisUtil.getValue("DRIVER" + String.valueOf(orderPrivateCar.getDriverId()));
        String value = redisUtil.getValue("dache:DRIVER" + String.valueOf(orderPrivateCar.getDriverId()));
        order = this.baseMapper.queryOrderInfo(orderId,5,value.split(",")[0],value.split(",")[1]);
        if(order!=null){
            orders.addAll(order);
@@ -1048,7 +1053,9 @@
     * @throws Exception
     */
    public OrderPrivateCar setMoney(OrderPrivateCar orderPrivateCar, Double parkingFee, Double crossingFee) throws Exception {
        Map<String, Object> query1 = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId());
        Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString());
        SystemPriceCity systemPriceCity = systemPriceCityService.queryOne(geocode.get("provinceCode"), geocode.get("cityCode"), geocode.get("districtCode"));
        Map<String, Object> query1 = systemPriceMapper.query(systemPriceCity.getId(), 1, orderPrivateCar.getServerCarModelId());
        //开始根据不同的方式计算金额
        double amount = 0;
        JSONObject jsonObject = JSON.parseObject(String.valueOf(query1.get("content")));