shiqian 4 년 전
부모
커밋
b3aaf73bfd
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      boman-modules/boman-system/src/main/java/com/boman/system/utils/IdUtils.java

+ 2 - 1
boman-modules/boman-system/src/main/java/com/boman/system/utils/IdUtils.java

@@ -28,7 +28,8 @@ public class IdUtils {
         StandardlyMapper mapper = SpringUtils.getBean(StandardlyMapper.class);
         Long maxId = mapper.selectMaxId(tableName, pkName);
         if (null == maxId || maxId <= 0) {
-            redisService.setCacheObject(sequencesKey, 1L);
+            maxId = 1L;
+            redisService.setCacheObject(sequencesKey, maxId);
         } else {
             redisService.increment(sequencesKey, ++maxId);
         }