com.ruoyi.system.domain.SysConfig Java Examples

The following examples show how to use com.ruoyi.system.domain.SysConfig. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SysConfigServiceImpl.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 校验参数键名是否唯一
 * 
 * @param config 参数配置信息
 * @return 结果
 */
@Override
public String checkConfigKeyUnique(SysConfig config)
{
    Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
    SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey());
    if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue())
    {
        return UserConstants.CONFIG_KEY_NOT_UNIQUE;
    }
    return UserConstants.CONFIG_KEY_UNIQUE;
}
 
Example #2
Source File: SysConfigServiceImpl.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 查询参数配置信息
 * 
 * @param configId 参数配置ID
 * @return 参数配置信息
 */
@Override
public SysConfig selectConfigById(Long configId)
{
    SysConfig config = new SysConfig();
    config.setConfigId(configId);
    return configMapper.selectConfig(config);
}
 
Example #3
Source File: SysConfigController.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 校验参数键名
 */
@PostMapping("/checkConfigKeyUnique")
@ResponseBody
public String checkConfigKeyUnique(SysConfig config)
{
    return configService.checkConfigKeyUnique(config);
}
 
Example #4
Source File: SysConfigController.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 修改保存参数配置
 */
@RequiresPermissions("system:config:edit")
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(@Validated SysConfig config)
{
    if (UserConstants.CONFIG_KEY_NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
    {
        return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
    }
    config.setUpdateBy(ShiroUtils.getLoginName());
    return toAjax(configService.updateConfig(config));
}
 
Example #5
Source File: SysConfigController.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 新增保存参数配置
 */
@RequiresPermissions("system:config:add")
@Log(title = "参数管理", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(@Validated SysConfig config)
{
    if (UserConstants.CONFIG_KEY_NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
    {
        return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
    }
    config.setCreateBy(ShiroUtils.getLoginName());
    return toAjax(configService.insertConfig(config));
}
 
Example #6
Source File: SysConfigController.java    From supplierShop with MIT License 5 votes vote down vote up
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
@RequiresPermissions("system:config:export")
@PostMapping("/export")
@ResponseBody
public AjaxResult export(SysConfig config)
{
    List<SysConfig> list = configService.selectConfigList(config);
    ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
    return util.exportExcel(list, "参数数据");
}
 
Example #7
Source File: SysConfigServiceImpl.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 根据键名查询参数配置信息
 * 
 * @param configKey 参数key
 * @return 参数键值
 */
@Override
public String selectConfigByKey(String configKey)
{
    SysConfig config = new SysConfig();
    config.setConfigKey(configKey);
    SysConfig retConfig = configMapper.selectConfig(config);
    return StringUtils.isNotNull(retConfig) ? retConfig.getConfigValue() : "";
}
 
Example #8
Source File: SysConfigServiceImpl.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 校验参数键名是否唯一
 * 
 * @param config 参数配置信息
 * @return 结果
 */
@Override
public String checkConfigKeyUnique(SysConfig config)
{
    Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
    SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey());
    if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue())
    {
        return UserConstants.CONFIG_KEY_NOT_UNIQUE;
    }
    return UserConstants.CONFIG_KEY_UNIQUE;
}
 
Example #9
Source File: SysConfigController.java    From ruoyiplus with MIT License 5 votes vote down vote up
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
@RequiresPermissions("system:config:export")
@PostMapping("/export")
@ResponseBody
public AjaxResult export(SysConfig config)
{
    List<SysConfig> list = configService.selectConfigList(config);
    ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
    return util.exportExcel(list, "参数数据");
}
 
Example #10
Source File: SysConfigController.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 新增保存参数配置
 */
@RequiresPermissions("system:config:add")
@Log(title = "参数管理", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(SysConfig config)
{
    config.setCreateBy(ShiroUtils.getLoginName());
    return toAjax(configService.insertConfig(config));
}
 
Example #11
Source File: SysConfigController.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 修改保存参数配置
 */
@RequiresPermissions("system:config:edit")
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(SysConfig config)
{
    config.setUpdateBy(ShiroUtils.getLoginName());
    return toAjax(configService.updateConfig(config));
}
 
Example #12
Source File: SysConfigController.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 校验参数键名
 */
@PostMapping("/checkConfigKeyUnique")
@ResponseBody
public String checkConfigKeyUnique(SysConfig config)
{
    return configService.checkConfigKeyUnique(config);
}
 
Example #13
Source File: SysConfigServiceImpl.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
/**
 * 查询参数配置信息
 *
 * @param configId 参数配置ID
 * @return 参数配置信息
 */
@Override
public SysConfig selectConfigById(Long configId) {
    SysConfig config = new SysConfig();
    config.setConfigId(configId);
    return configMapper.selectConfig(config);
}
 
Example #14
Source File: SysConfigServiceImpl.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
/**
 * 根据键名查询参数配置信息
 *
 * @param configKey 参数key
 * @return 参数键值
 */
@Override
public String selectConfigByKey(String configKey) {
    SysConfig config = new SysConfig();
    config.setConfigKey(configKey);
    SysConfig retConfig = configMapper.selectConfig(config);
    return ObjectUtil.isNotNull(retConfig) ? retConfig.getConfigValue() : "" ;
}
 
Example #15
Source File: SysConfigServiceImpl.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 根据键名查询参数配置信息
 * 
 * @param configKey 参数key
 * @return 参数键值
 */
@Override
public String selectConfigByKey(String configKey)
{
    SysConfig config = new SysConfig();
    config.setConfigKey(configKey);
    SysConfig retConfig = configMapper.selectConfig(config);
    return StringUtils.isNotNull(retConfig) ? retConfig.getConfigValue() : "";
}
 
Example #16
Source File: SysConfigServiceImpl.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 查询参数配置信息
 * 
 * @param configId 参数配置ID
 * @return 参数配置信息
 */
@Override
public SysConfig selectConfigById(Long configId)
{
    SysConfig config = new SysConfig();
    config.setConfigId(configId);
    return configMapper.selectConfig(config);
}
 
Example #17
Source File: SysConfigServiceImpl.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
/**
 * 校验参数键名是否唯一
 *
 * @param config 参数配置信息
 * @return 结果
 */
@Override
public String checkConfigKeyUnique(SysConfig config) {
    SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey());
    if (ObjectUtil.isNotNull(info) && !info.getConfigId().equals(config.getConfigId())) {
        return UserConstants.CONFIG_KEY_NOT_UNIQUE;
    }
    return UserConstants.CONFIG_KEY_UNIQUE;
}
 
Example #18
Source File: SysConfigController.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
@RequiresPermissions("system:config:export")
@PostMapping("/export")
@ResponseBody
public AjaxResult export(SysConfig config) {
    List<SysConfig> list = configService.selectConfigList(config);
    ExcelUtil<SysConfig> util = new ExcelUtil<>(SysConfig.class);
    return util.exportExcel(list, "参数管理");
}
 
Example #19
Source File: SysConfigController.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
/**
 * 新增保存参数配置
 */
@RequiresPermissions("system:config:add")
@Log(title = "参数管理", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(SysConfig config) {
    config.setCreateBy(ShiroUtils.getLoginName());
    return toAjax(configService.insertConfig(config));
}
 
Example #20
Source File: SysConfigController.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
/**
 * 修改保存参数配置
 */
@RequiresPermissions("system:config:edit")
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(SysConfig config) {
    config.setUpdateBy(ShiroUtils.getLoginName());
    return toAjax(configService.updateConfig(config));
}
 
Example #21
Source File: SysConfigController.java    From RuoYi with Apache License 2.0 4 votes vote down vote up
/**
 * 校验参数键名
 */
@PostMapping("/checkConfigKeyUnique")
@ResponseBody
public String checkConfigKeyUnique(SysConfig config) {
    return configService.checkConfigKeyUnique(config);
}
 
Example #22
Source File: ISysConfigService.java    From supplierShop with MIT License 2 votes vote down vote up
/**
 * 校验参数键名是否唯一
 * 
 * @param config 参数信息
 * @return 结果
 */
public String checkConfigKeyUnique(SysConfig config);
 
Example #23
Source File: ISysConfigService.java    From RuoYi with Apache License 2.0 2 votes vote down vote up
/**
 * 查询参数配置列表
 *
 * @param config 参数配置信息
 * @return 参数配置集合
 */
List<SysConfig> selectConfigList(SysConfig config);
 
Example #24
Source File: ISysConfigService.java    From RuoYi with Apache License 2.0 2 votes vote down vote up
/**
 * 新增参数配置
 *
 * @param config 参数配置信息
 * @return 结果
 */
int insertConfig(SysConfig config);
 
Example #25
Source File: ISysConfigService.java    From RuoYi with Apache License 2.0 2 votes vote down vote up
/**
 * 修改参数配置
 *
 * @param config 参数配置信息
 * @return 结果
 */
int updateConfig(SysConfig config);
 
Example #26
Source File: ISysConfigService.java    From RuoYi with Apache License 2.0 2 votes vote down vote up
/**
 * 校验参数键名是否唯一
 *
 * @param config 参数信息
 * @return 结果
 */
String checkConfigKeyUnique(SysConfig config);
 
Example #27
Source File: SysConfigServiceImpl.java    From supplierShop with MIT License 2 votes vote down vote up
/**
 * 新增参数配置
 * 
 * @param config 参数配置信息
 * @return 结果
 */
@Override
public int insertConfig(SysConfig config)
{
    return configMapper.insertConfig(config);
}
 
Example #28
Source File: SysConfigServiceImpl.java    From supplierShop with MIT License 2 votes vote down vote up
/**
 * 查询参数配置列表
 * 
 * @param config 参数配置信息
 * @return 参数配置集合
 */
@Override
public List<SysConfig> selectConfigList(SysConfig config)
{
    return configMapper.selectConfigList(config);
}
 
Example #29
Source File: SysConfigServiceImpl.java    From RuoYi with Apache License 2.0 2 votes vote down vote up
/**
 * 查询参数配置列表
 *
 * @param config 参数配置信息
 * @return 参数配置集合
 */
@Override
public List<SysConfig> selectConfigList(SysConfig config) {
    return configMapper.selectConfigList(config);
}
 
Example #30
Source File: SysConfigServiceImpl.java    From RuoYi with Apache License 2.0 2 votes vote down vote up
/**
 * 新增参数配置
 *
 * @param config 参数配置信息
 * @return 结果
 */
@Override
public int insertConfig(SysConfig config) {
    return configMapper.insertConfig(config);
}