mirror of
				https://github.com/YunaiV/ruoyi-vue-pro.git
				synced 2025-11-01 03:28:41 +08:00 
			
		
		
		
	feat: BPM-更多设置-流程编码
This commit is contained in:
		| @ -17,9 +17,6 @@ import java.time.LocalDateTime; | |||||||
| @Repository | @Repository | ||||||
| public class BpmProcessIdRedisDAO { | public class BpmProcessIdRedisDAO { | ||||||
|  |  | ||||||
|     // TODO @lesan:要枚举到 rediskeyconstants 哈 |  | ||||||
|     public static final String BPM_PROCESS_ID_PREFIX = "BPMPID"; |  | ||||||
|  |  | ||||||
|     @Resource |     @Resource | ||||||
|     private StringRedisTemplate stringRedisTemplate; |     private StringRedisTemplate stringRedisTemplate; | ||||||
|  |  | ||||||
| @ -49,7 +46,7 @@ public class BpmProcessIdRedisDAO { | |||||||
|  |  | ||||||
|         // 生成序号 |         // 生成序号 | ||||||
|         String noPrefix = processIdRule.getPrefix() + infix + processIdRule.getPostfix(); |         String noPrefix = processIdRule.getPrefix() + infix + processIdRule.getPostfix(); | ||||||
|         String key = BPM_PROCESS_ID_PREFIX + noPrefix; |         String key = RedisKeyConstants.BPM_PROCESS_ID + noPrefix; | ||||||
|         Long no = stringRedisTemplate.opsForValue().increment(key); |         Long no = stringRedisTemplate.opsForValue().increment(key); | ||||||
|         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); | ||||||
|  | |||||||
| @ -0,0 +1,15 @@ | |||||||
|  | package cn.iocoder.yudao.module.bpm.dal.redis; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * BPM Redis Key 枚举类 | ||||||
|  |  * | ||||||
|  |  * @author 芋道源码 | ||||||
|  |  */ | ||||||
|  | public interface RedisKeyConstants { | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 流程 ID 的缓存 | ||||||
|  |      */ | ||||||
|  |     String BPM_PROCESS_ID = "bpm:process_id:seq_no:"; | ||||||
|  |  | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user
	 Lesan
					Lesan