疯狂的狮子li
2021-08-02 c813046594b82230cd2cb61622d68a4981096e08
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java
@@ -1,7 +1,6 @@
package com.ruoyi.system.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Validator;
import com.ruoyi.common.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -51,10 +50,10 @@
         .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(Validator.isNotEmpty(params.get("beginTime")),
         .apply(StringUtils.isNotEmpty(params.get("beginTime")),
            "date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
            params.get("beginTime"))
         .apply(Validator.isNotEmpty(params.get("endTime")),
         .apply(StringUtils.isNotEmpty(params.get("endTime")),
            "date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
            params.get("endTime"));
      return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
@@ -73,10 +72,10 @@
         .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(Validator.isNotEmpty(params.get("beginTime")),
         .apply(StringUtils.isNotEmpty(params.get("beginTime")),
            "date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
            params.get("beginTime"))
         .apply(Validator.isNotEmpty(params.get("endTime")),
         .apply(StringUtils.isNotEmpty(params.get("endTime")),
            "date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
            params.get("endTime")));
   }
@@ -225,11 +224,11 @@
    */
   @Override
   public String checkDictTypeUnique(SysDictType dict) {
      Long dictId = Validator.isNull(dict.getDictId()) ? -1L : dict.getDictId();
      Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
      SysDictType dictType = getOne(new LambdaQueryWrapper<SysDictType>()
         .eq(SysDictType::getDictType, dict.getDictType())
         .last("limit 1"));
      if (Validator.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
      if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
         return UserConstants.NOT_UNIQUE;
      }
      return UserConstants.UNIQUE;