新增:模板待办
This commit is contained in:
parent
b0bc890c57
commit
f7348b3407
@ -104,25 +104,25 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
bd.getBusinessDatabase().doInsert(flow);
|
bd.getBusinessDatabase().doInsert(flow);
|
||||||
|
|
||||||
// 新增待办
|
// 新增待办
|
||||||
// List<TodoTaskPojo> list = new ArrayList<>();
|
List<TodoTaskPojo> list = new ArrayList<>();
|
||||||
// for (String person : request.getProofreadUsers()) {
|
for (String person : request.getProofreadUsers()) {
|
||||||
// TodoTaskPojo todoTask = new TodoTaskPojo();
|
TodoTaskPojo todoTask = new TodoTaskPojo();
|
||||||
// todoTask.setCreatedById(permissionGetter.getCurrentUserId());
|
todoTask.setCreatedById(permissionGetter.getCurrentUserId());
|
||||||
// todoTask.setCreatedBy(xdapDeptUsersService.selectUserByID(permissionGetter.getCurrentUserId()).getUsername());
|
todoTask.setCreatedBy(xdapDeptUsersService.selectUserByID(permissionGetter.getCurrentUserId()).getUsername());
|
||||||
// todoTask.setCurrentNode(getNodeName(flow.getCurrentNode()));
|
todoTask.setCurrentNode(getNodeName(flow.getCurrentNode()));
|
||||||
// todoTask.setDataType("-");
|
todoTask.setDataType("-");
|
||||||
// todoTask.setDocumentNo(flow.getId());
|
todoTask.setDocumentNo(flow.getId());
|
||||||
// todoTask.setCreationDate(Timestamp.valueOf(LocalDateTime.now()));
|
todoTask.setCreationDate(Timestamp.valueOf(LocalDateTime.now()));
|
||||||
// todoTask.setIsDelete(0);
|
todoTask.setIsDelete(0);
|
||||||
// todoTask.setModelId(template.getId());
|
todoTask.setModelId(template.getId());
|
||||||
// todoTask.setModelName(template.getTemplateName());
|
todoTask.setModelName(template.getTemplateName());
|
||||||
// todoTask.setProcessTitle("模板审核");
|
todoTask.setProcessTitle("模板审核");
|
||||||
// todoTask.setStatusCode(flow.getFlowStatus());
|
todoTask.setStatusCode(flow.getFlowStatus());
|
||||||
// todoTask.setVersionNumber(template.getVersion());
|
todoTask.setVersionNumber(template.getVersion());
|
||||||
// todoTask.setOwnerId(person);
|
todoTask.setOwnerId(person);
|
||||||
// list.add(todoTask);
|
list.add(todoTask);
|
||||||
// }
|
}
|
||||||
// bd.getBusinessDatabase().doBatchInsert(list);
|
bd.getBusinessDatabase().doBatchInsert(list);
|
||||||
|
|
||||||
// 3. 更新模板状态为校对中
|
// 3. 更新模板状态为校对中
|
||||||
template.setStatus("APPROVING");
|
template.setStatus("APPROVING");
|
||||||
@ -142,7 +142,6 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public List<TodoAndTemplateView> getApprovalList(ApprovalListForm form) {
|
public List<TodoAndTemplateView> getApprovalList(ApprovalListForm form) {
|
||||||
|
|
||||||
// List<TodoAndTemplateView> todoAndTemplateViews = bd.getBusinessDatabase()
|
// List<TodoAndTemplateView> todoAndTemplateViews = bd.getBusinessDatabase()
|
||||||
// .viewQueryMode(true)
|
// .viewQueryMode(true)
|
||||||
// .view("getAllApproval")
|
// .view("getAllApproval")
|
||||||
@ -160,26 +159,27 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
.setVar("createdTime", form.getCreateDate() == null ? "" : form.getCreateDate())
|
.setVar("createdTime", form.getCreateDate() == null ? "" : form.getCreateDate())
|
||||||
.setVar("username",form.getUsername())
|
.setVar("username",form.getUsername())
|
||||||
.doQuery(TodoAndTemplateView.class);
|
.doQuery(TodoAndTemplateView.class);
|
||||||
|
setCurrentApprovers(approvalList, todoList);
|
||||||
return approvalList;
|
return approvalList;
|
||||||
// return todoAndTemplateViews;
|
// return todoAndTemplateViews;
|
||||||
}
|
}
|
||||||
|
|
||||||
// private void setCurrentApprovers(List<TodoAndTemplateView> approvalList, List<TodoAndTemplateView> todoAndTemplateViews) {
|
private void setCurrentApprovers(List<TodoAndTemplateView> approvalList, List<TodoAndTemplateView> todoAndTemplateViews) {
|
||||||
// todoAndTemplateViews.forEach(item -> {
|
todoAndTemplateViews.forEach(item -> {
|
||||||
// if (item.getCurrentUsers() == null || item.getCurrentUsers().isEmpty()) {
|
if (item.getCurrentUsers() == null || item.getCurrentUsers().isEmpty()) {
|
||||||
// item.setCurrentApprovers(null);
|
item.setCurrentApprovers(null);
|
||||||
// item.setCurrentUsers(null);
|
item.setCurrentUsers(null);
|
||||||
// } else {
|
} else {
|
||||||
// List<String> userIds = JSON.parseArray(item.getCurrentUsers()).toJavaList(String.class);
|
List<String> userIds = JSON.parseArray(item.getCurrentUsers()).toJavaList(String.class);
|
||||||
// List<ApprovalXdapUsers> approvalXdapUsers = bd.getBusinessDatabase()
|
List<ApprovalXdapUsers> approvalXdapUsers = bd.getBusinessDatabase()
|
||||||
// .in("id", userIds)
|
.in("id", userIds)
|
||||||
// .doQuery(ApprovalXdapUsers.class);
|
.doQuery(ApprovalXdapUsers.class);
|
||||||
// item.setCurrentApprovers(approvalXdapUsers);
|
item.setCurrentApprovers(approvalXdapUsers);
|
||||||
// item.setCurrentUsers(null);
|
item.setCurrentUsers(null);
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// approvalList.addAll(todoAndTemplateViews);
|
approvalList.addAll(todoAndTemplateViews);
|
||||||
// }
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = CommonException.class)
|
@Transactional(rollbackFor = CommonException.class)
|
||||||
@ -248,14 +248,14 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
// 删除当前节点的已处理待办
|
// 删除当前节点的已处理待办
|
||||||
if ("COUNTERSIGN".equals(flow.getCurrentNode())) {
|
if ("COUNTERSIGN".equals(flow.getCurrentNode())) {
|
||||||
redisTemplate.opsForSet().remove(TODO_PREFIX + request.getUserId(), flow.getId());
|
redisTemplate.opsForSet().remove(TODO_PREFIX + request.getUserId(), flow.getId());
|
||||||
// bd.getBusinessDatabase()
|
bd.getBusinessDatabase()
|
||||||
// .eq("document_no", flow.getId())
|
.eq("document_no", flow.getId())
|
||||||
// .eq("owner_id", permissionGetter.getCurrentUserId())
|
.eq("owner_id", permissionGetter.getCurrentUserId())
|
||||||
// .doDelete(TodoTaskPojo.class);
|
.doDelete(TodoTaskPojo.class);
|
||||||
// } else {
|
} else {
|
||||||
// bd.getBusinessDatabase()
|
bd.getBusinessDatabase()
|
||||||
// .eq("document_no", flow.getId())
|
.eq("document_no", flow.getId())
|
||||||
// .doDelete(TodoTaskPojo.class);
|
.doDelete(TodoTaskPojo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理驳回逻辑
|
// 处理驳回逻辑
|
||||||
@ -399,7 +399,7 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
clearProcessed(flow);
|
clearProcessed(flow);
|
||||||
} else {
|
} else {
|
||||||
flow.setCurrentNode(nextNode);
|
flow.setCurrentNode(nextNode);
|
||||||
addNodeTodo(flow, nextNode);
|
addNodeTodo(flow, nextNode, template);
|
||||||
}
|
}
|
||||||
|
|
||||||
bd.getBusinessDatabase()
|
bd.getBusinessDatabase()
|
||||||
@ -478,13 +478,31 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addNodeTodo(ApprovalFlow flow, String node) {
|
private void addNodeTodo(ApprovalFlow flow, String node, Template template) {
|
||||||
List<String> users = getNodeUsers(flow, node);
|
List<String> users = getNodeUsers(flow, node);
|
||||||
users.forEach(userId -> {
|
users.forEach(userId -> {
|
||||||
redisTemplate.opsForSet().add(TODO_PREFIX+ userId, flow.getId());
|
redisTemplate.opsForSet().add(TODO_PREFIX+ userId, flow.getId());
|
||||||
});
|
});
|
||||||
|
// 新增待办
|
||||||
|
List<TodoTaskPojo> list = new ArrayList<>();
|
||||||
|
for (String person : users) {
|
||||||
|
TodoTaskPojo todoTask = new TodoTaskPojo();
|
||||||
|
todoTask.setCreatedById(permissionGetter.getCurrentUserId());
|
||||||
|
todoTask.setCreatedBy(xdapDeptUsersService.selectUserByID(permissionGetter.getCurrentUserId()).getUsername());
|
||||||
|
todoTask.setCurrentNode(getNodeName(flow.getCurrentNode()));
|
||||||
|
todoTask.setDataType("-");
|
||||||
|
todoTask.setDocumentNo(flow.getId());
|
||||||
|
todoTask.setCreationDate(Timestamp.valueOf(LocalDateTime.now()));
|
||||||
|
todoTask.setIsDelete(0);
|
||||||
|
todoTask.setModelId(template.getId());
|
||||||
|
todoTask.setModelName(template.getTemplateName());
|
||||||
|
todoTask.setProcessTitle("模板审核");
|
||||||
|
todoTask.setStatusCode(flow.getFlowStatus());
|
||||||
|
todoTask.setVersionNumber(template.getVersion());
|
||||||
|
todoTask.setOwnerId(person);
|
||||||
|
list.add(todoTask);
|
||||||
|
}
|
||||||
|
bd.getBusinessDatabase().doBatchInsert(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearNodeTodo(ApprovalFlow flow, String node) {
|
private void clearNodeTodo(ApprovalFlow flow, String node) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user