| | |
| | | if(b){ |
| | | //先计算里程,在存储最新位置 |
| | | orderPosition.setInsertTime(new Date()); |
| | | //将数据存储到文件中 |
| | | List<OrderPosition> orderPositions = orderPositionService.queryPosition(orderCrossCity.getId(), 3); |
| | | orderPositions.add(orderPosition); |
| | | mongoTemplate.save(orderPositions); |
| | | mongoTemplate.save(orderPosition); |
| | | } |
| | | } |
| | | return false;//上层不需要处理 |
| | |
| | | @Override |
| | | public Map<String, Object> queryPhone(String code) throws Exception { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(ToolUtil.isEmpty(code)){ |
| | | map.put("phone","400-995-1700"); |
| | | return map; |
| | | } |
| | | OpenCity openCity = openCityService.openCity1(code); |
| | | Phone phone = phoneMapper.queryInfo(openCity.getId(), 2, 2); |
| | | map.put("phone", null != phone ? phone.getPhone() : ""); |
| | |
| | | |
| | | //平台抽成金额 |
| | | BigDecimal multiply1 = new BigDecimal(payMoney).multiply(new BigDecimal(percent / 100)); |
| | | //抽成金额小于最低金额,司机收入为0 |
| | | //抽成金额小于最低金额,平台抽范围最低金额 |
| | | if(multiply1.compareTo(new BigDecimal(d)) < 0){ |
| | | saveData(1, 1, 2, orderId, orderType, payMoney); |
| | | return new BigDecimal(0); |
| | | //司机收入 |
| | | BigDecimal subtract = new BigDecimal(payMoney).subtract(new BigDecimal(d)); |
| | | saveData(2, driverId, 2, orderId, orderType, subtract.doubleValue()); |
| | | saveData(1, 1, 2, orderId, orderType, d); |
| | | return subtract; |
| | | } |
| | | if(multiply1.compareTo(new BigDecimal(d)) >= 0 && multiply1.compareTo(new BigDecimal(g)) < 0){ |
| | | //司机收入 |
| | |
| | | redis: |
| | | namespace: spring:chuxing:session |
| | | store-type: redis |
| | | timeout: 1800 |
| | | timeout: 7200 |
| | | |
| | | mybatis-plus: |
| | | type-aliases-package: com.stylefeng.guns.modular |
| | |
| | | redis: |
| | | namespace: spring:chuxing:session |
| | | store-type: redis |
| | | timeout: 1800 |
| | | timeout: 7200 |
| | | redis: |
| | | host: 10.31.1.219 |
| | | port: 6410 |
| | |
| | | redis: |
| | | namespace: spring:chuxing:session |
| | | store-type: redis |
| | | timeout: 1800 |
| | | timeout: 7200 |
| | | redis: |
| | | host: 10.88.154.24 |
| | | port: 7560 |
| | |
| | | Query query = Query.query(Criteria.where("point").withinSphere(circle)); |
| | | List<DriverPosition> driverPositions = mongoTemplate.find(query, DriverPosition.class); |
| | | |
| | | log.info("地理空间检索出的数据:{}", JSON.toJSONString(driverPositions)); |
| | | // log.info("地理空间检索出的数据:{}", JSON.toJSONString(driverPositions)); |
| | | List<Map<String, Object>> collect = new ArrayList<>(); |
| | | if(driverPositions.size() > 0){ |
| | | List<Integer> driverIds = driverPositions.stream().map(DriverPosition::getDriverId).collect(Collectors.toList()); |
| | |
| | | } |
| | | }else { |
| | | Region code = regionService.selectOne(new EntityWrapper<Region>().eq("code", driver.getPlaceOfEmployment())); |
| | | Region region = regionService.selectById(code.getParentId()); |
| | | TDriverPromotionActivity tDriverPromotionActivity1 = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("cityCode", region.getCode()).le("startTime", new Date()).ge("endTime", new Date()).last(" limit 1")); |
| | | if(tDriverPromotionActivity1!=null) { |
| | | if (userInfo.getBindDriverId() == null || userInfo.getBindExpireDate().getTime() <= System.currentTimeMillis()) { |
| | | Integer bindingDays = tDriverPromotionActivity1.getBindingDays(); |
| | | // 当前时间+绑定天数 |
| | | Date endTime = DateUtils.addDays(new Date(), bindingDays); |
| | | userInfo.setBindDriverId(driverId); |
| | | userInfo.setBindExpireDate(endTime); |
| | | userInfo.setBindDate(new Date()); |
| | | userInfoService.updateById(userInfo); |
| | | if(null != code){ |
| | | Region region = regionService.selectById(code.getParentId()); |
| | | TDriverPromotionActivity tDriverPromotionActivity1 = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("cityCode", region.getCode()).le("startTime", new Date()).ge("endTime", new Date()).last(" limit 1")); |
| | | if(tDriverPromotionActivity1!=null) { |
| | | if (userInfo.getBindDriverId() == null || userInfo.getBindExpireDate().getTime() <= System.currentTimeMillis()) { |
| | | Integer bindingDays = tDriverPromotionActivity1.getBindingDays(); |
| | | // 当前时间+绑定天数 |
| | | Date endTime = DateUtils.addDays(new Date(), bindingDays); |
| | | userInfo.setBindDriverId(driverId); |
| | | userInfo.setBindExpireDate(endTime); |
| | | userInfo.setBindDate(new Date()); |
| | | userInfoService.updateById(userInfo); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private ICompanyService companyService; |
| | | |
| | | @Autowired |
| | | private IOrderInvitationService orderInvitationService; |
| | | |
| | | |
| | | |
| | |
| | | OrderRide orderRide=orderRideService.selectOne(new EntityWrapper<OrderRide>().eq("userId",userId) |
| | | .eq("state",2)); |
| | | if(orderRide!=null){ |
| | | OrderInvitation orderInvitation = new OrderInvitation(); |
| | | orderInvitation.setOrderRideId(orderRide.getId()); |
| | | orderInvitation.setOrderTravelId(orderTravel.getId()); |
| | | orderInvitation.setInsertTime(new Date()); |
| | | orderInvitationService.insert(orderInvitation); |
| | | String message="您发布的"+DateUtil.getDateToString(orderTravel.getStartTime(),"MM月dd日")+"的行程有乘客邀请您同行"; |
| | | /*添加系统消息*/ |
| | | try { |
| | |
| | | } |
| | | return ResultUtil.error("异常"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 用户订单匹配列表页面,用户订单去匹配司机的行程 |
| | | * @param type 搜索条件:1默认排序(根据线路、时间,人数综合匹配排序721),2时间最早,3距离最近 |
| | |
| | | orderRideVo.setLon(orderRide.getStartLon()); |
| | | orderRideVo.setLat(orderRide.getStartLat()); |
| | | orderRideVo.setNum(orderRide.getNum()); |
| | | orderRideVo.setId(orderId); |
| | | orderRideVo.setType(type+1);//搜索条件:1默认排序(根据线路、时间,人数综合匹配排序721),2时间最早,3距离最近 |
| | | List<OrderRideVo> orderRides=orderTravelService.getOrderTravel(orderRideVo); |
| | | return ResultUtil.success(orderRides); |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.rest.modular.system.dao.FinancialMapper"> |
| | | <mapper namespace="com.stylefeng.guns.modular.shunfeng.dao.FinancialMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.shunfeng.model.Financial"> |
| | |
| | | <!--顺风车司机订单行程 type :1待处理的订单,2根据线路、时间,人数综合匹配排序 3按时间排序,4距离最近排序 and r.startTime>=now()--> |
| | | <select id="getOrderTravel" resultType="com.stylefeng.guns.modular.shunfeng.model.vo.OrderRideVo"> |
| | | select r.*,calculate_distance(#{lat},#{lon},r.startLat, r.startLon) as distance,d.totalOrders,u.sex,u.avatar as headImg,u.nickName as name, |
| | | r.id as driverOrderId,i.id as userOrderId, r.startLon as lon, r.startLat as lat |
| | | r.id as driverOrderId,i.id as userOrderId, r.startLon as lon, r.startLat as lat, if(e.id is null, 0, 1) as invitation |
| | | from app_order_travel r |
| | | left join app_order_ride i on i.travelId=r.id |
| | | left join t_user u on u.driverId = r.driverId |
| | | left join app_driver_ride d on d.id=r.driverId |
| | | left join app_order_invitation e on e.orderRideId = #{id} and e.orderTravelId = r.id |
| | | <where> |
| | | <if test="driverId!=null"> |
| | | and r.driverId = #{driverId} |
| | |
| | | private Double lon; |
| | | |
| | | private Double lat; |
| | | /** |
| | | * 是否已邀请(0=否,1=是) |
| | | */ |
| | | private Integer invitation; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | public void setDriverOrderId(Integer driverOrderId) { |
| | | this.driverOrderId = driverOrderId; |
| | | } |
| | | |
| | | public Integer getInvitation() { |
| | | return invitation; |
| | | } |
| | | |
| | | public void setInvitation(Integer invitation) { |
| | | this.invitation = invitation; |
| | | } |
| | | } |
| | |
| | | carService.setType(1); |
| | | carService.setCarId(driver.getCarId()); |
| | | CarService carService1 = carServiceMapper.selectOne(carService); |
| | | serverCarModel = "{\"serverCarModelId\":" + carService1.getServerCarModelId() + ",\"rideType\":1}"; |
| | | serverCarModel = "[{\"serverCarModelId\":" + carService1.getServerCarModelId() + ",\"rideType\":1}]"; |
| | | } |
| | | |
| | | startAddress = startAddress.replaceAll("& #40;", "("); |
| | |
| | | carService.setType(1); |
| | | carService.setCarId(driver.getCarId()); |
| | | CarService carService1 = carServiceMapper.selectOne(carService); |
| | | serverCarModel = "{\"serverCarModelId\":" + carService1.getServerCarModelId() + ",\"rideType\":1}"; |
| | | serverCarModel = "[{\"serverCarModelId\":" + carService1.getServerCarModelId() + ",\"rideType\":1}]"; |
| | | } |
| | | |
| | | startAddress = startAddress.replaceAll("& #40;", "("); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.dao.PhoneMapper; |
| | | import com.stylefeng.guns.modular.system.model.OpenCity; |
| | | import com.stylefeng.guns.modular.system.model.Phone; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | |
| | | @Service |
| | |
| | | */ |
| | | @Override |
| | | public List<Phone> queryPhones(String code) throws Exception { |
| | | OpenCity openCity = openCityService.openCity1(code); |
| | | return phoneMapper.selectList(new EntityWrapper<Phone>().eq("openCityId", openCity.getId())); |
| | | if(ToolUtil.isNotEmpty(code)){ |
| | | OpenCity openCity = openCityService.openCity1(code); |
| | | return phoneMapper.selectList(new EntityWrapper<Phone>().eq("openCityId", openCity.getId())); |
| | | } |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | |
| | |
| | | nickName = userInfo.getNickName(); |
| | | } |
| | | //调中台接口查询用户 |
| | | List<QYTUserInfo> infoByPhone = UserUtil.getUserInfoByPhone(phone); |
| | | if (null == userInfo) { |
| | | userInfo = new UserInfo(); |
| | | userInfo.setAvatar("https://traffic.qytzt.cn/v1/AUTH_d8bef0a04db511f0b79d01a3e2b7587e/qyt20250702/imgs/management/d081e7a9-13d4-4eec-afb6-afd10885a664.png"); |
| | |
| | | userInfo.setConsumption(0D); |
| | | userInfo.setBalance(0D); |
| | | userInfo.setState(1); |
| | | if(null != onconUUID){ |
| | | userInfo.setOnconUUID(onconUUID); |
| | | } |
| | | userInfo.setOnconUUID(onconUUID); |
| | | |
| | | //用户所属企业 |
| | | if(null != areaCode){ |