fix:bug#I8DLHU
parent
0a90c90498
commit
7217438afb
|
@ -7,6 +7,7 @@ import cc.iotkit.data.ICommonData;
|
|||
import cc.iotkit.data.util.PageBuilder;
|
||||
import cc.iotkit.model.Id;
|
||||
import org.springframework.data.domain.Example;
|
||||
import org.springframework.data.domain.ExampleMatcher;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
|
@ -120,8 +121,9 @@ public interface IJPACommData< T extends Id<ID>, ID> extends ICommonData<T , ID
|
|||
if (Objects.isNull(data)) {
|
||||
return null;
|
||||
}
|
||||
return Example.of(MapstructUtils.convert(data, getJpaRepositoryClass()));
|
||||
return Example.of(MapstructUtils.convert(data, getJpaRepositoryClass()),
|
||||
ExampleMatcher.matching().withStringMatcher(ExampleMatcher.StringMatcher.CONTAINING)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -303,9 +303,9 @@ public class SysUserDataImpl implements ISysUserData, IJPACommData<SysUser, Long
|
|||
}
|
||||
return PredicateBuilder.instance()
|
||||
.and(ObjectUtil.isNotNull(user.getId()), () -> tbSysUser.id.eq(user.getId()))
|
||||
.and(StringUtils.isNotEmpty(user.getUserName()), () -> tbSysUser.userName.like(user.getUserName()))
|
||||
.and(StringUtils.isNotEmpty(user.getUserName()), () -> tbSysUser.userName.like("%" + user.getUserName() + "%"))
|
||||
.and(StringUtils.isNotEmpty(user.getStatus()), () -> tbSysUser.status.eq(user.getStatus()))
|
||||
.and(StringUtils.isNotEmpty(user.getPhonenumber()), () -> tbSysUser.phonenumber.like(user.getPhonenumber()))
|
||||
.and(StringUtils.isNotEmpty(user.getPhonenumber()), () -> tbSysUser.phonenumber.like("%" + user.getPhonenumber() + "%"))
|
||||
.and(ObjectUtil.isNotEmpty(ids), () -> tbSysUser.deptId.in(ids)).build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,10 @@
|
|||
*/
|
||||
package cc.iotkit.config;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import redis.embedded.RedisServer;
|
||||
|
||||
@Slf4j
|
||||
public class EmbeddedRedisConfig {
|
||||
|
||||
public static boolean embeddedEnable() {
|
||||
|
@ -28,7 +30,14 @@ public class EmbeddedRedisConfig {
|
|||
} else {
|
||||
redisServer = new RedisServer();
|
||||
}
|
||||
try {
|
||||
redisServer.start();
|
||||
} catch (Exception e) {
|
||||
if (e.getMessage().contains("Address already in use")) {
|
||||
throw new RuntimeException("redis端口被占用,请先停止本地的redis服务");
|
||||
}
|
||||
log.error("start redis server failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue