Browse Source

立项批复时间

tags/24080901
PoffyZhang 1 year ago
parent
commit
f1d1818560
2 changed files with 28 additions and 3 deletions
  1. +14
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  2. +14
    -0
      pmapi/src/test/java/com/ningdatech/pmapi/instance/InstanceTest.java

+ 14
- 3
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -881,14 +881,25 @@ public class TodoCenterManage {
}

//设置 节点的状态 为null 代表继续审核
runtimeService.setVariables(dto.getInstanceId(),
org.assertj.core.util.Maps.newHashMap("approve_" + dto.getTaskId(), "PASS"));
List<HistoricVariableInstance> approves = historyService.createHistoricVariableInstanceQuery()
.processInstanceId(dto.getInstanceId())
.variableNameLike("approve_%")
.list();
if(CollUtil.isNotEmpty(approves)){
for(HistoricVariableInstance approve : approves){
if(approve.getValue() instanceof ProcessHandlerEnum){
if(ProcessHandlerEnum.BACK.equals(ProcessHandlerEnum.getEnumByName(String.valueOf(approve.getValue())))){
runtimeService.removeVariable(approve.getProcessInstanceId(),approve.getVariableName());
break;
}
}
}
}

// 更新当前流程状态为审核中
processTaskService.updateProInstStatus(dto.getInstanceId());

return dto.getInstanceId();

}

private Boolean modifyProject(ProjectDTO projectDto) {


+ 14
- 0
pmapi/src/test/java/com/ningdatech/pmapi/instance/InstanceTest.java View File

@@ -13,12 +13,14 @@ import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.wflow.contants.ProcessConstant;
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto;
import com.wflow.workflow.bean.dto.TodoCenterListReqDTO;
import com.wflow.workflow.enums.ProcessHandlerEnum;
import org.flowable.engine.HistoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.history.HistoricActivityInstance;
import org.flowable.engine.runtime.ActivityInstance;
import org.flowable.task.api.history.HistoricTaskInstance;
import org.flowable.task.service.history.NativeHistoricTaskInstanceQuery;
import org.flowable.variable.api.history.HistoricVariableInstance;
import org.junit.Test;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -116,4 +118,16 @@ public class InstanceTest extends AppTests {

System.out.println(taskInstanceList.size());
}

@Test
public void test2(){
// 获取节点处理结果
// Map<String, ProcessHandlerEnum> varMap = historyService.createHistoricVariableInstanceQuery()
// .processInstanceId("e99fe24c-d21c-11ed-af5d-02426daa406d")
// .variableNameLike("approve_%")
// .list().stream()
// .collect(Collectors.toMap(HistoricVariableInstance::getVariableName, v -> (ProcessHandlerEnum) v.getValue()));
runtimeService.removeVariable("564102ce-d1ff-11ed-b694-02424b2b849f","approve_7d2a191a-d1ff-11ed-b694-02424b2b849f");
System.out.println(1);
}
}

Loading…
Cancel
Save