puzhibing
2026-02-27 12de395d4c80b36c3ee2bfa72cf7c48245390f3a
Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/Robotaxi
7个文件已修改
619 ■■■■■ 已修改文件
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/controller/XpOperationsUserNotificationController.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/account/XpOperationsUserNotification.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/utils/XpPricingUtil.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/controller/XpVehicleOperationsController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/model/query/TaskPageListQuery.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpTaskServiceImpl.java 563 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/resources/mapper/maintenance/XpTaskMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/controller/XpOperationsUserNotificationController.java
@@ -9,9 +9,7 @@
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
 * <p>
@@ -55,4 +53,21 @@
        return R.ok(pageInfo);
    }
    @GetMapping("/api/v1/notification/unreadCount")
    @ApiOperation(value = "获取未读通知数量", tags = {"运维APP-消息通知"})
    public R<Long> getUnreadNotificationCount() {
        // 从Token中获取当前登录用户ID
        Long currentUserId = tokenService.getLoginOperationUser().getId();
        Long count = notificationService.lambdaQuery().eq(XpOperationsUserNotification::getOperationsUserId, currentUserId)
                .eq(XpOperationsUserNotification::getReadStatus, 0).count();
        return R.ok(count);
    }
    @PostMapping("/api/v1/notification/read")
    @ApiOperation(value = "操作已读", tags = "运维APP-消息通知")
    public R<?> readNotification(@RequestParam Long notificationId){
        notificationService.lambdaUpdate().set(XpOperationsUserNotification::getReadStatus, 1).eq(XpOperationsUserNotification::getId, notificationId).update();
        return R.ok();
    }
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/account/XpOperationsUserNotification.java
@@ -6,6 +6,7 @@
import java.time.LocalDateTime;
import java.io.Serializable;
import com.sun.org.apache.bcel.internal.generic.INEG;
import com.xiaopeng.common.core.web.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -34,7 +35,7 @@
    @TableId(value = "id", type = IdType.NONE)
    private Long id;
    @ApiModelProperty(value = "通知类型1新任务通知 2任务状态通知 3排班变动通知 4公告通知 5新事故通知 6事故状态通知")
    @ApiModelProperty(value = "通知类型通知类型 1=新增事故,2=事故即将超时提示,3=事故超时提示,4=排班信息变动,5=事故状态变更,6=新增任务,7=任务过期提示,8=版本更新提示,9=变更协议政策内容,10=变更协议内容并需用户授权,11=打卡成功通知")
    private Integer notificationType;
    @ApiModelProperty(value = "通知内容")
@@ -46,5 +47,7 @@
    @ApiModelProperty(value = "数据id 根据通知类型区分")
    private Long dataId;
    @ApiModelProperty(value = "是否已读 0-未读 1-已读")
    private Integer readStatus;
}
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/utils/XpPricingUtil.java
@@ -271,7 +271,7 @@
            if (realDistance > rule.getDouble("num12")) {
                longDistanceThree = rule.getDouble("num34") * (realDistance - rule.getDouble("num12"));
            }
            amount = rule.getDouble("num29") + (exceedDistance * rule.getDouble("num30")) + (exceedTime * rule.getDouble("num31")) + (wait * waitMoney) + longDistanceOne + longDistanceTwo + longDistanceThree;
            amount = rule.getDouble("num29") + new BigDecimal(exceedDistance * rule.getDouble("num30")).setScale(2,RoundingMode.HALF_UP).doubleValue() + (exceedTime * rule.getDouble("num31")) + (wait * waitMoney) + longDistanceOne + longDistanceTwo + longDistanceThree;
            // 起步价
@@ -285,6 +285,7 @@
            // 里程费
            double distancePrice = (exceedDistance * rule.getDouble("num30")) + longDistanceOne + longDistanceTwo + longDistanceThree;
            distancePrice = new BigDecimal(distancePrice).setScale(2,RoundingMode.HALF_UP).doubleValue();
            xpPricingCardVo.setDistancePrice(distancePrice);
            // 时长
@@ -305,7 +306,7 @@
                if (realDistance > rule.getDouble("num12")) {
                    longDistanceThree = rule.getDouble("num20") * (realDistance - rule.getDouble("num12"));
                }
                amount = rule.getDouble("num15") + (exceedDistance * rule.getDouble("num16")) + (exceedTime * rule.getDouble("num17")) + (wait * waitMoney) + longDistanceOne + longDistanceTwo + longDistanceThree;
                amount = rule.getDouble("num15") + new BigDecimal(exceedDistance * rule.getDouble("num16")).setScale(2,RoundingMode.HALF_UP).doubleValue() + (exceedTime * rule.getDouble("num17")) + (wait * waitMoney) + longDistanceOne + longDistanceTwo + longDistanceThree;
                // 起步价
@@ -318,6 +319,7 @@
                // 里程费
                double distancePrice = (exceedDistance * rule.getDouble("num16")) + longDistanceOne + longDistanceTwo + longDistanceThree;
                distancePrice = new BigDecimal(distancePrice).setScale(2,RoundingMode.HALF_UP).doubleValue();
                xpPricingCardVo.setDistancePrice(distancePrice);
                // 时长
@@ -360,7 +362,7 @@
                    if (realDistance > rule.getDouble("num12")) {
                        longDistanceThree = rule.getDouble("num28") * (realDistance - rule.getDouble("num12"));
                    }
                    amount = rule.getDouble("num23") + (exceedDistance * rule.getDouble("num24")) + (exceedTime * rule.getDouble("num25")) + (wait * waitMoney) + longDistanceOne + longDistanceTwo + longDistanceThree;
                    amount = rule.getDouble("num23") + new BigDecimal(exceedDistance * rule.getDouble("num24")).setScale(2,RoundingMode.HALF_UP).doubleValue() + (exceedTime * rule.getDouble("num25")) + (wait * waitMoney) + longDistanceOne + longDistanceTwo + longDistanceThree;
                    // 起步价
@@ -378,6 +380,7 @@
                    // 里程费
                    double distancePrice = (exceedDistance * rule.getDouble("num24")) + longDistanceOne + longDistanceTwo + longDistanceThree;
                    distancePrice = new BigDecimal(distancePrice).setScale(2,RoundingMode.HALF_UP).doubleValue();
                    xpPricingCardVo.setDistancePrice(distancePrice);
                    // 时长
@@ -397,7 +400,7 @@
                    if (realDistance > rule.getDouble("num12")) {
                        longDistanceThree = rule.getDouble("num13") * (realDistance - rule.getDouble("num12"));
                    }
                    amount = rule.getDouble("num1") + (exceedDistance * rule.getDouble("num4")) + (exceedTime * rule.getDouble("num5")) + (wait * waitMoney) + longDistanceOne + longDistanceTwo + longDistanceThree;
                    amount = rule.getDouble("num1") + new BigDecimal(exceedDistance * rule.getDouble("num4")).setScale(2,RoundingMode.HALF_UP).doubleValue() + (exceedTime * rule.getDouble("num5")) + (wait * waitMoney) + longDistanceOne + longDistanceTwo + longDistanceThree;
                    // 起步价
@@ -415,6 +418,7 @@
                    // 里程费
                    double distancePrice = (exceedDistance * rule.getDouble("num4")) + longDistanceOne + longDistanceTwo + longDistanceThree;
                    distancePrice = new BigDecimal(distancePrice).setScale(2,RoundingMode.HALF_UP).doubleValue();
                    xpPricingCardVo.setDistancePrice(distancePrice);
                    // 时长
@@ -437,6 +441,7 @@
        xpPricingCardVo.setTotalPrice(amount);
        return xpPricingCardVo;
    }
    /**
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/controller/XpVehicleOperationsController.java
@@ -89,16 +89,18 @@
            // redis 获取当前最新经纬度位置
            VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(xpVehicle.getVehicleVin())), VehiclePosition.class);
            double x = vehiclePosition.getPoint().getX();
            double y = vehiclePosition.getPoint().getY();
            XpCruiseOrder xpCruiseOrder = new XpCruiseOrder();
            if(vehiclePosition!=null){
                double x = vehiclePosition.getPoint().getX();
                double y = vehiclePosition.getPoint().getY();
                xpCruiseOrder.setStartLon(x);
                xpCruiseOrder.setStartLat(y);
            }
            xpCruiseOrder.setId("XU"+ IdUtil.fastUUID());
            xpCruiseOrder.setVehicleId(xpVehicle.getId());
            xpCruiseOrder.setFleetId(xpVehicle.getFleetId());
            xpCruiseOrder.setOrderType(2);
            xpCruiseOrder.setStartLon(x);
            xpCruiseOrder.setStartLat(y);
            xpCruiseOrder.setStatus(1);
            xpCruiseOrder.setOrderReverse(1);
            xpCruiseOrder.setLastOrderId(r.getData());
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/model/query/TaskPageListQuery.java
@@ -24,6 +24,8 @@
    private Integer sortRule;
    @ApiModelProperty(value = "状态0=待到达 1=待处理 2=已完成 3=已取消")
    private Integer status;
    @ApiModelProperty(value = "当前登陆人id")
    private Long userId;
    @ApiModelProperty(value = "车牌号")
    private String plateNumber;
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpTaskServiceImpl.java
@@ -28,6 +28,8 @@
import com.xiaopeng.maintenance.service.XpTaskService;
import com.xiaopeng.maintenance.utils.UUIDUtil;
import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -38,6 +40,7 @@
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
@@ -50,11 +53,13 @@
 */
@Service
public class XpTaskServiceImpl extends ServiceImpl<XpTaskMapper, XpTask> implements XpTaskService {
    @Autowired
    private RedissonClient redissonClient;
    /**
     * 常规任务类型映射
     */
    private static final Map<String, String> TASK_TYPE_MAP = new java.util.HashMap<>();
    static {
        TASK_TYPE_MAP.put("1", "车辆检查");
        TASK_TYPE_MAP.put("2", "车辆充电");
@@ -92,6 +97,7 @@
    private XpVehicleClient xpVehicleClient;
    @Autowired
    private XpTaskRuleMapper xpTaskRuleMapper;
    @Override
    public PageInfo<WorkBenchVO> workbench(WorkBenchQuery query) {
        PageInfo<WorkBenchVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
@@ -135,7 +141,7 @@
        List<TaskPageListVO> list = this.baseMapper.pageList(pageInfo, query);
        XpTaskRule xpTaskRule = xpTaskRuleMapper.selectOne(new LambdaQueryWrapper<XpTaskRule>().last("limit 1"));
        if (Objects.nonNull(xpTaskRule)) {
            list.stream().filter(item -> item.getTaskCategory().equals(2)).forEach(item->{
            list.stream().filter(item -> item.getTaskCategory().equals(2)).forEach(item -> {
                item.setCanArriveRange(xpTaskRule.getCanArriveRange());
            });
        }
@@ -169,14 +175,14 @@
    public R<TaskAccidentDetailVO> vehicleAccidentDetail(Long id) {
        TaskAccidentDetailVO res = new TaskAccidentDetailVO();
        XpTask task = this.getById(id);
        if (task == null){
        if (task == null) {
            throw new ServiceException(
                    "任务不存在",
                    I18nKeyConstant.TASK_NOT_EXIST
            );
        }
        XpVehicle vehicle = xpVehicleClient.queryById(task.getVehicleId()).getData();
        if (vehicle == null){
        if (vehicle == null) {
            throw new ServiceException(
                    "车辆不存在",
                    I18nKeyConstant.VEHICLE_NOT_EXIST
@@ -218,7 +224,7 @@
    @Override
    public R handleVehicleAccident(HandleVehicleAccidentDto dto, XpOperationsUser xpOperationsUser) {
        XpTask task = this.getById(dto.getId());
        if (task == null){
        if (task == null) {
            throw new ServiceException(
                    "任务不存在",
                    I18nKeyConstant.TASK_NOT_EXIST
@@ -249,14 +255,14 @@
    public R<TaskRoutineDetailVO> vehicleRoutineDetail(Long id) {
        TaskRoutineDetailVO res = new TaskRoutineDetailVO();
        XpTask task = this.getById(id);
        if (task == null){
        if (task == null) {
            throw new ServiceException(
                    "任务不存在",
                    I18nKeyConstant.TASK_NOT_EXIST
            );
        }
        XpVehicle vehicle = xpVehicleClient.queryById(task.getVehicleId()).getData();
        if (vehicle == null){
        if (vehicle == null) {
            throw new ServiceException(
                    "车辆不存在",
                    I18nKeyConstant.VEHICLE_NOT_EXIST
@@ -282,7 +288,7 @@
        res.setTaskImage(task.getTaskImage());
        res.setHandleUserId(task.getHandleUserId());
        res.setHandleTime(task.getHandleTime());
        if (Objects.nonNull(task.getHandleUserId())&&task.getHandleUserId().split(",").length==1) {
        if (Objects.nonNull(task.getHandleUserId()) && task.getHandleUserId().split(",").length == 1) {
            XpOperationsUser data = xpOperationUserClient.queryById(Long.valueOf(task.getHandleUserId())).getData();
            if (Objects.nonNull(data)) {
                res.setHandleUserName(data.getNickName());
@@ -295,14 +301,14 @@
    public R<TaskChargingDetailVO> chargingDetail(Long id) {
        TaskChargingDetailVO res = new TaskChargingDetailVO();
        XpTask task = this.getById(id);
        if (task == null){
        if (task == null) {
            throw new ServiceException(
                    "任务不存在",
                    I18nKeyConstant.TASK_NOT_EXIST
            );
        }
        XpVehicle vehicle = xpVehicleClient.queryById(task.getVehicleId()).getData();
        if (vehicle == null){
        if (vehicle == null) {
            throw new ServiceException(
                    "车辆不存在",
                    I18nKeyConstant.VEHICLE_NOT_EXIST
@@ -323,7 +329,7 @@
        res.setStatus(task.getStatus());
        XpChargingRecord chargingRecord = chargingRecordMapper.selectOne(new LambdaQueryWrapper<XpChargingRecord>()
                .eq(XpChargingRecord::getTaskId, id).last("limit 1"));
        if (chargingRecord != null){
        if (chargingRecord != null) {
            res.setStartRemainingBattery(chargingRecord.getStartRemainingBattery());
            res.setStartChargingPicture(chargingRecord.getStartChargingPicture());
            res.setStartTime(chargingRecord.getStartTime());
@@ -332,15 +338,15 @@
            res.setEndTime(chargingRecord.getEndTime());
            res.setStartOperationsUserId(chargingRecord.getStartOperationsUserId());
            res.setEndOperationsUserId(chargingRecord.getEndOperationsUserId());
            if (chargingRecord.getStartOperationsUserId() != null){
            if (chargingRecord.getStartOperationsUserId() != null) {
                XpOperationsUser operationsUser = xpOperationUserClient.queryById(chargingRecord.getStartOperationsUserId()).getData();
                if (operationsUser != null){
                if (operationsUser != null) {
                    res.setStartOperationsUserName(operationsUser.getNickName());
                }
            }
            if (chargingRecord.getEndOperationsUserId() != null){
            if (chargingRecord.getEndOperationsUserId() != null) {
                XpOperationsUser operationsUser = xpOperationUserClient.queryById(chargingRecord.getEndOperationsUserId()).getData();
                if (operationsUser != null){
                if (operationsUser != null) {
                    res.setEndOperationsUserName(operationsUser.getNickName());
                }
            }
@@ -355,14 +361,14 @@
        XpTask task = this.getById(id);
        if (task == null){
        if (task == null) {
            throw new ServiceException(
                    "任务不存在",
                    I18nKeyConstant.TASK_NOT_EXIST
            );
        }
        XpVehicle vehicle = xpVehicleClient.queryById(task.getVehicleId()).getData();
        if (vehicle == null){
        if (vehicle == null) {
            throw new ServiceException(
                    "车辆不存在",
                    I18nKeyConstant.VEHICLE_NOT_EXIST
@@ -383,7 +389,7 @@
        res.setStatus(task.getStatus());
        XpVehicleRepair vehicleRepair = vehicleRepairMapper.selectOne(new LambdaQueryWrapper<XpVehicleRepair>()
                .eq(XpVehicleRepair::getTaskId, id).last("limit 1"));
        if (vehicleRepair != null){
        if (vehicleRepair != null) {
            res.setStartTime(vehicleRepair.getStartTime());
            res.setEndTime(vehicleRepair.getEndTime());
            res.setRepairReason(vehicleRepair.getRepairReason());
@@ -394,15 +400,15 @@
            res.setSendTime(vehicleRepair.getSendTime());
            res.setReturnUserId(vehicleRepair.getReturnUserId());
            res.setReturnTime(vehicleRepair.getReturnTime());
            if (vehicleRepair.getReturnUserId() != null){
            if (vehicleRepair.getReturnUserId() != null) {
                XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleRepair.getReturnUserId()).getData();
                if (operationsUser != null){
                if (operationsUser != null) {
                    res.setReturnUserName(operationsUser.getNickName());
                }
            }
            if (vehicleRepair.getSendUserId() != null){
            if (vehicleRepair.getSendUserId() != null) {
                XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleRepair.getSendUserId()).getData();
                if (operationsUser != null){
                if (operationsUser != null) {
                    res.setSendUserName(operationsUser.getNickName());
                }
            }
@@ -416,18 +422,15 @@
        com.xiaopeng.maintenance.vo.TaskPreparationDetailVO res = new com.xiaopeng.maintenance.vo.TaskPreparationDetailVO();
        XpTask task = this.getById(id);
        if (task == null){
        if (task == null) {
            throw new ServiceException(
                    "任务不存在",
                    I18nKeyConstant.TASK_NOT_EXIST
            );
        }
        XpVehicle vehicle = xpVehicleClient.queryById(task.getVehicleId()).getData();
        if (vehicle == null){
        if (vehicle == null) {
            throw new ServiceException(
                    "车辆不存在",
                    I18nKeyConstant.VEHICLE_NOT_EXIST
@@ -448,7 +451,7 @@
        res.setStatus(task.getStatus());
        XpVehiclePreparation vehiclePreparation = vehiclePreparationMapper.selectOne(new LambdaQueryWrapper<XpVehiclePreparation>()
                .eq(XpVehiclePreparation::getTaskId, id).last("limit 1"));
        if (vehiclePreparation != null){
        if (vehiclePreparation != null) {
            res.setLeftFrontWheel(vehiclePreparation.getLeftFrontWheel());
            res.setRightFrontWheel(vehiclePreparation.getRightFrontWheel());
            res.setLeftRearWheel(vehiclePreparation.getLeftRearWheel());
@@ -463,9 +466,9 @@
            res.setRemarks(vehiclePreparation.getRemarks());
            res.setOperationsUserId(vehiclePreparation.getOperationsUserId());
            res.setOperationsTime(vehiclePreparation.getCreateTime());
            if (vehiclePreparation.getOperationsUserId() != null){
            if (vehiclePreparation.getOperationsUserId() != null) {
                XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehiclePreparation.getOperationsUserId()).getData();
                if (operationsUser != null){
                if (operationsUser != null) {
                    res.setOperationsUserName(operationsUser.getNickName());
                }
            }
@@ -477,14 +480,14 @@
    public R<com.xiaopeng.maintenance.vo.TaskDetectionDetailVO> detectionDetail(Long id) {
        com.xiaopeng.maintenance.vo.TaskDetectionDetailVO res = new com.xiaopeng.maintenance.vo.TaskDetectionDetailVO();
        XpTask task = this.getById(id);
        if (task == null){
        if (task == null) {
            throw new ServiceException(
                    "任务不存在",
                    I18nKeyConstant.TASK_NOT_EXIST
            );
        }
        XpVehicle vehicle = xpVehicleClient.queryById(task.getVehicleId()).getData();
        if (vehicle == null){
        if (vehicle == null) {
            throw new ServiceException(
                    "车辆不存在",
                    I18nKeyConstant.VEHICLE_NOT_EXIST
@@ -505,7 +508,7 @@
        res.setStatus(task.getStatus());
        XpVehicleDetection vehicleDetection = vehicleDetectionMapper.selectOne(new LambdaQueryWrapper<XpVehicleDetection>()
                .eq(XpVehicleDetection::getTaskId, id).last("limit 1"));
        if (vehicleDetection != null){
        if (vehicleDetection != null) {
            res.setNetworkDetection(vehicleDetection.getNetworkDetection());
            res.setVersionVerification(vehicleDetection.getVersionVerification());
            res.setCommunicationSelfCheck(vehicleDetection.getCommunicationSelfCheck());
@@ -524,9 +527,9 @@
            res.setSystemCheckPicture(vehicleDetection.getSystemCheckPicture());
            res.setCheckTime(vehicleDetection.getCheckTime());
            res.setOperationsUserId(vehicleDetection.getOperationsUserId());
            if (vehicleDetection.getOperationsUserId() != null){
            if (vehicleDetection.getOperationsUserId() != null) {
                XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleDetection.getOperationsUserId()).getData();
                if (operationsUser != null){
                if (operationsUser != null) {
                    res.setOperationsUserName(operationsUser.getNickName());
                }
            }
@@ -537,7 +540,7 @@
    @Override
    public R saveRoutineDetail(SaveRoutineDetailDto dto, Long id) {
        XpTask task = this.getById(dto.getId());
        if (task == null){
        if (task == null) {
            throw new ServiceException(
                    "任务不存在",
                    I18nKeyConstant.TASK_NOT_EXIST
@@ -546,7 +549,7 @@
        XpTaskHandleDetailRoutine xpTaskHandleDetailRoutine = new XpTaskHandleDetailRoutine();
        xpTaskHandleDetailRoutine.setTaskId(task.getId());
        String taskTypeId = task.getTaskTypeId();
        switch (taskTypeId){
        switch (taskTypeId) {
            case "6":
                xpTaskHandleDetailRoutine.setTaskType(1);
                break;
@@ -575,14 +578,14 @@
    public R<com.xiaopeng.maintenance.vo.TaskCleanDetailVO> cleanDetail(Long id) {
        com.xiaopeng.maintenance.vo.TaskCleanDetailVO res = new com.xiaopeng.maintenance.vo.TaskCleanDetailVO();
        XpTask task = this.getById(id);
        if (task == null){
        if (task == null) {
            throw new ServiceException(
                    "任务不存在",
                    I18nKeyConstant.TASK_NOT_EXIST
            );
        }
        XpVehicle vehicle = xpVehicleClient.queryById(task.getVehicleId()).getData();
        if (vehicle == null){
        if (vehicle == null) {
            throw new ServiceException(
                    "车辆不存在",
                    I18nKeyConstant.VEHICLE_NOT_EXIST
@@ -603,12 +606,12 @@
        res.setStatus(task.getStatus());
        XpVehicleClean vehicleDetection = vehicleCleanMapper.selectOne(new LambdaQueryWrapper<XpVehicleClean>()
                .eq(XpVehicleClean::getTaskId, id).last("limit 1"));
        if (vehicleDetection != null){
        if (vehicleDetection != null) {
            res.setTaskImage(vehicleDetection.getTaskImage());
            res.setOperationUserId(vehicleDetection.getOperationsUserId());
            if (vehicleDetection.getOperationsUserId() != null){
            if (vehicleDetection.getOperationsUserId() != null) {
                XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleDetection.getOperationsUserId()).getData();
                if (operationsUser != null){
                if (operationsUser != null) {
                    res.setOperationsUserName(operationsUser.getNickName());
                }
            }
@@ -617,13 +620,43 @@
    }
    @Override
    public R confirmArrive(Long id,Long userId) {
        XpTask task = this.getById(id);
        if (task!=null){
    public R confirmArrive(Long id, Long userId) {
        RLock lock = redissonClient.getLock("TASK_CONFIRM_" + id);
        try {
            // 尝试获取锁,最多等待3秒
            boolean isLocked = lock.tryLock(3, 10, TimeUnit.SECONDS);
            if (!isLocked) {
                return R.fail("系统繁忙,请稍后重试");
            }
            // 查询任务
            XpTask task = this.getById(id);
            if (task == null) {
                return R.fail("任务不存在");
            }
            // 检查任务状态
            if (task.getStatus() != 0) {
                return R.fail("任务已被处理");
            }
            // 更新任务
            task.setStatus(1);
            task.setHandleUserId(userId.toString());
            this.updateById(task);
            return R.ok();
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            return R.fail("操作被中断");
        } finally {
            // 确保锁被释放
            if (lock.isHeldByCurrentThread()) {
                lock.unlock();
            }
        }
        return R.ok();
    }
    @Override
@@ -662,7 +695,7 @@
            Set<Long> errorTypeIds = new HashSet<>();
            for (XpTask task : resultPage.getRecords()) {
                if (task.getTaskCategory() != null && task.getTaskCategory() == 2
                    && StringUtils.isNotBlank(task.getTaskTypeId())) {
                        && StringUtils.isNotBlank(task.getTaskTypeId())) {
                    String[] ids = task.getTaskTypeId().split(",");
                    for (String id : ids) {
                        try {
@@ -744,6 +777,7 @@
        pageInfo.setRecords(list);
        return pageInfo;
    }
    @Override
    public List<TaskManagementPageListVO> exportList(TaskManagementPageListQuery query) {
        List<TaskManagementPageListVO> list = this.baseMapper.exportList(query);
@@ -756,7 +790,7 @@
    }
    @Override
    public R assigneeTask(Long id, Long handlerUserId,Long assigneeUserId) {
    public R assigneeTask(Long id, Long handlerUserId, Long assigneeUserId) {
        XpTask task = this.getById(id);
        task.setAssigneeTime(LocalDateTime.now());
        task.setHandleUserId(handlerUserId.toString());
@@ -779,7 +813,7 @@
            task.setTaskCode(code);
            // 查询规则
            XpTaskRule taskRule = xpTaskRuleMapper.selectOne(null);
            if (taskRule != null){
            if (taskRule != null) {
                task.setEndTime(LocalDateTime.now().plusMinutes(taskRule.getProcessingTimeLimit()));
            }
            task.setTaskCategory(2);
@@ -802,251 +836,251 @@
    public R<TaskManagementDetailVO> taskDetail(Long id) {
        TaskManagementDetailVO managementDetailVO = new TaskManagementDetailVO();
        XpTask task = this.getById(id);
        if (task == null){
        if (task == null) {
            throw new ServiceException(
                    "任务不存在",
                    I18nKeyConstant.TASK_NOT_EXIST
            );
        }
        XpVehicle vehicle = xpVehicleClient.queryById(task.getVehicleId()).getData();
        if (vehicle == null){
        if (vehicle == null) {
            throw new ServiceException(
                    "车辆不存在",
                    I18nKeyConstant.VEHICLE_NOT_EXIST
            );
        }
        if (task.getTaskCategory()==1){
        if (task.getTaskCategory() == 1) {
            // 常规任务
                switch (task.getTaskTypeId()){
                    case "1":
                        // 检测
                        TaskManagementDetectionDetailVO taskManagementDetectionDetailVO = new TaskManagementDetectionDetailVO();
                        taskManagementDetectionDetailVO.setId(task.getId());
                        taskManagementDetectionDetailVO.setVehicleId(vehicle.getId());
                        taskManagementDetectionDetailVO.setTaskUrgencyLevel(task.getTaskUrgencyLevel());
                        taskManagementDetectionDetailVO.setPlateNumber(vehicle.getPlateNumber());
                        taskManagementDetectionDetailVO.setVehicleColor(vehicle.getVehicleColor());
                        taskManagementDetectionDetailVO.setVehicleCode(vehicle.getVehicleCode());
                        taskManagementDetectionDetailVO.setVehicleVin(vehicle.getVehicleVin());
                        taskManagementDetectionDetailVO.setVehicleLocation(task.getVehicleLocation());
                        taskManagementDetectionDetailVO.setTaskCode(task.getTaskCode());
                        XpVehicleDetection vehicleDetection = vehicleDetectionMapper.selectOne(new LambdaQueryWrapper<XpVehicleDetection>()
                                .eq(XpVehicleDetection::getTaskId, id).last("limit 1"));
                        if (vehicleDetection != null){
                            taskManagementDetectionDetailVO.setNetworkDetection(vehicleDetection.getNetworkDetection());
                            taskManagementDetectionDetailVO.setVersionVerification(vehicleDetection.getVersionVerification());
                            taskManagementDetectionDetailVO.setCommunicationSelfCheck(vehicleDetection.getCommunicationSelfCheck());
                            taskManagementDetectionDetailVO.setRemoteSelfCheck(vehicleDetection.getRemoteSelfCheck());
                            taskManagementDetectionDetailVO.setCollisionPrevention(vehicleDetection.getCollisionPrevention());
                            taskManagementDetectionDetailVO.setSensorSelfCheck(vehicleDetection.getSensorSelfCheck());
                            taskManagementDetectionDetailVO.setSensorCleaning(vehicleDetection.getSensorCleaning());
                            taskManagementDetectionDetailVO.setSensorCleaningPicture(vehicleDetection.getSensorCleaningPicture());
                            taskManagementDetectionDetailVO.setInteractiveScreen(vehicleDetection.getInteractiveScreen());
                            taskManagementDetectionDetailVO.setInteractiveScreenPicture(vehicleDetection.getInteractiveScreenPicture());
                            taskManagementDetectionDetailVO.setHelpButton(vehicleDetection.getHelpButton());
                            taskManagementDetectionDetailVO.setHelpButtonPicture(vehicleDetection.getHelpButtonPicture());
                            taskManagementDetectionDetailVO.setPaymentFunction(vehicleDetection.getPaymentFunction());
                            taskManagementDetectionDetailVO.setPaymentFunctionPicture(vehicleDetection.getPaymentFunctionPicture());
                            taskManagementDetectionDetailVO.setSystemCheck(vehicleDetection.getSystemCheck());
                            taskManagementDetectionDetailVO.setSystemCheckPicture(vehicleDetection.getSystemCheckPicture());
                            taskManagementDetectionDetailVO.setCheckTime(vehicleDetection.getCheckTime());
                            taskManagementDetectionDetailVO.setOperationsUserId(vehicleDetection.getOperationsUserId());
                            if (vehicleDetection.getOperationsUserId() != null){
                                XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleDetection.getOperationsUserId()).getData();
                                if (operationsUser != null){
                                    taskManagementDetectionDetailVO.setOperationsUserName(operationsUser.getNickName());
                                }
            switch (task.getTaskTypeId()) {
                case "1":
                    // 检测
                    TaskManagementDetectionDetailVO taskManagementDetectionDetailVO = new TaskManagementDetectionDetailVO();
                    taskManagementDetectionDetailVO.setId(task.getId());
                    taskManagementDetectionDetailVO.setVehicleId(vehicle.getId());
                    taskManagementDetectionDetailVO.setTaskUrgencyLevel(task.getTaskUrgencyLevel());
                    taskManagementDetectionDetailVO.setPlateNumber(vehicle.getPlateNumber());
                    taskManagementDetectionDetailVO.setVehicleColor(vehicle.getVehicleColor());
                    taskManagementDetectionDetailVO.setVehicleCode(vehicle.getVehicleCode());
                    taskManagementDetectionDetailVO.setVehicleVin(vehicle.getVehicleVin());
                    taskManagementDetectionDetailVO.setVehicleLocation(task.getVehicleLocation());
                    taskManagementDetectionDetailVO.setTaskCode(task.getTaskCode());
                    XpVehicleDetection vehicleDetection = vehicleDetectionMapper.selectOne(new LambdaQueryWrapper<XpVehicleDetection>()
                            .eq(XpVehicleDetection::getTaskId, id).last("limit 1"));
                    if (vehicleDetection != null) {
                        taskManagementDetectionDetailVO.setNetworkDetection(vehicleDetection.getNetworkDetection());
                        taskManagementDetectionDetailVO.setVersionVerification(vehicleDetection.getVersionVerification());
                        taskManagementDetectionDetailVO.setCommunicationSelfCheck(vehicleDetection.getCommunicationSelfCheck());
                        taskManagementDetectionDetailVO.setRemoteSelfCheck(vehicleDetection.getRemoteSelfCheck());
                        taskManagementDetectionDetailVO.setCollisionPrevention(vehicleDetection.getCollisionPrevention());
                        taskManagementDetectionDetailVO.setSensorSelfCheck(vehicleDetection.getSensorSelfCheck());
                        taskManagementDetectionDetailVO.setSensorCleaning(vehicleDetection.getSensorCleaning());
                        taskManagementDetectionDetailVO.setSensorCleaningPicture(vehicleDetection.getSensorCleaningPicture());
                        taskManagementDetectionDetailVO.setInteractiveScreen(vehicleDetection.getInteractiveScreen());
                        taskManagementDetectionDetailVO.setInteractiveScreenPicture(vehicleDetection.getInteractiveScreenPicture());
                        taskManagementDetectionDetailVO.setHelpButton(vehicleDetection.getHelpButton());
                        taskManagementDetectionDetailVO.setHelpButtonPicture(vehicleDetection.getHelpButtonPicture());
                        taskManagementDetectionDetailVO.setPaymentFunction(vehicleDetection.getPaymentFunction());
                        taskManagementDetectionDetailVO.setPaymentFunctionPicture(vehicleDetection.getPaymentFunctionPicture());
                        taskManagementDetectionDetailVO.setSystemCheck(vehicleDetection.getSystemCheck());
                        taskManagementDetectionDetailVO.setSystemCheckPicture(vehicleDetection.getSystemCheckPicture());
                        taskManagementDetectionDetailVO.setCheckTime(vehicleDetection.getCheckTime());
                        taskManagementDetectionDetailVO.setOperationsUserId(vehicleDetection.getOperationsUserId());
                        if (vehicleDetection.getOperationsUserId() != null) {
                            XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleDetection.getOperationsUserId()).getData();
                            if (operationsUser != null) {
                                taskManagementDetectionDetailVO.setOperationsUserName(operationsUser.getNickName());
                            }
                        }
                        managementDetailVO.setDetectionDetailVO(taskManagementDetectionDetailVO);
                        break;
                    case "2":
                        // 充电
                        TaskManagementChargingDetailVO taskManagementChargingDetailVO = new TaskManagementChargingDetailVO();
                        taskManagementChargingDetailVO.setId(task.getId());
                        taskManagementChargingDetailVO.setVehicleId(vehicle.getId());
                        taskManagementChargingDetailVO.setTaskUrgencyLevel(task.getTaskUrgencyLevel());
                        taskManagementChargingDetailVO.setPlateNumber(vehicle.getPlateNumber());
                        taskManagementChargingDetailVO.setVehicleColor(vehicle.getVehicleColor());
                        taskManagementChargingDetailVO.setVehicleCode(vehicle.getVehicleCode());
                        taskManagementChargingDetailVO.setVehicleVin(vehicle.getVehicleVin());
                        taskManagementChargingDetailVO.setVehicleLocation(task.getVehicleLocation());
                        taskManagementChargingDetailVO.setTaskCode(task.getTaskCode());
                        XpChargingRecord chargingRecord = chargingRecordMapper.selectOne(new LambdaQueryWrapper<XpChargingRecord>()
                                .eq(XpChargingRecord::getTaskId, id).last("limit 1"));
                        if (chargingRecord != null){
                            taskManagementChargingDetailVO.setStartRemainingBattery(chargingRecord.getStartRemainingBattery());
                            taskManagementChargingDetailVO.setStartChargingPicture(chargingRecord.getStartChargingPicture());
                            taskManagementChargingDetailVO.setStartTime(chargingRecord.getStartTime());
                            taskManagementChargingDetailVO.setEndRemainingBattery(chargingRecord.getEndRemainingBattery());
                            taskManagementChargingDetailVO.setEndChargingPicture(chargingRecord.getEndChargingPicture());
                            taskManagementChargingDetailVO.setEndTime(chargingRecord.getEndTime());
                            taskManagementChargingDetailVO.setStartOperationsUserId(chargingRecord.getStartOperationsUserId());
                            taskManagementChargingDetailVO.setEndOperationsUserId(chargingRecord.getEndOperationsUserId());
                            if (chargingRecord.getStartOperationsUserId() != null){
                                XpOperationsUser operationsUser = xpOperationUserClient.queryById(chargingRecord.getStartOperationsUserId()).getData();
                                if (operationsUser != null){
                                    taskManagementChargingDetailVO.setStartOperationsUserName(operationsUser.getNickName());
                                }
                            }
                            if (chargingRecord.getEndOperationsUserId() != null){
                                XpOperationsUser operationsUser = xpOperationUserClient.queryById(chargingRecord.getEndOperationsUserId()).getData();
                                if (operationsUser != null){
                                    taskManagementChargingDetailVO.setEndOperationsUserName(operationsUser.getNickName());
                                }
                    }
                    managementDetailVO.setDetectionDetailVO(taskManagementDetectionDetailVO);
                    break;
                case "2":
                    // 充电
                    TaskManagementChargingDetailVO taskManagementChargingDetailVO = new TaskManagementChargingDetailVO();
                    taskManagementChargingDetailVO.setId(task.getId());
                    taskManagementChargingDetailVO.setVehicleId(vehicle.getId());
                    taskManagementChargingDetailVO.setTaskUrgencyLevel(task.getTaskUrgencyLevel());
                    taskManagementChargingDetailVO.setPlateNumber(vehicle.getPlateNumber());
                    taskManagementChargingDetailVO.setVehicleColor(vehicle.getVehicleColor());
                    taskManagementChargingDetailVO.setVehicleCode(vehicle.getVehicleCode());
                    taskManagementChargingDetailVO.setVehicleVin(vehicle.getVehicleVin());
                    taskManagementChargingDetailVO.setVehicleLocation(task.getVehicleLocation());
                    taskManagementChargingDetailVO.setTaskCode(task.getTaskCode());
                    XpChargingRecord chargingRecord = chargingRecordMapper.selectOne(new LambdaQueryWrapper<XpChargingRecord>()
                            .eq(XpChargingRecord::getTaskId, id).last("limit 1"));
                    if (chargingRecord != null) {
                        taskManagementChargingDetailVO.setStartRemainingBattery(chargingRecord.getStartRemainingBattery());
                        taskManagementChargingDetailVO.setStartChargingPicture(chargingRecord.getStartChargingPicture());
                        taskManagementChargingDetailVO.setStartTime(chargingRecord.getStartTime());
                        taskManagementChargingDetailVO.setEndRemainingBattery(chargingRecord.getEndRemainingBattery());
                        taskManagementChargingDetailVO.setEndChargingPicture(chargingRecord.getEndChargingPicture());
                        taskManagementChargingDetailVO.setEndTime(chargingRecord.getEndTime());
                        taskManagementChargingDetailVO.setStartOperationsUserId(chargingRecord.getStartOperationsUserId());
                        taskManagementChargingDetailVO.setEndOperationsUserId(chargingRecord.getEndOperationsUserId());
                        if (chargingRecord.getStartOperationsUserId() != null) {
                            XpOperationsUser operationsUser = xpOperationUserClient.queryById(chargingRecord.getStartOperationsUserId()).getData();
                            if (operationsUser != null) {
                                taskManagementChargingDetailVO.setStartOperationsUserName(operationsUser.getNickName());
                            }
                        }
                        managementDetailVO.setChargingDetailVO(taskManagementChargingDetailVO);
                        break;
                    case "3":
                        // 整备
                        TaskManagementPreparationDetailVO taskManagementPreparationDetailVO = new TaskManagementPreparationDetailVO();
                        taskManagementPreparationDetailVO.setId(task.getId());
                        taskManagementPreparationDetailVO.setVehicleId(vehicle.getId());
                        taskManagementPreparationDetailVO.setTaskUrgencyLevel(task.getTaskUrgencyLevel());
                        taskManagementPreparationDetailVO.setPlateNumber(vehicle.getPlateNumber());
                        taskManagementPreparationDetailVO.setVehicleColor(vehicle.getVehicleColor());
                        taskManagementPreparationDetailVO.setVehicleCode(vehicle.getVehicleCode());
                        taskManagementPreparationDetailVO.setVehicleVin(vehicle.getVehicleVin());
                        taskManagementPreparationDetailVO.setVehicleLocation(task.getVehicleLocation());
                        taskManagementPreparationDetailVO.setTaskCode(task.getTaskCode());
                        XpVehiclePreparation vehiclePreparation = vehiclePreparationMapper.selectOne(new LambdaQueryWrapper<XpVehiclePreparation>()
                                .eq(XpVehiclePreparation::getTaskId, id).last("limit 1"));
                        if (vehiclePreparation != null){
                            taskManagementPreparationDetailVO.setLeftFrontWheel(vehiclePreparation.getLeftFrontWheel());
                            taskManagementPreparationDetailVO.setRightFrontWheel(vehiclePreparation.getRightFrontWheel());
                            taskManagementPreparationDetailVO.setLeftRearWheel(vehiclePreparation.getLeftRearWheel());
                            taskManagementPreparationDetailVO.setRightRearWheel(vehiclePreparation.getRightRearWheel());
                            taskManagementPreparationDetailVO.setHeadLight(vehiclePreparation.getHeadLight());
                            taskManagementPreparationDetailVO.setTurnSignal(vehiclePreparation.getTurnSignal());
                            taskManagementPreparationDetailVO.setBrakeLight(vehiclePreparation.getBrakeLight());
                            taskManagementPreparationDetailVO.setFogLight(vehiclePreparation.getFogLight());
                            taskManagementPreparationDetailVO.setBodyEmblem(vehiclePreparation.getBodyEmblem());
                            taskManagementPreparationDetailVO.setCabinCleaning(vehiclePreparation.getCabinCleaning());
                            taskManagementPreparationDetailVO.setLostItems(vehiclePreparation.getLostItems());
                            taskManagementPreparationDetailVO.setRemarks(vehiclePreparation.getRemarks());
                            taskManagementPreparationDetailVO.setOperationsUserId(vehiclePreparation.getOperationsUserId());
                            taskManagementPreparationDetailVO.setOperationsTime(vehiclePreparation.getCreateTime());
                            if (vehiclePreparation.getOperationsUserId() != null){
                                XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehiclePreparation.getOperationsUserId()).getData();
                                if (operationsUser != null){
                                    taskManagementPreparationDetailVO.setOperationsUserName(operationsUser.getNickName());
                                }
                        if (chargingRecord.getEndOperationsUserId() != null) {
                            XpOperationsUser operationsUser = xpOperationUserClient.queryById(chargingRecord.getEndOperationsUserId()).getData();
                            if (operationsUser != null) {
                                taskManagementChargingDetailVO.setEndOperationsUserName(operationsUser.getNickName());
                            }
                        }
                        managementDetailVO.setPreparationDetailVO(taskManagementPreparationDetailVO);
                    }
                    managementDetailVO.setChargingDetailVO(taskManagementChargingDetailVO);
                        break;
                    case "4":
                        // 洗车
                        TaskManagementCleanDetailVO taskManagementCleanDetailVO = new TaskManagementCleanDetailVO();
                        taskManagementCleanDetailVO.setId(task.getId());
                        taskManagementCleanDetailVO.setVehicleId(vehicle.getId());
                        taskManagementCleanDetailVO.setTaskUrgencyLevel(task.getTaskUrgencyLevel());
                        taskManagementCleanDetailVO.setPlateNumber(vehicle.getPlateNumber());
                        taskManagementCleanDetailVO.setVehicleColor(vehicle.getVehicleColor());
                        taskManagementCleanDetailVO.setVehicleCode(vehicle.getVehicleCode());
                        taskManagementCleanDetailVO.setVehicleVin(vehicle.getVehicleVin());
                        taskManagementCleanDetailVO.setVehicleLocation(task.getVehicleLocation());
                        taskManagementCleanDetailVO.setTaskCode(task.getTaskCode());
                        XpVehicleClean vehicleClean = vehicleCleanMapper.selectOne(new LambdaQueryWrapper<XpVehicleClean>()
                                .eq(XpVehicleClean::getTaskId, id).last("limit 1"));
                        if (vehicleClean != null){
                            taskManagementCleanDetailVO.setTaskImage(vehicleClean.getTaskImage());
                            taskManagementCleanDetailVO.setOperationUserId(vehicleClean.getOperationsUserId());
                            if (vehicleClean.getOperationsUserId() != null){
                                XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleClean.getOperationsUserId()).getData();
                                if (operationsUser != null){
                                    taskManagementCleanDetailVO.setOperationsUserName(operationsUser.getNickName());
                                }
                    break;
                case "3":
                    // 整备
                    TaskManagementPreparationDetailVO taskManagementPreparationDetailVO = new TaskManagementPreparationDetailVO();
                    taskManagementPreparationDetailVO.setId(task.getId());
                    taskManagementPreparationDetailVO.setVehicleId(vehicle.getId());
                    taskManagementPreparationDetailVO.setTaskUrgencyLevel(task.getTaskUrgencyLevel());
                    taskManagementPreparationDetailVO.setPlateNumber(vehicle.getPlateNumber());
                    taskManagementPreparationDetailVO.setVehicleColor(vehicle.getVehicleColor());
                    taskManagementPreparationDetailVO.setVehicleCode(vehicle.getVehicleCode());
                    taskManagementPreparationDetailVO.setVehicleVin(vehicle.getVehicleVin());
                    taskManagementPreparationDetailVO.setVehicleLocation(task.getVehicleLocation());
                    taskManagementPreparationDetailVO.setTaskCode(task.getTaskCode());
                    XpVehiclePreparation vehiclePreparation = vehiclePreparationMapper.selectOne(new LambdaQueryWrapper<XpVehiclePreparation>()
                            .eq(XpVehiclePreparation::getTaskId, id).last("limit 1"));
                    if (vehiclePreparation != null) {
                        taskManagementPreparationDetailVO.setLeftFrontWheel(vehiclePreparation.getLeftFrontWheel());
                        taskManagementPreparationDetailVO.setRightFrontWheel(vehiclePreparation.getRightFrontWheel());
                        taskManagementPreparationDetailVO.setLeftRearWheel(vehiclePreparation.getLeftRearWheel());
                        taskManagementPreparationDetailVO.setRightRearWheel(vehiclePreparation.getRightRearWheel());
                        taskManagementPreparationDetailVO.setHeadLight(vehiclePreparation.getHeadLight());
                        taskManagementPreparationDetailVO.setTurnSignal(vehiclePreparation.getTurnSignal());
                        taskManagementPreparationDetailVO.setBrakeLight(vehiclePreparation.getBrakeLight());
                        taskManagementPreparationDetailVO.setFogLight(vehiclePreparation.getFogLight());
                        taskManagementPreparationDetailVO.setBodyEmblem(vehiclePreparation.getBodyEmblem());
                        taskManagementPreparationDetailVO.setCabinCleaning(vehiclePreparation.getCabinCleaning());
                        taskManagementPreparationDetailVO.setLostItems(vehiclePreparation.getLostItems());
                        taskManagementPreparationDetailVO.setRemarks(vehiclePreparation.getRemarks());
                        taskManagementPreparationDetailVO.setOperationsUserId(vehiclePreparation.getOperationsUserId());
                        taskManagementPreparationDetailVO.setOperationsTime(vehiclePreparation.getCreateTime());
                        if (vehiclePreparation.getOperationsUserId() != null) {
                            XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehiclePreparation.getOperationsUserId()).getData();
                            if (operationsUser != null) {
                                taskManagementPreparationDetailVO.setOperationsUserName(operationsUser.getNickName());
                            }
                        }
                        managementDetailVO.setCleanDetailVO(taskManagementCleanDetailVO);
                    }
                    managementDetailVO.setPreparationDetailVO(taskManagementPreparationDetailVO);
                        break;
                    case "5":
                        // 维修
                        TaskManagementRepairDetailVO taskManagementRepairDetailVO = new TaskManagementRepairDetailVO();
                        taskManagementRepairDetailVO.setId(task.getId());
                        taskManagementRepairDetailVO.setVehicleId(vehicle.getId());
                        taskManagementRepairDetailVO.setTaskUrgencyLevel(task.getTaskUrgencyLevel());
                        taskManagementRepairDetailVO.setPlateNumber(vehicle.getPlateNumber());
                        taskManagementRepairDetailVO.setVehicleColor(vehicle.getVehicleColor());
                        taskManagementRepairDetailVO.setVehicleCode(vehicle.getVehicleCode());
                        taskManagementRepairDetailVO.setVehicleVin(vehicle.getVehicleVin());
                        taskManagementRepairDetailVO.setVehicleLocation(task.getVehicleLocation());
                        taskManagementRepairDetailVO.setTaskCode(task.getTaskCode());
                        XpVehicleRepair vehicleRepair = vehicleRepairMapper.selectOne(new LambdaQueryWrapper<XpVehicleRepair>()
                                .eq(XpVehicleRepair::getTaskId, id).last("limit 1"));
                        if (vehicleRepair != null){
                            taskManagementRepairDetailVO.setStartTime(vehicleRepair.getStartTime());
                            taskManagementRepairDetailVO.setEndTime(vehicleRepair.getEndTime());
                            taskManagementRepairDetailVO.setRepairReason(vehicleRepair.getRepairReason());
                            taskManagementRepairDetailVO.setStartRepairPicture(vehicleRepair.getStartRepairPicture());
                            taskManagementRepairDetailVO.setRepairMoney(vehicleRepair.getRepairMoney());
                            taskManagementRepairDetailVO.setRepairMoneyDetail(vehicleRepair.getRepairMoneyDetail());
                            taskManagementRepairDetailVO.setSendUserId(vehicleRepair.getSendUserId());
                            taskManagementRepairDetailVO.setSendTime(vehicleRepair.getSendTime());
                            taskManagementRepairDetailVO.setReturnUserId(vehicleRepair.getReturnUserId());
                            taskManagementRepairDetailVO.setReturnTime(vehicleRepair.getReturnTime());
                            if (vehicleRepair.getReturnUserId() != null){
                                XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleRepair.getReturnUserId()).getData();
                                if (operationsUser != null){
                                    taskManagementRepairDetailVO.setReturnUserName(operationsUser.getNickName());
                                }
                            }
                            if (vehicleRepair.getSendUserId() != null){
                                XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleRepair.getSendUserId()).getData();
                                if (operationsUser != null){
                                    taskManagementRepairDetailVO.setSendUserName(operationsUser.getNickName());
                                }
                    break;
                case "4":
                    // 洗车
                    TaskManagementCleanDetailVO taskManagementCleanDetailVO = new TaskManagementCleanDetailVO();
                    taskManagementCleanDetailVO.setId(task.getId());
                    taskManagementCleanDetailVO.setVehicleId(vehicle.getId());
                    taskManagementCleanDetailVO.setTaskUrgencyLevel(task.getTaskUrgencyLevel());
                    taskManagementCleanDetailVO.setPlateNumber(vehicle.getPlateNumber());
                    taskManagementCleanDetailVO.setVehicleColor(vehicle.getVehicleColor());
                    taskManagementCleanDetailVO.setVehicleCode(vehicle.getVehicleCode());
                    taskManagementCleanDetailVO.setVehicleVin(vehicle.getVehicleVin());
                    taskManagementCleanDetailVO.setVehicleLocation(task.getVehicleLocation());
                    taskManagementCleanDetailVO.setTaskCode(task.getTaskCode());
                    XpVehicleClean vehicleClean = vehicleCleanMapper.selectOne(new LambdaQueryWrapper<XpVehicleClean>()
                            .eq(XpVehicleClean::getTaskId, id).last("limit 1"));
                    if (vehicleClean != null) {
                        taskManagementCleanDetailVO.setTaskImage(vehicleClean.getTaskImage());
                        taskManagementCleanDetailVO.setOperationUserId(vehicleClean.getOperationsUserId());
                        if (vehicleClean.getOperationsUserId() != null) {
                            XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleClean.getOperationsUserId()).getData();
                            if (operationsUser != null) {
                                taskManagementCleanDetailVO.setOperationsUserName(operationsUser.getNickName());
                            }
                        }
                        managementDetailVO.setRepairDetailVO(taskManagementRepairDetailVO);
                    }
                    managementDetailVO.setCleanDetailVO(taskManagementCleanDetailVO);
                        break;
                    default:
                        // 保养、年检、保险、营运资质
                        TaskManagementRoutineDetailVO res = new TaskManagementRoutineDetailVO();
                        res.setId(task.getId());
                        res.setTaskUrgencyLevel(task.getTaskUrgencyLevel());
                        res.setPlateNumber(vehicle.getPlateNumber());
                        res.setVehicleColor(vehicle.getVehicleColor());
                        res.setVehicleCode(vehicle.getVehicleCode());
                        res.setVehicleLocation(task.getVehicleLocation());
                        res.setVehicleVin(vehicle.getVehicleVin());
                        res.setTaskCode(task.getTaskCode());
                        XpTaskHandleDetailRoutine xpTaskHandleDetailRoutine = xpTaskHandleDetailRoutineMapper.selectOne(new LambdaQueryWrapper<XpTaskHandleDetailRoutine>()
                                .eq(XpTaskHandleDetailRoutine::getTaskId, id));
                        if (xpTaskHandleDetailRoutine!=null){
                            res.setTaskDescription(xpTaskHandleDetailRoutine.getTaskDescription());
                            res.setTaskImage(xpTaskHandleDetailRoutine.getTaskImage());
                            res.setHandleUserId(task.getHandleUserId());
                            XpOperationsUser operationsUser = xpOperationUserClient.queryById(xpTaskHandleDetailRoutine.getOperationsUserId()).getData();
                            if (operationsUser != null){
                                res.setHandleUserId(operationsUser.getId().toString());
                                res.setHandleUserName(operationsUser.getNickName());
                    break;
                case "5":
                    // 维修
                    TaskManagementRepairDetailVO taskManagementRepairDetailVO = new TaskManagementRepairDetailVO();
                    taskManagementRepairDetailVO.setId(task.getId());
                    taskManagementRepairDetailVO.setVehicleId(vehicle.getId());
                    taskManagementRepairDetailVO.setTaskUrgencyLevel(task.getTaskUrgencyLevel());
                    taskManagementRepairDetailVO.setPlateNumber(vehicle.getPlateNumber());
                    taskManagementRepairDetailVO.setVehicleColor(vehicle.getVehicleColor());
                    taskManagementRepairDetailVO.setVehicleCode(vehicle.getVehicleCode());
                    taskManagementRepairDetailVO.setVehicleVin(vehicle.getVehicleVin());
                    taskManagementRepairDetailVO.setVehicleLocation(task.getVehicleLocation());
                    taskManagementRepairDetailVO.setTaskCode(task.getTaskCode());
                    XpVehicleRepair vehicleRepair = vehicleRepairMapper.selectOne(new LambdaQueryWrapper<XpVehicleRepair>()
                            .eq(XpVehicleRepair::getTaskId, id).last("limit 1"));
                    if (vehicleRepair != null) {
                        taskManagementRepairDetailVO.setStartTime(vehicleRepair.getStartTime());
                        taskManagementRepairDetailVO.setEndTime(vehicleRepair.getEndTime());
                        taskManagementRepairDetailVO.setRepairReason(vehicleRepair.getRepairReason());
                        taskManagementRepairDetailVO.setStartRepairPicture(vehicleRepair.getStartRepairPicture());
                        taskManagementRepairDetailVO.setRepairMoney(vehicleRepair.getRepairMoney());
                        taskManagementRepairDetailVO.setRepairMoneyDetail(vehicleRepair.getRepairMoneyDetail());
                        taskManagementRepairDetailVO.setSendUserId(vehicleRepair.getSendUserId());
                        taskManagementRepairDetailVO.setSendTime(vehicleRepair.getSendTime());
                        taskManagementRepairDetailVO.setReturnUserId(vehicleRepair.getReturnUserId());
                        taskManagementRepairDetailVO.setReturnTime(vehicleRepair.getReturnTime());
                        if (vehicleRepair.getReturnUserId() != null) {
                            XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleRepair.getReturnUserId()).getData();
                            if (operationsUser != null) {
                                taskManagementRepairDetailVO.setReturnUserName(operationsUser.getNickName());
                            }
                        }
                        if (vehicleRepair.getSendUserId() != null) {
                            XpOperationsUser operationsUser = xpOperationUserClient.queryById(vehicleRepair.getSendUserId()).getData();
                            if (operationsUser != null) {
                                taskManagementRepairDetailVO.setSendUserName(operationsUser.getNickName());
                            }
                        }
                    }
                    managementDetailVO.setRepairDetailVO(taskManagementRepairDetailVO);
                        res.setHandleTime(task.getHandleTime());
                        res.setId(id);
                        res.setTaskUrgencyLevel(task.getTaskUrgencyLevel());
                        res.setPlateNumber(vehicle.getPlateNumber());
                        res.setVehicleColor(vehicle.getVehicleColor());
                        res.setVehicleCode(vehicle.getVehicleCode());
                        res.setVehicleLocation(task.getVehicleLocation());
                        res.setVehicleVin(vehicle.getVehicleVin());
                        managementDetailVO.setRoutineDetailVO(res);
                    break;
                default:
                    // 保养、年检、保险、营运资质
                    TaskManagementRoutineDetailVO res = new TaskManagementRoutineDetailVO();
                    res.setId(task.getId());
                    res.setTaskUrgencyLevel(task.getTaskUrgencyLevel());
                    res.setPlateNumber(vehicle.getPlateNumber());
                    res.setVehicleColor(vehicle.getVehicleColor());
                    res.setVehicleCode(vehicle.getVehicleCode());
                    res.setVehicleLocation(task.getVehicleLocation());
                    res.setVehicleVin(vehicle.getVehicleVin());
                    res.setTaskCode(task.getTaskCode());
                    XpTaskHandleDetailRoutine xpTaskHandleDetailRoutine = xpTaskHandleDetailRoutineMapper.selectOne(new LambdaQueryWrapper<XpTaskHandleDetailRoutine>()
                            .eq(XpTaskHandleDetailRoutine::getTaskId, id));
                    if (xpTaskHandleDetailRoutine != null) {
                        res.setTaskDescription(xpTaskHandleDetailRoutine.getTaskDescription());
                        res.setTaskImage(xpTaskHandleDetailRoutine.getTaskImage());
                        res.setHandleUserId(task.getHandleUserId());
                        XpOperationsUser operationsUser = xpOperationUserClient.queryById(xpTaskHandleDetailRoutine.getOperationsUserId()).getData();
                        if (operationsUser != null) {
                            res.setHandleUserId(operationsUser.getId().toString());
                            res.setHandleUserName(operationsUser.getNickName());
                        }
                    }
                        break;
                }
                    res.setHandleTime(task.getHandleTime());
                    res.setId(id);
                    res.setTaskUrgencyLevel(task.getTaskUrgencyLevel());
                    res.setPlateNumber(vehicle.getPlateNumber());
                    res.setVehicleColor(vehicle.getVehicleColor());
                    res.setVehicleCode(vehicle.getVehicleCode());
                    res.setVehicleLocation(task.getVehicleLocation());
                    res.setVehicleVin(vehicle.getVehicleVin());
                    managementDetailVO.setRoutineDetailVO(res);
                    break;
            }
        }else{
        } else {
            // 事故任务
            TaskManagementAccidentDetailVO res = new TaskManagementAccidentDetailVO();
@@ -1072,16 +1106,16 @@
            List<Long> reportUserIds = new ArrayList<>();
            reportUserIds.add(task.getReportUserId());
            List<SysUser> sysUsers = sysUserClient.listByIds(reportUserIds).getData();
            if (sysUsers!=null && !sysUsers.isEmpty()){
            if (sysUsers != null && !sysUsers.isEmpty()) {
                SysUser sysUser = sysUsers.get(0);
                res.setReportUserId(sysUser.getId());
                res.setReportUserName(sysUser.getNickName());
                res.setReportUserPhone(sysUser.getPhoneNumber());
                res.setReportUserAvatar(sysUser.getAvatar());
            }
            if (task.getHandleUserId().split(",").length==1){
            if (task.getHandleUserId().split(",").length == 1) {
                XpOperationsUser operationsUser = xpOperationUserClient.queryById(Long.valueOf(task.getHandleUserId())).getData();
                if (operationsUser != null){
                if (operationsUser != null) {
                    res.setHandleUserId(operationsUser.getId());
                    res.setHandleUserName(operationsUser.getNickName());
                    res.setHandleUserPhone(operationsUser.getPhoneNumber());
@@ -1104,7 +1138,6 @@
        }
        return R.ok(managementDetailVO);
    }
}
xp-robotaxi-maintenance-boot/src/main/resources/mapper/maintenance/XpTaskMapper.xml
@@ -60,6 +60,9 @@
        <if test="query.taskCategory != null">
            and t1.task_category = #{query.taskCategory}
        </if>
          <if test="query.userId != null">
              and FIND_IN_SET(#{query.userId}, t1.handle_user_id)
        </if>
        <if test="query.taskUrgencyLevel != null">
            and t1.task_urgency_level = #{query.taskUrgencyLevel}