174-撤回流程修改
This commit is contained in:
@@ -158,42 +158,10 @@ public class BLApplicantAfter implements TaskListener{
|
|||||||
String esId1 = object.getString("esId1");
|
String esId1 = object.getString("esId1");
|
||||||
String esId2 = object.getString("esId2");
|
String esId2 = object.getString("esId2");
|
||||||
|
|
||||||
List<EsPrcRelation> esPrcRelationList1 = esPrcRelationService.list(esId1);
|
|
||||||
if (esPrcRelationList1 != null && !esPrcRelationList1.isEmpty()) {
|
|
||||||
String prcId1 = esPrcRelationList1.get(0).getPrcId();
|
|
||||||
List<Task> list1 = taskService.createTaskQuery().processInstanceId(prcId1).active().list();
|
|
||||||
if (list1 != null && !list1.isEmpty()) {
|
|
||||||
// 删除正在运行中的流程根据流程实例ID
|
|
||||||
runtimeService.deleteProcessInstance(prcId1, "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
List<EsPrcRelation> esPrcRelationList2 = esPrcRelationService.list(esId2);
|
|
||||||
if (esPrcRelationList2 != null && !esPrcRelationList2.isEmpty()) {
|
|
||||||
String prcId2 = esPrcRelationList2.get(0).getPrcId();
|
|
||||||
List<Task> list2 = taskService.createTaskQuery().processInstanceId(prcId2).active().list();
|
|
||||||
if (list2 != null && !list2.isEmpty()) {
|
|
||||||
// 删除正在运行中的流程根据流程实例ID
|
|
||||||
runtimeService.deleteProcessInstance(prcId2, "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除旧的 计划和流程关联关系, 因为 一条计划只对应一条企标制修订流程
|
// 删除旧的 计划和流程关联关系, 因为 一条计划只对应一条企标制修订流程
|
||||||
esPrcRelationService.delEsPrcRelation(esId1);
|
esPrcRelationService.delEsPrcRelation(esId1);
|
||||||
esPrcRelationService.delEsPrcRelation(esId2);
|
esPrcRelationService.delEsPrcRelation(esId2);
|
||||||
|
|
||||||
} else if ("2".equals(type) || "3".equals(type) || "4".equals(type)) {
|
|
||||||
String esId = object.getString("esId");
|
|
||||||
List<EsPrcRelation> esPrcRelationList = esPrcRelationService.list(esId);
|
|
||||||
if (esPrcRelationList != null && !esPrcRelationList.isEmpty()) {
|
|
||||||
String prcId = esPrcRelationList.get(0).getPrcId();
|
|
||||||
List<Task> list = taskService.createTaskQuery().processInstanceId(esPrcRelationList.get(0).getPrcId()).active().list();
|
|
||||||
if (list != null && !list.isEmpty()) {
|
|
||||||
// 删除正在运行中的流程根据流程实例ID
|
|
||||||
runtimeService.deleteProcessInstance(prcId, "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// 修改 计划和流程关联关系
|
// 修改 计划和流程关联关系
|
||||||
esPrcRelationService.modifyEsPrcRelation(object.getString("nowEsId"), delegateTask.getProcessInstanceId(), null, null);
|
esPrcRelationService.modifyEsPrcRelation(object.getString("nowEsId"), delegateTask.getProcessInstanceId(), null, null);
|
||||||
|
|||||||
+83
@@ -12,8 +12,11 @@ import com.ydw.bat.wkflow.util.SpringContextUtil;
|
|||||||
import net.sf.json.JSONArray;
|
import net.sf.json.JSONArray;
|
||||||
import net.sf.json.util.JSONTokener;
|
import net.sf.json.util.JSONTokener;
|
||||||
import org.activiti.engine.ActivitiException;
|
import org.activiti.engine.ActivitiException;
|
||||||
|
import org.activiti.engine.RuntimeService;
|
||||||
|
import org.activiti.engine.TaskService;
|
||||||
import org.activiti.engine.delegate.DelegateTask;
|
import org.activiti.engine.delegate.DelegateTask;
|
||||||
import org.activiti.engine.delegate.TaskListener;
|
import org.activiti.engine.delegate.TaskListener;
|
||||||
|
import org.activiti.engine.task.Task;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@@ -38,6 +41,10 @@ public class ProcessStep4After implements TaskListener {
|
|||||||
|
|
||||||
IEsPrcRelationService esPrcRelationService = SpringContextUtil.getBean(IEsPrcRelationService.class);
|
IEsPrcRelationService esPrcRelationService = SpringContextUtil.getBean(IEsPrcRelationService.class);
|
||||||
|
|
||||||
|
TaskService taskService = SpringContextUtil.getBean(TaskService.class);
|
||||||
|
|
||||||
|
RuntimeService runtimeService = SpringContextUtil.getBean(RuntimeService.class);
|
||||||
|
|
||||||
//根据流程id找到流程信息
|
//根据流程id找到流程信息
|
||||||
QueryWrapper<Datas> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<Datas> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("ACTI_TASK_ID", delegateTask.getId());
|
queryWrapper.eq("ACTI_TASK_ID", delegateTask.getId());
|
||||||
@@ -267,5 +274,81 @@ public class ProcessStep4After implements TaskListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 撤回对应的计划管控流程
|
||||||
|
//1合并 2延期 3取消 4更名 5立项
|
||||||
|
if (StringUtils.isNotBlank(type)) {
|
||||||
|
if ("1".equals(type)) {
|
||||||
|
String esId1 = object.getString("esId1");
|
||||||
|
String esId2 = object.getString("esId2");
|
||||||
|
|
||||||
|
List<EsPrcRelation> esPrcRelationList1 = esPrcRelationService.list(esId1);
|
||||||
|
if (esPrcRelationList1 != null && !esPrcRelationList1.isEmpty()) {
|
||||||
|
String prcIdGk1 = esPrcRelationList1.get(0).getPrcIdGk();
|
||||||
|
List<Task> list1 = taskService.createTaskQuery().processInstanceId(prcIdGk1).active().list();
|
||||||
|
if (list1 != null && !list1.isEmpty()) {
|
||||||
|
String nowTaskInfo1 = list1.get(0).getName();
|
||||||
|
if ("技术标准起草".equals(nowTaskInfo1)) {
|
||||||
|
// 删除正在运行中的流程根据流程实例ID
|
||||||
|
runtimeService.deleteProcessInstance(prcIdGk1, "");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
String prcId1 = esPrcRelationList1.get(0).getPrcId();
|
||||||
|
List<Task> list = taskService.createTaskQuery().processInstanceId(prcId1).active().list();
|
||||||
|
if (list != null && !list.isEmpty()) {
|
||||||
|
// 删除正在运行中的流程根据流程实例ID
|
||||||
|
runtimeService.deleteProcessInstance(prcId1, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<EsPrcRelation> esPrcRelationList2 = esPrcRelationService.list(esId2);
|
||||||
|
if (esPrcRelationList2 != null && !esPrcRelationList2.isEmpty()) {
|
||||||
|
String prcIdGk2 = esPrcRelationList2.get(0).getPrcIdGk();
|
||||||
|
List<Task> list2 = taskService.createTaskQuery().processInstanceId(prcIdGk2).active().list();
|
||||||
|
if (list2 != null && !list2.isEmpty()) {
|
||||||
|
String nowTaskInfo2 = list2.get(0).getName();
|
||||||
|
if ("技术标准起草".equals(nowTaskInfo2)) {
|
||||||
|
// 删除正在运行中的流程根据流程实例ID
|
||||||
|
runtimeService.deleteProcessInstance(prcIdGk2, "");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
String prcId2 = esPrcRelationList2.get(0).getPrcId();
|
||||||
|
List<Task> list = taskService.createTaskQuery().processInstanceId(prcId2).active().list();
|
||||||
|
if (list != null && !list.isEmpty()) {
|
||||||
|
// 删除正在运行中的流程根据流程实例ID
|
||||||
|
runtimeService.deleteProcessInstance(prcId2, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除旧的 计划和流程关联关系, 因为 一条计划只对应一条企标制修订流程
|
||||||
|
esPrcRelationService.delEsPrcRelation(esId1);
|
||||||
|
esPrcRelationService.delEsPrcRelation(esId2);
|
||||||
|
|
||||||
|
} else if ("2".equals(type) || "3".equals(type) || "4".equals(type)) {
|
||||||
|
String esId = object.getString("esId");
|
||||||
|
List<EsPrcRelation> esPrcRelationList = esPrcRelationService.list(esId);
|
||||||
|
if (esPrcRelationList != null && !esPrcRelationList.isEmpty()) {
|
||||||
|
String prcIdGk = esPrcRelationList.get(0).getPrcIdGk();
|
||||||
|
List<Task> listGk = taskService.createTaskQuery().processInstanceId(esPrcRelationList.get(0).getPrcIdGk()).active().list();
|
||||||
|
if (listGk != null && !listGk.isEmpty()) {
|
||||||
|
String nowTaskInfo = listGk.get(0).getName();
|
||||||
|
if ("技术标准起草".equals(nowTaskInfo)) {
|
||||||
|
// 删除正在运行中的流程根据流程实例ID
|
||||||
|
runtimeService.deleteProcessInstance(prcIdGk, "");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
String prcId = esPrcRelationList.get(0).getPrcId();
|
||||||
|
List<Task> list = taskService.createTaskQuery().processInstanceId(prcId).active().list();
|
||||||
|
if (list != null && !list.isEmpty()) {
|
||||||
|
// 删除正在运行中的流程根据流程实例ID
|
||||||
|
runtimeService.deleteProcessInstance(prcId, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user