|
@@ -100,6 +100,9 @@ public class TPssrApproveController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private ITPssrLaboratoryService tPssrLaboratoryService;
|
|
private ITPssrLaboratoryService tPssrLaboratoryService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private ITPssrMocService tPssrMocService;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private ITPssrCircuitService tPssrCircuitService;
|
|
private ITPssrCircuitService tPssrCircuitService;
|
|
|
|
|
|
@@ -178,6 +181,7 @@ public class TPssrApproveController extends BaseController {
|
|
case "kgfa"://开工方案
|
|
case "kgfa"://开工方案
|
|
break;
|
|
break;
|
|
case "sjbg"://设计变更
|
|
case "sjbg"://设计变更
|
|
|
|
+ doMocApprove(tPssrSubcontent);
|
|
break;
|
|
break;
|
|
case "mb"://盲板
|
|
case "mb"://盲板
|
|
doMbApprove(tPssrSubcontent);
|
|
doMbApprove(tPssrSubcontent);
|
|
@@ -205,13 +209,15 @@ public class TPssrApproveController extends BaseController {
|
|
case "dqzh"://氮气置换
|
|
case "dqzh"://氮气置换
|
|
break;
|
|
break;
|
|
case "xqf"://消气防设施
|
|
case "xqf"://消气防设施
|
|
- doXqfApprove(tPssrSubcontent);
|
|
|
|
|
|
+ doPatrolApprove(tPssrSubcontent);
|
|
break;
|
|
break;
|
|
case "aqss"://安全设施
|
|
case "aqss"://安全设施
|
|
break;
|
|
break;
|
|
case "txjk"://通讯监控
|
|
case "txjk"://通讯监控
|
|
|
|
+ doPatrolApprove(tPssrSubcontent);
|
|
break;
|
|
break;
|
|
case "bxsjcy"://便携式检测仪
|
|
case "bxsjcy"://便携式检测仪
|
|
|
|
+ doPatrolApprove(tPssrSubcontent);
|
|
break;
|
|
break;
|
|
case "gygc"://公用工程
|
|
case "gygc"://公用工程
|
|
break;
|
|
break;
|
|
@@ -376,12 +382,7 @@ public class TPssrApproveController extends BaseController {
|
|
tPssrApproveService.updateTPssrApprove(approve);
|
|
tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- try {
|
|
|
|
- runtimeService.deleteProcessInstance(exist.getProcessId(), "pssrMgrConfirm");
|
|
|
|
- historyService.deleteHistoricProcessInstance(exist.getProcessId());
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- logger.info("无运行时流程");
|
|
|
|
- }
|
|
|
|
|
|
+ delProcess(exist.getProcessId(), "pssrMgrConfirm");
|
|
|
|
|
|
// 开始申请流程
|
|
// 开始申请流程
|
|
long businessKey = exist.getApproveId();
|
|
long businessKey = exist.getApproveId();
|
|
@@ -496,6 +497,11 @@ public class TPssrApproveController extends BaseController {
|
|
}
|
|
}
|
|
logger.info("=======================confirmers:{}", confirmers);
|
|
logger.info("=======================confirmers:{}", confirmers);
|
|
|
|
|
|
|
|
+ List<String> confirmersList = new ArrayList<>();
|
|
|
|
+ if (StringUtils.isNotEmpty(confirmers)) {
|
|
|
|
+ confirmersList = Arrays.asList(confirmers.split(","));
|
|
|
|
+ }
|
|
|
|
+
|
|
TPssrApprove exist = new TPssrApprove();
|
|
TPssrApprove exist = new TPssrApprove();
|
|
exist.setSubId(sub.getId());
|
|
exist.setSubId(sub.getId());
|
|
List<TPssrApprove> tPssrApproves = tPssrApproveService.selectTPssrApproveList(exist);
|
|
List<TPssrApprove> tPssrApproves = tPssrApproveService.selectTPssrApproveList(exist);
|
|
@@ -510,49 +516,12 @@ public class TPssrApproveController extends BaseController {
|
|
approve.setCreaterCode(userId);
|
|
approve.setCreaterCode(userId);
|
|
approve.setCreatedate(new Date());
|
|
approve.setCreatedate(new Date());
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
-
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- if(StringUtils.isNotEmpty(confirmers)){
|
|
|
|
- variables.put("confirmers", Arrays.asList(confirmers.split(",")));
|
|
|
|
- }else {
|
|
|
|
- variables.put("confirmUsers", new ArrayList<>());
|
|
|
|
- }
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr1confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr1confirm(approve, confirmersList, sub.getConfirm());
|
|
} else {
|
|
} else {
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
- try {
|
|
|
|
- runtimeService.deleteProcessInstance(approve.getProcessId(), "pssr1confirm");
|
|
|
|
- historyService.deleteHistoricProcessInstance(approve.getProcessId());
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- logger.info("无运行时流程");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- List<String> confirmersList = new ArrayList<>();
|
|
|
|
- if (StringUtils.isNotEmpty(confirmers)) {
|
|
|
|
- confirmersList = Arrays.asList(confirmers.split(","));
|
|
|
|
- }
|
|
|
|
- variables.put("confirmUsers", confirmersList);
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr1confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ delProcess(approve.getProcessId(), "pssr1confirm");
|
|
|
|
+ pssr1confirm(approve, confirmersList, sub.getConfirm());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -601,29 +570,11 @@ public class TPssrApproveController extends BaseController {
|
|
approve.setCreaterCode(userId);
|
|
approve.setCreaterCode(userId);
|
|
approve.setCreatedate(new Date());
|
|
approve.setCreatedate(new Date());
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
-
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers1", new ArrayList<>(installer));
|
|
|
|
- variables.put("confirmUsers2", new ArrayList<>(remover));
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr2confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(installer), new ArrayList<>(remover), sub.getConfirm());
|
|
} else {
|
|
} else {
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
- try {
|
|
|
|
- runtimeService.deleteProcessInstance(approve.getProcessId(), "pssr2confirm");
|
|
|
|
- historyService.deleteHistoricProcessInstance(approve.getProcessId());
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- logger.info("无运行时流程");
|
|
|
|
- }
|
|
|
|
|
|
+ delProcess(approve.getProcessId(), "pssr2confirm");
|
|
|
|
|
|
tPssrBlind = new TPssrBlind();
|
|
tPssrBlind = new TPssrBlind();
|
|
tPssrBlind.setApproveStatus(1L);
|
|
tPssrBlind.setApproveStatus(1L);
|
|
@@ -643,20 +594,7 @@ public class TPssrApproveController extends BaseController {
|
|
remover.add(item.getReProcess());
|
|
remover.add(item.getReProcess());
|
|
remover.add(item.getReCoordinator());
|
|
remover.add(item.getReCoordinator());
|
|
}
|
|
}
|
|
-
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers1", new ArrayList<>(installer));
|
|
|
|
- variables.put("confirmUsers2", new ArrayList<>(remover));
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr2confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(installer), new ArrayList<>(remover), sub.getConfirm());
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -696,29 +634,11 @@ public class TPssrApproveController extends BaseController {
|
|
approve.setCreaterCode(userId);
|
|
approve.setCreaterCode(userId);
|
|
approve.setCreatedate(new Date());
|
|
approve.setCreatedate(new Date());
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
-
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers1", new ArrayList<>(lockeders));
|
|
|
|
- variables.put("confirmUsers2", new ArrayList<>(confirmers));
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr2confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(lockeders), new ArrayList<>(confirmers), sub.getConfirm());
|
|
} else {
|
|
} else {
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
- try {
|
|
|
|
- runtimeService.deleteProcessInstance(approve.getProcessId(), "pssr2confirm");
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- logger.info("无运行时流程");
|
|
|
|
- }
|
|
|
|
- historyService.deleteHistoricProcessInstance(approve.getProcessId());
|
|
|
|
|
|
+ delProcess(approve.getProcessId(), "pssr2confirm");
|
|
|
|
|
|
tPssrLock = new TPssrLock();
|
|
tPssrLock = new TPssrLock();
|
|
tPssrLock.setApproveStatus(1L);
|
|
tPssrLock.setApproveStatus(1L);
|
|
@@ -731,20 +651,7 @@ public class TPssrApproveController extends BaseController {
|
|
// 确认人2
|
|
// 确认人2
|
|
confirmers.add(item.getConfirm());
|
|
confirmers.add(item.getConfirm());
|
|
}
|
|
}
|
|
-
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers1", new ArrayList<>(lockeders));
|
|
|
|
- variables.put("confirmUsers2", new ArrayList<>(confirmers));
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr2confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(lockeders), new ArrayList<>(confirmers), sub.getConfirm());
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -787,28 +694,11 @@ public class TPssrApproveController extends BaseController {
|
|
approve.setCreatedate(new Date());
|
|
approve.setCreatedate(new Date());
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers1", new ArrayList<>(installer));
|
|
|
|
- variables.put("confirmUsers2", new ArrayList<>(remover));
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr2confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(installer), new ArrayList<>(remover), sub.getConfirm());
|
|
} else {
|
|
} else {
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
- try {
|
|
|
|
- runtimeService.deleteProcessInstance(approve.getProcessId(), "pssr2confirm");
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- logger.info("无运行时流程");
|
|
|
|
- }
|
|
|
|
- historyService.deleteHistoricProcessInstance(approve.getProcessId());
|
|
|
|
|
|
+ delProcess(approve.getProcessId(), "pssr2confirm");
|
|
|
|
|
|
tPssrPipe = new TPssrPipe();
|
|
tPssrPipe = new TPssrPipe();
|
|
tPssrPipe.setApproveStatus(1L);
|
|
tPssrPipe.setApproveStatus(1L);
|
|
@@ -819,25 +709,13 @@ public class TPssrApproveController extends BaseController {
|
|
//拆除人员
|
|
//拆除人员
|
|
remover.add(item.getConfirmer2());
|
|
remover.add(item.getConfirmer2());
|
|
}
|
|
}
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers1", new ArrayList<>(installer));
|
|
|
|
- variables.put("confirmUsers2", new ArrayList<>(remover));
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr2confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(installer), new ArrayList<>(remover), sub.getConfirm());
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- //消气防审批流程发起申请
|
|
|
|
- public void doXqfApprove(TPssrSubcontent sub) {
|
|
|
|
|
|
+ //巡检审批流程发起申请
|
|
|
|
+ public void doPatrolApprove(TPssrSubcontent sub) {
|
|
String userId = getUserId().toString();
|
|
String userId = getUserId().toString();
|
|
TPssrApprove tPssrApprove = tPssrApproveService.selectTPssrApproveBySubId(sub.getId());
|
|
TPssrApprove tPssrApprove = tPssrApproveService.selectTPssrApproveBySubId(sub.getId());
|
|
if (tPssrApprove == null) {
|
|
if (tPssrApprove == null) {
|
|
@@ -850,38 +728,11 @@ public class TPssrApproveController extends BaseController {
|
|
approve.setCreatedate(new Date());
|
|
approve.setCreatedate(new Date());
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers", new ArrayList<String>());
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr1confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr1confirm(tPssrApprove, new ArrayList<>(), sub.getConfirm());
|
|
} else {
|
|
} else {
|
|
- try {
|
|
|
|
- runtimeService.deleteProcessInstance(tPssrApprove.getProcessId(), "pssr1confirm");
|
|
|
|
- historyService.deleteHistoricProcessInstance(tPssrApprove.getProcessId());
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- logger.info("无运行时流程");
|
|
|
|
- }
|
|
|
|
|
|
+ delProcess(tPssrApprove.getProcessId(), "pssr1confirm");
|
|
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = tPssrApprove.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers", new ArrayList<String>());
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr1confirm", String.valueOf(businessKey), variables);
|
|
|
|
- tPssrApprove.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(tPssrApprove);
|
|
|
|
|
|
+ pssr1confirm(tPssrApprove, new ArrayList<>(), sub.getConfirm());
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -922,28 +773,11 @@ public class TPssrApproveController extends BaseController {
|
|
approve.setCreatedate(new Date());
|
|
approve.setCreatedate(new Date());
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers1", new ArrayList<>(installer));
|
|
|
|
- variables.put("confirmUsers2", new ArrayList<>(remover));
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr2confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(installer), new ArrayList<>(remover), sub.getConfirm());
|
|
} else {
|
|
} else {
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
- try {
|
|
|
|
- runtimeService.deleteProcessInstance(approve.getProcessId(), "pssr2confirm");
|
|
|
|
- historyService.deleteHistoricProcessInstance(approve.getProcessId());
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- logger.info("无运行时流程");
|
|
|
|
- }
|
|
|
|
|
|
+ delProcess(approve.getProcessId(), "pssr2confirm");
|
|
|
|
|
|
tPssrHygiene = new TPssrHygiene();
|
|
tPssrHygiene = new TPssrHygiene();
|
|
tPssrHygiene.setApproveStatus(1L);
|
|
tPssrHygiene.setApproveStatus(1L);
|
|
@@ -953,22 +787,9 @@ public class TPssrApproveController extends BaseController {
|
|
installer.add(item.getConfirm1());
|
|
installer.add(item.getConfirm1());
|
|
|
|
|
|
//拆除人员
|
|
//拆除人员
|
|
- remover.add(item.getConfirm1());
|
|
|
|
|
|
+ remover.add(item.getConfirm2());
|
|
}
|
|
}
|
|
-
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers1", new ArrayList<>(installer));
|
|
|
|
- variables.put("confirmUsers2", new ArrayList<>(remover));
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr2confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(installer), new ArrayList<>(remover), sub.getConfirm());
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1008,29 +829,11 @@ public class TPssrApproveController extends BaseController {
|
|
approve.setCreaterCode(userId);
|
|
approve.setCreaterCode(userId);
|
|
approve.setCreatedate(new Date());
|
|
approve.setCreatedate(new Date());
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
-
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers1", new ArrayList<>(installer));
|
|
|
|
- variables.put("confirmUsers2", new ArrayList<>(remover));
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr2confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(installer), new ArrayList<>(remover), sub.getConfirm());
|
|
} else {
|
|
} else {
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
- try {
|
|
|
|
- runtimeService.deleteProcessInstance(approve.getProcessId(), "pssr2confirm");
|
|
|
|
- historyService.deleteHistoricProcessInstance(approve.getProcessId());
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- logger.info("无运行时流程");
|
|
|
|
- }
|
|
|
|
|
|
+ delProcess(approve.getProcessId(), "pssr2confirm");
|
|
|
|
|
|
tPssrCleaning = new TPssrCleaning();
|
|
tPssrCleaning = new TPssrCleaning();
|
|
tPssrCleaning.setApproveStatus(1L);
|
|
tPssrCleaning.setApproveStatus(1L);
|
|
@@ -1040,22 +843,9 @@ public class TPssrApproveController extends BaseController {
|
|
installer.add(item.getConfirm1());
|
|
installer.add(item.getConfirm1());
|
|
|
|
|
|
//拆除人员
|
|
//拆除人员
|
|
- remover.add(item.getConfirm1());
|
|
|
|
|
|
+ remover.add(item.getConfirm2());
|
|
}
|
|
}
|
|
-
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers1", new ArrayList<>(installer));
|
|
|
|
- variables.put("confirmUsers2", new ArrayList<>(remover));
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr2confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(installer), new ArrayList<>(remover), sub.getConfirm());
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1095,29 +885,11 @@ public class TPssrApproveController extends BaseController {
|
|
approve.setCreaterCode(userId);
|
|
approve.setCreaterCode(userId);
|
|
approve.setCreatedate(new Date());
|
|
approve.setCreatedate(new Date());
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
-
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers1", new ArrayList<>(installer));
|
|
|
|
- variables.put("confirmUsers2", new ArrayList<>(remover));
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr2confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(installer), new ArrayList<>(remover), sub.getConfirm());
|
|
} else {
|
|
} else {
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
- try {
|
|
|
|
- runtimeService.deleteProcessInstance(approve.getProcessId(), "pssr2confirm");
|
|
|
|
- historyService.deleteHistoricProcessInstance(approve.getProcessId());
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- logger.info("无运行时流程");
|
|
|
|
- }
|
|
|
|
|
|
+ delProcess(approve.getProcessId(), "pssr2confirm");
|
|
|
|
|
|
tPssrAirtight = new TPssrAirtight();
|
|
tPssrAirtight = new TPssrAirtight();
|
|
tPssrAirtight.setApproveStatus(1L);
|
|
tPssrAirtight.setApproveStatus(1L);
|
|
@@ -1127,22 +899,9 @@ public class TPssrApproveController extends BaseController {
|
|
installer.add(item.getConfirm1());
|
|
installer.add(item.getConfirm1());
|
|
|
|
|
|
//拆除人员
|
|
//拆除人员
|
|
- remover.add(item.getConfirm1());
|
|
|
|
|
|
+ remover.add(item.getConfirm2());
|
|
}
|
|
}
|
|
-
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers1", new ArrayList<>(installer));
|
|
|
|
- variables.put("confirmUsers2", new ArrayList<>(remover));
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr2confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(installer), new ArrayList<>(remover), sub.getConfirm());
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1182,29 +941,11 @@ public class TPssrApproveController extends BaseController {
|
|
approve.setCreaterCode(userId);
|
|
approve.setCreaterCode(userId);
|
|
approve.setCreatedate(new Date());
|
|
approve.setCreatedate(new Date());
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
-
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers1", new ArrayList<>(installer));
|
|
|
|
- variables.put("confirmUsers2", new ArrayList<>(remover));
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr2confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(installer), new ArrayList<>(remover), sub.getConfirm());
|
|
} else {
|
|
} else {
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
- try {
|
|
|
|
- runtimeService.deleteProcessInstance(approve.getProcessId(), "pssr2confirm");
|
|
|
|
- historyService.deleteHistoricProcessInstance(approve.getProcessId());
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- logger.info("无运行时流程");
|
|
|
|
- }
|
|
|
|
|
|
+ delProcess(approve.getProcessId(), "pssr2confirm");
|
|
|
|
|
|
tPssrLaboratory = new TPssrLaboratory();
|
|
tPssrLaboratory = new TPssrLaboratory();
|
|
tPssrLaboratory.setApproveStatus(1L);
|
|
tPssrLaboratory.setApproveStatus(1L);
|
|
@@ -1214,22 +955,9 @@ public class TPssrApproveController extends BaseController {
|
|
installer.add(item.getConfirm1());
|
|
installer.add(item.getConfirm1());
|
|
|
|
|
|
//拆除人员
|
|
//拆除人员
|
|
- remover.add(item.getConfirm1());
|
|
|
|
|
|
+ remover.add(item.getConfirm2());
|
|
}
|
|
}
|
|
-
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers1", new ArrayList<>(installer));
|
|
|
|
- variables.put("confirmUsers2", new ArrayList<>(remover));
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr2confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(installer), new ArrayList<>(remover), sub.getConfirm());
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1270,28 +998,11 @@ public class TPssrApproveController extends BaseController {
|
|
approve.setCreatedate(new Date());
|
|
approve.setCreatedate(new Date());
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
tPssrApproveService.insertTPssrApprove(approve);
|
|
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers1", new ArrayList<>(installer));
|
|
|
|
- variables.put("confirmUsers2", new ArrayList<>(remover));
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr2confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(installer), new ArrayList<>(remover), sub.getConfirm());
|
|
} else {
|
|
} else {
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
// 已存在流程时,删除旧流程,重新发起
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
TPssrApprove approve = tPssrApproves.get(0);
|
|
- try {
|
|
|
|
- runtimeService.deleteProcessInstance(approve.getProcessId(), "pssr2confirm");
|
|
|
|
- historyService.deleteHistoricProcessInstance(approve.getProcessId());
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- logger.info("无运行时流程");
|
|
|
|
- }
|
|
|
|
|
|
+ delProcess(approve.getProcessId(), "pssr2confirm");
|
|
|
|
|
|
tPssrCircuit = new TPssrCircuit();
|
|
tPssrCircuit = new TPssrCircuit();
|
|
tPssrCircuit.setApproveStatus(1L);
|
|
tPssrCircuit.setApproveStatus(1L);
|
|
@@ -1301,24 +1012,145 @@ public class TPssrApproveController extends BaseController {
|
|
installer.add(item.getConfirm1());
|
|
installer.add(item.getConfirm1());
|
|
|
|
|
|
//拆除人员
|
|
//拆除人员
|
|
- remover.add(item.getConfirm1());
|
|
|
|
|
|
+ remover.add(item.getConfirm2());
|
|
}
|
|
}
|
|
|
|
|
|
- // 开始申请流程
|
|
|
|
- long businessKey = approve.getApproveId();
|
|
|
|
- //开始工作流、监听
|
|
|
|
- Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
- Map<String, Object> variables = new HashMap<>();
|
|
|
|
- variables.put("applyUser", userId);
|
|
|
|
- variables.put("confirmUsers1", new ArrayList<>(installer));
|
|
|
|
- variables.put("confirmUsers2", new ArrayList<>(remover));
|
|
|
|
- variables.put("chargePerson", sub.getConfirm());
|
|
|
|
- //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
- ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr2confirm", String.valueOf(businessKey), variables);
|
|
|
|
- approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
- tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(installer), new ArrayList<>(remover), sub.getConfirm());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 设计变更发起流程
|
|
|
|
+ */
|
|
|
|
+ private void doMocApprove(TPssrSubcontent sub) {
|
|
|
|
+ String userId = getUserId().toString();
|
|
|
|
+ //修改状态
|
|
|
|
+ TPssrMoc tPssrMoc = new TPssrMoc();
|
|
|
|
+ tPssrMoc.setApproveStatus(0L);
|
|
|
|
+ tPssrMoc.setSubId(sub.getId());
|
|
|
|
+ Set<String> confirm1 = new HashSet<>();
|
|
|
|
+ Set<String> confirm2 = new HashSet<>();
|
|
|
|
+ for (TPssrMoc item : tPssrMocService.selectTPssrMocList(tPssrMoc)) {
|
|
|
|
+ item.setApproveStatus(1L);
|
|
|
|
+ item.setUpdatedate(new Date());
|
|
|
|
+ item.setUpdaterCode(userId);
|
|
|
|
+ tPssrMocService.updateTPssrMoc(item);
|
|
|
|
+
|
|
|
|
+ // 安装人员
|
|
|
|
+ confirm1.add(item.getConfirm1());
|
|
|
|
+
|
|
|
|
+ //拆除人员
|
|
|
|
+ confirm2.add(item.getConfirm2());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ TPssrApprove exist = new TPssrApprove();
|
|
|
|
+ exist.setSubId(sub.getId());
|
|
|
|
+ List<TPssrApprove> tPssrApproves = tPssrApproveService.selectTPssrApproveList(exist);
|
|
|
|
+ if (CollectionUtil.isEmpty(tPssrApproves)) {
|
|
|
|
+ //新增审批数据
|
|
|
|
+ TPssrApprove approve = new TPssrApprove();
|
|
|
|
+ approve.setSubId(sub.getId());
|
|
|
|
+ approve.setApNo(DateUtils.dateTimeNow() + userId);
|
|
|
|
+ approve.setApproveStatus(1L);
|
|
|
|
+ approve.setSubCharge(sub.getConfirm());
|
|
|
|
+ approve.setCreaterCode(userId);
|
|
|
|
+ approve.setCreatedate(new Date());
|
|
|
|
+ tPssrApproveService.insertTPssrApprove(approve);
|
|
|
|
+
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(confirm1), new ArrayList<>(confirm2), sub.getConfirm());
|
|
|
|
+ } else {
|
|
|
|
+ // 已存在流程时,删除旧流程,重新发起
|
|
|
|
+ TPssrApprove approve = tPssrApproves.get(0);
|
|
|
|
+ delProcess(approve.getProcessId(), "pssr2confirm");
|
|
|
|
+
|
|
|
|
+ tPssrMoc = new TPssrMoc();
|
|
|
|
+ tPssrMoc.setApproveStatus(1L);
|
|
|
|
+ tPssrMoc.setSubId(sub.getId());
|
|
|
|
+ for (TPssrMoc item : tPssrMocService.selectTPssrMocList(tPssrMoc)) {
|
|
|
|
+ // 安装人员
|
|
|
|
+ confirm1.add(item.getConfirm1());
|
|
|
|
+
|
|
|
|
+ //拆除人员
|
|
|
|
+ confirm2.add(item.getConfirm2());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ pssr2confirm(approve, new ArrayList<>(confirm1), new ArrayList<>(confirm2), sub.getConfirm());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 单确认人发起流程
|
|
|
|
+ */
|
|
|
|
+ private void pssr1confirm(TPssrApprove approve, List<String> confirmUsers, String confirm) {
|
|
|
|
+ String userId = getUserId().toString();
|
|
|
|
+
|
|
|
|
+ // 开始申请流程
|
|
|
|
+ long businessKey = approve.getApproveId();
|
|
|
|
+ //开始工作流、监听
|
|
|
|
+ Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
+ Map<String, Object> variables = new HashMap<>();
|
|
|
|
+ variables.put("applyUser", userId);
|
|
|
|
+ variables.put("confirmUsers", confirmUsers);
|
|
|
|
+ variables.put("chargePerson", confirm);
|
|
|
|
+ //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
+ ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr1confirm", String.valueOf(businessKey), variables);
|
|
|
|
+ approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
+ tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 双确认人发起流程
|
|
|
|
+ */
|
|
|
|
+ private void pssr2confirm(TPssrApprove approve, List<String> confirmUsers1, List<String> confirmUsers2, String confirm) {
|
|
|
|
+ String userId = getUserId().toString();
|
|
|
|
+
|
|
|
|
+ // 开始申请流程
|
|
|
|
+ long businessKey = approve.getApproveId();
|
|
|
|
+ //开始工作流、监听
|
|
|
|
+ Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
+ Map<String, Object> variables = new HashMap<>();
|
|
|
|
+ variables.put("applyUser", userId);
|
|
|
|
+ variables.put("confirmUsers1", confirmUsers1);
|
|
|
|
+ variables.put("confirmUsers2", confirmUsers2);
|
|
|
|
+ variables.put("chargePerson", confirm);
|
|
|
|
+ //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
+ ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr2confirm", String.valueOf(businessKey), variables);
|
|
|
|
+ approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
+ tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 三确认人发起流程
|
|
|
|
+ */
|
|
|
|
+ private void pssr3confirm(TPssrApprove approve, List<String> confirmUsers1, List<String> confirmUsers2, List<String> confirmUsers3, String confirm) {
|
|
|
|
+ String userId = getUserId().toString();
|
|
|
|
+
|
|
|
|
+ // 开始申请流程
|
|
|
|
+ long businessKey = approve.getApproveId();
|
|
|
|
+ //开始工作流、监听
|
|
|
|
+ Authentication.setAuthenticatedUserId(userId);//设置当前申请人
|
|
|
|
+ Map<String, Object> variables = new HashMap<>();
|
|
|
|
+ variables.put("applyUser", userId);
|
|
|
|
+ variables.put("confirmUsers1", confirmUsers1);
|
|
|
|
+ variables.put("confirmUsers2", confirmUsers2);
|
|
|
|
+ variables.put("confirmUsers3", confirmUsers3);
|
|
|
|
+ variables.put("chargePerson", confirm);
|
|
|
|
+ //采用key来启动流程定义并设置流程变量,返回流程实例
|
|
|
|
+ ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr3confirm", String.valueOf(businessKey), variables);
|
|
|
|
+ approve.setProcessId(pi.getProcessInstanceId());
|
|
|
|
+ tPssrApproveService.updateTPssrApprove(approve);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除已存在流程
|
|
|
|
+ */
|
|
|
|
+ private void delProcess(String processId, String processName) {
|
|
|
|
+ try {
|
|
|
|
+ runtimeService.deleteProcessInstance(processId, processName);
|
|
|
|
+ historyService.deleteHistoricProcessInstance(processId);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.info("无运行时流程");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|