| | |
| | | public TableDataInfo<SysConfig> selectPageConfigList(SysConfig config) { |
| | | Map<String, Object> params = config.getParams(); |
| | | LambdaQueryWrapper<SysConfig> lqw = new LambdaQueryWrapper<SysConfig>() |
| | | .like(StringUtils.isNotBlank(config.getConfigName()), SysConfig::getConfigName, config.getConfigName()) |
| | | .eq(StringUtils.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType()) |
| | | .like(StringUtils.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey()) |
| | | .apply(StringUtils.isNotEmpty(params.get("beginTime")), |
| | | "date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')", |
| | | params.get("beginTime")) |
| | | .apply(StringUtils.isNotEmpty(params.get("endTime")), |
| | | "date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')", |
| | | params.get("endTime")); |
| | | .like(StringUtils.isNotBlank(config.getConfigName()), SysConfig::getConfigName, config.getConfigName()) |
| | | .eq(StringUtils.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType()) |
| | | .like(StringUtils.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey()) |
| | | .between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysConfig::getCreateTime, params.get("beginTime"), params.get("endTime")); |
| | | return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw)); |
| | | } |
| | | |
| | |
| | | return configValue; |
| | | } |
| | | SysConfig retConfig = baseMapper.selectOne(new LambdaQueryWrapper<SysConfig>() |
| | | .eq(SysConfig::getConfigKey, configKey)); |
| | | .eq(SysConfig::getConfigKey, configKey)); |
| | | if (StringUtils.isNotNull(retConfig)) { |
| | | RedisUtils.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue()); |
| | | return retConfig.getConfigValue(); |
| | |
| | | public List<SysConfig> selectConfigList(SysConfig config) { |
| | | Map<String, Object> params = config.getParams(); |
| | | LambdaQueryWrapper<SysConfig> lqw = new LambdaQueryWrapper<SysConfig>() |
| | | .like(StringUtils.isNotBlank(config.getConfigName()), SysConfig::getConfigName, config.getConfigName()) |
| | | .eq(StringUtils.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType()) |
| | | .like(StringUtils.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey()) |
| | | .apply(StringUtils.isNotEmpty(params.get("beginTime")), |
| | | "date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')", |
| | | params.get("beginTime")) |
| | | .apply(StringUtils.isNotEmpty(params.get("endTime")), |
| | | "date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')", |
| | | params.get("endTime")); |
| | | .like(StringUtils.isNotBlank(config.getConfigName()), SysConfig::getConfigName, config.getConfigName()) |
| | | .eq(StringUtils.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType()) |
| | | .like(StringUtils.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey()) |
| | | .between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysConfig::getCreateTime, params.get("beginTime"), params.get("endTime")); |
| | | return baseMapper.selectList(lqw); |
| | | } |
| | | |
| | |
| | | public TableDataInfo<SysDictType> selectPageDictTypeList(SysDictType dictType) { |
| | | Map<String, Object> params = dictType.getParams(); |
| | | LambdaQueryWrapper<SysDictType> lqw = new LambdaQueryWrapper<SysDictType>() |
| | | .like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName()) |
| | | .eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus()) |
| | | .like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType()) |
| | | .apply(StringUtils.isNotEmpty(params.get("beginTime")), |
| | | "date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')", |
| | | params.get("beginTime")) |
| | | .apply(StringUtils.isNotEmpty(params.get("endTime")), |
| | | "date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')", |
| | | params.get("endTime")); |
| | | .like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName()) |
| | | .eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus()) |
| | | .like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType()) |
| | | .between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysDictType::getCreateTime, params.get("beginTime"), params.get("endTime")); |
| | | return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw)); |
| | | } |
| | | |
| | |
| | | public List<SysDictType> selectDictTypeList(SysDictType dictType) { |
| | | Map<String, Object> params = dictType.getParams(); |
| | | return list(new LambdaQueryWrapper<SysDictType>() |
| | | .like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName()) |
| | | .eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus()) |
| | | .like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType()) |
| | | .apply(StringUtils.isNotEmpty(params.get("beginTime")), |
| | | "date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')", |
| | | params.get("beginTime")) |
| | | .apply(StringUtils.isNotEmpty(params.get("endTime")), |
| | | "date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')", |
| | | params.get("endTime"))); |
| | | .like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName()) |
| | | .eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus()) |
| | | .like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType()) |
| | | .between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysDictType::getCreateTime, params.get("beginTime"), params.get("endTime"))); |
| | | } |
| | | |
| | | /** |
| | |
| | | for (Long dictId : dictIds) { |
| | | SysDictType dictType = selectDictTypeById(dictId); |
| | | if (dictDataMapper.selectCount(new LambdaQueryWrapper<SysDictData>() |
| | | .eq(SysDictData::getDictType, dictType.getDictType())) > 0) { |
| | | .eq(SysDictData::getDictType, dictType.getDictType())) > 0) { |
| | | throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName())); |
| | | } |
| | | RedisUtils.deleteObject(getCacheKey(dictType.getDictType())); |
| | |
| | | public int updateDictType(SysDictType dict) { |
| | | SysDictType oldDict = getById(dict.getDictId()); |
| | | dictDataMapper.update(null, new LambdaUpdateWrapper<SysDictData>() |
| | | .set(SysDictData::getDictType, dict.getDictType()) |
| | | .eq(SysDictData::getDictType, oldDict.getDictType())); |
| | | .set(SysDictData::getDictType, dict.getDictType()) |
| | | .eq(SysDictData::getDictType, oldDict.getDictType())); |
| | | int row = baseMapper.updateById(dict); |
| | | if (row > 0) { |
| | | List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType()); |
| | |
| | | public String checkDictTypeUnique(SysDictType dict) { |
| | | Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId(); |
| | | long count = count(new LambdaQueryWrapper<SysDictType>() |
| | | .eq(SysDictType::getDictType, dict.getDictType()) |
| | | .ne(SysDictType::getDictId, dictId)); |
| | | .eq(SysDictType::getDictType, dict.getDictType()) |
| | | .ne(SysDictType::getDictId, dictId)); |
| | | if (count > 0) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | |
| | | public TableDataInfo<SysLogininfor> selectPageLogininforList(SysLogininfor logininfor) { |
| | | Map<String, Object> params = logininfor.getParams(); |
| | | LambdaQueryWrapper<SysLogininfor> lqw = new LambdaQueryWrapper<SysLogininfor>() |
| | | .like(StringUtils.isNotBlank(logininfor.getIpaddr()), SysLogininfor::getIpaddr, logininfor.getIpaddr()) |
| | | .eq(StringUtils.isNotBlank(logininfor.getStatus()), SysLogininfor::getStatus, logininfor.getStatus()) |
| | | .like(StringUtils.isNotBlank(logininfor.getUserName()), SysLogininfor::getUserName, logininfor.getUserName()) |
| | | .apply(StringUtils.isNotEmpty(params.get("beginTime")), |
| | | "date_format(login_time,'%y%m%d') >= date_format({0},'%y%m%d')", |
| | | params.get("beginTime")) |
| | | .apply(StringUtils.isNotEmpty(params.get("endTime")), |
| | | "date_format(login_time,'%y%m%d') <= date_format({0},'%y%m%d')", |
| | | params.get("endTime")); |
| | | return PageUtils.buildDataInfo(page(PageUtils.buildPage("info_id","desc"), lqw)); |
| | | .like(StringUtils.isNotBlank(logininfor.getIpaddr()), SysLogininfor::getIpaddr, logininfor.getIpaddr()) |
| | | .eq(StringUtils.isNotBlank(logininfor.getStatus()), SysLogininfor::getStatus, logininfor.getStatus()) |
| | | .like(StringUtils.isNotBlank(logininfor.getUserName()), SysLogininfor::getUserName, logininfor.getUserName()) |
| | | .between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysLogininfor::getLoginTime, params.get("beginTime"), params.get("endTime")); |
| | | return PageUtils.buildDataInfo(page(PageUtils.buildPage("info_id", "desc"), lqw)); |
| | | } |
| | | |
| | | /** |
| | |
| | | public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor) { |
| | | Map<String, Object> params = logininfor.getParams(); |
| | | return list(new LambdaQueryWrapper<SysLogininfor>() |
| | | .like(StringUtils.isNotBlank(logininfor.getIpaddr()),SysLogininfor::getIpaddr,logininfor.getIpaddr()) |
| | | .eq(StringUtils.isNotBlank(logininfor.getStatus()),SysLogininfor::getStatus,logininfor.getStatus()) |
| | | .like(StringUtils.isNotBlank(logininfor.getUserName()),SysLogininfor::getUserName,logininfor.getUserName()) |
| | | .apply(StringUtils.isNotEmpty(params.get("beginTime")), |
| | | "date_format(login_time,'%y%m%d') >= date_format({0},'%y%m%d')", |
| | | params.get("beginTime")) |
| | | .apply(StringUtils.isNotEmpty(params.get("endTime")), |
| | | "date_format(login_time,'%y%m%d') <= date_format({0},'%y%m%d')", |
| | | params.get("endTime")) |
| | | .orderByDesc(SysLogininfor::getInfoId)); |
| | | .like(StringUtils.isNotBlank(logininfor.getIpaddr()), SysLogininfor::getIpaddr, logininfor.getIpaddr()) |
| | | .eq(StringUtils.isNotBlank(logininfor.getStatus()), SysLogininfor::getStatus, logininfor.getStatus()) |
| | | .like(StringUtils.isNotBlank(logininfor.getUserName()), SysLogininfor::getUserName, logininfor.getUserName()) |
| | | .between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysLogininfor::getLoginTime, params.get("beginTime"), params.get("endTime")) |
| | | .orderByDesc(SysLogininfor::getInfoId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | public TableDataInfo<SysOperLog> selectPageOperLogList(SysOperLog operLog) { |
| | | Map<String, Object> params = operLog.getParams(); |
| | | LambdaQueryWrapper<SysOperLog> lqw = new LambdaQueryWrapper<SysOperLog>() |
| | | .like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle()) |
| | | .eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0, |
| | | SysOperLog::getBusinessType, operLog.getBusinessType()) |
| | | .func(f -> { |
| | | if (ArrayUtil.isNotEmpty(operLog.getBusinessTypes())) { |
| | | f.in(SysOperLog::getBusinessType, Arrays.asList(operLog.getBusinessTypes())); |
| | | } |
| | | }) |
| | | .eq(operLog.getStatus() != null, |
| | | SysOperLog::getStatus, operLog.getStatus()) |
| | | .like(StringUtils.isNotBlank(operLog.getOperName()), SysOperLog::getOperName, operLog.getOperName()) |
| | | .apply(StringUtils.isNotEmpty(params.get("beginTime")), |
| | | "date_format(oper_time,'%y%m%d') >= date_format({0},'%y%m%d')", |
| | | params.get("beginTime")) |
| | | .apply(StringUtils.isNotEmpty(params.get("endTime")), |
| | | "date_format(oper_time,'%y%m%d') <= date_format({0},'%y%m%d')", |
| | | params.get("endTime")); |
| | | .like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle()) |
| | | .eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0, |
| | | SysOperLog::getBusinessType, operLog.getBusinessType()) |
| | | .func(f -> { |
| | | if (ArrayUtil.isNotEmpty(operLog.getBusinessTypes())) { |
| | | f.in(SysOperLog::getBusinessType, Arrays.asList(operLog.getBusinessTypes())); |
| | | } |
| | | }) |
| | | .eq(operLog.getStatus() != null, |
| | | SysOperLog::getStatus, operLog.getStatus()) |
| | | .like(StringUtils.isNotBlank(operLog.getOperName()), SysOperLog::getOperName, operLog.getOperName()) |
| | | .between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysOperLog::getOperTime, params.get("beginTime"), params.get("endTime")); |
| | | return PageUtils.buildDataInfo(page(PageUtils.buildPage("oper_id", "desc"), lqw)); |
| | | } |
| | | |
| | |
| | | public List<SysOperLog> selectOperLogList(SysOperLog operLog) { |
| | | Map<String, Object> params = operLog.getParams(); |
| | | return list(new LambdaQueryWrapper<SysOperLog>() |
| | | .like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle()) |
| | | .eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0, |
| | | SysOperLog::getBusinessType, operLog.getBusinessType()) |
| | | .func(f -> { |
| | | if (ArrayUtil.isNotEmpty(operLog.getBusinessTypes())) { |
| | | f.in(SysOperLog::getBusinessType, Arrays.asList(operLog.getBusinessTypes())); |
| | | } |
| | | }) |
| | | .eq(operLog.getStatus() != null && operLog.getStatus() > 0, |
| | | SysOperLog::getStatus, operLog.getStatus()) |
| | | .like(StringUtils.isNotBlank(operLog.getOperName()), SysOperLog::getOperName, operLog.getOperName()) |
| | | .apply(StringUtils.isNotEmpty(params.get("beginTime")), |
| | | "date_format(oper_time,'%y%m%d') >= date_format({0},'%y%m%d')", |
| | | params.get("beginTime")) |
| | | .apply(StringUtils.isNotEmpty(params.get("endTime")), |
| | | "date_format(oper_time,'%y%m%d') <= date_format({0},'%y%m%d')", |
| | | params.get("endTime")) |
| | | .orderByDesc(SysOperLog::getOperId)); |
| | | .like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle()) |
| | | .eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0, |
| | | SysOperLog::getBusinessType, operLog.getBusinessType()) |
| | | .func(f -> { |
| | | if (ArrayUtil.isNotEmpty(operLog.getBusinessTypes())) { |
| | | f.in(SysOperLog::getBusinessType, Arrays.asList(operLog.getBusinessTypes())); |
| | | } |
| | | }) |
| | | .eq(operLog.getStatus() != null && operLog.getStatus() > 0, |
| | | SysOperLog::getStatus, operLog.getStatus()) |
| | | .like(StringUtils.isNotBlank(operLog.getOperName()), SysOperLog::getOperName, operLog.getOperName()) |
| | | .between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysOperLog::getOperTime, params.get("beginTime"), params.get("endTime")) |
| | | .orderByDesc(SysOperLog::getOperId)); |
| | | } |
| | | |
| | | /** |