puzhibing
2026-04-25 e7d5a46da772e15638ccbf61c87857d8ca8c2c09
修改bug
2个文件已修改
24 ■■■■■ 已修改文件
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/maintenance/XpCruiseCheckInRecord.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpCruiseCheckInRuleServiceImpl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/maintenance/XpCruiseCheckInRecord.java
@@ -35,6 +35,7 @@
    /**
     * 巡游打卡规则id
     */
    @ApiModelProperty("巡游打卡规则id")
    @TableField("cruise_check_in_rule_id")
    private Integer cruiseCheckInRuleId;
    /**
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpCruiseCheckInRuleServiceImpl.java
@@ -144,8 +144,15 @@
    @Override
    public Long saveCruiseCheckInRecord(XpCruiseCheckInRecord dto) {
        Long checkLocationId = dto.getCheckLocationId();
        List<XpCruiseCheckInRule> list = this.list(new LambdaQueryWrapper<XpCruiseCheckInRule>().eq(XpCruiseCheckInRule::getDeleted, 0)
                .eq(XpCruiseCheckInRule::getOperationsUserId, dto.getOperationsUserId()).last(" and (now() BETWEEN start_time and end_time or cyclic_mode = 1)"));
        if(list.isEmpty()){
            return null;
        }
        XpCruiseCheckInRule xpCruiseCheckInRule = list.get(0);
        dto.setCruiseCheckInRuleId(xpCruiseCheckInRule.getId());
        XpCruiseCheckInRuleLocation one = xpCruiseCheckInRuleLocationService.getOne(new LambdaQueryWrapper<XpCruiseCheckInRuleLocation>()
                .eq(XpCruiseCheckInRuleLocation::getCheckLocationId, checkLocationId));
                .eq(XpCruiseCheckInRuleLocation::getCheckLocationId, checkLocationId).eq(XpCruiseCheckInRuleLocation::getCruiseCheckInRuleId, dto.getCruiseCheckInRuleId()));
        if(null == one){
            throw new ServiceException("打卡点位不存在", I18nKeyConstant.CHECK_IN_LOCATION_DOES_NOT_EXIST);
        }
@@ -225,12 +232,14 @@
        Map<String, Double> distance = GeodesyUtil.getDistance(xpCheckLocation.getLocationLon() + "," + xpCheckLocation.getLocationLat(), dto.getLongitude() + "," + dto.getLatitude());
        if(xpCheckLocation.getLocationRange().compareTo(new BigDecimal(distance.get("WGS84"))) >= 0){
            vo.setIsInRange(true);
            Boolean read = redisService.getCacheObject("CHECK_IN_SCOPE:" + xpCheckLocation.getId());
            if(null == read || !read){
                vo.setMessageType(2);
                vo.setCheckLocationId(cruiseCheckInRuleLocation.getCheckLocationId());
                redisService.setCacheObject("CHECK_IN_SCOPE:" + xpCheckLocation.getId(), true, 1L, TimeUnit.HOURS);
            }
            vo.setMessageType(2);
            vo.setCheckLocationId(cruiseCheckInRuleLocation.getCheckLocationId());
//            Boolean read = redisService.getCacheObject("CHECK_IN_SCOPE:" + xpCheckLocation.getId());
//            if(null == read || !read){
//                vo.setMessageType(2);
//                vo.setCheckLocationId(cruiseCheckInRuleLocation.getCheckLocationId());
//                redisService.setCacheObject("CHECK_IN_SCOPE:" + xpCheckLocation.getId(), true, 1L, TimeUnit.HOURS);
//            }
            return vo;
        }
        //判断时间小于10分钟首次触发和小于3分钟再次触发