xuhy
2026-04-23 0646f4a967fccc8ab9c74666424f5dc2d755fd55
[feat] 巡游打卡详情
6个文件已修改
162 ■■■■■ 已修改文件
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/maintenance/XpCruiseCheckInRule.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/controller/XpTaskController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpCruiseCheckInRecordServiceImpl.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpTaskServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/vo/XpCruiseCheckInRecordVO.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/resources/mapper/maintenance/XpCruiseCheckInRecordMapper.xml 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/maintenance/XpCruiseCheckInRule.java
@@ -21,6 +21,7 @@
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 规则名称
     */
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/controller/XpTaskController.java
@@ -107,9 +107,9 @@
    }
    @ApiOperation(value = "接收工单", tags = "运维APP-任务中心")
    @PostMapping("/maintenance-app/api/v1/task/accept")
    public R<?> accept(@RequestParam String taskId) {
        xpTaskService.accept(taskId);
    @PostMapping("/maintenance-app/api/v1/task/accept/{id}")
    public R<?> accept(@PathVariable("id") String id) {
        xpTaskService.accept(id);
        return R.ok();
    }
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpCruiseCheckInRecordServiceImpl.java
@@ -1,15 +1,19 @@
package com.xiaopeng.maintenance.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaopeng.api.feignClient.account.XpOperationsUserClient;
import com.xiaopeng.api.model.account.XpOperationsUser;
import com.xiaopeng.api.model.maintenance.XpCheckLocation;
import com.xiaopeng.api.model.maintenance.XpCruiseCheckInRecord;
import com.xiaopeng.api.model.maintenance.XpCruiseCheckInRuleLocation;
import com.xiaopeng.api.vo.account.XpOperationsUserProfileVO;
import com.xiaopeng.common.core.web.page.PageInfo;
import com.xiaopeng.maintenance.mapper.XpCruiseCheckInRecordMapper;
import com.xiaopeng.maintenance.model.vo.AppXpCruiseCheckInLocationVo;
import com.xiaopeng.maintenance.service.IXpCheckLocationService;
import com.xiaopeng.maintenance.service.IXpCruiseCheckInRecordService;
import com.xiaopeng.maintenance.service.IXpCruiseCheckInRuleLocationService;
import com.xiaopeng.maintenance.vo.XpCruiseCheckInRecordQuery;
import com.xiaopeng.maintenance.vo.XpCruiseCheckInRecordVO;
import com.xiaopeng.maintenance.vo.XpCruiseCheckInStatisticsQuery;
@@ -20,10 +24,7 @@
import javax.annotation.Resource;
import java.time.LocalDate;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -65,21 +66,18 @@
        return pageInfo;
    }
    IXpCheckLocationService checkLocationService;
    @Resource
    IXpCruiseCheckInRuleLocationService xpCruiseCheckInRuleLocationService;
    @Override
    public XpCruiseCheckInRecordVO detail(Long id) {
        XpCruiseCheckInRecordVO vo = xpCruiseCheckInRecordMapper.detail(id);
//        Xp
        XpCheckLocation location = checkLocationService.getById(vo.getCheckLocationId());
        vo.setLocationRange(location.getLocationRange());
        vo.setDetailAddr(location.getLocationAddress());
        List<XpCruiseCheckInRuleLocation> list = xpCruiseCheckInRuleLocationService.list(new LambdaQueryWrapper<XpCruiseCheckInRuleLocation>()
                .eq(XpCruiseCheckInRuleLocation::getCruiseCheckInRuleId,vo.getRuleId()).orderByAsc(XpCruiseCheckInRuleLocation::getSort));
        vo.setPointCount(list.size());
        List<Long> ids = Collections.singletonList(vo.getOperationsUserId());
        List<XpOperationsUser> xpOperationsUsers = xpOperationsUserClient.listByIds(ids).getData();
        Map<Long, XpOperationsUser> userMap = xpOperationsUsers.stream().collect(Collectors.toMap(XpOperationsUser::getId, Function.identity()));
        XpOperationsUser user = userMap.get(vo.getOperationsUserId());
        XpOperationsUser user = xpOperationsUserClient.listByIds(ids).getData().get(0);
        if (user != null) {
            XpOperationsUserProfileVO profile = xpOperationsUserClient.getProfile(user.getId()).getData();
            vo.setOperationsUserId(user.getId());
@@ -88,7 +86,6 @@
            vo.setFleetName(profile.getFleet().getFleetName());
            vo.setRole(profile.getRoles().stream().map(XpOperationsUserProfileVO.RoleInfoVO::getRoleName).collect(Collectors.joining(",")));
        }
        return vo;
    }
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpTaskServiceImpl.java
@@ -1411,7 +1411,7 @@
        Long fleetId = xpFleetVehicleClient.getFleetIdByVehicleId(vehicle.getId()).getData();
        List<Long> roleIds = taskRuleRole.stream().map(XpTaskRuleRole::getRoleId).collect(Collectors.toList());
        List<Long> ids = xpFleetOperationsClient.getOperationsIdsByFleetId(fleetId).getData();
        List<Long> ids = xpFleetOperationsClient.getOperationsIdsByFleetId(fleetId).getData();//TODO 空指针
        String belongUserIds = xpOperationUserClient.getXpOperationsRoleByRoleIds(roleIds).getData().stream()
                .map(XpOperationsRole::getOperationsUserId)
                .filter(ids::contains)
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/vo/XpCruiseCheckInRecordVO.java
@@ -19,54 +19,43 @@
    @ApiModelProperty(value = "主键")
    private Long id;
    /**
     * 规则名称
     */
    @TableField("name")
    private String name;
    /**
     * 任务开始时间
     */
    @TableField("start_time")
    private LocalDateTime startTime;
    /**
     * 任务结束时间
     */
    @TableField("end_time")
    private LocalDateTime endTime;
    /**
     * 循环方式(0=不循环,1=每天循环)
     */
    @TableField("cyclic_mode")
    @ApiModelProperty(value = "规则id")
    private Long ruleId;
    @ApiModelProperty(value = "打卡规则名称")
    private String ruleName;
    @ApiModelProperty(value = "(0=不循环,1=每天循环)")
    private Integer cyclicMode;
//    点位总数:
//    当前点位排序:
//    XpCheckLocation and XpCruiseCheckInRule
    @ApiModelProperty(value = "点位总数")
    private Integer pointCount;
    @ApiModelProperty(value = "当前点位排序")
    private Integer pointIndex;
    @ApiModelProperty(value = "任务开始时间")
    private String ruleStartTime;
    @ApiModelProperty(value = "任务结束时间")
    private String ruleEndTime;
    @ApiModelProperty(value = "运维人员id")
    private Long operationsUserId;
    @ApiModelProperty(value = "运维人员姓名")
    private String operationsUserName;
    @ApiModelProperty(value = "运维人员手机号")
    private String phoneNumber;
    @ApiModelProperty(value = "所属分队")
    private String fleetName;
    @ApiModelProperty(value = "角色")
    private String role;
    @ApiModelProperty(value = "打卡点位id")
    private Long checkLocationId;
    /* 对应界面详细信息 */
    @ApiModelProperty(value = "打卡点位经度")
    private BigDecimal locationLongitude;
    @ApiModelProperty(value = "打卡点位纬度")
    private BigDecimal locationLatitude;
    @ApiModelProperty(value = "打卡点位名称")
    private String locationAddress;
@@ -74,17 +63,12 @@
    @ApiModelProperty(value = "打卡点位范围")
    private BigDecimal locationRange;
    @ApiModelProperty(value = "打卡点位限时")
    private String locationTimeLimit;
    @ApiModelProperty(value = "打卡开始时段")
    private String locationStartTime;
    @ApiModelProperty(value = "打卡点位详细地址")
    private String detailAddr;
    @ApiModelProperty(value = "打卡结束时段")
    private String locationEndTime;
    @ApiModelProperty(value = "巡游打卡规则id")
    private Integer cruiseCheckInRuleId;
    @ApiModelProperty(value = "打卡规则名称")
    private String ruleName;
    @ApiModelProperty(value = "打卡时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
xp-robotaxi-maintenance-boot/src/main/resources/mapper/maintenance/XpCruiseCheckInRecordMapper.xml
@@ -2,15 +2,56 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xiaopeng.maintenance.mapper.XpCruiseCheckInRecordMapper">
    <sql id="CruiseCheckInRecordColumns">
        r.id,
        r.operations_user_id,
        r.check_location_id,
        r.cruise_check_in_rule_id,
        r.check_in_time,
        r.check_in_result,
        r.field_situation,
        r.scene_photo,
        r.scene_description,
        r.is_deleted,
        r.create_time,
        r.update_time,
        r.create_by,
        r.update_by,
        cl.location_address,
        cl.location_range,
        cl.location_lon,
        cl.location_lat,
        cl.status AS location_status,
        cl.type AS location_type,
        rl.start_time AS rule_location_start_time,
        rl.end_time AS rule_location_end_time,
        rl.sort AS rule_location_sort,
        cr.name AS rule_name,
        cr.start_time AS rule_start_time,
        cr.end_time AS rule_end_time,
        cr.cyclic_mode
    </sql>
    <resultMap id="CruiseCheckInRecordVOMap" type="com.xiaopeng.maintenance.vo.XpCruiseCheckInRecordVO">
        <id column="id" property="id"/>
        <result column="cruise_check_in_rule_id" property="ruleId"/>
        <result column="rule_name" property="ruleName"/>
        <result column="cyclic_mode" property="cyclicMode"/>
        <result column="rule_location_sort" property="pointIndex"/>
        <result column="rule_start_time" property="ruleStartTime"/>
        <result column="rule_end_time" property="ruleEndTime"/>
        <result column="rule_location_start_time" property="locationStartTime"/>
        <result column="rule_location_end_time" property="locationEndTime"/>
        <result column="operations_user_id" property="operationsUserId"/>
        <result column="operations_user_name" property="operationsUserName"/>
        <result column="phone_number" property="phoneNumber"/>
        <result column="fleet_name" property="fleetName"/>
        <result column="role" property="role"/>
        <result column="check_location_id" property="checkLocationId"/>
        <result column="location_address" property="locationAddress"/>
        <result column="cruise_check_in_rule_id" property="cruiseCheckInRuleId"/>
        <result column="rule_name" property="ruleName"/>
        <result column="location_range" property="locationRange"/>
        <result column="location_lon" property="locationLongitude"/>
        <result column="location_lat" property="locationLatitude"/>
        <result column="check_in_time" property="checkInTime"/>
        <result column="check_in_result" property="checkInResult"/>
        <result column="field_situation" property="fieldSituation"/>
@@ -28,18 +69,10 @@
    <select id="selectCruiseCheckInRecordList" resultMap="CruiseCheckInRecordVOMap">
        SELECT
            r.id,
            r.operations_user_id,
            r.check_location_id,
            cl.location_address,
            r.cruise_check_in_rule_id,
            cr.name AS rule_name,
            r.check_in_time,
            r.check_in_result,
            r.field_situation,
            r.scene_photo,
            r.scene_description
        <include refid="CruiseCheckInRecordColumns"/>
        FROM xp_cruise_check_in_record r
        LEFT JOIN xp_cruise_check_in_rule_location rl ON r.cruise_check_in_rule_id = rl.cruise_check_in_rule_id AND r.check_location_id = rl.check_location_id AND rl.is_deleted = '0'
        LEFT JOIN xp_check_location cl ON r.check_location_id = cl.id AND cl.is_deleted = '0'
        LEFT JOIN xp_cruise_check_in_rule cr ON r.cruise_check_in_rule_id = cr.id AND cr.is_deleted = '0'
        WHERE r.is_deleted = '0'
@@ -69,8 +102,9 @@
    <select id="detail" resultMap="CruiseCheckInRecordVOMap">
        SELECT
            r.*,cr.*,cl.*
        <include refid="CruiseCheckInRecordColumns"/>
        FROM xp_cruise_check_in_record r
        LEFT JOIN xp_cruise_check_in_rule_location rl ON r.cruise_check_in_rule_id = rl.cruise_check_in_rule_id AND r.check_location_id = rl.check_location_id AND rl.is_deleted = '0'
        LEFT JOIN xp_check_location cl ON r.check_location_id = cl.id AND cl.is_deleted = '0'
        LEFT JOIN xp_cruise_check_in_rule cr ON r.cruise_check_in_rule_id = cr.id AND cr.is_deleted = '0'
        WHERE r.id = #{id}