xuhy
2026-04-24 88f21bc1e19221e2f01d32cc117a65174b80f38f
[feat] 巡游打卡详情
3个文件已修改
81 ■■■■■ 已修改文件
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/mapper/XpCruiseCheckInRecordMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpCruiseCheckInRecordServiceImpl.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/resources/mapper/maintenance/XpCruiseCheckInRecordMapper.xml 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/mapper/XpCruiseCheckInRecordMapper.java
@@ -20,4 +20,7 @@
    List<XpCruiseCheckInStatisticsVO> selectCruiseCheckInStatistics(@Param("query") XpCruiseCheckInStatisticsQuery query);
    List<XpCruiseCheckInRecordVO> selectCruiseCheckInRecordList(@Param("query") XpCruiseCheckInRecordQuery query);
    List<XpCruiseCheckInRecordVO> exportList(@Param("query") XpCruiseCheckInRecordQuery query);
}
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpCruiseCheckInRecordServiceImpl.java
@@ -88,7 +88,9 @@
            vo.setOperationsUserId(user.getId());
            vo.setOperationsUserName(user.getNickName());
            vo.setPhoneNumber(user.getPhoneNumber());
            vo.setFleetName(profile.getFleet().getFleetName());
            if (profile.getFleet() != null) {
                vo.setFleetName(profile.getFleet().getFleetName());
            }
            vo.setRole(profile.getRoles().stream().map(XpOperationsUserProfileVO.RoleInfoVO::getRoleName).collect(Collectors.joining(",")));
        }
        return vo;
@@ -115,27 +117,30 @@
    @Override
    public List<XpCruiseCheckInRecordVO> all(XpCruiseCheckInRecordQuery query) {
        List<XpCruiseCheckInRecordVO> list = xpCruiseCheckInRecordMapper.selectCruiseCheckInRecordList(query);
        List<XpCruiseCheckInRecordVO> list = xpCruiseCheckInRecordMapper.exportList(query);
        List<Long> ids = list.stream().map(XpCruiseCheckInRecordVO::getOperationsUserId).collect(Collectors.toList());
        List<XpOperationsUser> xpOperationsUsers = xpOperationsUserClient.listByIds(ids).getData();
        Map<Long, XpOperationsUser> userMap = xpOperationsUsers.stream().collect(Collectors.toMap(XpOperationsUser::getId, Function.identity()));
        list = list.stream().map(record -> {
                    XpOperationsUser user = userMap.get(record.getOperationsUserId());
                    if (user == null) return null;
                    record.setOperationsUserId(user.getId());
                    record.setOperationsUserName(user.getNickName());
                    record.setPhoneNumber(user.getPhoneNumber());
                    if (StringUtils.isNotBlank(query.getOperationsUserName()) && !record.getOperationsUserName().contains(query.getOperationsUserName())) {
                        return null;
                    }
                    if (StringUtils.isNotBlank(query.getPhoneNumber()) && !record.getPhoneNumber().contains(query.getPhoneNumber())) {
                        return null;
                    }
                    return record;
                })
                .filter(Objects::nonNull)
                .collect(Collectors.toList());
        for (XpCruiseCheckInRecordVO xpCruiseCheckInRecordVO : list) {
            XpOperationsUser user = userMap.get(xpCruiseCheckInRecordVO.getOperationsUserId());
            if (user == null) continue;
            xpCruiseCheckInRecordVO.setOperationsUserId(user.getId());
            xpCruiseCheckInRecordVO.setOperationsUserName(user.getNickName());
            xpCruiseCheckInRecordVO.setPhoneNumber(user.getPhoneNumber());
        }
        list.removeIf(vo -> {
            if (StringUtils.isNotBlank(query.getOperationsUserName()) && !vo.getOperationsUserName().contains(query.getOperationsUserName())) {
                return true;
            }
            return StringUtils.isNotBlank(query.getPhoneNumber()) && !vo.getPhoneNumber().contains(query.getPhoneNumber());
        });
        return list;
    }
xp-robotaxi-maintenance-boot/src/main/resources/mapper/maintenance/XpCruiseCheckInRecordMapper.xml
@@ -143,4 +143,41 @@
        ORDER BY `date` DESC
    </select>
    <select id="exportList" resultType="com.xiaopeng.maintenance.vo.XpCruiseCheckInRecordVO">
        SELECT
        r.id,
        r.check_in_time,
        r.check_in_result,
        r.field_situation,
        cl.location_address,
        cr.name AS rule_name
        FROM xp_cruise_check_in_record r
        JOIN xp_check_location cl ON r.check_location_id = cl.id AND cl.is_deleted = '0'
        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'
        <if test="query.fieldSituation != null">
            AND r.field_situation = #{query.fieldSituation}
        </if>
        <if test="query.checkInResult != null and query.checkInResult == 3">
            AND r.check_in_result IS NULL
        </if>
        <if test="query.checkInResult != null and query.checkInResult != 3">
            AND r.check_in_result = #{query.checkInResult}
        </if>
        <if test="query.ruleName != null and query.ruleName != ''">
            AND cr.name LIKE CONCAT('%', #{query.ruleName}, '%')
        </if>
        <if test="query.locationAddress != null and query.locationAddress != ''">
            AND cl.location_address LIKE CONCAT('%', #{query.locationAddress}, '%')
        </if>
        <if test="query.startDate != null">
            AND DATE(r.check_in_time) &gt;= #{query.startDate}
        </if>
        <if test="query.endDate != null">
            AND DATE(r.check_in_time) &lt;= #{query.endDate}
        </if>
        ORDER BY r.check_in_time DESC
    </select>
</mapper>