只给有效账号发送审批任务
parent
5ba593f16e
commit
613864fbb4
|
@ -94,7 +94,7 @@ public class ActProcInsController extends BaseController {
|
||||||
variables.put(ActConstant.START_PROCESS_USERID, InterfaceUtil.getAdminId());
|
variables.put(ActConstant.START_PROCESS_USERID, InterfaceUtil.getAdminId());
|
||||||
String procInsId = null;
|
String procInsId = null;
|
||||||
try {
|
try {
|
||||||
procInsId = actProcInsService.startProcessInstance(procDefKey, "", variables);
|
procInsId = actProcInsService.startProcessInstance(procDefKey, "0", variables);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("", e);
|
logger.error("", e);
|
||||||
return ResponseMsg.buildFailedMsg("流程启动失败:" + e.getMessage());
|
return ResponseMsg.buildFailedMsg("流程启动失败:" + e.getMessage());
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package cn.palmte.work.service;
|
package cn.palmte.work.service;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.palmte.work.model.Admin;
|
||||||
|
import cn.palmte.work.model.AdminRepository;
|
||||||
import cn.palmte.work.utils.ActUtil;
|
import cn.palmte.work.utils.ActUtil;
|
||||||
import org.activiti.engine.RuntimeService;
|
import org.activiti.engine.RuntimeService;
|
||||||
import org.activiti.engine.delegate.DelegateExecution;
|
import org.activiti.engine.delegate.DelegateExecution;
|
||||||
|
@ -34,6 +36,9 @@ public class ActListenerService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ActUtil actUtil;
|
private ActUtil actUtil;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AdminRepository adminRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务节点创建后监听 动态设置审批人
|
* 任务节点创建后监听 动态设置审批人
|
||||||
*
|
*
|
||||||
|
@ -89,7 +94,14 @@ public class ActListenerService {
|
||||||
try {
|
try {
|
||||||
int adminId = 0;
|
int adminId = 0;
|
||||||
if (!candidateUsers.isEmpty()) {
|
if (!candidateUsers.isEmpty()) {
|
||||||
adminId = Integer.parseInt(candidateUsers.get(0));
|
for (String id : candidateUsers) {
|
||||||
|
Admin one = adminRepository.findOne(Integer.parseInt(id));
|
||||||
|
if (!one.isDeleted() && one.getEnabled() == 1) {
|
||||||
|
//找到有效账号 发送任务
|
||||||
|
adminId = one.getId();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
projectInstanceService.updateApprover(Integer.parseInt(businessKey), adminId);
|
projectInstanceService.updateApprover(Integer.parseInt(businessKey), adminId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -254,7 +254,6 @@
|
||||||
|
|
||||||
var startProcIns = function (procDefKey) {
|
var startProcIns = function (procDefKey) {
|
||||||
var params = {
|
var params = {
|
||||||
projectId: 1,
|
|
||||||
projectType: 3
|
projectType: 3
|
||||||
};
|
};
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|
Loading…
Reference in New Issue