| | |
| | | private String callbackPath; |
| | | |
| | | |
| | | @Autowired |
| | | private TDriverPromotionActivityService driverPromotionActivityService; |
| | | /** |
| | | * 出租车下单操作 |
| | | * |
| | |
| | | orderTaxi.setAbnormal(1); |
| | | this.baseMapper.updateById(orderTaxi); |
| | | } |
| | | |
| | | @Override |
| | | public void promotion(Integer orderId) { |
| | | OrderTaxi orderTaxi = this.baseMapper.selectById(orderId); |
| | | UserInfo userInfo = userInfoService.selectById(orderTaxi.getUserId()); |
| | | 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(" + 2 + ", bizType) limit 1")); |
| | | if(tDriverPromotionActivity!=null){ |
| | | Double payMoney = orderTaxi.getPayMoney(); |
| | | BigDecimal bigDecimal = tDriverPromotionActivity.getCommissionRatio().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(payMoney)).setScale(2, RoundingMode.HALF_UP); |
| | | orderTaxi.setPromotionDriverId(userInfo.getBindDriverId()); |
| | | orderTaxi.setPromotionMoney(bigDecimal); |
| | | this.baseMapper.updateById(orderTaxi); |
| | | } |
| | | } |
| | | } |
| | | } |