| | |
| | | public void promotion(Integer orderId) { |
| | | OrderCrossCity orderCrossCity = this.baseMapper.selectById(orderId); |
| | | UserInfo userInfo = userInfoMapper.selectById(orderCrossCity.getUserId()); |
| | | if(userInfo.getBindDriverId()!=null && userInfo.getBindExpireDate().getTime()<=System.currentTimeMillis()){ |
| | | if(orderCrossCity.getPromotionDriverId()!=null ){ |
| | | 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(" + 3 + ", bizType) limit 1")); |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("districtCode", registAreaCode).le("startTime", new Date()).ge("endTime", new Date()).last("AND FIND_IN_SET(" + 3 + ", bizType) limit 1")); |
| | | System.out.println("ddddd"+tDriverPromotionActivity); |
| | | if(tDriverPromotionActivity!=null){ |
| | | Double payMoney = orderCrossCity.getPayMoney(); |
| | | System.out.println(payMoney); |
| | | BigDecimal bigDecimal = tDriverPromotionActivity.getCommissionRatio().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(payMoney)).setScale(2, RoundingMode.HALF_UP); |
| | | System.out.println(bigDecimal); |
| | | orderCrossCity.setPromotionDriverId(userInfo.getBindDriverId()); |
| | | orderCrossCity.setPromotionMoney(bigDecimal); |
| | | orderCrossCity.setPromotionActivityId(tDriverPromotionActivity.getId()); |
| | | orderCrossCity.setSuccessTime(new Date()); |
| | | this.baseMapper.updateById(orderCrossCity); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | /** |
| | |
| | | String lat = orderPosition.getLat(); |
| | | OrderCrossCity order = this.selectById(orderId); |
| | | if(null == order){ |
| | | System.err.println("订单数据异常:" + orderId); |
| | | System.err.println("跨城订单数据异常:" + orderId); |
| | | return false; |
| | | } |
| | | |