yyy
2026-04-18 953630821f8ab667460e647df657aa16c4511e4a
1.定向服务管理功能开发
16个文件已添加
7个文件已修改
1014 ■■■■■ 已修改文件
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpTargetedService.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpTargetedServiceVehicle.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpTargetedServiceWhitelist.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpTradingStrategy.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/vehicleConvoy/XpVehicle.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/query/operation/XpTargetedServiceQuery.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/operation/XpTargetedServiceVo.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/operation/XpTradingStrategyDetailVO.java 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpTargetedServiceController.java 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/dto/XpTradingStrategyEditDTO.java 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/mapper/XpTargetedServiceMapper.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/mapper/XpTargetedServiceVehicleMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/mapper/XpTargetedServiceWhitelistMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/XpTargetedServiceService.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/XpTargetedServiceVehicleService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/XpTargetedServiceWhitelistService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpTargetedServiceServiceImpl.java 186 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpTargetedServiceVehicleServiceImpl.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpTargetedServiceWhitelistServiceImp.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/resources/mapper/operation/XpTargetedServiceMapper.xml 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/model/vo/XpVehicleVO.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/service/impl/XpVehicleServiceImpl.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-vehicle-convoy-boot/src/main/resources/mapper/vehicleConvoy/XpVehicleMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpTargetedService.java
New file
@@ -0,0 +1,61 @@
package com.xiaopeng.api.model.operation;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xiaopeng.common.core.web.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
/**
 * <p>
 * 定向服务
 * </p>
 * @author mitao
 * @since 2026-02-03
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("xp_targeted_service")
@ApiModel(value="XpTargetedService对象", description="定向服务")
public class XpTargetedService extends BaseModel {
    @ApiModelProperty(value = "自增id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @ApiModelProperty(value = "省份名称")
    private String provinceName;
    @ApiModelProperty(value = "省份code")
    private String provinceCode;
    @ApiModelProperty(value = "城市名称")
    private String cityName;
    @ApiModelProperty(value = "城市code")
    private String cityCode;
    @ApiModelProperty(value = "区县名称")
    private String districtName;
    @ApiModelProperty(value = "区县code")
    private String districtCode;
    @ApiModelProperty(value = "有效期开始时间")
    private LocalDateTime startTime;
    @ApiModelProperty(value = "有效期结束时间")
    private LocalDateTime endTime;
    @ApiModelProperty(value = "是否长期有效 1=是 0=否")
    private Integer isLongValid;
    @ApiModelProperty(value = "备注")
    private String remarks;
    @ApiModelProperty(value = "状态(1=启动,2=禁用)")
    private Integer status;
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpTargetedServiceVehicle.java
New file
@@ -0,0 +1,54 @@
package com.xiaopeng.api.model.operation;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
 * <p>
 * 定向服务车辆关系表
 * </p>
 * @author mitao
 * @since 2026-02-03
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("xp_targeted_service_vehicle")
@ApiModel(value="XpTargetedServiceVehicle 对象", description="定向服务车辆关系表")
public class XpTargetedServiceVehicle {
    @ApiModelProperty(value = "定向服务id")
    private Long targetedServiceId;
    @ApiModelProperty(value = "车辆id")
    private Long vehicleId;
    @ApiModelProperty(value = "巡游计划id")
    private Long cruisePlanId;
    @ApiModelProperty(value = "巡游计划名称")
    @TableField(exist = false)
    private String planName;
    @ApiModelProperty(value = "车辆编码")
    @TableField(exist = false)
    private String vehicleCode;
    @ApiModelProperty(value = "车牌号")
    @TableField(exist = false)
    private String plateNumber;
    @ApiModelProperty(value = "车型名称")
    @TableField(exist = false)
    private String vehicleModelName;
    @ApiModelProperty(value = "车队id")
    @TableField(exist = false)
    private Long fleetName;
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpTargetedServiceWhitelist.java
New file
@@ -0,0 +1,44 @@
package com.xiaopeng.api.model.operation;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
 * <p>
 * 定向服务白名单关系表
 * </p>
 * @author mitao
 * @since 2026-02-03
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("xp_targeted_service_whitelist")
@ApiModel(value="XpTargetedServiceWhitelist 对象", description="定向服务白名单关系表")
public class XpTargetedServiceWhitelist {
    @ApiModelProperty(value = "定向服务id")
    private Long targetedServiceId;
    @ApiModelProperty(value = "白名单id")
    private Long whitelistId;
    @ApiModelProperty(value = "优先级权重")
    private Integer weight;
    @ApiModelProperty(value = "备注 优先级说明")
    private String remarks;
    @ApiModelProperty(value = "白名单用户名称")
    @TableField(exist = false)
    private String nickName;
    @ApiModelProperty(value = "白名单账号")
    @TableField(exist = false)
    private String account;
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpTradingStrategy.java
@@ -31,10 +31,14 @@
@ApiModel(value="XpTradingStrategy对象", description="交易策略配置")
public class XpTradingStrategy extends BaseModel {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
//----------------发单策略--------------------
    @ApiModelProperty(value = "用户每日取消订单数")
    private Integer cancleCount;
@@ -44,9 +48,11 @@
    @ApiModelProperty(value = "乘客端首页安全中心是否开启")
    private Boolean showSecurityCenter;
//----------------发单策略--------------------
    //
    //---------------发单拦截策略------------------------------------
    @ApiModelProperty(value = "豁免金额")
    private BigDecimal exemptionAmount;
@@ -67,13 +73,16 @@
    @ApiModelProperty(value = "豁免角色 逗号分割 0=全部 1=新客 2=老客 3=流失召回 4=媒体")
    private String exemptionRole;
    //
    @ApiModelProperty(value = "免密授权金额")
    private BigDecimal passwordFreeAmount;
    @ApiModelProperty(value = "预付额度  订单大于金额需预付")
    private BigDecimal prepaidLimit;
    //---------------发单拦截策略------------------------------------
    //---------------播单策略------------------------------------
    @ApiModelProperty(value = "一轮推单距离")
    @Min(0)
@@ -113,6 +122,25 @@
    @ApiModelProperty(value = "五轮推单时间")
    private Integer fivePushTime;
    @ApiModelProperty(value = "排队是时,每X秒轮询接口查询排序")
    private Integer queuePollingTime;
    @ApiModelProperty(value = "乘客据上车点大于X米展示步行导航按钮")
    private Integer  walkingNavigationDistance;
    @ApiModelProperty(value = "用户在页面超过X秒未下单,系统静默判断价格是否有波动")
    private Integer notAddOrderTime;
    @ApiModelProperty(value = "波动大于X%,则弹框提示")
    private Integer  priceFluctuationRatio;
    @ApiModelProperty(value = "播单—乘客上车后x分钟内未点击出车,订单自动取消")
    private Integer  bdNotBoardedTime;
    //---------------播单策略------------------------------------
    //---------------分单策略------------------------------------
    @ApiModelProperty(value = "规则类型 1=单手举手 2=多手举手")
    private Integer ruleType;
@@ -121,6 +149,7 @@
    @ApiModelProperty(value = "倾向订单价值")
    private Integer tendencyOrderValue;
    @ApiModelProperty(value = "倾向距离")
    private Integer tendencyDistance;
@@ -152,24 +181,34 @@
    @ApiModelProperty(value = "触发步行导航的最小距离")
    private Integer walkingGuideDistance;
    @ApiModelProperty(value = "允许车辆进入连环派单候选池路程阈值, unit : km")
    @Min(0)@NotNull
    //---------------分单策略------------------------------------
    //-------------------连环派单策略----------------------
    @ApiModelProperty(value = "连环派单车辆侧 允许车辆进入连环派单候选池路程阈值, unit : km")
    @Min(value = 0, message = "连环派单策略>当前订单剩余里程不能小于0")
    @NotNull(message = "连环派单策略>当前订单剩余里程不能为空")
    private Integer distanceRegardAsEnding;
    @ApiModelProperty(value = "允许车辆进入连环派单候选池时间阈值 unit : min")
    @Min(0)@NotNull
    @ApiModelProperty(value = "连环派单车辆侧 允许车辆进入连环派单候选池时间阈值 unit : min")
    @Min(value = 0, message = "连环派单策略>当前订单剩余时间不能小于0")
    @NotNull(message = "连环派单策略>当前订单剩余时间不能为空")
    private Integer timeRegardAsEnding;
    @ApiModelProperty(value = "保障可完成连环订单的电量 unit : km")
    @Min(0)@NotNull
    @ApiModelProperty(value = "连环派单车辆侧 保障可完成连环订单的电量 unit : km")
    @Min(value = 0, message = "车辆电量/续航不能小于0")
    @NotNull(message = "车辆电量/续航不能为空")
    private Integer backupPower;
    @ApiModelProperty(value = "终点距离起点的距离阈值 unit : km")
    @ApiModelProperty(value = "连环派单订单侧 终点距离起点的距离阈值 unit : km")
    @Min(0)
    private Integer destToPassenger;
    @ApiModelProperty(value = "结束时间到用车时间阈值unit : min")
    @ApiModelProperty(value = "连环派单订单侧 结束时间到用车时间阈值unit : min")
    @Min(0)
    private Integer endingTimeToUseTime;
    //-------------------连环派单策略----------------------
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/vehicleConvoy/XpVehicle.java
@@ -129,6 +129,9 @@
    @TableField(exist = false)
    private Long fleetId;
    @ApiModelProperty(value = "车队id")
    @TableField(exist = false)
    protected String fleetName;
    @ApiModelProperty(value = "车型名称")
    @TableField(exist = false)
    private String vehicleModelName;
xp-robotaxi-api/src/main/java/com/xiaopeng/api/query/operation/XpTargetedServiceQuery.java
New file
@@ -0,0 +1,27 @@
package com.xiaopeng.api.query.operation;
import com.xiaopeng.common.core.web.page.BasePage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "定向服务 query")
public class XpTargetedServiceQuery extends BasePage {
    @ApiModelProperty(value = "省份名称")
    private String provinceName;
    @ApiModelProperty(value = "省份code")
    private String provinceCode;
    @ApiModelProperty(value = "城市名称")
    private String cityName;
    @ApiModelProperty(value = "城市code")
    private String cityCode;
    @ApiModelProperty(value = "区县名称")
    private String districtName;
    @ApiModelProperty(value = "区县code")
    private String districtCode;
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/operation/XpTargetedServiceVo.java
New file
@@ -0,0 +1,32 @@
package com.xiaopeng.api.vo.operation;
import com.xiaopeng.api.model.operation.XpTargetedService;
import com.xiaopeng.api.model.operation.XpTargetedServiceVehicle;
import com.xiaopeng.api.model.operation.XpTargetedServiceWhitelist;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="XpTargetedService对象", description="定向服务")
public class XpTargetedServiceVo  extends XpTargetedService {
    @ApiModelProperty(value = "定向服务车辆关系表")
    List<XpTargetedServiceVehicle> vehicleList;
    @ApiModelProperty(value = "定向服务白名单关系表")
    List<XpTargetedServiceWhitelist> whitelistList;
    @ApiModelProperty(value = "绑定车辆数")
    private Integer vehicleCount;
    @ApiModelProperty(value = "绑定用户数")
    private Integer whitelistCount;
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/operation/XpTradingStrategyDetailVO.java
@@ -27,21 +27,39 @@
    @ApiModelProperty(value = "主键ID")
    private Long id;
    @ApiModelProperty(value = "关联城市列表")
    private List<XpTradingStrategyCity> cityList;
//----------------发单策略--------------------
    @ApiModelProperty(value = "用户每日取消订单数")
    private Integer cancleCount;
    @ApiModelProperty(value = "单个订单可修改目的地次数")
    private Integer amendCountPerOrder;
    @ApiModelProperty(value = "乘客端首页安全中心是否开启")
    private Boolean showSecurityCenter;
//----------------发单策略--------------------
    //---------------发单拦截策略------------------------------------
    @ApiModelProperty(value = "豁免金额")
    private BigDecimal exemptionAmount;
    @ApiModelProperty(value = "是否长期有效 1=是 0=否")
    private Boolean isLongValid;
    @ApiModelProperty(value = "豁免城市")
    private String cityCode;
    @ApiModelProperty(value = "豁免开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime exemptionStartTime;
    @ApiModelProperty(value = "豁免结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime exemptionEndTime;
    @ApiModelProperty(value = "豁免角色 逗号分割 0=全部 1=新客 2=老客 3=流失召回 4=媒体")
@@ -52,29 +70,42 @@
    @ApiModelProperty(value = "预付额度  订单大于金额需预付")
    private BigDecimal prepaidLimit;
    //---------------发单拦截策略------------------------------------
    //---------------播单策略------------------------------------
    @ApiModelProperty(value = "一轮推单距离")
    @Min(0)
    private Double onePushDistance;
    @ApiModelProperty(value = "一轮推单时间")
    @Min(0)
    private Integer onePushTime;
    @ApiModelProperty(value = "二轮推单距离")
    @Min(0)
    private Double twoPushDistance;
    @ApiModelProperty(value = "二轮推单时间")
    @Min(0)
    private Integer twoPushTime;
    @ApiModelProperty(value = "三轮推单距离")
    @Min(0)
    private Double threePushDistance;
    @ApiModelProperty(value = "三轮推单时间")
    @Min(0)
    private Integer threePushTime;
    @ApiModelProperty(value = "四轮推单距离")
    @Min(0)
    private Double fourPushDistance;
    @ApiModelProperty(value = "四轮推单时间")
    @Min(0)
    private Integer fourPushTime;
    @ApiModelProperty(value = "五轮推单距离")
@@ -82,6 +113,25 @@
    @ApiModelProperty(value = "五轮推单时间")
    private Integer fivePushTime;
    @ApiModelProperty(value = "排队是时,每X秒轮询接口查询排序")
    private Integer queuePollingTime;
    @ApiModelProperty(value = "乘客据上车点大于X米展示步行导航按钮")
    private Integer  walkingNavigationDistance;
    @ApiModelProperty(value = "用户在页面超过X秒未下单,系统静默判断价格是否有波动")
    private Integer notAddOrderTime;
    @ApiModelProperty(value = "波动大于X%,则弹框提示")
    private Integer  priceFluctuationRatio;
    @ApiModelProperty(value = "播单—乘客上车后x分钟内未点击出车,订单自动取消")
    private Integer  bdNotBoardedTime;
    //---------------播单策略------------------------------------
    //---------------分单策略------------------------------------
    @ApiModelProperty(value = "规则类型 1=单手举手 2=多手举手")
    private Integer ruleType;
@@ -91,6 +141,7 @@
    @ApiModelProperty(value = "倾向订单价值")
    private Integer tendencyOrderValue;
    @ApiModelProperty(value = "倾向距离")
    private Integer tendencyDistance;
@@ -116,49 +167,40 @@
    @ApiModelProperty(value = "电量权重")
    private Integer weightElectricity;
    @ApiModelProperty(value = "关联城市列表")
    private List<XpTradingStrategyCity> cityList;
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    @ApiModelProperty(value = "单个订单可修改目的地次数")
    private Integer amendCountPerOrder;
    @ApiModelProperty(value = "乘客端首页安全中心是否开启")
    private Boolean showSecurityCenter;
    @ApiModelProperty(value = "豁免城市")
    private String cityCode;
    @ApiModelProperty(value = "路线时效,过了需要重新获取,单位:秒")
    private Integer maxStandingTiming;
    private Integer MaxStandingTiming;
    @ApiModelProperty(value = "触发步行导航的最小距离")
    private Integer walkingGuideDistance;
    @ApiModelProperty(value = "允许车辆进入连环派单候选池路程阈值, unit : km")
    @Min(0)@NotNull
    //---------------分单策略------------------------------------
    //-------------------连环派单策略----------------------
    @ApiModelProperty(value = "连环派单车辆侧 允许车辆进入连环派单候选池路程阈值, unit : km")
    @Min(value = 0, message = "连环派单策略>当前订单剩余里程不能小于0")
    @NotNull(message = "连环派单策略>当前订单剩余里程不能为空")
    private Integer distanceRegardAsEnding;
    @ApiModelProperty(value = "允许车辆进入连环派单候选池时间阈值 unit : min")
    @Min(0)@NotNull
    @ApiModelProperty(value = "连环派单车辆侧 允许车辆进入连环派单候选池时间阈值 unit : min")
    @Min(value = 0, message = "连环派单策略>当前订单剩余时间不能小于0")
    @NotNull(message = "连环派单策略>当前订单剩余时间不能为空")
    private Integer timeRegardAsEnding;
    @ApiModelProperty(value = "保障可完成连环订单的电量 unit : km")
    @Min(0)@NotNull
    @ApiModelProperty(value = "连环派单车辆侧 保障可完成连环订单的电量 unit : km")
    @Min(value = 0, message = "车辆电量/续航不能小于0")
    @NotNull(message = "车辆电量/续航不能为空")
    private Integer backupPower;
    @ApiModelProperty(value = "终点距离起点的距离阈值 unit : km")
    @ApiModelProperty(value = "连环派单订单侧 终点距离起点的距离阈值 unit : km")
    @Min(0)
    private Integer destToPassenger;
    @ApiModelProperty(value = "结束时间到用车时间阈值unit : min")
    @ApiModelProperty(value = "连环派单订单侧 结束时间到用车时间阈值unit : min")
    @Min(0)
    private Integer endingTimeToUseTime;
    //-------------------连环派单策略----------------------
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpTargetedServiceController.java
New file
@@ -0,0 +1,127 @@
package com.xiaopeng.operation.controller;
import com.xiaopeng.api.model.account.SysUser;
import com.xiaopeng.api.model.operation.XpTargetedService;
import com.xiaopeng.api.model.operation.XpWhitelist;
import com.xiaopeng.api.query.operation.XpTargetedServiceQuery;
import com.xiaopeng.api.vo.operation.XpTargetedServiceVo;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.utils.bean.BeanUtils;
import com.xiaopeng.common.core.web.page.PageInfo;
import com.xiaopeng.common.security.service.TokenService;
import com.xiaopeng.operation.dto.WhitelistAddDto;
import com.xiaopeng.operation.dto.WhitelistEditDto;
import com.xiaopeng.operation.query.WhitelistPageListQuery;
import com.xiaopeng.operation.service.XpTargetedServiceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@RestController
@RequestMapping("")
@Api(tags = "定向服务")
@Slf4j
public class XpTargetedServiceController {
    @Resource
    XpTargetedServiceService xpTargetedServiceService;
    @Resource
    private TokenService tokenService;
    @ApiOperation(value = "定向服务分页", tags = {"管理后台-定向服务分页"})
    @PostMapping("/api/v1/targetedService/pageList")
    public R<PageInfo<XpTargetedServiceVo>> pageList(@RequestBody XpTargetedServiceQuery query) {
        PageInfo<XpTargetedServiceVo> pageList = xpTargetedServiceService.pageList(query);
        return R.ok(pageList);
    }
    @ApiOperation(value = "定向服务-详情", tags = {"管理后台-定向服务详情"})
    @GetMapping("/api/v1/targetedService/detail")
    public R<XpTargetedServiceVo> detail(@RequestParam Long id) {
        if (id == null) {
            return R.fail("ID不能为空");
        }
        XpTargetedServiceVo vo = xpTargetedServiceService.getById(id);
        if (vo == null) {
            return R.fail("数据不存在");
        }
        return R.ok(vo);
    }
    /**
     * 新增白名单
     */
    @PostMapping("/api/v1/targetedService/add")
    @ApiOperation(value = "定向服务-添加", tags = {"管理后台-定向服务添加"})
    public R add(@Validated @RequestBody XpTargetedServiceVo dto) {
        SysUser sysUser = tokenService.getLoginUser().getSysUser();
        xpTargetedServiceService.add(dto, sysUser);
        return R.ok();
    }
    /**
     * 编辑白名单
     */
    @PostMapping("/api/v1/targetedService/edit")
    @ApiOperation(value = "定向服务-修改", tags = {"管理后台-定向服务修改"})
    public R edit(@Validated @RequestBody XpTargetedServiceVo dto) {
        if(dto.getId() == null){
            return R.fail("ID不能为空");
        }
        XpTargetedService byId = xpTargetedServiceService.getById(dto.getId());
        if(byId == null){
            return R.fail("数据不存在");
        }
        SysUser sysUser = tokenService.getLoginUser().getSysUser();
        xpTargetedServiceService.edit(dto, sysUser);
        return R.ok();
    }
    /**
     * 修改状态
     */
    @PostMapping("/api/v1/targetedService/updateStatus")
    @ApiOperation(value = "定向服务-修改状态", tags = {"管理后台-定向服务修改状态"})
    public R updateStatus(@RequestParam Long id, @RequestParam Integer status) {
        if (id == null) {
            return R.fail("ID不能为空");
        }
        if (status == null) {
            return R.fail("状态不能为空");
        }
        SysUser sysUser = tokenService.getLoginUser().getSysUser();
        boolean b = xpTargetedServiceService.updateStatus(id, status, sysUser);
        if(b){
            return R.ok();
        }
        return R.fail("修改失败");
    }
    /**
     * 批量删除
     */
    @GetMapping("/api/v1/whitelist/deleteByIds")
    @ApiOperation(value = "定向服务-批量删除", tags = {"管理后台-定向服务批量删除"})
    public R deleteByIds(String ids) {
        SysUser sysUser = tokenService.getLoginUser().getSysUser();
        List<Long> whiteIds = Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList());
        return xpTargetedServiceService.deleteByIds(whiteIds, sysUser);
    }
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/dto/XpTradingStrategyEditDTO.java
@@ -28,15 +28,32 @@
    @ApiModelProperty(value = "主键ID", required = true)
    @NotNull(message = "ID不能为空")
    private Long id;
    @ApiModelProperty(value = "关联城市列表")
    private List<XpTradingStrategyCity> cityList;
//----------------发单策略--------------------
    @ApiModelProperty(value = "用户每日取消订单数")
    private Integer cancleCount;
    @ApiModelProperty(value = "单个订单可修改目的地次数")
    private Integer amendCountPerOrder;
    @ApiModelProperty(value = "乘客端首页安全中心是否开启")
    private Boolean showSecurityCenter;
//----------------发单策略--------------------
    //---------------发单拦截策略------------------------------------
    @ApiModelProperty(value = "豁免金额")
    private BigDecimal exemptionAmount;
    @ApiModelProperty(value = "是否长期有效 1=是 0=否")
    private Boolean isLongValid;
    @ApiModelProperty(value = "豁免城市")
    private String cityCode;
    @ApiModelProperty(value = "豁免开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@@ -54,29 +71,42 @@
    @ApiModelProperty(value = "预付额度  订单大于金额需预付")
    private BigDecimal prepaidLimit;
    //---------------发单拦截策略------------------------------------
    //---------------播单策略------------------------------------
    @ApiModelProperty(value = "一轮推单距离")
    @Min(0)
    private Double onePushDistance;
    @ApiModelProperty(value = "一轮推单时间")
    @Min(0)
    private Integer onePushTime;
    @ApiModelProperty(value = "二轮推单距离")
    @Min(0)
    private Double twoPushDistance;
    @ApiModelProperty(value = "二轮推单时间")
    @Min(0)
    private Integer twoPushTime;
    @ApiModelProperty(value = "三轮推单距离")
    @Min(0)
    private Double threePushDistance;
    @ApiModelProperty(value = "三轮推单时间")
    @Min(0)
    private Integer threePushTime;
    @ApiModelProperty(value = "四轮推单距离")
    @Min(0)
    private Double fourPushDistance;
    @ApiModelProperty(value = "四轮推单时间")
    @Min(0)
    private Integer fourPushTime;
    @ApiModelProperty(value = "五轮推单距离")
@@ -84,6 +114,25 @@
    @ApiModelProperty(value = "五轮推单时间")
    private Integer fivePushTime;
    @ApiModelProperty(value = "排队是时,每X秒轮询接口查询排序")
    private Integer queuePollingTime;
    @ApiModelProperty(value = "乘客据上车点大于X米展示步行导航按钮")
    private Integer  walkingNavigationDistance;
    @ApiModelProperty(value = "用户在页面超过X秒未下单,系统静默判断价格是否有波动")
    private Integer notAddOrderTime;
    @ApiModelProperty(value = "波动大于X%,则弹框提示")
    private Integer  priceFluctuationRatio;
    @ApiModelProperty(value = "播单—乘客上车后x分钟内未点击出车,订单自动取消")
    private Integer  bdNotBoardedTime;
    //---------------播单策略------------------------------------
    //---------------分单策略------------------------------------
    @ApiModelProperty(value = "规则类型 1=单手举手 2=多手举手")
    private Integer ruleType;
@@ -93,6 +142,7 @@
    @ApiModelProperty(value = "倾向订单价值")
    private Integer tendencyOrderValue;
    @ApiModelProperty(value = "倾向距离")
    private Integer tendencyDistance;
@@ -118,42 +168,40 @@
    @ApiModelProperty(value = "电量权重")
    private Integer weightElectricity;
    @ApiModelProperty(value = "关联城市列表")
    @Valid
    private List<XpTradingStrategyCity> cityList;
    @ApiModelProperty(value = "单个订单可修改目的地次数")
    private Integer amendCountPerOrder;
    @ApiModelProperty(value = "乘客端首页安全中心是否开启")
    private Boolean showSecurityCenter;
    @ApiModelProperty(value = "豁免城市")
    private String cityCode;
    @ApiModelProperty(value = "路线时效,过了需要重新获取,单位:秒")
    private Integer MaxStandingTiming;
    @ApiModelProperty(value = "触发步行导航的最小距离")
    private Integer walkingGuideDistance;
    @ApiModelProperty(value = "允许车辆进入连环派单候选池路程阈值, unit : km")
    @Min(0)@NotNull
    //---------------分单策略------------------------------------
    //-------------------连环派单策略----------------------
    @ApiModelProperty(value = "连环派单车辆侧 允许车辆进入连环派单候选池路程阈值, unit : km")
    @Min(value = 0, message = "连环派单策略>当前订单剩余里程不能小于0")
    @NotNull(message = "连环派单策略>当前订单剩余里程不能为空")
    private Integer distanceRegardAsEnding;
    @ApiModelProperty(value = "允许车辆进入连环派单候选池时间阈值 unit : min")
    @Min(0)@NotNull
    @ApiModelProperty(value = "连环派单车辆侧 允许车辆进入连环派单候选池时间阈值 unit : min")
    @Min(value = 0, message = "连环派单策略>当前订单剩余时间不能小于0")
    @NotNull(message = "连环派单策略>当前订单剩余时间不能为空")
    private Integer timeRegardAsEnding;
    @ApiModelProperty(value = "保障可完成连环订单的电量 unit : km")
    @Min(0)@NotNull
    @ApiModelProperty(value = "连环派单车辆侧 保障可完成连环订单的电量 unit : km")
    @Min(value = 0, message = "车辆电量/续航不能小于0")
    @NotNull(message = "车辆电量/续航不能为空")
    private Integer backupPower;
    @ApiModelProperty(value = "终点距离起点的距离阈值 unit : km")
    @ApiModelProperty(value = "连环派单订单侧 终点距离起点的距离阈值 unit : km")
    @Min(0)
    private Integer destToPassenger;
    @ApiModelProperty(value = "结束时间到用车时间阈值unit : min")
    @ApiModelProperty(value = "连环派单订单侧 结束时间到用车时间阈值unit : min")
    @Min(0)
    private Integer endingTimeToUseTime;
    //-------------------连环派单策略----------------------
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/mapper/XpTargetedServiceMapper.java
New file
@@ -0,0 +1,29 @@
package com.xiaopeng.operation.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaopeng.api.model.operation.XpTargetedService;
import com.xiaopeng.api.model.operation.XpTargetedServiceVehicle;
import com.xiaopeng.api.model.operation.XpTargetedServiceWhitelist;
import com.xiaopeng.api.query.operation.XpTargetedServiceQuery;
import com.xiaopeng.api.vo.operation.XpTargetedServiceVo;
import com.xiaopeng.common.core.web.page.PageInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface XpTargetedServiceMapper extends BaseMapper<XpTargetedService> {
    List<XpTargetedServiceVo> pageList(@Param("pageInfo") PageInfo<XpTargetedServiceVo> pageInfo, @Param("query") XpTargetedServiceQuery query);
    List<XpTargetedServiceVehicle> listVehicle(Long targetedServiceId);
    List<XpTargetedServiceWhitelist> listWhitelist(Long targetedServiceId);
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/mapper/XpTargetedServiceVehicleMapper.java
New file
@@ -0,0 +1,11 @@
package com.xiaopeng.operation.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaopeng.api.model.operation.XpTargetedServiceVehicle;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface XpTargetedServiceVehicleMapper extends BaseMapper<XpTargetedServiceVehicle> {
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/mapper/XpTargetedServiceWhitelistMapper.java
New file
@@ -0,0 +1,12 @@
package com.xiaopeng.operation.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaopeng.api.model.operation.XpTargetedServiceWhitelist;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface XpTargetedServiceWhitelistMapper extends BaseMapper<XpTargetedServiceWhitelist> {
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/XpTargetedServiceService.java
New file
@@ -0,0 +1,30 @@
package com.xiaopeng.operation.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaopeng.api.model.account.SysUser;
import com.xiaopeng.api.model.operation.XpTargetedService;
import com.xiaopeng.api.query.operation.XpTargetedServiceQuery;
import com.xiaopeng.api.vo.operation.XpTargetedServiceVo;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.web.page.PageInfo;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
public interface XpTargetedServiceService extends IService<XpTargetedService> {
    PageInfo<XpTargetedServiceVo> pageList(XpTargetedServiceQuery query);
    XpTargetedServiceVo getById(Long id);
    @Transactional
    boolean add(XpTargetedServiceVo dto, SysUser sysUser);
    @Transactional
    boolean edit(XpTargetedServiceVo dto, SysUser sysUser);
    boolean updateStatus(Long id, Integer status, SysUser sysUser);
    R deleteByIds(List<Long> ids, SysUser sysUser);
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/XpTargetedServiceVehicleService.java
New file
@@ -0,0 +1,18 @@
package com.xiaopeng.operation.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaopeng.api.model.operation.XpTargetedServiceVehicle;
import java.util.List;
public interface XpTargetedServiceVehicleService extends IService<XpTargetedServiceVehicle> {
    /**
     * 根据 targetedServiceId 删除数据
     *
     * @param targetedServiceId 定向服务ID
     */
    void deleteByTargetedServiceId(Long targetedServiceId);
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/XpTargetedServiceWhitelistService.java
New file
@@ -0,0 +1,8 @@
package com.xiaopeng.operation.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaopeng.api.model.operation.XpTargetedServiceWhitelist;
public interface XpTargetedServiceWhitelistService extends IService<XpTargetedServiceWhitelist> {
    boolean removeByTargetedServiceId(Long targetedServiceId);
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpTargetedServiceServiceImpl.java
New file
@@ -0,0 +1,186 @@
package com.xiaopeng.operation.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient;
import com.xiaopeng.api.model.account.SysUser;
import com.xiaopeng.api.model.operation.XpTargetedService;
import com.xiaopeng.api.model.operation.XpTargetedServiceVehicle;
import com.xiaopeng.api.model.operation.XpTargetedServiceWhitelist;
import com.xiaopeng.api.model.vehicleConvoy.XpVehicle;
import com.xiaopeng.api.query.operation.XpTargetedServiceQuery;
import com.xiaopeng.api.vo.operation.XpTargetedServiceVo;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.exception.ServiceException;
import com.xiaopeng.common.core.web.page.PageInfo;
import com.xiaopeng.operation.mapper.XpTargetedServiceMapper;
import com.xiaopeng.operation.service.XpTargetedServiceService;
import com.xiaopeng.operation.service.XpTargetedServiceVehicleService;
import com.xiaopeng.operation.service.XpTargetedServiceWhitelistService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
public class XpTargetedServiceServiceImpl extends ServiceImpl<XpTargetedServiceMapper, XpTargetedService> implements XpTargetedServiceService {
    @Resource
    private XpTargetedServiceVehicleService xpTargetedServiceVehicleService;
    @Resource
    private XpTargetedServiceWhitelistService xpTargetedServiceWhitelistService;
    @Resource
    XpVehicleClient xpVehicleClient;
    @Resource
    XpTargetedServiceMapper xpTargetedServiceMapper;
    public List<XpTargetedServiceVehicle> listByTargetedServiceId(Long targetedServiceId) {
        if (targetedServiceId == null) {
            return Collections.emptyList();
        }
        List<XpTargetedServiceVehicle> list = xpTargetedServiceMapper.listVehicle(targetedServiceId);
        if(!list.isEmpty()){
            List<Long> ids = new ArrayList<>();
            for (XpTargetedServiceVehicle xpTargetedServiceVehicle : list) {
                ids.add(xpTargetedServiceVehicle.getVehicleId());
            }
            R<List<XpVehicle>> listR = xpVehicleClient.listByIds(ids);
            if(!listR.getData().isEmpty()){
                List<XpVehicle> vehicleList = listR.getData();
                Map<Long, XpVehicle> vehicleMap = vehicleList.stream()
                        .collect(Collectors.toMap(XpVehicle::getId, vehicle -> vehicle));
                for (XpTargetedServiceVehicle entity : list) {
                    entity.setVehicleCode(vehicleMap.get(entity.getVehicleId()).getVehicleCode());
                    entity.setPlateNumber(vehicleMap.get(entity.getVehicleId()).getPlateNumber());
                    entity.setVehicleModelName(vehicleMap.get(entity.getVehicleId()).getVehicleModelName());
                    entity.setFleetName(vehicleMap.get(entity.getVehicleId()).getFleetName());
                }
            }
        }
        return list;
    }
    @Override
    public PageInfo<XpTargetedServiceVo> pageList(XpTargetedServiceQuery query) {
        PageInfo<XpTargetedServiceVo> pageInfo = new PageInfo<>(query.getPageNum(),query.getPageSize());
        List<XpTargetedServiceVo> list = this.baseMapper.pageList(pageInfo,query);
        pageInfo.setRecords(list);
        return pageInfo;
    }
    @Override
    public XpTargetedServiceVo getById(Long id) {
        XpTargetedService entity = this.getById(id);
        if (entity == null) {
            return null;
        }
        XpTargetedServiceVo vo = new XpTargetedServiceVo();
        // 拷贝基础属性
        org.springframework.beans.BeanUtils.copyProperties(entity, vo);
        // 查询关联的车辆列表
        List<XpTargetedServiceVehicle> vehicleList = this.listByTargetedServiceId(id);
        vo.setVehicleList(vehicleList);
        // 查询关联的白名单列表
        List<XpTargetedServiceWhitelist> whitelistList = baseMapper.listWhitelist(id);
        vo.setWhitelistList(whitelistList);
        return vo;
    }
    @Transactional
    @Override
    public boolean add(XpTargetedServiceVo dto, SysUser sysUser){
        dto.setCreateTime(LocalDateTime.now());
        dto.setCreateBy(sysUser.getNickName());
        dto.setUpdateTime(LocalDateTime.now());
        dto.setUpdateBy(sysUser.getNickName());
        boolean b = save(dto);
        if(!b){
            throw new ServiceException("保存失败");
        }
        for (XpTargetedServiceVehicle entity : dto.getVehicleList()) {
            entity.setTargetedServiceId(dto.getId());
        }
         b = xpTargetedServiceVehicleService.saveBatch(dto.getVehicleList());
        if(!b){
            throw new ServiceException("保存失败");
        }
        for (XpTargetedServiceWhitelist entity : dto.getWhitelistList()) {
            entity.setTargetedServiceId(dto.getId());
        }
         b = xpTargetedServiceWhitelistService.saveBatch(dto.getWhitelistList());
        if(!b){
            throw new ServiceException("保存失败");
        }
        return true;
    }
    @Transactional
    @Override
    public boolean edit(XpTargetedServiceVo dto, SysUser sysUser){
        dto.setUpdateTime(LocalDateTime.now());
        dto.setUpdateBy(sysUser.getNickName());
        boolean b = updateById(dto);
        if(!b){
            throw new ServiceException("保存失败");
        }
        xpTargetedServiceVehicleService.deleteByTargetedServiceId(dto.getId());
        xpTargetedServiceWhitelistService.removeByTargetedServiceId(dto.getId());
        for (XpTargetedServiceVehicle entity : dto.getVehicleList()) {
            entity.setTargetedServiceId(dto.getId());
        }
        b = xpTargetedServiceVehicleService.saveBatch(dto.getVehicleList());
        if(!b){
            throw new ServiceException("保存失败");
        }
        for (XpTargetedServiceWhitelist entity : dto.getWhitelistList()) {
            entity.setTargetedServiceId(dto.getId());
        }
        b = xpTargetedServiceWhitelistService.saveBatch(dto.getWhitelistList());
        if(!b){
            throw new ServiceException("保存失败");
        }
        return true;
    }
    @Override
    public boolean updateStatus(Long id, Integer status, SysUser sysUser) {
        XpTargetedService entity = new XpTargetedService();
        entity.setId(id);
        entity.setStatus(status);
        entity.setUpdateBy(sysUser.getNickName());
        return this.updateById(entity);
    }
    @Override
    public R deleteByIds(List<Long> ids, SysUser sysUser) {
        List<XpTargetedService> list = new ArrayList<>();
        for (Long id : ids) {
            list.add(new XpTargetedService(){{
                setId(id);
                setUpdateBy(sysUser.getNickName());
                setDeleted(true);
            }});
        }
        this.updateBatchById(list);
        return R.ok();
    }
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpTargetedServiceVehicleServiceImpl.java
New file
@@ -0,0 +1,38 @@
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.feignClient.vehicleConvoy.XpVehicleClient;
import com.xiaopeng.api.model.operation.XpTargetedServiceVehicle;
import com.xiaopeng.api.model.vehicleConvoy.XpVehicle;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.operation.mapper.XpTargetedServiceMapper;
import com.xiaopeng.operation.mapper.XpTargetedServiceVehicleMapper;
import com.xiaopeng.operation.service.XpTargetedServiceVehicleService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
public class XpTargetedServiceVehicleServiceImpl  extends ServiceImpl<XpTargetedServiceVehicleMapper, XpTargetedServiceVehicle> implements XpTargetedServiceVehicleService {
    @Override
    public void deleteByTargetedServiceId(Long targetedServiceId) {
        if (targetedServiceId == null) {
            return;
        }
        LambdaQueryWrapper<XpTargetedServiceVehicle> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(XpTargetedServiceVehicle::getTargetedServiceId, targetedServiceId);
        this.remove(wrapper);
    }
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpTargetedServiceWhitelistServiceImp.java
New file
@@ -0,0 +1,25 @@
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.XpTargetedServiceWhitelist;
import com.xiaopeng.operation.mapper.XpTargetedServiceWhitelistMapper;
import com.xiaopeng.operation.service.XpTargetedServiceWhitelistService;
import org.springframework.stereotype.Service;
@Service
public class XpTargetedServiceWhitelistServiceImp  extends ServiceImpl<XpTargetedServiceWhitelistMapper, XpTargetedServiceWhitelist> implements XpTargetedServiceWhitelistService {
    @Override
    public boolean removeByTargetedServiceId(Long targetedServiceId) {
        if (targetedServiceId == null) {
            return false;
        }
        LambdaQueryWrapper<XpTargetedServiceWhitelist> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(XpTargetedServiceWhitelist::getTargetedServiceId, targetedServiceId);
        return this.remove(wrapper);
    }
}
xp-robotaxi-operation-boot/src/main/resources/mapper/operation/XpTargetedServiceMapper.xml
New file
@@ -0,0 +1,37 @@
<?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.XpTargetedServiceMapper">
    <select id="pageList" resultType="com.xiaopeng.api.vo.operation.XpTargetedServiceVo">
        select a.* ,
            (select count(1) from xp_targeted_service_vehicle where xp_targeted_service_id = a.id) as vehicleCount,
            (select count(1) from xp_targeted_service_whitelist where xp_targeted_service_id = a.id) as whitelistCount
        from xp_targeted_service as a
        where a.is_deleted = 0
        <if test="query.cityCode != null and query.cityCode != ''">
            and a.cityCode = #{query.cityCode}
        </if>
        order by a.create_time desc
    </select>
        <select id="listVehicle" resultType="com.xiaopeng.api.model.operation.XpTargetedServiceVehicle">
            select a.*,b.plan_name
            from xp_targeted_service_vehicle as a
            inner join xp_cruise_plan as b on a.cruise_plan_id = b.id
            where a.targeted_service_id = #{targetedServiceId}
        </select>
    <select id="listWhitelist" resultType="com.xiaopeng.api.model.operation.XpTargetedServiceWhitelist">
        select a.*,b.nick_name,b.account
        from xp_targeted_service_whitelist as a
        inner join xp_whitelist as b on a.whitelist_id = b.id
        where a.targeted_service_id = #{targetedServiceId}
    </select>
</mapper>
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/model/vo/XpVehicleVO.java
@@ -20,8 +20,8 @@
@ApiModel("车辆视图对象")
public class XpVehicleVO extends XpVehicle {
    @ApiModelProperty(value = "车队名称")
    private String fleetName;
//    @ApiModelProperty(value = "车队名称")
//    private String fleetName;
    @ApiModelProperty(value = "下次保养时间")
    @JsonFormat(pattern = "yyyy年M月dd日",timezone = "GMT+8")
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/service/impl/XpVehicleServiceImpl.java
@@ -138,6 +138,7 @@
        if (CollectionUtils.isEmpty(ids)) {
            return new ArrayList<>();
        }
        //查询车型和 车队信息
        return super.listByIds(ids);
    }
xp-robotaxi-vehicle-convoy-boot/src/main/resources/mapper/vehicleConvoy/XpVehicleMapper.xml
@@ -12,6 +12,18 @@
          is_deleted, create_time, update_time, create_by, update_by
    </sql>
    <select id="selectBatchIds" resultType="com.xiaopeng.api.model.vehicleConvoy.XpVehicle">
        SELECT  a.*,b.name as vehicleModelName,d.fleet_name,d.id as fleetId
        FROM xp_vehicle a
         left join xp_vehicle_model b on a.vehicle_model = b.id
        left join xp_fleet_vehicle c on a.id = c.vehicle_id
        left join xp_fleet d on c.fleet_id = d.id
        WHERE a.id IN
            <foreach collection="coll" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
    </select>
    <select id="selectById" resultType="com.xiaopeng.api.model.vehicleConvoy.XpVehicle">
        SELECT  a.*,b.name as vehicleModelName
        FROM xp_vehicle a