mirror of
				https://github.com/YunaiV/ruoyi-vue-pro.git
				synced 2025-11-01 03:28:41 +08:00 
			
		
		
		
	!1217 fix: 无时间中缀不设置Redis过期时间
Merge pull request !1217 from Lesan/feature/bpm-new
This commit is contained in:
		| @ -29,6 +29,7 @@ public class BpmProcessIdRedisDAO { | ||||
|     public String generate(BpmModelMetaInfoVO.ProcessIdRule processIdRule) { | ||||
|         // 生成日期前缀 | ||||
|         String infix = ""; | ||||
|         boolean expireEnable = true; | ||||
|         switch (processIdRule.getInfix()) { | ||||
|             case "DAY": | ||||
|                 infix = DateUtil.format(LocalDateTime.now(), "yyyyMMDD"); | ||||
| @ -42,13 +43,18 @@ public class BpmProcessIdRedisDAO { | ||||
|             case "SECOND": | ||||
|                 infix = DateUtil.format(LocalDateTime.now(), "yyyyMMDDHHmmss"); | ||||
|                 break; | ||||
|             default: | ||||
|                 expireEnable = false; | ||||
|                 break; | ||||
|         } | ||||
|  | ||||
|         // 生成序号 | ||||
|         String noPrefix = processIdRule.getPrefix() + infix + processIdRule.getPostfix(); | ||||
|         String key = RedisKeyConstants.BPM_PROCESS_ID + noPrefix; | ||||
|         Long no = stringRedisTemplate.opsForValue().increment(key); | ||||
|         if (Boolean.TRUE.equals(expireEnable)) { | ||||
|             stringRedisTemplate.expire(key, Duration.ofDays(1L)); | ||||
|         } | ||||
|         return noPrefix + String.format("%0" + processIdRule.getLength() + "d", no); | ||||
|     } | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 芋道源码
					芋道源码