Commit 3ec5b19a77ad7282660a1fc4ff020a3cfd085ecc

Authored by 芋道源码
Committed by Gitee
2 parents f486790d 4a1fe1f3

!1200 BPM:更多设置-流程编码

Merge pull request !1200 from Lesan/feature/bpm-流程编码
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
  1 +package cn.iocoder.yudao.module.bpm.dal.redis;
  2 +
  3 +/**
  4 + * BPM Redis Key 枚举类
  5 + *
  6 + * @author 芋道源码
  7 + */
  8 +public interface RedisKeyConstants {
  9 +
  10 + /**
  11 + * 流程 ID 的缓存
  12 + */
  13 + String BPM_PROCESS_ID = "bpm:process_id:seq_no:";
  14 +
  15 +}