liujie
5 天以前 3003ef3b80f346a73f3c154c04e7d5d1f0e3b5eb
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java
@@ -8,10 +8,8 @@
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
import com.stylefeng.guns.modular.system.model.Company;
import com.stylefeng.guns.modular.system.model.Driver;
import com.stylefeng.guns.modular.system.model.OrderAdditionalFee;
import com.stylefeng.guns.modular.system.model.OrderPosition;
import com.stylefeng.guns.modular.system.dao.UserInfoMapper;
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.*;
import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper;
@@ -68,6 +66,12 @@
    @Autowired
    private IOrderAdditionalFeeService orderAdditionalFeeService;
    @Resource
    private UserInfoMapper userInfoMapper;
    @Autowired
    private TDriverPromotionActivityService driverPromotionActivityService;
@@ -207,6 +211,16 @@
//            orderTaxi.setBindId(map.get("bindId"));
//        }
        // 是否推广订单
        Integer promotion = isPromotion(orderTaxi.getUserId());
        if(promotion!=null){
            orderTaxi.setPromotion(2);
            Driver driver1 = driverService.selectById(promotion);
            orderTaxi.setPromotionUser(driver1.getName());
            orderTaxi.setPromotionPhone(driver1.getPhone());
            orderTaxi.setPromotionDriverId(promotion);
        }
        this.updateById(orderTaxi);
        if(orderTaxi.getType() == 2){
@@ -279,7 +293,18 @@
        return ResultUtil.success(orderTaxi.getId());
    }
    private Integer isPromotion(Integer userId){
        UserInfo userInfo = userInfoMapper.selectById(userId);
        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"));
            if(tDriverPromotionActivity!=null){
                return userInfo.getBindDriverId();
            }
        }
        return null;
    }
    public OrderTaxi setOrderTaxi(OrderPrivateCar orderPrivateCar){