|
@@ -96,23 +96,14 @@ public class FlowDefineServiceImpl extends BaseServiceImpl<FlowDefineDao, FlowDe
|
|
|
}
|
|
|
}
|
|
|
// 生成流程实例ID
|
|
|
- String serialKey = "flow:serial";
|
|
|
+ String currentDate = DateTimeFormatter.ISO_DATE.format(LocalDate.now());
|
|
|
+ String serialKey = String.format("flow:serial:%s", currentDate);
|
|
|
Long increment = redisService.incr(serialKey, 1L);
|
|
|
if (increment == 1L) {
|
|
|
- // 设置缓存过期时间
|
|
|
- Calendar tomorrowMidnight = Calendar.getInstance();
|
|
|
- tomorrowMidnight.add(Calendar.DAY_OF_YEAR, 1);
|
|
|
- tomorrowMidnight.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
- tomorrowMidnight.set(Calendar.MINUTE, 0);
|
|
|
- tomorrowMidnight.set(Calendar.SECOND, 0);
|
|
|
- tomorrowMidnight.set(Calendar.MILLISECOND, 0);
|
|
|
- long midnightTimestamp = (tomorrowMidnight.getTimeInMillis() - System.currentTimeMillis()) / 1000;
|
|
|
- redisService.expire(serialKey, midnightTimestamp);
|
|
|
+ redisService.expire(serialKey, 60 * 60 * 24L);
|
|
|
}
|
|
|
String serial = String.format("%3s", increment).replace(" ", "0");
|
|
|
- String currentDate = DateTimeFormatter.ofPattern("yyyyMMdd").format(LocalDate.now());
|
|
|
- String instanceId = String.format("fw%s%s", currentDate, serial);
|
|
|
-
|
|
|
+ String instanceId = String.format("LF%s%s", currentDate, serial);
|
|
|
String instanceName = startProcess.getInstanceName();
|
|
|
Settings settings = flowDefine.getSettings();
|
|
|
TitleConfig titleConfig = settings.getTitle();
|