Commit 4a1fe1f3074df04f474c6dca8144fb086f3ccf06
1 parent
f486790d
feat: BPM-更多设置-流程编码
Showing
2 changed files
with
16 additions
and
4 deletions
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/redis/BpmProcessIdRedisDAO.java
| @@ -17,9 +17,6 @@ import java.time.LocalDateTime; | @@ -17,9 +17,6 @@ import java.time.LocalDateTime; | ||
| 17 | @Repository | 17 | @Repository |
| 18 | public class BpmProcessIdRedisDAO { | 18 | public class BpmProcessIdRedisDAO { |
| 19 | 19 | ||
| 20 | - // TODO @lesan:要枚举到 rediskeyconstants 哈 | ||
| 21 | - public static final String BPM_PROCESS_ID_PREFIX = "BPMPID"; | ||
| 22 | - | ||
| 23 | @Resource | 20 | @Resource |
| 24 | private StringRedisTemplate stringRedisTemplate; | 21 | private StringRedisTemplate stringRedisTemplate; |
| 25 | 22 | ||
| @@ -49,7 +46,7 @@ public class BpmProcessIdRedisDAO { | @@ -49,7 +46,7 @@ public class BpmProcessIdRedisDAO { | ||
| 49 | 46 | ||
| 50 | // 生成序号 | 47 | // 生成序号 |
| 51 | String noPrefix = processIdRule.getPrefix() + infix + processIdRule.getPostfix(); | 48 | String noPrefix = processIdRule.getPrefix() + infix + processIdRule.getPostfix(); |
| 52 | - String key = BPM_PROCESS_ID_PREFIX + noPrefix; | 49 | + String key = RedisKeyConstants.BPM_PROCESS_ID + noPrefix; |
| 53 | Long no = stringRedisTemplate.opsForValue().increment(key); | 50 | Long no = stringRedisTemplate.opsForValue().increment(key); |
| 54 | stringRedisTemplate.expire(key, Duration.ofDays(1L)); | 51 | stringRedisTemplate.expire(key, Duration.ofDays(1L)); |
| 55 | return noPrefix + String.format("%0" + processIdRule.getLength() + "d", no); | 52 | return noPrefix + String.format("%0" + processIdRule.getLength() + "d", no); |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/redis/RedisKeyConstants.java
0 → 100644