Merge branch 'feature/REQ-5865' into pre
This commit is contained in:
commit
941ca60061
@ -120,7 +120,7 @@ public interface ProcessTaskApi {
|
||||
*/
|
||||
@Operation(summary = "系统操作回退任务到指定节点")
|
||||
@PostMapping("/api/process/task/system/back")
|
||||
@Manageable
|
||||
@InvokeMode(ASYNC)
|
||||
CommonResponse<Boolean> systemBackTask(@Validated @RequestBody BpmnNodeBackSystemOperateDTO dto);
|
||||
|
||||
/**
|
||||
|
||||
@ -47,6 +47,13 @@ public class BpmnProcessInstanceLogQueryDTO {
|
||||
@Builder.Default
|
||||
private Boolean hasButton = false;
|
||||
|
||||
/**
|
||||
* 是否包含未来的节点,默认包含
|
||||
*/
|
||||
@ApiModelProperty(value = "是否包含未来的节点,默认包含")
|
||||
@Builder.Default
|
||||
private Boolean includeFutureTasks = true;
|
||||
|
||||
/**
|
||||
* 是否需要加密(同一个实例的日志,在不同端[cms/oms]下,审批人的信息需要按一定规则进行隐藏控制)
|
||||
*/
|
||||
|
||||
@ -1245,7 +1245,7 @@ public class BpmnProcessInstanceServiceImpl implements BpmnProcessInstanceServic
|
||||
|
||||
List<ProcessNodeDetailVO> forecasting = new ArrayList<>();
|
||||
// 只有还在运行中的实例才需要推测后续节点
|
||||
if (Objects.equals(historicProcessInstance.getBusinessStatus(), PROCESSING.getStatus())) {
|
||||
if (Objects.equals(historicProcessInstance.getBusinessStatus(), PROCESSING.getStatus()) && Objects.equals(Boolean.TRUE, dto.getIncludeFutureTasks())) {
|
||||
ProcessInstance instance = runtimeService.createProcessInstanceQuery()
|
||||
.processInstanceId(dto.getProcessInstanceId())
|
||||
.includeProcessVariables()
|
||||
|
||||
@ -81,19 +81,30 @@ public class ImplementationReadyChecker implements ApplicationListener<Applicati
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 自适应转换:value ≤15 时返回 4 位数组,否则返回最小所需位数数组
|
||||
*/
|
||||
public static boolean[] toBooleansAdaptive(int value) {
|
||||
if (value < 0) throw new IllegalArgumentException("adaptive mode only for non-negative");
|
||||
if (value == 0) return new boolean[]{false};
|
||||
int bits = 32 - Integer.numberOfLeadingZeros(value);
|
||||
if (value < 0) {
|
||||
throw new IllegalArgumentException("adaptive mode only for non-negative");
|
||||
}
|
||||
|
||||
// 核心修改:value ≤15 强制用 4 位,否则计算最小所需位数
|
||||
int bits = (value <= 15) ? 4 : (32 - Integer.numberOfLeadingZeros(value));
|
||||
return toBooleans(value, bits);
|
||||
}
|
||||
|
||||
// 高位在前:index=0 是最高位
|
||||
/**
|
||||
* 将 value 转换为指定位数的 boolean 数组(高位在前)
|
||||
*/
|
||||
public static boolean[] toBooleans(int value, int bits) {
|
||||
if (bits <= 0 || bits > 32) throw new IllegalArgumentException("bits must be 1~32");
|
||||
if (bits <= 0 || bits > 32) {
|
||||
throw new IllegalArgumentException("bits must be 1~32");
|
||||
}
|
||||
|
||||
boolean[] arr = new boolean[bits];
|
||||
for (int i = 0; i < bits; i++) {
|
||||
int shift = bits - 1 - i;
|
||||
int shift = bits - 1 - i; // 从高位到低位遍历
|
||||
arr[i] = ((value >>> shift) & 1) == 1;
|
||||
}
|
||||
return arr;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user