fix:【bpm 工作流】流程自定义 ID 序号,无 infix 前缀时,永不过期,可见 https://t.zsxq.com/MU1E2 讨论
This commit is contained in:
@@ -51,8 +51,8 @@ public class BpmProcessIdRedisDAO {
|
|||||||
String noPrefix = processIdRule.getPrefix() + infix + processIdRule.getPostfix();
|
String noPrefix = processIdRule.getPrefix() + infix + processIdRule.getPostfix();
|
||||||
String key = RedisKeyConstants.BPM_PROCESS_ID + noPrefix;
|
String key = RedisKeyConstants.BPM_PROCESS_ID + noPrefix;
|
||||||
Long no = stringRedisTemplate.opsForValue().increment(key);
|
Long no = stringRedisTemplate.opsForValue().increment(key);
|
||||||
if (StrUtil.isNotEmpty(infix)) {
|
if (StrUtil.isEmpty(infix)) {
|
||||||
// 特殊:没有前缀,则不能过期,不能每次都是从 0 开始
|
// 特殊:没有前缀,则不能过期,不能每次都是从 0 开始。可见 https://t.zsxq.com/MU1E2 讨论
|
||||||
stringRedisTemplate.expire(key, Duration.ofDays(1L));
|
stringRedisTemplate.expire(key, Duration.ofDays(1L));
|
||||||
}
|
}
|
||||||
return noPrefix + String.format("%0" + processIdRule.getLength() + "d", no);
|
return noPrefix + String.format("%0" + processIdRule.getLength() + "d", no);
|
||||||
|
|||||||
Reference in New Issue
Block a user