| | |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.specialTrain.server.impl.OrderPrivateCarServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.RegionMapper; |
| | | import com.stylefeng.guns.modular.system.dao.SensitiveWordsMapper; |
| | | import com.stylefeng.guns.modular.system.dao.SysIntegralMapper; |
| | | import com.stylefeng.guns.modular.system.dao.UserActivityDiscount1Mapper; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.vo.UnPayOrderVO; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | |
| | | @Resource |
| | | private OrderTaxiMapper orderTaxiMapper; |
| | | |
| | | @Resource |
| | | private RegionMapper regionMapper; |
| | | |
| | | |
| | | @Resource |
| | | private SensitiveWordsMapper sensitiveWordsMapper; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IOrderPrivateCarService orderPrivateCarService; |
| | | |
| | | @Autowired |
| | | private ILineService lineService; |
| | | |
| | | |
| | | @Autowired |
| | | private IIncomeService incomeService; |
| | | |
| | |
| | | @Autowired |
| | | private ChinaMobileUtil chinaMobileUtil; |
| | | |
| | | @Autowired |
| | | private GDFalconUtil gdFalconUtil; |
| | | |
| | | |
| | | @Resource |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | |
| | | @Autowired |
| | | private ITaxiCardPaymentService taxiCardPaymentService; |
| | | |
| | | |
| | | @Autowired |
| | | private ICompanyService companyService; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IRegionService regionService; |
| | | |
| | | @Autowired |
| | | private TAbnormalPayOrderMapper abnormalPayOrderMapper; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private TDriverPromotionActivityService driverPromotionActivityService; |
| | | |
| | | |
| | | @Value("${callbackPath}") |
| | |
| | | // orderCrossCity.setTelX(map.get("telX")); |
| | | // orderCrossCity.setBindId(map.get("bindId")); |
| | | // } |
| | | |
| | | // 是否推广订单 |
| | | Integer promotion = isPromotion(uid); |
| | | orderCrossCity.setPromotion(promotion); |
| | | |
| | | this.insert(orderCrossCity); |
| | | |
| | | if (driver.getState() == 2) { |
| | |
| | | |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | |
| | | |
| | | |
| | | private Integer isPromotion(Integer userId){ |
| | | UserInfo userInfo = userInfoService.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(" + 3 + ", bizType) limit 1")); |
| | | if(tDriverPromotionActivity!=null){ |
| | | return 2; |
| | | } |
| | | } |
| | | return null; |
| | | |
| | | } |
| | | /** |
| | | * 获取订单 |
| | | * |
| | |
| | | if (Integer.valueOf(String.valueOf(map.get("state"))) == 11) { |
| | | map.put("state", map.get("oldState")); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("state"))) ==7 && (map.get("responsibilityType")==null || Integer.valueOf(String.valueOf(map.get("responsibilityType")))<4)){ |
| | | map.put("appealButton", 1); |
| | | } |
| | | if(map.get("abnormalIntro")!=null){ |
| | | map.put("appealStatus", 1); |
| | | } |
| | | |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(map.get("startLon").toString(), map.get("startLat").toString()); |
| | | map.put("startCity", geocode.get("city")); |
| | | geocode = gdMapGeocodingUtil.geocode(map.get("endLon").toString(), map.get("endLat").toString()); |
| | |
| | | } |
| | | return unPayOrderVOList; |
| | | } |
| | | |
| | | @Override |
| | | public void addAppeal(Integer uid, Integer orderId, String abnormalIntro, String abnormalImg) { |
| | | OrderCrossCity orderCrossCity = this.selectById(orderId); |
| | | if(orderCrossCity.getState()!=7 || orderCrossCity.getAbnormalIntro()!=null){ |
| | | throw new RuntimeException("此订单无法申诉"); |
| | | } |
| | | orderCrossCity.setAbnormalIntro(abnormalIntro); |
| | | orderCrossCity.setAbnormalImg(abnormalImg); |
| | | orderCrossCity.setAbnormal(2); |
| | | this.baseMapper.updateById(orderCrossCity); |
| | | } |
| | | |
| | | @Override |
| | | public void promotion(Integer orderId) { |
| | | OrderCrossCity orderCrossCity = this.baseMapper.selectById(orderId); |
| | | UserInfo userInfo = userInfoService.selectById(orderCrossCity.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(" + 3 + ", bizType) limit 1")); |
| | | if(tDriverPromotionActivity!=null){ |
| | | Double payMoney = orderCrossCity.getPayMoney(); |
| | | BigDecimal bigDecimal = tDriverPromotionActivity.getCommissionRatio().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(payMoney)).setScale(2, RoundingMode.HALF_UP); |
| | | orderCrossCity.setPromotionDriverId(userInfo.getBindDriverId()); |
| | | orderCrossCity.setPromotionMoney(bigDecimal); |
| | | orderCrossCity.setPromotionActivityId(tDriverPromotionActivity.getId()); |
| | | this.baseMapper.updateById(orderCrossCity); |
| | | } |
| | | } |
| | | |
| | | // 是否异常订单 |
| | | if (orderCrossCity.getResponsibilityType() !=null && orderCrossCity.getResponsibilityType() >2) { |
| | | TAbnormalPayOrder tAbnormalPayOrder = abnormalPayOrderMapper.selectList(new EntityWrapper<TAbnormalPayOrder>().eq("type", 3).eq("orderNum", orderCrossCity.getOrderNum())).stream().findFirst().orElse(null); |
| | | if (tAbnormalPayOrder != null) { |
| | | tAbnormalPayOrder.setPayStatus(2); |
| | | tAbnormalPayOrder.setPayTime(new Date()); |
| | | abnormalPayOrderMapper.updateById(tAbnormalPayOrder); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryMyTripList(Integer uid, Integer pageNum, Integer size) throws Exception { |
| | | pageNum = (pageNum - 1) * size; |
| | | List<Map<String, Object>> maps = orderCrossCityMapper.queryMyTripList(uid, pageNum, size); |
| | | for (Map<String, Object> map : maps) { |
| | | if (Integer.valueOf(String.valueOf(map.get("state"))) == 11) { |
| | | map.put("state", map.get("oldState")); |
| | | } |
| | | } |
| | | return maps; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryMyTripListAll(Integer uid) throws Exception { |
| | | |
| | | List<Map<String, Object>> maps = orderCrossCityMapper.queryMyTripListAll(uid); |
| | | for (Map<String, Object> map : maps) { |
| | | if (Integer.valueOf(String.valueOf(map.get("state"))) == 11) { |
| | | map.put("state", map.get("oldState")); |
| | | } |
| | | } |
| | | return maps; |
| | | } |
| | | } |