|
@@ -21,12 +21,13 @@ import static com.boman.common.core.utils.obj.ObjectUtils.requireNonNull;
|
|
|
public class IdUtils {
|
|
|
|
|
|
|
|
|
- public static int getMaxId(String tableName, String pkName) {
|
|
|
+ public static Long getMaxId(String tableName, String pkName) {
|
|
|
RedisService redisService = SpringUtils.getBean(RedisService.class);
|
|
|
String sequencesKey = RedisKey.SEQ + tableName.toUpperCase();
|
|
|
boolean isExist = redisService.exists(sequencesKey);
|
|
|
if (isExist) {
|
|
|
- return redisService.increment(sequencesKey);
|
|
|
+ int result = redisService.increment(sequencesKey);
|
|
|
+ return (long) result;
|
|
|
}
|
|
|
|
|
|
// 查数据库
|
|
@@ -39,7 +40,7 @@ public class IdUtils {
|
|
|
redisService.increment(sequencesKey, ++maxId);
|
|
|
}
|
|
|
|
|
|
- return maxId;
|
|
|
+ return (long) maxId;
|
|
|
}
|
|
|
|
|
|
public static String getPkName(List<GenTableColumn> columnList) {
|