Search in sources :

Example 11 with SysOssConfig

use of com.ruoyi.system.domain.SysOssConfig in project RuoYi-Vue-Plus by JavaLionLi.

the class SysOssConfigServiceImpl method checkConfigKeyUnique.

/**
 * 判断configKey是否唯一
 */
private String checkConfigKeyUnique(SysOssConfig sysOssConfig) {
    long ossConfigId = ObjectUtil.isNull(sysOssConfig.getOssConfigId()) ? -1L : sysOssConfig.getOssConfigId();
    SysOssConfig info = baseMapper.selectOne(new LambdaQueryWrapper<SysOssConfig>().select(SysOssConfig::getOssConfigId, SysOssConfig::getConfigKey).eq(SysOssConfig::getConfigKey, sysOssConfig.getConfigKey()));
    if (ObjectUtil.isNotNull(info) && info.getOssConfigId() != ossConfigId) {
        return UserConstants.NOT_UNIQUE;
    }
    return UserConstants.UNIQUE;
}
Also used : SysOssConfig(com.ruoyi.system.domain.SysOssConfig)

Example 12 with SysOssConfig

use of com.ruoyi.system.domain.SysOssConfig in project RuoYi-Flowable-Plus by KonBAI-Q.

the class SysOssConfigServiceImpl method checkConfigKeyUnique.

/**
 * 判断configKey是否唯一
 */
private String checkConfigKeyUnique(SysOssConfig sysOssConfig) {
    long ossConfigId = ObjectUtil.isNull(sysOssConfig.getOssConfigId()) ? -1L : sysOssConfig.getOssConfigId();
    SysOssConfig info = baseMapper.selectOne(new LambdaQueryWrapper<SysOssConfig>().select(SysOssConfig::getOssConfigId, SysOssConfig::getConfigKey).eq(SysOssConfig::getConfigKey, sysOssConfig.getConfigKey()));
    if (ObjectUtil.isNotNull(info) && info.getOssConfigId() != ossConfigId) {
        return UserConstants.NOT_UNIQUE;
    }
    return UserConstants.UNIQUE;
}
Also used : SysOssConfig(com.ruoyi.system.domain.SysOssConfig)

Aggregations

SysOssConfig (com.ruoyi.system.domain.SysOssConfig)12 LambdaUpdateWrapper (com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper)4 ServiceException (com.ruoyi.common.exception.ServiceException)2 Transactional (org.springframework.transaction.annotation.Transactional)2