| | |
| | | <artifactId>geodesy</artifactId> |
| | | <version>1.1.3</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-mongodb</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | </dependency> |
| | | |
| | | <!--引入本地工行支付jar start--> |
| | | <!--<dependency>--> |
| | | <!--<groupId>com.icbc</groupId>--> |
| | |
| | | left join t_car_model f on (d.carModelId = f.id) |
| | | left join t_car_service g on (d.id = g.carId and g.`type` = 3) |
| | | left join t_line_price h on (g.serverCarModelId = h.serverCarModelId and a.lineId = h.lineId) |
| | | where 1 = 1 |
| | | where b.driverId in (select driverId from t_driver_work where state = 1 and type like '%3%') |
| | | <if test="null != lineId"> |
| | | and a.lineId = #{lineId} |
| | | </if> |
| | |
| | | orderCrossCity.setRemark(orderCrossCityWarpper.getRemark()); |
| | | orderCrossCity.setIsReassign(1); |
| | | //调用高德创建轨迹 |
| | | String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | String track = gdFalconUtil.createTrack(s); |
| | | orderCrossCity.setTrackId(track); |
| | | // String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | // String track = gdFalconUtil.createTrack(s); |
| | | // orderCrossCity.setTrackId(track); |
| | | if(orderCrossCity.getTravelMode() == 2){//包车 |
| | | orderCrossCity.setSeatNumber(lineShiftDriver.getLaveSeatNumber()); |
| | | orderCrossCity.setPeopleNumber(lineShiftDriver.getLaveSeat()); |
| | |
| | | import com.stylefeng.guns.modular.crossCity.server.ISiteService; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.SiteWarpper; |
| | | import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; |
| | | import com.stylefeng.guns.modular.system.util.model.GeoFencingPolygon; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.geo.GeoJsonPoint; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | @Service |
| | |
| | | |
| | | @Resource |
| | | private LocationMapper locationMapper; |
| | | |
| | | |
| | | @Autowired |
| | | private GDMapElectricFenceUtil gdMapElectricFenceUtil; |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | if(Integer.valueOf(map.get("type").toString()) == 2){//电子围栏 |
| | | String gid = map.get("gid").toString(); |
| | | List<String> list1 = gdMapElectricFenceUtil.monitorElectricFenc("", lonLat); |
| | | if(list1.contains(gid)){ |
| | | String[] split = lonLat.split(","); |
| | | GeoJsonPoint point = new GeoJsonPoint(Double.valueOf(split[0]), Double.valueOf(split[1])); |
| | | Query query = Query.query(Criteria.where("geoJsonPolygon").intersects(point)); |
| | | List<GeoFencingPolygon> geoFencingPolygons = mongoTemplate.find(query, GeoFencingPolygon.class); |
| | | List<Integer> s_sites = geoFencingPolygons.stream().map(GeoFencingPolygon::getSiteId).collect(Collectors.toList()); |
| | | if(s_sites.contains(siteId)){ |
| | | return true; |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | | return false; |
| | |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogisticsSpread; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsSpreadService; |
| | | 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.SystemPriceMapper; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | @Autowired |
| | | private IUserRedPacketRecordService userRedPacketRecordService; |
| | | |
| | | @Resource |
| | | private UserActivityDiscount1Mapper userActivityDiscount1Mapper; |
| | | |
| | | @Autowired |
| | | private IPaymentRecordService paymentRecordService; |
| | |
| | | if(dist.compareTo(jsonObject.getDouble("num20")) >= 0 && dist.compareTo(jsonObject.getDouble("num21")) < 0){ |
| | | price2 = jsonObject.getDouble("num22"); |
| | | } |
| | | if(dist.compareTo(jsonObject.getDouble("num10")) >= 0){ |
| | | price1 = jsonObject.getDouble("num11"); |
| | | } |
| | | if(dist.compareTo(jsonObject.getDouble("num21")) >= 0){ |
| | | price2 = jsonObject.getDouble("num22"); |
| | | } |
| | | }else{ |
| | | Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null); |
| | | String content = String.valueOf(query1.get("content")); |
| | |
| | | Double orderMoney = orderLogistics.getOrderMoney(); |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | ResultUtil resultUtil = ResultUtil.success(); |
| | | orderLogistics.setCouponMoney(0D);//初始化历史数据 |
| | | orderLogistics.setCouponId(null); |
| | | |
| | | //计算折扣 |
| | | UserActivityDiscount1 query2 = userActivityDiscount1Mapper.query(orderLogistics.getCompanyId()); |
| | | if(null != query2){ |
| | | Double special = query2.getLogistics(); |
| | | orderLogistics.setDiscount(special); |
| | | double v = new BigDecimal(orderMoney).multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | if(orderMoney.compareTo(v) > 0){ |
| | | orderLogistics.setDiscountMoney(orderMoney - v); |
| | | orderLogistics.setActivityId(query2.getId()); |
| | | orderMoney = v; |
| | | } |
| | | } |
| | | |
| | | if(payType == 1){//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | |
| | | if(null == orderLogistics){ |
| | | return ResultUtil.error("取消订单失败,订单信息有误"); |
| | | } |
| | | if(orderLogistics.getState() > 5 && orderLogistics.getState() != 7 && orderLogistics.getState() != 8 && orderLogistics.getState() != 11){ |
| | | if(orderLogistics.getState() >= 5 && orderLogistics.getState() != 7 && orderLogistics.getState() != 8 && orderLogistics.getState() != 11){ |
| | | return ResultUtil.error("取消订单失败,不合法的操作"); |
| | | } |
| | | |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | |
| | | |
| | |
| | | orderPrivateCar.setSnatchOrderTime(new Date()); |
| | | |
| | | //调用高德创建轨迹 |
| | | String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | String track = gdFalconUtil.createTrack(s); |
| | | orderPrivateCar.setTrackId(track); |
| | | // String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | // String track = gdFalconUtil.createTrack(s); |
| | | // orderPrivateCar.setTrackId(track); |
| | | |
| | | //调用移动的小号接口 |
| | | Map<String, String> geocode1 = gdMapGeocodingUtil.geocode(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | |
| | | System.err.println("查询距离出错了"); |
| | | }else{ |
| | | d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), 2, RoundingMode.HALF_UP).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | } |
| | | OrderServerWarpper orderServerWarpper = new OrderServerWarpper(); |
| | | orderServerWarpper.setOrderId(orderPrivateCar.getId()); |
| | |
| | | System.err.println("查询距离出错了"); |
| | | }else{ |
| | | d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), 2, RoundingMode.HALF_UP).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | } |
| | | orderServerWarpper.setReservationMileage("0"); |
| | | orderServerWarpper.setReservationTime("0"); |
| | |
| | | a.headImgUrl as avatar, |
| | | a.phone as phone, |
| | | c.carLicensePlate as carCode, |
| | | CONCAT(F.`name`, d.`name`, '.', c.carColor) as carName, |
| | | CONCAT(f.`name`, d.`name`, '.', c.carColor) as carName, |
| | | (select sum(fraction) / count(id) from t_order_evaluate where driverId = a.id) as score, |
| | | ( |
| | | (select count(id) from t_order_private_car where state in (7, 8, 9) and driverId = a.id) + |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.model; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.data.mongodb.core.geo.GeoJsonPolygon; |
| | | import org.springframework.data.mongodb.core.index.GeoSpatialIndexType; |
| | | import org.springframework.data.mongodb.core.index.GeoSpatialIndexed; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 地理围栏-多边形 |
| | | * @author zhibing.pu |
| | | * @date 2023/4/29 23:53 |
| | | */ |
| | | @Data |
| | | @Document(collection = "geo_fencing") |
| | | public class GeoFencingPolygon implements Serializable { |
| | | private static final long serialVersionUID = 4508868382007529971L; |
| | | |
| | | private String id; |
| | | /** |
| | | * 站点id |
| | | */ |
| | | private Integer siteId; |
| | | /** |
| | | * 站点名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 多边形经纬度 |
| | | */ |
| | | @GeoSpatialIndexed(type = GeoSpatialIndexType.GEO_2DSPHERE) |
| | | private GeoJsonPolygon geoJsonPolygon; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class GeoJson { |
| | | private String type; |
| | | private Double[] coordinates; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class LocationQuery { |
| | | /** |
| | | * 当前经纬度[xxx,xxx] |
| | | **/ |
| | | private Double[] coordinates; |
| | | /** |
| | | * 距离,如:200,500,1,3,5,10,20 |
| | | **/ |
| | | private Double distance; |
| | | /** |
| | | * 距离单位,如:m,km |
| | | **/ |
| | | private String unit; |
| | | /** |
| | | * 位置类型:1-景点,2-加油站,3-酒店 |
| | | **/ |
| | | private Integer type; |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | |
| | | orderTaxi.setState(2);//待出发 |
| | | orderTaxi.setSnatchOrderTime(new Date()); |
| | | //调用高德创建轨迹 |
| | | String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | String track = gdFalconUtil.createTrack(s); |
| | | orderTaxi.setTrackId(track); |
| | | // String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | // String track = gdFalconUtil.createTrack(s); |
| | | // orderTaxi.setTrackId(track); |
| | | |
| | | //调用移动的小号接口 |
| | | Map<String, String> geocode1 = gdMapGeocodingUtil.geocode(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | |
| | | System.err.println("查询距离出错了"); |
| | | }else{ |
| | | d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), 2, RoundingMode.HALF_UP).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | } |
| | | OrderServerWarpper orderServerWarpper = new OrderServerWarpper(); |
| | | orderServerWarpper.setOrderId(orderTaxi.getId()); |
| | |
| | | System.err.println("查询距离出错了"); |
| | | }else{ |
| | | d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), 2, RoundingMode.HALF_UP).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | } |
| | | orderServerWarpper.setReservationMileage("0"); |
| | | orderServerWarpper.setReservationTime("0"); |
| | |
| | | dataSourceNames: |
| | | - dataSourceGuns |
| | | - dataSourceBiz |
| | | --- |
| | | |
| | | spring: |
| | | data: |
| | | mongodb: |
| | | uri: mongodb://127.0.0.1:27017/admin |
| | | --- |
| | | |
| | | |