kong
2026-04-12 7f3081da3c0597cfbfc8f0fc4e342c4ceb901f6d
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpSystemSettingServiceImpl.java
@@ -46,6 +46,15 @@
    }
    @Override
    public Integer getMinOrderDistance() {
        XpSystemSetting xpSystemSetting = this.getOne(null);
        if (xpSystemSetting != null) {
            return xpSystemSetting.getMinOrderDistance();
        }
        return 0;
    }
    @Override
    public Integer getOrderFinishTime() {
        XpSystemSetting xpSystemSetting = this.getOne(null);
        if (xpSystemSetting != null) {
@@ -54,18 +63,30 @@
        return 15;
    }
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void saveSystemSetting(XpSystemSetting xpSystemSetting) {
        if (Objects.nonNull(xpSystemSetting.getId())) {
            update(xpSystemSetting, new LambdaQueryWrapper<XpSystemSetting>().eq(XpSystemSetting::getId, xpSystemSetting.getId()));
        } else {
        XpSystemSetting existSetting = lambdaQuery().last("limit 1").one();
        if (Objects.nonNull(existSetting)) {
            lambdaUpdate().eq(XpSystemSetting::getId, existSetting.getId())
                    .set(XpSystemSetting::getCustomerServicePhone, xpSystemSetting.getCustomerServicePhone())
                    .set(XpSystemSetting::getOrderDistance, xpSystemSetting.getOrderDistance())
                    .set(XpSystemSetting::getMinOrderDistance, xpSystemSetting.getMinOrderDistance())
                    .set(XpSystemSetting::getArriveTime, xpSystemSetting.getArriveTime())
                    .set(XpSystemSetting::getHeadShowCount, xpSystemSetting.getHeadShowCount())
                    .set(XpSystemSetting::getNearPointDistance, xpSystemSetting.getNearPointDistance())
                    .set(XpSystemSetting::getAdsorptionDistance, xpSystemSetting.getAdsorptionDistance())
                    .set(XpSystemSetting::getHotfixStatus, xpSystemSetting.getHotfixStatus())
                    .set(XpSystemSetting::getHotfixStartTime, xpSystemSetting.getHotfixStartTime())
                    .set(XpSystemSetting::getHotfixEndTime, xpSystemSetting.getHotfixEndTime()).update();
        }else {
            save(xpSystemSetting);
        }
        //保存热修复信息到redis
        HotFixInfoVo hotFixInfoVo = new HotFixInfoVo();
        hotFixInfoVo.setHotfixStatus(xpSystemSetting.getHotfixStatus() == null ? 0 : xpSystemSetting.getHotfixStatus());
        hotFixInfoVo.setHotfixStartTime(xpSystemSetting.getHotfixStartTime());
        hotFixInfoVo.setHotfixEndTime(xpSystemSetting.getHotfixEndTime());
        redisService.setCacheObject("HOT_FIX_INFO", hotFixInfoVo);
    }
}