| | |
| | | Map<String, String> distanceMap = gdMapElectricFenceUtil.getDistance(orderPrivateCar.getStartLon() + "," + orderPrivateCar.getStartLat(), orderPrivateCar.getEndLon() + "," + orderPrivateCar.getEndLat(), 1); |
| | | orderPrivateCar.setEstimateMileage(Double.valueOf(distanceMap.get("distance"))); |
| | | orderPrivateCar.setEstimateTime(Double.valueOf(distanceMap.get("duration")) / 60); |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | if (instead == 0 || ToolUtil.isEmpty(orderPrivateCar.getPassengers())) { |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | |
| | | if (ToolUtil.isEmpty(userInfo.getPhone())) { |
| | | return ResultUtil.error("请先绑定手机号码"); |
| | | } |
| | |
| | | orderPrivateCar.setPromotionDriverId(promotion); |
| | | } |
| | | |
| | | |
| | | this.insert(orderPrivateCar); |
| | | |
| | | //判断独享,一口价,拼车 |
| | | JSONArray jsonArray = JSON.parseArray(serverCarModel); |
| | | this.insert(orderPrivateCar); |
| | | |
| | | |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject1 = jsonArray.getJSONObject(i); |
| | | Integer serverCarModelId = jsonObject1.getInteger("serverCarModelId"); |
| | |
| | | orderPrivateCar.setIsReassign(1); |
| | | orderPrivateCar.setIsDelete(1); |
| | | orderPrivateCar.setPid(orderPrivateCar1.getPid() == null ? orderPrivateCar1.getId() : orderPrivateCar1.getPid()); |
| | | |
| | | Company company = companyService.selectById(driver.getCompanyId()); |
| | | //调三方订单中心创建行程单 |
| | | CreateTravelItineraryRequest request = new CreateTravelItineraryRequest(); |
| | | request.setOrderNo("PR" + orderPrivateCar.getId()); |
| | | request.setCustomerId(userInfo.getOnconUUID()); |
| | | request.setDriverId(driver.getEmpId().toString()); |
| | | request.setSupplierShopId(company.getEnterCode()); |
| | | if(orderPrivateCar.getPromotion() !=null && 2 == orderPrivateCar.getPromotion()){ |
| | | Driver driver1 = driverService.selectById(orderPrivateCar.getPromotionDriverId()); |
| | | request.setPromoterId(driver1.getEmpId().toString()); |
| | | } |
| | | request.setServiceType(2); |
| | | String travelItinerary = OrderUtil.createTravelItinerary(request); |
| | | orderPrivateCar.setTravelId(travelItinerary); |
| | | |
| | | this.insertOrUpdate(orderPrivateCar); |
| | | //修改总订单人数 |
| | | OrderPrivateCar orderPrivateCar2 = new OrderPrivateCar(); |
| | |
| | | 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(" + 1 + ", bizType) limit 1")); |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("districtCode", registAreaCode).eq("state",1).ge("startTime", new Date()).lt("endTime", new Date()).last("AND FIND_IN_SET(" + 1 + ", bizType) limit 1")); |
| | | if(tDriverPromotionActivity!=null){ |
| | | return userInfo.getBindDriverId(); |
| | | } |
| | |
| | | Driver driver2 = driverService.selectById(orderPrivateCar.getPromotionDriverId()); |
| | | request.setPromoterId(driver2.getEmpId().toString()); |
| | | } |
| | | OrderUtil.modifyTravelItinerary(request); |
| | | if(orderPrivateCar.getTravelId()!=null){ |
| | | OrderUtil.modifyTravelItinerary(request); |
| | | } |
| | | } |
| | | } else { |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | |
| | | } |
| | | orderPrivateCar.setAbnormalIntro(abnormalIntro); |
| | | orderPrivateCar.setAbnormalImg(abnormalImg); |
| | | orderPrivateCar.setAbnormal(1); |
| | | orderPrivateCar.setAbnormal(2); |
| | | this.baseMapper.updateById(orderPrivateCar); |
| | | |
| | | } |
| | |
| | | BigDecimal bigDecimal = tDriverPromotionActivity.getCommissionRatio().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(payMoney)).setScale(2, RoundingMode.HALF_UP); |
| | | orderPrivateCar.setPromotionDriverId(userInfo.getBindDriverId()); |
| | | orderPrivateCar.setPromotionMoney(bigDecimal); |
| | | orderPrivateCar.setPromotionActivityId(tDriverPromotionActivity.getId()); |
| | | this.baseMapper.updateById(orderPrivateCar); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryMyTripList(Integer uid, Integer pageNum, Integer size) throws Exception { |
| | | pageNum = (pageNum - 1) * size; |
| | | List<Map<String, Object>> maps = orderPrivateCarMapper.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 = orderPrivateCarMapper.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; |
| | | } |
| | | } |