|
|
|
@ -454,7 +454,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
variables.put("approvd", approve.getResult());
|
|
|
|
|
OcrTaskchildPicture model = ocrTaskchildPictureService.getById(Long.parseLong(flowTaskInfo.getFormId()));
|
|
|
|
|
if (approve.getResult()) {
|
|
|
|
|
disposeSucceedTask(task, processDefinition, variables, model, flowTaskInfo.getFormId(), userToken, approve);
|
|
|
|
|
disposeSucceedTask(task, processDefinition, variables, model, flowTaskInfo.getFormId(), userToken, approve,approve.getDeptid());
|
|
|
|
|
} else {
|
|
|
|
|
disposeFailureTask(task, flowTaskInfo.getFormId(), variables, approve);
|
|
|
|
|
|
|
|
|
@ -474,10 +474,11 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
/**
|
|
|
|
|
* 处理审批成功任务
|
|
|
|
|
*/
|
|
|
|
|
private void disposeSucceedTask(Task task, ProcessDefinition processDefinition, Map<String, Object> variables, OcrTaskchildPicture model, String formId, UserToken userToken, FlowApprove approve) throws Exception {
|
|
|
|
|
private void disposeSucceedTask(Task task, ProcessDefinition processDefinition, Map<String, Object> variables,
|
|
|
|
|
OcrTaskchildPicture model, String formId, UserToken userToken, FlowApprove approve,String deptid) throws Exception {
|
|
|
|
|
//进入下一个节点
|
|
|
|
|
taskService.complete(task.getId(), variables);
|
|
|
|
|
updateAssignee(task.getProcessInstanceId(), task.getProcessDefinitionId(), processDefinition);
|
|
|
|
|
updateAssignee(task.getProcessInstanceId(), task.getProcessDefinitionId(), processDefinition,deptid);
|
|
|
|
|
String category = processDefinition.getCategory();
|
|
|
|
|
Category categoryDto = this.categoryService.getCategory(category);
|
|
|
|
|
IFormCustomService iFormCustomService = SpringUtils.getBean(categoryDto.getServicename());
|
|
|
|
@ -581,10 +582,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
*
|
|
|
|
|
* @param processDefinition
|
|
|
|
|
*/
|
|
|
|
|
public void updateAssignee(String processInstanceId, String processDefinitionId, ProcessDefinition processDefinition) {
|
|
|
|
|
public void updateAssignee(String processInstanceId, String processDefinitionId, ProcessDefinition processDefinition,String deptid) {
|
|
|
|
|
|
|
|
|
|
//如果是多个候选人或者是候选组,做任务拾取
|
|
|
|
|
FlowTaskCompleteVO flowTaskCompleteVO = updateNowTaskAssignee(processInstanceId, processDefinitionId);
|
|
|
|
|
FlowTaskCompleteVO flowTaskCompleteVO = updateNowTaskAssignee(processInstanceId, processDefinitionId,deptid);
|
|
|
|
|
|
|
|
|
|
if (null != flowTaskCompleteVO) {
|
|
|
|
|
|
|
|
|
@ -673,7 +674,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
*
|
|
|
|
|
* @param processInstanceId
|
|
|
|
|
*/
|
|
|
|
|
public FlowTaskCompleteVO updateNowTaskAssignee(String processInstanceId, String processDefinitionId) {
|
|
|
|
|
public FlowTaskCompleteVO updateNowTaskAssignee(String processInstanceId, String processDefinitionId,String deptid) {
|
|
|
|
|
|
|
|
|
|
FlowTaskCompleteVO flowTaskCompleteVO = null;
|
|
|
|
|
BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId);
|
|
|
|
@ -710,7 +711,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
//发起人员登录账号
|
|
|
|
|
String startUserId = hi.getStartUserId();
|
|
|
|
|
//通过候选组主键,查询审批人员信息,并自动拾取
|
|
|
|
|
loginuser = candidateuserService.getClaimUser(startUserId, groupid);
|
|
|
|
|
loginuser = candidateuserService.getClaimUser(startUserId, groupid,deptid);
|
|
|
|
|
if (StringUtils.isNotBlank(loginuser)) {
|
|
|
|
|
taskService.claim(task.getId(), loginuser);
|
|
|
|
|
}
|
|
|
|
@ -1764,7 +1765,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ResultVo removeTask(String fromid, String taskid) {
|
|
|
|
|
public ResultVo removeTask(String fromid, String taskid,String deptid) {
|
|
|
|
|
// 获取当前任务
|
|
|
|
|
OcrTaskchildPicture ocrTaskchildPicture = this.ocrTaskchildPictureService.selectDtoById(Long.parseLong(fromid));
|
|
|
|
|
|
|
|
|
@ -1783,7 +1784,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
String historyProcessDefinitionId = terminatedInstances.get(0).getProcessDefinitionId();
|
|
|
|
|
|
|
|
|
|
boolean isStart = iFlowInstanceService.startProcessInstanceById(historyProcessDefinitionId, ocrTaskchildPicture.getCreateusername(),
|
|
|
|
|
ocrTaskchildPicture.getCreateuser(), ocrTaskchildPicture.getId().toString(), category.getServicename());
|
|
|
|
|
ocrTaskchildPicture.getCreateuser(), ocrTaskchildPicture.getId().toString(), category.getServicename(),deptid);
|
|
|
|
|
|
|
|
|
|
if (isStart) {
|
|
|
|
|
ResultVoUtil.success();
|
|
|
|
@ -1803,7 +1804,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
Category category = this.categoryService.getById(ocrTaskchildPicture.getCategoryid());
|
|
|
|
|
|
|
|
|
|
boolean isStart = iFlowInstanceService.startProcessInstanceById(task.getProcessDefinitionId(), ocrTaskchildPicture.getCreateusername(),
|
|
|
|
|
ocrTaskchildPicture.getCreateuser(), ocrTaskchildPicture.getId().toString(), category.getServicename());
|
|
|
|
|
ocrTaskchildPicture.getCreateuser(), ocrTaskchildPicture.getId().toString(), category.getServicename(),deptid);
|
|
|
|
|
|
|
|
|
|
if (isStart) {
|
|
|
|
|
ResultVoUtil.success();
|
|
|
|
|