|
@@ -17,6 +17,8 @@ public class FlowInstance {
|
|
|
private ProcessStatus status;
|
|
|
private Integer cancelDays;
|
|
|
@TableField(exist = false)
|
|
|
+ private Boolean isCancel = false;
|
|
|
+ @TableField(exist = false)
|
|
|
private String name;
|
|
|
@TableField(exist = false)
|
|
|
private String definitionId;
|
|
@@ -46,4 +48,13 @@ public class FlowInstance {
|
|
|
this.duration = milliSecond - startTime.toInstant(ZoneOffset.UTC).toEpochMilli();
|
|
|
}
|
|
|
|
|
|
+ public void setCancelDays(Integer cancelDays) {
|
|
|
+ this.cancelDays = cancelDays;
|
|
|
+ if (this.status == ProcessStatus.RUNNING) {
|
|
|
+ LocalDateTime exp = this.startTime.plusDays(cancelDays);
|
|
|
+ if (LocalDateTime.now().isBefore(exp)) {
|
|
|
+ this.isCancel = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|