8 文件已重命名
30个文件已添加
34个文件已修改
| File was renamed from xp-service/xp-operation/src/main/java/com/xiaopeng/operation/model/ServerCarModelWarpper.java |
| | |
| | | package com.xiaopeng.operation.model; |
| | | package com.xiaopeng.api.model.operation; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| File was renamed from xp-service/xp-operation/src/main/java/com/xiaopeng/operation/model/XpAgreement.java |
| | |
| | | package com.xiaopeng.operation.model; |
| | | package com.xiaopeng.api.model.operation; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| File was renamed from xp-service/xp-operation/src/main/java/com/xiaopeng/operation/model/XpAgreementAppUser.java |
| | |
| | | package com.xiaopeng.operation.model; |
| | | package com.xiaopeng.api.model.operation; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| File was renamed from xp-service/xp-operation/src/main/java/com/xiaopeng/operation/model/XpBanner.java |
| | |
| | | package com.xiaopeng.operation.model; |
| | | package com.xiaopeng.api.model.operation; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| New file |
| | |
| | | package com.xiaopeng.api.model.operation; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 电子围栏 |
| | | * </p> |
| | | * |
| | | * @author liu |
| | | * @since 2026-02-03 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("xp_electronic_fence") |
| | | @ApiModel(value="XpElectronicFence对象", description="电子围栏") |
| | | public class XpElectronicFence implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "围栏名称") |
| | | @TableField("electronic_name") |
| | | private String electronicName; |
| | | |
| | | @ApiModelProperty(value = "围栏编号唯一 规则:城市首字母-类型简写-4位自增流水号(如 SZ-OP-001)") |
| | | @TableField("electronic_number") |
| | | private String electronicNumber; |
| | | |
| | | @ApiModelProperty(value = "围栏状态 0=草稿 1=待启用 2=启用中 3=已停用") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "生效类型 1=立即生效 2=定时生效") |
| | | @TableField("effect_type") |
| | | private Integer effectType; |
| | | |
| | | @ApiModelProperty(value = "生效时间") |
| | | @TableField("effect_time") |
| | | private LocalDateTime effectTime; |
| | | |
| | | @ApiModelProperty(value = "失效类型 1=永不失效 2=定时失效") |
| | | @TableField("failure_type") |
| | | private Integer failureType; |
| | | |
| | | @ApiModelProperty(value = "失效时间") |
| | | @TableField("failure_time") |
| | | private LocalDateTime failureTime; |
| | | |
| | | @ApiModelProperty(value = "运营策略") |
| | | @TableField("operation_strategy") |
| | | private String operationStrategy; |
| | | |
| | | @ApiModelProperty(value = "是否删除 0=未删除 1=已删除") |
| | | @TableField("is_deleted") |
| | | private Boolean isDeleted; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "修改时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "创建人") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "修改人") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.api.model.operation; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 电子围栏区域构成 |
| | | * </p> |
| | | * |
| | | * @author liu |
| | | * @since 2026-02-03 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("xp_electronic_fence_area") |
| | | @ApiModel(value="XpElectronicFenceArea对象", description="电子围栏区域构成") |
| | | public class XpElectronicFenceArea implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "围栏id") |
| | | @TableField("electronic_id") |
| | | private Long electronicId; |
| | | |
| | | @ApiModelProperty(value = "区域名称") |
| | | @TableField("area_name") |
| | | private String areaName; |
| | | |
| | | @ApiModelProperty(value = "区域类型 1=运营区 2=禁行区") |
| | | @TableField("area_type") |
| | | private Integer areaType; |
| | | |
| | | @ApiModelProperty(value = "区域描述") |
| | | @TableField("area_description") |
| | | private String areaDescription; |
| | | |
| | | @ApiModelProperty(value = "区域状态 1=启用 2=禁用") |
| | | @TableField("area_status") |
| | | private Integer areaStatus; |
| | | |
| | | @ApiModelProperty(value = "围栏点位") |
| | | @TableField("fence_points") |
| | | private String fencePoints; |
| | | |
| | | @ApiModelProperty(value = "是否删除 0=未删除 1=已删除") |
| | | @TableField("is_deleted") |
| | | private Boolean isDeleted; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "修改时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "创建人") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "修改人") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | |
| | | } |
| File was renamed from xp-service/xp-operation/src/main/java/com/xiaopeng/operation/model/XpOpenCity.java |
| | |
| | | package com.xiaopeng.operation.model; |
| | | package com.xiaopeng.api.model.operation; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| New file |
| | |
| | | package com.xiaopeng.api.model.operation; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 点位管理 |
| | | * </p> |
| | | * |
| | | * @author liu |
| | | * @since 2026-02-03 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("xp_point") |
| | | @ApiModel(value="XpPoint对象", description="点位管理") |
| | | public class XpPoint implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "点位名称") |
| | | @TableField("point_name") |
| | | private String pointName; |
| | | |
| | | @ApiModelProperty(value = "点位poi") |
| | | @TableField("point_poi") |
| | | private String pointPoi; |
| | | |
| | | @ApiModelProperty(value = "点位编号唯一") |
| | | @TableField("point_number") |
| | | private String pointNumber; |
| | | |
| | | @ApiModelProperty(value = "运营状态 1=待启用 2=启用中 3=已停用 4=已失效") |
| | | @TableField("operation_status") |
| | | private Integer operationStatus; |
| | | |
| | | @ApiModelProperty(value = "点位类型 1=运营点位 2=测试点位") |
| | | @TableField("point_type") |
| | | private Integer pointType; |
| | | |
| | | @ApiModelProperty(value = "验证状态 1=待验证、2=验证中、3=已验证") |
| | | @TableField("verification_status") |
| | | private Integer verificationStatus; |
| | | |
| | | @ApiModelProperty(value = "限停时长") |
| | | @TableField("parking_time_limit") |
| | | private Integer parkingTimeLimit; |
| | | |
| | | @ApiModelProperty(value = "运营类型 1=与运营区同步 2=自定义时间段") |
| | | @TableField("operation_type") |
| | | private Integer operationType; |
| | | |
| | | @ApiModelProperty(value = "生效周期 1=“每日生效”、2=“仅工作日生效”、3=“仅非工作日生效”、4=“仅节假日生效”") |
| | | @TableField("effective_period") |
| | | private Integer effectivePeriod; |
| | | |
| | | @ApiModelProperty(value = "生效时间段") |
| | | @TableField("effective_time_period") |
| | | private String effectiveTimePeriod; |
| | | |
| | | @ApiModelProperty(value = "点位地址") |
| | | @TableField("point_address") |
| | | private String pointAddress; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @TableField("remarks") |
| | | private String remarks; |
| | | |
| | | @ApiModelProperty(value = "点位照片") |
| | | @TableField("point_pictures") |
| | | private String pointPictures; |
| | | |
| | | @ApiModelProperty(value = "经度") |
| | | @TableField("point_lon") |
| | | private Double pointLon; |
| | | |
| | | @ApiModelProperty(value = "纬度") |
| | | @TableField("point_lat") |
| | | private Double pointLat; |
| | | |
| | | @ApiModelProperty(value = "是否删除 0=未删除 1=已删除") |
| | | @TableField("is_deleted") |
| | | private Boolean isDeleted; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "修改时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "创建人") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "修改人") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | |
| | | } |
| File was renamed from xp-service/xp-operation/src/main/java/com/xiaopeng/operation/model/XpPricing.java |
| | |
| | | package com.xiaopeng.operation.model; |
| | | package com.xiaopeng.api.model.operation; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| New file |
| | |
| | | package com.xiaopeng.api.model.operation; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市管理 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-02-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("xp_region") |
| | | @ApiModel(value="TRegion对象", description="省市管理") |
| | | public class XpRegion implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "城市名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "城市代码") |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "城市code") |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | |
| | | @ApiModelProperty(value = "父级ID") |
| | | @TableField("parentId") |
| | | private Long parentId; |
| | | |
| | | @ApiModelProperty(value = "英文名称") |
| | | @TableField("english") |
| | | private String english; |
| | | |
| | | @ApiModelProperty(value = "首字母") |
| | | @TableField("initial") |
| | | private String initial; |
| | | |
| | | private String lon; |
| | | |
| | | private String lat; |
| | | |
| | | } |
| File was renamed from xp-service/xp-operation/src/main/java/com/xiaopeng/operation/model/XpRideGuide.java |
| | |
| | | package com.xiaopeng.operation.model; |
| | | package com.xiaopeng.api.model.operation; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| File was renamed from xp-service/xp-operation/src/main/java/com/xiaopeng/operation/model/XpSystemSetting.java |
| | |
| | | package com.xiaopeng.operation.model; |
| | | package com.xiaopeng.api.model.operation; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| New file |
| | |
| | | package com.xiaopeng.api.vo.operation; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("电子围栏开放区域Vo") |
| | | public class XpElectronicFenceVo { |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "围栏名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "多边形顶点坐标数组") |
| | | private List<XpPointsVo> points; |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.api.vo.operation; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("经纬度信息Vo") |
| | | public class XpPointsVo { |
| | | private Double lat; |
| | | |
| | | private Double lng; |
| | | } |
| | |
| | | <version>2.6</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | |
| | | <!--mongodb--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-mongodb</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| New file |
| | |
| | | package com.xiaopeng.map.controller; |
| | | |
| | | |
| | | import com.xiaopeng.api.vo.operation.XpElectronicFenceVo; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | | import com.xiaopeng.common.core.web.domain.AjaxResult; |
| | | import com.xiaopeng.map.service.XpElectronicFenceAreaService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/base/v1/mini-program") |
| | | @Api(tags = "电子围栏") |
| | | public class ElectronicFenceController extends BaseController { |
| | | |
| | | private final XpElectronicFenceAreaService xpElectronicFenceAreaService; |
| | | |
| | | public ElectronicFenceController(XpElectronicFenceAreaService xpElectronicFenceAreaService) { |
| | | this.xpElectronicFenceAreaService = xpElectronicFenceAreaService; |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取地图开放区域围栏 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取地图开放区域围栏",tags = {"小程序-获取地图开放区域围栏"},response = XpElectronicFenceVo.class) |
| | | @GetMapping("/cities/list") |
| | | public AjaxResult<List<XpElectronicFenceVo>> citiesList() { |
| | | return success(xpElectronicFenceAreaService.citiesList()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.map.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.api.model.operation.XpElectronicFenceArea; |
| | | |
| | | /** |
| | | * <p> |
| | | * 电子围栏区域构成 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author liu |
| | | * @since 2026-02-03 |
| | | */ |
| | | public interface XpElectronicFenceAreaMapper extends BaseMapper<XpElectronicFenceArea> { |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.map.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.api.model.operation.XpElectronicFence; |
| | | |
| | | /** |
| | | * <p> |
| | | * 电子围栏 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author liu |
| | | * @since 2026-02-03 |
| | | */ |
| | | public interface XpElectronicFenceMapper extends BaseMapper<XpElectronicFence> { |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.map.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.api.model.operation.XpElectronicFenceArea; |
| | | import com.xiaopeng.api.vo.operation.XpElectronicFenceVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 电子围栏区域构成 服务类 |
| | | * </p> |
| | | * |
| | | * @author liu |
| | | * @since 2026-02-03 |
| | | */ |
| | | public interface XpElectronicFenceAreaService extends IService<XpElectronicFenceArea> { |
| | | |
| | | List<XpElectronicFenceVo> citiesList(); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.map.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.api.model.operation.XpElectronicFence; |
| | | |
| | | /** |
| | | * <p> |
| | | * 电子围栏 服务类 |
| | | * </p> |
| | | * |
| | | * @author liu |
| | | * @since 2026-02-03 |
| | | */ |
| | | public interface XpElectronicFenceService extends IService<XpElectronicFence> { |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取电子围栏列表 |
| | | */ |
| | | List<XpElectronicFenceVo> getXpElectronicFenceList(String cityCode); |
| | | |
| | | |
| | | /** |
| | | * 判断当前位置是否在运营区域内 |
| | | */ |
| | | Boolean isInElectronicFence(Double latitude, Double longitude,String cityCode); |
| | | } |
| | | |
| New file |
| | |
| | | package com.xiaopeng.map.service.serviceimpl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.api.model.operation.XpElectronicFenceArea; |
| | | import com.xiaopeng.api.vo.operation.XpElectronicFenceVo; |
| | | import com.xiaopeng.map.mapper.XpElectronicFenceAreaMapper; |
| | | import com.xiaopeng.map.service.XpElectronicFenceAreaService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 电子围栏区域构成 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author liu |
| | | * @since 2026-02-03 |
| | | */ |
| | | @Service |
| | | public class XpElectronicFenceAreaServiceImpl extends ServiceImpl<XpElectronicFenceAreaMapper, XpElectronicFenceArea> implements XpElectronicFenceAreaService { |
| | | |
| | | @Override |
| | | public List<XpElectronicFenceVo> citiesList() { |
| | | return null; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.map.service.serviceimpl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.api.model.operation.XpElectronicFence; |
| | | import com.xiaopeng.api.model.operation.XpOpenCity; |
| | | import com.xiaopeng.api.vo.operation.XpElectronicFenceVo; |
| | | import com.xiaopeng.map.mapper.XpElectronicFenceAreaMapper; |
| | | import com.xiaopeng.map.mapper.XpElectronicFenceMapper; |
| | | import com.xiaopeng.map.service.XpElectronicFenceService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 电子围栏 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author liu |
| | | * @since 2026-02-03 |
| | | */ |
| | | @Service |
| | | public class XpElectronicFenceServiceImpl extends ServiceImpl<XpElectronicFenceMapper, XpElectronicFence> implements XpElectronicFenceService { |
| | | |
| | | |
| | | @Resource |
| | | private XpOpenCityMapper xpOpenCityMapper; |
| | | |
| | | @Resource |
| | | private XpElectronicFenceAreaMapper xpElectronicFenceAreaMapper; |
| | | |
| | | @Override |
| | | public List<XpElectronicFenceVo> getXpElectronicFenceList(String cityCode) { |
| | | // 通过code找到电子围栏信息 |
| | | // TODO 魔法数字 |
| | | List<XpOpenCity> xpOpenCities = xpOpenCityMapper.selectList(new LambdaQueryWrapper<XpOpenCity>().eq(XpOpenCity::getCityCode, cityCode).eq(XpOpenCity::getStatus, 1)); |
| | | if (!xpOpenCities.isEmpty()) { |
| | | List<Long> openCityIds = xpOpenCities.stream().map(XpOpenCity::getId).collect(Collectors.toList()); |
| | | |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean isInElectronicFence(Double latitude, Double longitude,String cityCode) { |
| | | |
| | | // 获取所有可用的电子围栏信息 |
| | | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通过一个点位 判断是否在某个电子围栏内 |
| | | */ |
| | | private static boolean isInElectronicFence(double lon, double lat,List<String> fencePoints) { |
| | | boolean contains = false; |
| | | |
| | | for (String fencePoint : fencePoints) { |
| | | ArrayList<GeoPolygonUtil.GeoPoint> geoPoints = new ArrayList<>(); |
| | | String[] split = fencePoint.split(","); |
| | | for (String lonLat : split) { |
| | | String[] split1 = lonLat.split("_"); |
| | | GeoPolygonUtil.GeoPoint geoPoint = new GeoPolygonUtil.GeoPoint(Double.parseDouble(split1[0]), Double.parseDouble(split1[1])); |
| | | geoPoints.add(geoPoint); |
| | | } |
| | | contains = GeoPolygonUtil.contains(lon, lat, geoPoints); |
| | | if(contains){ |
| | | // 一旦在范围中直接返回true |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.map.vo; |
| | | |
| | | 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 |
| | |
| | | <?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.xiaopeng.map.mapper.XpElectronicFenceAreaMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.api.model.operation.XpElectronicFenceArea"> |
| | | <id column="id" property="id" /> |
| | | <result column="electronic_id" property="electronicId" /> |
| | | <result column="area_name" property="areaName" /> |
| | | <result column="area_type" property="areaType" /> |
| | | <result column="area_description" property="areaDescription" /> |
| | | <result column="area_status" property="areaStatus" /> |
| | | <result column="fence_points" property="fencePoints" /> |
| | | <result column="is_deleted" property="isDeleted" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, electronic_id, area_name, area_type, area_description, area_status, fence_points, is_deleted, create_time, update_time, create_by, update_by |
| | | </sql> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | <?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.xiaopeng.map.mapper.XpElectronicFenceMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.api.model.operation.XpElectronicFence"> |
| | | <id column="id" property="id" /> |
| | | <result column="electronic_name" property="electronicName" /> |
| | | <result column="electronic_number" property="electronicNumber" /> |
| | | <result column="status" property="status" /> |
| | | <result column="effect_type" property="effectType" /> |
| | | <result column="effect_time" property="effectTime" /> |
| | | <result column="failure_type" property="failureType" /> |
| | | <result column="failure_time" property="failureTime" /> |
| | | <result column="operation_strategy" property="operationStrategy" /> |
| | | <result column="is_deleted" property="isDeleted" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, electronic_name, electronic_number, status, effect_type, effect_time, failure_type, failure_time, operation_strategy, is_deleted, create_time, update_time, create_by, update_by |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | this.xpAgreementService = xpAgreementService; |
| | | } |
| | | |
| | | @ApiOperation(value = "获取协议",tags = {"小程序首页"},response = XpAgreementVo.class) |
| | | @ApiOperation(value = "获取协议",tags = {"小程序-首页"},response = XpAgreementVo.class) |
| | | @GetMapping("/privacy/content/{type}") |
| | | public AjaxResult<XpAgreementVo> getContent(@PathVariable Integer type) { |
| | | return success(xpAgreementService.getContentByType(type)); |
| | |
| | | /** |
| | | * 用户同意隐私协议/法律条款操作 |
| | | */ |
| | | @ApiOperation(value = "用户同意隐私协议/法律条款",tags = {"用户协议"}) |
| | | @ApiOperation(value = "用户同意隐私协议/法律条款",tags = {"小程序-用户协议"}) |
| | | @PostMapping("/privacy/agreement") |
| | | @XpClientCheck(checkToken = false, checkOtpToken = true) |
| | | public AjaxResult<?> privacyAgreement(@RequestBody XpAgreementAppUserDto dto, HttpServletRequest request) { |
| | |
| | | } |
| | | |
| | | |
| | | // 获取banner列表 |
| | | @ApiOperation(value = "获取banner",tags = {"小程序首页"},response = XpBannerListVo.class) |
| | | /** |
| | | * 获取banner |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取banner",tags = {"小程序-获取banner"},response = XpBannerListVo.class) |
| | | @GetMapping("/getBannerList") |
| | | public AjaxResult<List<XpBannerListVo>> getBannerList() { |
| | | return success(xpBannerService.getXpBannerList()); |
| | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "获取开通城市列表",tags = {"小程序首页"},response = XpOpenCityVo.class) |
| | | /** |
| | | * 获取开通城市列表 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取开通城市列表",tags = {"小程序-开通城市列表"},response = XpOpenCityVo.class) |
| | | @GetMapping("/cities/list") |
| | | public AjaxResult<XpOpenCityVo> citiesList() { |
| | | return success(xpOpenCityService.citiesList()); |
| New file |
| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | |
| | | import com.xiaopeng.api.model.operation.XpPoint; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | | import com.xiaopeng.common.core.web.domain.AjaxResult; |
| | | import com.xiaopeng.operation.dto.NearestDto; |
| | | import com.xiaopeng.operation.service.XpPointService; |
| | | import com.xiaopeng.operation.vo.NearestVo; |
| | | import com.xiaopeng.operation.vo.XpOpenCityVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/base/v1/mini-program") |
| | | @Api(tags = "点位模块") |
| | | public class XpPointController extends BaseController { |
| | | |
| | | private final XpPointService xpPointService; |
| | | |
| | | public XpPointController(XpPointService xpPointService) { |
| | | this.xpPointService = xpPointService; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取附近上车站点 |
| | | */ |
| | | @ApiOperation(value = "获取附近上车站点",tags = {"小程序-附近上车站点"},response = XpPoint.class) |
| | | @RequestMapping("/pickup/nearest") |
| | | public AjaxResult<NearestVo> nearest(@RequestBody @Valid NearestDto dto) { |
| | | return success(xpPointService.nearest(dto)); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.api.model.operation.XpRegion; |
| | | import com.xiaopeng.operation.service.XpRegionService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.InputStreamReader; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市管理 前端控制器 |
| | | * </p> |
| | | * |
| | | */ |
| | | @Api(tags = "省市管理") |
| | | @RestController |
| | | @RequestMapping("/base/v1/mini-program") |
| | | public class XpRegionController { |
| | | |
| | | private final XpRegionService regionService; |
| | | |
| | | |
| | | @Autowired |
| | | public XpRegionController(XpRegionService regionService) { |
| | | this.regionService = regionService; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询省市管理 |
| | | */ |
| | | @ApiOperation(value = "查询省市管理",tags = {"小程序-省市管理"},response = XpRegion.class) |
| | | @GetMapping(value = "/open/t-region/getRegion") |
| | | public R<List<List<XpRegion>>> geXpRegion() { |
| | | return R.ok(regionService.getXpRegion()); |
| | | } |
| | | |
| | | |
| | | /* |
| | | * 查询市 |
| | | */ |
| | | @ApiOperation(value = "查询市",tags = {"小程序-查询市"},response = XpRegion.class) |
| | | @PostMapping(value = "/open/t-region/getProvince") |
| | | public R<List<XpRegion>> getProvince() { |
| | | List<XpRegion> list = regionService.list(Wrappers.lambdaQuery(XpRegion.class).ne(XpRegion::getParentId, 0).orderByAsc(XpRegion::getInitial)); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | } |
| | | |
| New file |
| | |
| | | package com.xiaopeng.operation.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "NearestDto", description = "附近上车站点") |
| | | public class NearestDto { |
| | | |
| | | @ApiModelProperty(value = "纬度") |
| | | @NotNull(message = "纬度不能为空") |
| | | private Double latitude; |
| | | |
| | | @ApiModelProperty(value = "经度") |
| | | @NotNull(message = "经度不能为空") |
| | | private Double longitude; |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.operation.model.XpAgreementAppUser; |
| | | import com.xiaopeng.api.model.operation.XpAgreementAppUser; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.operation.model.XpAgreement; |
| | | import com.xiaopeng.api.model.operation.XpAgreement; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.operation.model.XpBanner; |
| | | import com.xiaopeng.api.model.operation.XpBanner; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.operation.model.XpOpenCity; |
| | | import com.xiaopeng.api.model.operation.XpOpenCity; |
| | | |
| | | /** |
| | | * <p> |
| New file |
| | |
| | | package com.xiaopeng.operation.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.api.model.operation.XpPoint; |
| | | |
| | | /** |
| | | * <p> |
| | | * 点位管理 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author liu |
| | | * @since 2026-02-03 |
| | | */ |
| | | public interface XpPointMapper extends BaseMapper<XpPoint> { |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.operation.model.XpPricing; |
| | | import com.xiaopeng.api.model.operation.XpPricing; |
| | | |
| | | /** |
| | | * <p> |
| New file |
| | |
| | | package com.xiaopeng.operation.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.api.model.operation.XpRegion; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市区三级联动 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author liu |
| | | * @since 2026-02-03 |
| | | */ |
| | | public interface XpRegionMapper extends BaseMapper<XpRegion> { |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.operation.model.XpRideGuide; |
| | | import com.xiaopeng.api.model.operation.XpRideGuide; |
| | | import com.xiaopeng.operation.vo.XpRideGuideNextVo; |
| | | import com.xiaopeng.operation.vo.XpRideGuideVo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.operation.model.XpSystemSetting; |
| | | import com.xiaopeng.api.model.operation.XpSystemSetting; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.operation.dto.XpAgreementAppUserDto; |
| | | import com.xiaopeng.operation.model.XpAgreementAppUser; |
| | | import com.xiaopeng.api.model.operation.XpAgreementAppUser; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.operation.model.XpAgreement; |
| | | import com.xiaopeng.api.model.operation.XpAgreement; |
| | | import com.xiaopeng.operation.vo.XpAgreementVo; |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.operation.model.XpBanner; |
| | | import com.xiaopeng.api.model.operation.XpBanner; |
| | | import com.xiaopeng.operation.vo.XpBannerListVo; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.operation.model.XpOpenCity; |
| | | import com.xiaopeng.api.model.operation.XpOpenCity; |
| | | import com.xiaopeng.operation.vo.XpOpenCityVo; |
| | | |
| | | /** |
| New file |
| | |
| | | package com.xiaopeng.operation.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.api.model.operation.XpPoint; |
| | | import com.xiaopeng.common.core.web.domain.AjaxResult; |
| | | import com.xiaopeng.operation.dto.NearestDto; |
| | | import com.xiaopeng.operation.vo.NearestVo; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * <p> |
| | | * 点位管理 服务类 |
| | | * </p> |
| | | * |
| | | * @author liu |
| | | * @since 2026-02-03 |
| | | */ |
| | | public interface XpPointService extends IService<XpPoint> { |
| | | |
| | | /** |
| | | * 获取附近上车站点 |
| | | */ |
| | | NearestVo nearest(@Valid NearestDto dto); |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.operation.model.XpPricing; |
| | | import com.xiaopeng.api.model.operation.XpPricing; |
| | | |
| | | /** |
| | | * <p> |
| New file |
| | |
| | | package com.xiaopeng.operation.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.api.model.operation.XpRegion; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市区三级联动 服务类 |
| | | * </p> |
| | | * |
| | | * @author liu |
| | | * @since 2026-02-03 |
| | | */ |
| | | public interface XpRegionService extends IService<XpRegion> { |
| | | |
| | | /** |
| | | * 查询省市管理 |
| | | * @return |
| | | */ |
| | | List<List<XpRegion>> getXpRegion(); |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.operation.model.XpRideGuide; |
| | | import com.xiaopeng.api.model.operation.XpRideGuide; |
| | | import com.xiaopeng.operation.vo.XpRideGuideVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.operation.model.XpSystemSetting; |
| | | import com.xiaopeng.api.model.operation.XpSystemSetting; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.operation.mapper.XpAgreementAppUserMapper; |
| | | import com.xiaopeng.operation.model.XpAgreementAppUser; |
| | | import com.xiaopeng.api.model.operation.XpAgreementAppUser; |
| | | import com.xiaopeng.operation.service.XpAgreementAppUserService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.operation.mapper.XpAgreementMapper; |
| | | import com.xiaopeng.operation.model.XpAgreement; |
| | | import com.xiaopeng.api.model.operation.XpAgreement; |
| | | import com.xiaopeng.operation.service.XpAgreementService; |
| | | import com.xiaopeng.operation.vo.XpAgreementVo; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.operation.mapper.XpBannerMapper; |
| | | import com.xiaopeng.operation.model.XpBanner; |
| | | import com.xiaopeng.api.model.operation.XpBanner; |
| | | import com.xiaopeng.operation.service.XpBannerService; |
| | | import com.xiaopeng.operation.vo.XpBannerListVo; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.operation.mapper.XpOpenCityMapper; |
| | | import com.xiaopeng.operation.model.XpOpenCity; |
| | | import com.xiaopeng.api.model.operation.XpOpenCity; |
| | | import com.xiaopeng.operation.service.XpOpenCityService; |
| | | import com.xiaopeng.operation.vo.XpOpenCityNextVo; |
| | | import com.xiaopeng.operation.vo.XpOpenCityVo; |
| New file |
| | |
| | | package com.xiaopeng.operation.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.api.model.operation.XpPoint; |
| | | import com.xiaopeng.operation.dto.NearestDto; |
| | | import com.xiaopeng.operation.mapper.XpPointMapper; |
| | | import com.xiaopeng.operation.service.XpPointService; |
| | | import com.xiaopeng.operation.utils.map.FastDistanceCalculator; |
| | | import com.xiaopeng.operation.vo.NearestNextVo; |
| | | import com.xiaopeng.operation.vo.NearestVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 点位管理 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author liu |
| | | * @since 2026-02-03 |
| | | */ |
| | | @Service |
| | | public class XpPointServiceImpl extends ServiceImpl<XpPointMapper, XpPoint> implements XpPointService { |
| | | |
| | | |
| | | |
| | | @Override |
| | | public NearestVo nearest(NearestDto dto) { |
| | | // 获取所有的站点信息 |
| | | List<XpPoint> list = list(new LambdaQueryWrapper<XpPoint>().eq(XpPoint::getOperationStatus,1)); |
| | | NearestVo nearestVo = new NearestVo(); |
| | | List<NearestNextVo> nearestNextVos = new ArrayList<>(); |
| | | for (XpPoint xpPoint : list) { |
| | | // 计算距离 小于1000m的站点 |
| | | double v = FastDistanceCalculator.distanceFast(dto.getLatitude(), dto.getLongitude(), xpPoint.getPointLat(), xpPoint.getPointLon()); |
| | | if(v<1000){ |
| | | NearestNextVo nearestNextVo = new NearestNextVo(); |
| | | nearestNextVo.setId(xpPoint.getId()); |
| | | nearestNextVo.setName(xpPoint.getPointName()); |
| | | nearestNextVo.setLatitude(xpPoint.getPointLat()); |
| | | nearestNextVo.setLongitude(xpPoint.getPointLon()); |
| | | nearestNextVo.setDistance(v); |
| | | nearestNextVo.setAddress(xpPoint.getPointAddress()); |
| | | nearestNextVo.setTime(xpPoint.getParkingTimeLimit()); |
| | | nearestNextVos.add(nearestNextVo); |
| | | } |
| | | } |
| | | if(!nearestNextVos.isEmpty()){ |
| | | nearestNextVos = nearestNextVos.stream().sorted(Comparator.comparing(NearestNextVo::getDistance)).collect(Collectors.toList()); |
| | | } |
| | | nearestVo.setPoints(nearestNextVos); |
| | | nearestVo.setTotal(nearestNextVos.size()); |
| | | return nearestVo; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.operation.mapper.XpPricingMapper; |
| | | import com.xiaopeng.operation.model.XpPricing; |
| | | import com.xiaopeng.api.model.operation.XpPricing; |
| | | import com.xiaopeng.operation.service.XpPricingService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| New file |
| | |
| | | package com.xiaopeng.operation.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.operation.mapper.XpRegionMapper; |
| | | import com.xiaopeng.api.model.operation.XpRegion; |
| | | import com.xiaopeng.operation.service.XpRegionService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市区三级联动 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author liu |
| | | * @since 2026-02-03 |
| | | */ |
| | | @Service |
| | | public class XpRegionServiceImpl extends ServiceImpl<XpRegionMapper, XpRegion> implements XpRegionService { |
| | | |
| | | @Override |
| | | public List<List<XpRegion>> getXpRegion() { |
| | | String[] initials = {"A", "B", "C", "D", "E", "F", |
| | | "G", "H", "I", "J", "K", "L", |
| | | "M", "N", "O", "P", "Q", "R", |
| | | "S", "T", "U", "V", "W", "X", "Y", "Z"}; |
| | | List<XpRegion> tRegions = this.baseMapper.selectList(Wrappers.lambdaQuery(XpRegion.class)); |
| | | List<List<XpRegion>> result = new ArrayList<>(); |
| | | for (String initial : initials) { |
| | | List<XpRegion> init = tRegions.stream().filter(e -> e.getInitial().equals(initial) && !e.getCode().contains("0000")).collect(Collectors.toList()); |
| | | result.add(init); |
| | | } |
| | | return result; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.operation.mapper.XpRideGuideMapper; |
| | | import com.xiaopeng.operation.model.XpRideGuide; |
| | | import com.xiaopeng.api.model.operation.XpRideGuide; |
| | | import com.xiaopeng.operation.service.XpRideGuideService; |
| | | import com.xiaopeng.operation.vo.XpRideGuideNextVo; |
| | | import com.xiaopeng.operation.vo.XpRideGuideVo; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.operation.mapper.XpSystemSettingMapper; |
| | | import com.xiaopeng.operation.model.XpSystemSetting; |
| | | import com.xiaopeng.api.model.operation.XpSystemSetting; |
| | | import com.xiaopeng.operation.service.XpSystemSettingService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | package com.xiaopeng.operation.utils; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.xiaopeng.operation.model.ServerCarModelWarpper; |
| | | import com.xiaopeng.operation.model.XpPricing; |
| | | import com.xiaopeng.operation.service.XpPricingService; |
| | | import com.xiaopeng.operation.utils.map.GDMapElectricFenceUtil; |
| | | import com.xiaopeng.operation.utils.map.GDMapGeocodingUtil; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | /** |
| New file |
| | |
| | | package com.xiaopeng.operation.utils.map; |
| | | |
| | | public class FastDistanceCalculator { |
| | | private static final double R = 6371.0; // 地球半径(千米) |
| | | private static final double DEG_TO_RAD = Math.PI / 180.0; |
| | | |
| | | /** |
| | | * 快速近似算法 - 性能极高,误差<0.5% |
| | | * 适合需要大量计算的场景(如KNN、聚类) |
| | | */ |
| | | public static double distanceFast(double lat1, double lon1, |
| | | double lat2, double lon2) { |
| | | double x = (lon2 - lon1) * DEG_TO_RAD * Math.cos((lat1 + lat2) * 0.5 * DEG_TO_RAD); |
| | | double y = (lat2 - lat1) * DEG_TO_RAD; |
| | | return R * Math.sqrt(x * x + y * y); |
| | | } |
| | | |
| | | /** |
| | | * 平面近似 - 极高性能,适用于小范围(城市内) |
| | | */ |
| | | public static double distanceFlatApprox(double lat1, double lon1, |
| | | double lat2, double lon2) { |
| | | // 每度纬度约111km,每度经度随纬度变化 |
| | | double kmPerDegreeLat = 111.0; |
| | | double kmPerDegreeLon = 111.0 * Math.cos((lat1 + lat2) * 0.5 * DEG_TO_RAD); |
| | | |
| | | double dLat = lat2 - lat1; |
| | | double dLon = lon2 - lon1; |
| | | |
| | | return Math.sqrt(Math.pow(dLat * kmPerDegreeLat, 2) + |
| | | Math.pow(dLon * kmPerDegreeLon, 2)); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.operation.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "NearestNextVo对象", description = "附近站点二级Vo") |
| | | public class NearestNextVo { |
| | | |
| | | @ApiModelProperty(value = "站点id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "站点名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "站点经度") |
| | | private Double latitude; |
| | | |
| | | @ApiModelProperty(value = "站点纬度") |
| | | private Double longitude; |
| | | |
| | | @ApiModelProperty(value = "距离") |
| | | private Double distance; |
| | | |
| | | @ApiModelProperty(value = "站点地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "停车时长") |
| | | private Integer time; |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间") |
| | | private String endTime; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.operation.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "NearestNextVo对象", description = "附近站点vo") |
| | | public class NearestVo { |
| | | |
| | | private List<NearestNextVo> points; |
| | | |
| | | |
| | | private Integer total; |
| | | } |
| | |
| | | <mapper namespace="com.xiaopeng.operation.mapper.XpAgreementAppUserMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.operation.model.XpAgreementAppUser"> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.api.model.operation.XpAgreementAppUser"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="agreement_ids" property="agreementIds" /> |
| | |
| | | <mapper namespace="com.xiaopeng.operation.mapper.XpAgreementMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.operation.model.XpAgreement"> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.api.model.operation.XpAgreement"> |
| | | <id column="id" property="id" /> |
| | | <result column="content_type" property="contentType" /> |
| | | <result column="content" property="content" /> |
| | |
| | | <mapper namespace="com.xiaopeng.operation.mapper.XpBannerMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.operation.model.XpBanner"> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.api.model.operation.XpBanner"> |
| | | <id column="id" property="id" /> |
| | | <result column="start_time" property="startTime" /> |
| | | <result column="end_time" property="endTime" /> |
| | |
| | | <mapper namespace="com.xiaopeng.operation.mapper.XpOpenCityMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.operation.model.XpOpenCity"> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.api.model.operation.XpOpenCity"> |
| | | <id column="id" property="id" /> |
| | | <result column="province_name" property="provinceName" /> |
| | | <result column="province_code" property="provinceCode" /> |
| New file |
| | |
| | | <?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.xiaopeng.operation.mapper.XpPointMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.api.model.operation.XpPoint"> |
| | | <id column="id" property="id" /> |
| | | <result column="point_name" property="pointName" /> |
| | | <result column="point_poi" property="pointPoi" /> |
| | | <result column="point_number" property="pointNumber" /> |
| | | <result column="operation_status" property="operationStatus" /> |
| | | <result column="point_type" property="pointType" /> |
| | | <result column="verification_status" property="verificationStatus" /> |
| | | <result column="parking_time_limit" property="parkingTimeLimit" /> |
| | | <result column="operation_type" property="operationType" /> |
| | | <result column="effective_period" property="effectivePeriod" /> |
| | | <result column="effective_time_period" property="effectiveTimePeriod" /> |
| | | <result column="remarks" property="remarks" /> |
| | | <result column="point_pictures" property="pointPictures" /> |
| | | <result column="point_lon" property="pointLon" /> |
| | | <result column="point_lat" property="pointLat" /> |
| | | <result column="is_deleted" property="isDeleted" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, point_name, point_poi, point_number, operation_status, point_type, verification_status, parking_time_limit, operation_type, effective_period, effective_time_period, remarks, point_pictures, point_lon, point_lat, is_deleted, create_time, update_time, create_by, update_by |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | <mapper namespace="com.xiaopeng.operation.mapper.XpPricingMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.operation.model.XpPricing"> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.api.model.operation.XpPricing"> |
| | | <id column="id" property="id" /> |
| | | <result column="vehicle_model" property="vehicleModel" /> |
| | | <result column="channel" property="channel" /> |
| New file |
| | |
| | | <?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.xiaopeng.operation.mapper.XpRegionMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.api.model.operation.XpRegion"> |
| | | <id column="id" property="id" /> |
| | | <result column="name" property="name" /> |
| | | <result column="code" property="code" /> |
| | | <result column="citycode" property="citycode" /> |
| | | <result column="parent_id" property="parentId" /> |
| | | <result column="english" property="english" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, name, code, citycode, parent_id, english |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | <mapper namespace="com.xiaopeng.operation.mapper.XpRideGuideMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.operation.model.XpRideGuide"> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.api.model.operation.XpRideGuide"> |
| | | <id column="id" property="id" /> |
| | | <result column="guide_step" property="guideStep" /> |
| | | <result column="guide_title" property="guideTitle" /> |
| | |
| | | <mapper namespace="com.xiaopeng.operation.mapper.XpSystemSettingMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.operation.model.XpSystemSetting"> |
| | | <resultMap id="BaseResultMap" type="com.xiaopeng.api.model.operation.XpSystemSetting"> |
| | | <id column="id" property="id" /> |
| | | <result column="customer_service_phone" property="customerServicePhone" /> |
| | | <result column="order_distance" property="orderDistance" /> |