|
|
@ -453,13 +453,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
}
|
|
|
|
}
|
|
|
|
variables.put("approvd", taskVO.getApprovd());
|
|
|
|
variables.put("approvd", taskVO.getApprovd());
|
|
|
|
OcrTaskchildPicture model = ocrTaskchildPictureService.getById(Long.parseLong(taskVO.getFormid()));
|
|
|
|
OcrTaskchildPicture model = ocrTaskchildPictureService.getById(Long.parseLong(taskVO.getFormid()));
|
|
|
|
|
|
|
|
|
|
|
|
//只有同意,再进行候选人设置
|
|
|
|
//只有同意,再进行候选人设置
|
|
|
|
if (taskVO.getApprovd()) {
|
|
|
|
if (taskVO.getApprovd()) {
|
|
|
|
//进入下一个节点
|
|
|
|
//进入下一个节点
|
|
|
|
taskService.complete(task.getId(), variables);
|
|
|
|
taskService.complete(task.getId(), variables);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//判断是否存在表单二次提交
|
|
|
|
//判断是否存在表单二次提交
|
|
|
|
if (StringUtils.isNotBlank(taskVO.getDocumentation()) && taskVO.getDocumentation().equals(SystemConstantsOa.OA_TASK_COMPLETE_FORM)) {
|
|
|
|
if (StringUtils.isNotBlank(taskVO.getDocumentation()) && taskVO.getDocumentation().equals(SystemConstantsOa.OA_TASK_COMPLETE_FORM)) {
|
|
|
|
//获取流程类型
|
|
|
|
//获取流程类型
|
|
|
@ -493,13 +490,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
updateAssignee(task.getProcessInstanceId(), task.getProcessDefinitionId(), processDefinition);
|
|
|
|
updateAssignee(task.getProcessInstanceId(), task.getProcessDefinitionId(), processDefinition);
|
|
|
|
|
|
|
|
|
|
|
|
String category = processDefinition.getCategory();
|
|
|
|
String category = processDefinition.getCategory();
|
|
|
|
Category categoryDto = this.categoryService.getCategory(category);
|
|
|
|
Category categoryDto = this.categoryService.getCategory(category);
|
|
|
|
IFormCustomService iFormCustomService = SpringUtils.getBean(categoryDto.getServicename());
|
|
|
|
IFormCustomService iFormCustomService = SpringUtils.getBean(categoryDto.getServicename());
|
|
|
|
|
|
|
|
|
|
|
|
FlowModelVO formData = iFormCustomService.getForm(taskVO.getFormid());
|
|
|
|
FlowModelVO formData = iFormCustomService.getForm(taskVO.getFormid());
|
|
|
|
|
|
|
|
|
|
|
|
List<Task> taskList = this.nowRunTask(formData.getProcessInstanceId(), formData.getProcessdefinitionid());
|
|
|
|
List<Task> taskList = this.nowRunTask(formData.getProcessInstanceId(), formData.getProcessdefinitionid());
|
|
|
|
Task taskData = null;
|
|
|
|
Task taskData = null;
|
|
|
|
if (null != taskList && !taskList.isEmpty()) {
|
|
|
|
if (null != taskList && !taskList.isEmpty()) {
|
|
|
@ -512,8 +506,9 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
model.setFinishtime(System.currentTimeMillis());
|
|
|
|
model.setFinishtime(System.currentTimeMillis());
|
|
|
|
ocrTaskchildPictureService.updateById(model);
|
|
|
|
ocrTaskchildPictureService.updateById(model);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
OcrTaskchildPicture childPicture = ocrTaskchildPictureService.getById(Long.parseLong(taskVO.getFormid()));
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
cn.jyjz.xiaoyao.common.base.vo.User byLoginname = userTokenService.findByLoginname(model.getAssignee());
|
|
|
|
cn.jyjz.xiaoyao.common.base.vo.User byLoginname = userTokenService.findByLoginname(childPicture.getAssignee());
|
|
|
|
OcrMsg msg = new OcrMsg();
|
|
|
|
OcrMsg msg = new OcrMsg();
|
|
|
|
msg.setCreateTime(System.currentTimeMillis());
|
|
|
|
msg.setCreateTime(System.currentTimeMillis());
|
|
|
|
msg.setSendTime(System.currentTimeMillis());
|
|
|
|
msg.setSendTime(System.currentTimeMillis());
|
|
|
@ -523,7 +518,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
jsonObject.put("taskId", model.getFromtaskid());
|
|
|
|
jsonObject.put("taskId", model.getFromtaskid());
|
|
|
|
jsonObject.put("nodeName", model.getTaskname());
|
|
|
|
jsonObject.put("nodeName", model.getTaskname());
|
|
|
|
jsonObject.put("states", model.getStates());
|
|
|
|
jsonObject.put("states", 1);
|
|
|
|
jsonObject.put("sendUserId", userToken.getUserid());
|
|
|
|
jsonObject.put("sendUserId", userToken.getUserid());
|
|
|
|
jsonObject.put("sendUserName", userToken.getUsername());
|
|
|
|
jsonObject.put("sendUserName", userToken.getUsername());
|
|
|
|
jsonObject.put("sendTime", System.currentTimeMillis());
|
|
|
|
jsonObject.put("sendTime", System.currentTimeMillis());
|
|
|
@ -552,7 +547,6 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
FlowElement flowElement = bpmnModel.getFlowElement(task.getTaskDefinitionKey());
|
|
|
|
FlowElement flowElement = bpmnModel.getFlowElement(task.getTaskDefinitionKey());
|
|
|
|
if (flowElement instanceof UserTask) {
|
|
|
|
if (flowElement instanceof UserTask) {
|
|
|
|
UserTask userTask = (UserTask) flowElement;
|
|
|
|
UserTask userTask = (UserTask) flowElement;
|
|
|
|
|
|
|
|
|
|
|
|
//如果审批不存在,需要在候选组中查询
|
|
|
|
//如果审批不存在,需要在候选组中查询
|
|
|
|
if (StringUtils.isBlank(userTask.getAssignee())) {
|
|
|
|
if (StringUtils.isBlank(userTask.getAssignee())) {
|
|
|
|
assignee = userTask.getAssignee();
|
|
|
|
assignee = userTask.getAssignee();
|
|
|
@ -563,7 +557,6 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
//设置流程结束状态
|
|
|
|
//设置流程结束状态
|
|
|
|
iFormCustomService.endForm(busskey[1], SystemConstantsOa.OA_STATUS_TYPE_REFUSE, assignee, task.getProcessInstanceId(), task.getName());
|
|
|
|
iFormCustomService.endForm(busskey[1], SystemConstantsOa.OA_STATUS_TYPE_REFUSE, assignee, task.getProcessInstanceId(), task.getName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//1、获取终止节点
|
|
|
|
//1、获取终止节点
|
|
|
|
List<EndEvent> endNodes = findEndFlowElement(task.getProcessDefinitionId());
|
|
|
|
List<EndEvent> endNodes = findEndFlowElement(task.getProcessDefinitionId());
|
|
|
|
String endId = endNodes.get(0).getId();
|
|
|
|
String endId = endNodes.get(0).getId();
|
|
|
@ -576,13 +569,9 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
taskchildPicture.setFinishtime(System.currentTimeMillis());
|
|
|
|
taskchildPicture.setFinishtime(System.currentTimeMillis());
|
|
|
|
ocrTaskchildPictureService.updateById(taskchildPicture);
|
|
|
|
ocrTaskchildPictureService.updateById(taskchildPicture);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
//保存当前审批用户与业务表的关系
|
|
|
|
//保存当前审批用户与业务表的关系
|
|
|
|
userapproveService.save(userToken, taskVO, task);
|
|
|
|
userapproveService.save(userToken, taskVO, task);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
log.error("e={}", e);
|
|
|
|
log.error("e={}", e);
|
|
|
|