DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java
@@ -24,7 +24,6 @@ import com.stylefeng.guns.modular.system.service.*; import com.stylefeng.guns.modular.system.util.ResultUtil; import com.stylefeng.guns.modular.system.util.WeChatUtil; import com.stylefeng.guns.modular.system.util.qianyuntong.NCOSSUtil; import com.stylefeng.guns.modular.system.util.qianyuntong.QianYunTongConfig; import com.stylefeng.guns.modular.system.warpper.*; import com.stylefeng.guns.modular.taxi.model.OrderTaxi; DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/model/OrderPrivateCar.java
@@ -432,6 +432,7 @@ private Integer driverCancle; private Integer promotion; // 推广应的金额 private BigDecimal promotionMoney; @@ -439,6 +440,13 @@ // 推广司机id private Integer promotionDriverId; public Integer getPromotion() { return promotion; } public void setPromotion(Integer promotion) { this.promotion = promotion; } public Date getVoiceTime() { return voiceTime; DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
@@ -12,6 +12,7 @@ import com.stylefeng.guns.modular.system.dao.CarServiceMapper; import com.stylefeng.guns.modular.system.dao.RegionMapper; import com.stylefeng.guns.modular.system.dao.SystemPriceMapper; 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.*; @@ -89,6 +90,13 @@ @Resource private CarServiceMapper carServiceMapper; @Resource private UserInfoMapper userInfoMapper; @Autowired private TDriverPromotionActivityService driverPromotionActivityService; @Resource private RedisTemplate<String, Object> redisTemplate; @@ -226,6 +234,12 @@ // orderPrivateCar.setBindId(map.get("bindId")); // } // 是否推广订单 Integer promotion = isPromotion(uid); orderPrivateCar.setPromotion(promotion); this.updateById(orderPrivateCar); //处理摆渡车的情况 @@ -310,7 +324,18 @@ } 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; } /** * 获取订单详情页(服务中的页面) * @param orderId DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserInfo.java
@@ -133,6 +133,36 @@ @TableField("state") private Integer state; /** * 绑定的司机id */ @TableField("bindDriverId") private Integer bindDriverId; /** * 绑定司机有效期 */ private Date bindExpireDate; public Integer getBindDriverId() { return bindDriverId; } public void setBindDriverId(Integer bindDriverId) { this.bindDriverId = bindDriverId; } public Date getBindExpireDate() { return bindExpireDate; } public void setBindExpireDate(Date bindExpireDate) { this.bindExpireDate = bindExpireDate; } public String getRegistIp() { return registIp; } DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/model/OrderTaxi.java
@@ -344,6 +344,8 @@ private String splitAllocation; private Integer promotion; // 推广应的金额 private BigDecimal promotionMoney; @@ -355,6 +357,14 @@ private Date voiceTime; public Integer getPromotion() { return promotion; } public void setPromotion(Integer promotion) { this.promotion = promotion; } public Date getVoiceTime() { return voiceTime; } 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){