liujie
6 天以前 5321e3029faed64b250ec77b329a1ecd78086a23
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,10 @@
//            orderTaxi.setBindId(map.get("bindId"));
//        }
        // 是否推广订单
        Integer promotion = isPromotion(uid);
        orderTaxi.setPromotion(promotion);
        this.updateById(orderTaxi);
        if(orderTaxi.getType() == 2){
@@ -279,7 +287,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("districtCode", registAreaCode).ge("startTime", new Date()).lt("endTime", new Date()).last("AND FIND_IN_SET(" + 1 + ", bizType) limit 1"));
            if(tDriverPromotionActivity!=null){
                return 2;
            }
        }
        return null;
    }
    public OrderTaxi setOrderTaxi(OrderPrivateCar orderPrivateCar){