|
@@ -13,7 +13,6 @@ import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; |
|
|
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; |
|
|
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; |
|
|
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; |
|
|
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; |
|
|
import com.ningdatech.pmapi.common.util.ExcelDownUtil; |
|
|
import com.ningdatech.pmapi.common.util.ExcelDownUtil; |
|
|
import com.ningdatech.pmapi.common.util.SendWorkNoticeUtil; |
|
|
|
|
|
import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo; |
|
|
import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo; |
|
|
import com.ningdatech.pmapi.organization.model.entity.DingOrganization; |
|
|
import com.ningdatech.pmapi.organization.model.entity.DingOrganization; |
|
|
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService; |
|
|
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService; |
|
@@ -30,12 +29,10 @@ import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo; |
|
|
import com.ningdatech.pmapi.todocenter.bean.vo.ProcessProgressDetailVo; |
|
|
import com.ningdatech.pmapi.todocenter.bean.vo.ProcessProgressDetailVo; |
|
|
import com.ningdatech.pmapi.todocenter.enumeration.IsAppendProjectEnum; |
|
|
import com.ningdatech.pmapi.todocenter.enumeration.IsAppendProjectEnum; |
|
|
import com.ningdatech.pmapi.todocenter.model.dto.req.ProcessDetailReq; |
|
|
import com.ningdatech.pmapi.todocenter.model.dto.req.ProcessDetailReq; |
|
|
import com.ningdatech.pmapi.todocenter.model.dto.req.ToBeProcessedReq; |
|
|
|
|
|
import com.ningdatech.pmapi.todocenter.model.dto.req.ToBeProcessedExportReq; |
|
|
import com.ningdatech.pmapi.todocenter.model.dto.req.ToBeProcessedExportReq; |
|
|
|
|
|
import com.ningdatech.pmapi.todocenter.model.dto.req.ToBeProcessedReq; |
|
|
import com.ningdatech.pmapi.todocenter.model.dto.vo.ResToBeProcessedVO; |
|
|
import com.ningdatech.pmapi.todocenter.model.dto.vo.ResToBeProcessedVO; |
|
|
|
|
|
|
|
|
import com.ningdatech.pmapi.user.entity.UserInfo; |
|
|
import com.ningdatech.pmapi.user.entity.UserInfo; |
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; |
|
|
|
|
|
import com.ningdatech.pmapi.user.service.IUserInfoService; |
|
|
import com.ningdatech.pmapi.user.service.IUserInfoService; |
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
import com.wflow.contants.HisProInsEndActId; |
|
|
import com.wflow.contants.HisProInsEndActId; |
|
@@ -47,23 +44,23 @@ import com.wflow.workflow.bean.vo.ProcessInstanceVo; |
|
|
import com.wflow.workflow.bean.vo.ProcessProgressVo; |
|
|
import com.wflow.workflow.bean.vo.ProcessProgressVo; |
|
|
import com.wflow.workflow.bean.vo.ProcessTaskVo; |
|
|
import com.wflow.workflow.bean.vo.ProcessTaskVo; |
|
|
import com.wflow.workflow.enums.ProcessStatusEnum; |
|
|
import com.wflow.workflow.enums.ProcessStatusEnum; |
|
|
import com.wflow.workflow.service.*; |
|
|
|
|
|
|
|
|
import com.wflow.workflow.service.ProcessInstanceService; |
|
|
|
|
|
import com.wflow.workflow.service.ProcessTaskService; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.assertj.core.util.Lists; |
|
|
import org.assertj.core.util.Lists; |
|
|
import org.flowable.bpmn.model.*; |
|
|
import org.flowable.bpmn.model.*; |
|
|
import org.flowable.engine.*; |
|
|
|
|
|
|
|
|
import org.flowable.engine.HistoryService; |
|
|
import org.flowable.engine.history.HistoricProcessInstance; |
|
|
import org.flowable.engine.history.HistoricProcessInstance; |
|
|
import org.flowable.engine.runtime.ActivityInstance; |
|
|
import org.flowable.engine.runtime.ActivityInstance; |
|
|
import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
import java.time.LocalDateTime; |
|
|
import java.time.LocalDateTime; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
import static cn.hutool.core.collection.CollUtil.isEmpty; |
|
|
|
|
|
import static cn.hutool.core.collection.CollUtil.isNotEmpty; |
|
|
|
|
|
import static com.ningdatech.pmapi.todocenter.constant.WorkNotice.*; |
|
|
import static com.ningdatech.pmapi.todocenter.constant.WorkNotice.*; |
|
|
import static com.wflow.workflow.task.TriggerServiceTask.runtimeService; |
|
|
import static com.wflow.workflow.task.TriggerServiceTask.runtimeService; |
|
|
|
|
|
|
|
@@ -102,8 +99,8 @@ public class TodoCenterManage { |
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
//因为要解耦 不能把项目和工作流一起查 |
|
|
//因为要解耦 不能把项目和工作流一起查 |
|
|
//1.先查出用户工作流 |
|
|
//1.先查出用户工作流 |
|
|
List<ProcessTaskVo> userTodoList = processTaskService.getUserTodoList(param.getProcessDefId(),String.valueOf(userId)); |
|
|
|
|
|
if(CollUtil.isEmpty(userTodoList)){ |
|
|
|
|
|
|
|
|
List<ProcessTaskVo> userTodoList = processTaskService.getUserTodoList(param.getProcessDefId(), String.valueOf(userId)); |
|
|
|
|
|
if (CollUtil.isEmpty(userTodoList)) { |
|
|
return PageVo.empty(); |
|
|
return PageVo.empty(); |
|
|
} |
|
|
} |
|
|
List<String> instCodes = userTodoList.stream().map(ProcessTaskVo::getInstanceId).collect(Collectors.toList()); |
|
|
List<String> instCodes = userTodoList.stream().map(ProcessTaskVo::getInstanceId).collect(Collectors.toList()); |
|
@@ -112,16 +109,16 @@ public class TodoCenterManage { |
|
|
//2.再分页查询项目信息 |
|
|
//2.再分页查询项目信息 |
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
projectListReq.setInstCodes(instCodes); |
|
|
projectListReq.setInstCodes(instCodes); |
|
|
BeanUtils.copyProperties(param,projectListReq); |
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(param, projectListReq); |
|
|
PageVo<ProjectLibListItemVO> projectPage = projectLibManage.projectLibList(projectListReq); |
|
|
PageVo<ProjectLibListItemVO> projectPage = projectLibManage.projectLibList(projectListReq); |
|
|
|
|
|
|
|
|
if(0L == projectPage.getTotal()){ |
|
|
|
|
|
|
|
|
if (0L == projectPage.getTotal()) { |
|
|
return PageVo.empty(); |
|
|
return PageVo.empty(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
List<HistoricProcessInstance> instances = historyService.createHistoricProcessInstanceQuery() |
|
|
List<HistoricProcessInstance> instances = historyService.createHistoricProcessInstanceQuery() |
|
|
.list(); |
|
|
.list(); |
|
|
Map<String,HistoricProcessInstance> instanceMap = CollUtils.listToMap(instances,HistoricProcessInstance::getId); |
|
|
|
|
|
|
|
|
Map<String, HistoricProcessInstance> instanceMap = CollUtils.listToMap(instances, HistoricProcessInstance::getId); |
|
|
|
|
|
|
|
|
List<ResToBeProcessedVO> resVos = projectPage.getRecords().stream().map(d -> { |
|
|
List<ResToBeProcessedVO> resVos = projectPage.getRecords().stream().map(d -> { |
|
|
ResToBeProcessedVO res = new ResToBeProcessedVO(); |
|
|
ResToBeProcessedVO res = new ResToBeProcessedVO(); |
|
@@ -129,7 +126,7 @@ public class TodoCenterManage { |
|
|
res.setProjectId(d.getId()); |
|
|
res.setProjectId(d.getId()); |
|
|
ProcessTaskVo taskVo = taskVoMap.get(d.getInstCode()); |
|
|
ProcessTaskVo taskVo = taskVoMap.get(d.getInstCode()); |
|
|
res.setNodeId(taskVo.getTaskDefKey()); |
|
|
res.setNodeId(taskVo.getTaskDefKey()); |
|
|
if(instanceMap.containsKey(d.getInstCode())){ |
|
|
|
|
|
|
|
|
if (instanceMap.containsKey(d.getInstCode())) { |
|
|
res.setProcessStatusName(processInstanceService |
|
|
res.setProcessStatusName(processInstanceService |
|
|
.buildProcessStatusStr(instanceMap.get(d.getInstCode()))); |
|
|
.buildProcessStatusStr(instanceMap.get(d.getInstCode()))); |
|
|
} |
|
|
} |
|
@@ -156,13 +153,13 @@ public class TodoCenterManage { |
|
|
|
|
|
|
|
|
//因为要解耦 不能把项目和工作流一起查 |
|
|
//因为要解耦 不能把项目和工作流一起查 |
|
|
//1.先查出用户工作流 |
|
|
//1.先查出用户工作流 |
|
|
List<ProcessTaskVo> userTodoList = processTaskService.getUserTodoList(param.getProcessDefId(),String.valueOf(userId)); |
|
|
|
|
|
|
|
|
List<ProcessTaskVo> userTodoList = processTaskService.getUserTodoList(param.getProcessDefId(), String.valueOf(userId)); |
|
|
List<String> instCodes = userTodoList.stream().map(ProcessTaskVo::getInstanceId).collect(Collectors.toList()); |
|
|
List<String> instCodes = userTodoList.stream().map(ProcessTaskVo::getInstanceId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
//2.再查询项目信息 |
|
|
//2.再查询项目信息 |
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
projectListReq.setInstCodes(instCodes); |
|
|
projectListReq.setInstCodes(instCodes); |
|
|
BeanUtils.copyProperties(param,projectListReq); |
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(param, projectListReq); |
|
|
List<Project> projects = CollUtil.isEmpty(userTodoList) ? Collections.emptyList() : projectLibManage.projectList(projectListReq); |
|
|
List<Project> projects = CollUtil.isEmpty(userTodoList) ? Collections.emptyList() : projectLibManage.projectList(projectListReq); |
|
|
PageVo<ProjectLibListItemVO> projectLibList = projectLibManage.projectLibList(projectListReq); |
|
|
PageVo<ProjectLibListItemVO> projectLibList = projectLibManage.projectLibList(projectListReq); |
|
|
|
|
|
|
|
@@ -207,7 +204,7 @@ public class TodoCenterManage { |
|
|
// 获取当前申报项目 |
|
|
// 获取当前申报项目 |
|
|
Project declaredProject = projectService.getOne(Wrappers.lambdaQuery(Project.class) |
|
|
Project declaredProject = projectService.getOne(Wrappers.lambdaQuery(Project.class) |
|
|
.eq(Project::getInstCode, processInstanceId) |
|
|
.eq(Project::getInstCode, processInstanceId) |
|
|
.eq(Project::getId,projectId)); |
|
|
|
|
|
|
|
|
.eq(Project::getId, projectId)); |
|
|
VUtils.isTrue(Objects.isNull(projectId)).throwMessage("获取项目ID失败!"); |
|
|
VUtils.isTrue(Objects.isNull(projectId)).throwMessage("获取项目ID失败!"); |
|
|
// 获取当前项目名称 |
|
|
// 获取当前项目名称 |
|
|
String projectName = declaredProject.getProjectName(); |
|
|
String projectName = declaredProject.getProjectName(); |
|
@@ -244,12 +241,12 @@ public class TodoCenterManage { |
|
|
ProgressNode currentNode = newProgressInfo.get(newProgressInfo.size() - 1); |
|
|
ProgressNode currentNode = newProgressInfo.get(newProgressInfo.size() - 1); |
|
|
UserInfo auditUserInfo = null; |
|
|
UserInfo auditUserInfo = null; |
|
|
// 说明当前节点是子流程节点 |
|
|
// 说明当前节点是子流程节点 |
|
|
if (currentNode.getNodeType().name().equals(NodeTypeEnum.SUB.name())){ |
|
|
|
|
|
|
|
|
if (currentNode.getNodeType().name().equals(NodeTypeEnum.SUB.name())) { |
|
|
List<ProgressNode> children = currentNode.getChildren(); |
|
|
List<ProgressNode> children = currentNode.getChildren(); |
|
|
// 获取子流程当前审核人节点 |
|
|
// 获取子流程当前审核人节点 |
|
|
ProgressNode subCurrentNode = children.get(children.size() - 1); |
|
|
ProgressNode subCurrentNode = children.get(children.size() - 1); |
|
|
auditUserInfo = userInfoService.getById(Long.valueOf(subCurrentNode.getUserId())); |
|
|
auditUserInfo = userInfoService.getById(Long.valueOf(subCurrentNode.getUserId())); |
|
|
}else { |
|
|
|
|
|
|
|
|
} else { |
|
|
auditUserInfo = userInfoService.getById(Long.valueOf(currentNode.getUserId())); |
|
|
auditUserInfo = userInfoService.getById(Long.valueOf(currentNode.getUserId())); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -271,13 +268,13 @@ public class TodoCenterManage { |
|
|
switch (Objects.requireNonNull(ProjectStatusEnum.getValue(projectStatus))) { |
|
|
switch (Objects.requireNonNull(ProjectStatusEnum.getValue(projectStatus))) { |
|
|
// 当前项目状态是单位内部审核中 |
|
|
// 当前项目状态是单位内部审核中 |
|
|
case UNDER_INTERNAL_AUDIT: |
|
|
case UNDER_INTERNAL_AUDIT: |
|
|
// 当前项目状态是预审中 |
|
|
|
|
|
|
|
|
// 当前项目状态是预审中 |
|
|
case PRE_APPLYING: |
|
|
case PRE_APPLYING: |
|
|
// 当前项目状态是部门联审中 |
|
|
|
|
|
|
|
|
// 当前项目状态是部门联审中 |
|
|
case DEPARTMENT_JOINT_REVIEW: |
|
|
case DEPARTMENT_JOINT_REVIEW: |
|
|
// 当前项目状态是方案评审中 |
|
|
|
|
|
|
|
|
// 当前项目状态是方案评审中 |
|
|
case SCHEME_UNDER_REVIEW: |
|
|
case SCHEME_UNDER_REVIEW: |
|
|
// 当前项目状态是终验审核中 |
|
|
|
|
|
|
|
|
// 当前项目状态是终验审核中 |
|
|
case FINAL_ACCEPTANCE_IS_UNDER_REVIEW: |
|
|
case FINAL_ACCEPTANCE_IS_UNDER_REVIEW: |
|
|
updatePassProjectStatus(userId, declaredProject); |
|
|
updatePassProjectStatus(userId, declaredProject); |
|
|
break; |
|
|
break; |
|
@@ -290,11 +287,11 @@ public class TodoCenterManage { |
|
|
passWorkNoticeInfo2.setMsg(passMsg2); |
|
|
passWorkNoticeInfo2.setMsg(passMsg2); |
|
|
// 放入工作通知暂存表中,通过扫表异步发送 |
|
|
// 放入工作通知暂存表中,通过扫表异步发送 |
|
|
workNoticeStagingService.addByWorkNotice(passWorkNoticeInfo2, MsgTypeEnum.PASS); |
|
|
workNoticeStagingService.addByWorkNotice(passWorkNoticeInfo2, MsgTypeEnum.PASS); |
|
|
}else { |
|
|
|
|
|
|
|
|
} else { |
|
|
// 若有下一个审核人(当前节点的用户), |
|
|
// 若有下一个审核人(当前节点的用户), |
|
|
// 向其发送浙政钉工作通知:标题:审核任务 内容:【单位名称】的【项目名称】需要您审核。 |
|
|
// 向其发送浙政钉工作通知:标题:审核任务 内容:【单位名称】的【项目名称】需要您审核。 |
|
|
// 获取发送浙政钉工作通知必要信息 |
|
|
// 获取发送浙政钉工作通知必要信息 |
|
|
if (Objects.isNull(auditUserInfo)){ |
|
|
|
|
|
|
|
|
if (Objects.isNull(auditUserInfo)) { |
|
|
throw new BizException("审核人信息不存在!"); |
|
|
throw new BizException("审核人信息不存在!"); |
|
|
} |
|
|
} |
|
|
WorkNoticeInfo sendWorkNoticeInfo = getSendWorkNoticeInfo(auditUserInfo); |
|
|
WorkNoticeInfo sendWorkNoticeInfo = getSendWorkNoticeInfo(auditUserInfo); |
|
@@ -339,7 +336,7 @@ public class TodoCenterManage { |
|
|
// 撤回(流程发起人和当前流程审核人的前一个审核人操作) |
|
|
// 撤回(流程发起人和当前流程审核人的前一个审核人操作) |
|
|
case WITHDRAW: |
|
|
case WITHDRAW: |
|
|
// 当前登录用户是流程发起人 |
|
|
// 当前登录用户是流程发起人 |
|
|
if (userId.equals(Long.valueOf(startUserId))){ |
|
|
|
|
|
|
|
|
if (userId.equals(Long.valueOf(startUserId))) { |
|
|
processTaskService.handleTask(param, userId); |
|
|
processTaskService.handleTask(param, userId); |
|
|
// 若是流程发起人点击撤回,项目回到上一个状态,需调用状态机更新项目状态,流程状态更新为审核通过 |
|
|
// 若是流程发起人点击撤回,项目回到上一个状态,需调用状态机更新项目状态,流程状态更新为审核通过 |
|
|
switch (Objects.requireNonNull(ProjectStatusEnum.getValue(projectStatus))) { |
|
|
switch (Objects.requireNonNull(ProjectStatusEnum.getValue(projectStatus))) { |
|
@@ -358,7 +355,7 @@ public class TodoCenterManage { |
|
|
default: |
|
|
default: |
|
|
throw new IllegalStateException("Unexpected value: " + projectStatus); |
|
|
throw new IllegalStateException("Unexpected value: " + projectStatus); |
|
|
} |
|
|
} |
|
|
}else { |
|
|
|
|
|
|
|
|
} else { |
|
|
// 当前登录用户不是流程发起人 |
|
|
// 当前登录用户不是流程发起人 |
|
|
List<ProgressNode> currentProgressInfo = currentInstanceDetail.getProgressInfo(); |
|
|
List<ProgressNode> currentProgressInfo = currentInstanceDetail.getProgressInfo(); |
|
|
// 获取当前工作流任务前一个审核人信息 |
|
|
// 获取当前工作流任务前一个审核人信息 |
|
@@ -369,12 +366,12 @@ public class TodoCenterManage { |
|
|
ProcessInstanceUserDto currentUser = currentProgressNode.getUser(); |
|
|
ProcessInstanceUserDto currentUser = currentProgressNode.getUser(); |
|
|
// 判断当前工作流任务前一个审核人的部门和当前登录用户的部门是否是同一个,如果是同一个才可以撤回,否则抛出异常 |
|
|
// 判断当前工作流任务前一个审核人的部门和当前登录用户的部门是否是同一个,如果是同一个才可以撤回,否则抛出异常 |
|
|
boolean orgFlag = currentUser.getOrgCode().equals(beforeUser.getOrgCode()); |
|
|
boolean orgFlag = currentUser.getOrgCode().equals(beforeUser.getOrgCode()); |
|
|
boolean userFlag = beforeUser.getUserId().equals(String.valueOf( userId)); |
|
|
|
|
|
|
|
|
boolean userFlag = beforeUser.getUserId().equals(String.valueOf(userId)); |
|
|
if (!orgFlag) { |
|
|
if (!orgFlag) { |
|
|
throw new BizException("下一个审核人和您不是同一个部门,无法撤回!"); |
|
|
throw new BizException("下一个审核人和您不是同一个部门,无法撤回!"); |
|
|
} else if (!userFlag){ |
|
|
|
|
|
|
|
|
} else if (!userFlag) { |
|
|
throw new BizException("当前登录用户无法进行撤回操作!"); |
|
|
throw new BizException("当前登录用户无法进行撤回操作!"); |
|
|
} else{ |
|
|
|
|
|
|
|
|
} else { |
|
|
processTaskService.handleTask(param, userId); |
|
|
processTaskService.handleTask(param, userId); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@@ -412,6 +409,7 @@ public class TodoCenterManage { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 获取发送浙政钉工作通知的信息 |
|
|
* 获取发送浙政钉工作通知的信息 |
|
|
|
|
|
* |
|
|
* @param auditUserInfo |
|
|
* @param auditUserInfo |
|
|
* @return com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo |
|
|
* @return com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo |
|
|
* @author CMM |
|
|
* @author CMM |
|
@@ -420,7 +418,7 @@ public class TodoCenterManage { |
|
|
public WorkNoticeInfo getSendWorkNoticeInfo(UserInfo auditUserInfo) { |
|
|
public WorkNoticeInfo getSendWorkNoticeInfo(UserInfo auditUserInfo) { |
|
|
WorkNoticeInfo workNoticeInfo = new WorkNoticeInfo(); |
|
|
WorkNoticeInfo workNoticeInfo = new WorkNoticeInfo(); |
|
|
Long accountId = auditUserInfo.getAccountId(); |
|
|
Long accountId = auditUserInfo.getAccountId(); |
|
|
if (Objects.isNull(accountId)){ |
|
|
|
|
|
|
|
|
if (Objects.isNull(accountId)) { |
|
|
throw new BizException("该用户没有录入浙政钉信息!"); |
|
|
throw new BizException("该用户没有录入浙政钉信息!"); |
|
|
} |
|
|
} |
|
|
workNoticeInfo.setAccountId(accountId); |
|
|
workNoticeInfo.setAccountId(accountId); |
|
@@ -436,12 +434,13 @@ public class TodoCenterManage { |
|
|
workNoticeInfo.setOrganizationName(organizationName); |
|
|
workNoticeInfo.setOrganizationName(organizationName); |
|
|
// 构建唯一的消息ID |
|
|
// 构建唯一的消息ID |
|
|
String bizMsgId = "ZD_WORK_NOTICE_" + StrUtil.UNDERLINE + organizationCode + StrUtil.UNDERLINE |
|
|
String bizMsgId = "ZD_WORK_NOTICE_" + StrUtil.UNDERLINE + organizationCode + StrUtil.UNDERLINE |
|
|
+ organizationName + accountId + StrUtil.UNDERLINE + System.currentTimeMillis(); |
|
|
|
|
|
|
|
|
+ organizationName + accountId + StrUtil.UNDERLINE + System.currentTimeMillis(); |
|
|
workNoticeInfo.setBizMsgId(bizMsgId); |
|
|
workNoticeInfo.setBizMsgId(bizMsgId); |
|
|
String receiverUserId = String.valueOf(accountId); |
|
|
String receiverUserId = String.valueOf(accountId); |
|
|
workNoticeInfo.setReceiverUserId(receiverUserId); |
|
|
workNoticeInfo.setReceiverUserId(receiverUserId); |
|
|
return workNoticeInfo; |
|
|
return workNoticeInfo; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 当为通过操作时,更新项目表中项目状态 |
|
|
* 当为通过操作时,更新项目表中项目状态 |
|
|
* |
|
|
* |
|
@@ -497,6 +496,7 @@ public class TodoCenterManage { |
|
|
return rootUserId; |
|
|
return rootUserId; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 获取当前节点的下一个节点的审核用户ID |
|
|
* 获取当前节点的下一个节点的审核用户ID |
|
|
* |
|
|
* |
|
@@ -571,18 +571,18 @@ public class TodoCenterManage { |
|
|
|
|
|
|
|
|
Set<String> userSet = Sets.newHashSet(); |
|
|
Set<String> userSet = Sets.newHashSet(); |
|
|
progressInfo.forEach(node -> { |
|
|
progressInfo.forEach(node -> { |
|
|
if(CollUtil.isNotEmpty(node.getChildren())){ |
|
|
|
|
|
for(ProgressNode innerNode : node.getChildren()){ |
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(node.getChildren())) { |
|
|
|
|
|
for (ProgressNode innerNode : node.getChildren()) { |
|
|
userSet.add(innerNode.getUserId()); |
|
|
userSet.add(innerNode.getUserId()); |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
|
|
|
|
|
|
} else { |
|
|
userSet.add(node.getUserId()); |
|
|
userSet.add(node.getUserId()); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(userSet); |
|
|
Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(userSet); |
|
|
|
|
|
|
|
|
// 装配节点审核人员信息 |
|
|
// 装配节点审核人员信息 |
|
|
buildUser(progressInfo,userMap); |
|
|
|
|
|
|
|
|
buildUser(progressInfo, userMap); |
|
|
|
|
|
|
|
|
ProcessProgressDetailVo res = new ProcessProgressDetailVo(); |
|
|
ProcessProgressDetailVo res = new ProcessProgressDetailVo(); |
|
|
res.setProcessProgressVo(progressInstanceDetail); |
|
|
res.setProcessProgressVo(progressInstanceDetail); |
|
@@ -591,11 +591,11 @@ public class TodoCenterManage { |
|
|
return res; |
|
|
return res; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void buildUser(List<ProgressNode> progressInfo,Map<String, ProcessInstanceUserDto> userMap) { |
|
|
|
|
|
|
|
|
private void buildUser(List<ProgressNode> progressInfo, Map<String, ProcessInstanceUserDto> userMap) { |
|
|
for (ProgressNode progressNode : progressInfo) { |
|
|
for (ProgressNode progressNode : progressInfo) { |
|
|
progressNode.setUser(userMap.get(progressNode.getUserId())); |
|
|
progressNode.setUser(userMap.get(progressNode.getUserId())); |
|
|
if(CollUtil.isNotEmpty(progressNode.getChildren())){ |
|
|
|
|
|
buildUser(progressNode.getChildren(),userMap); |
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(progressNode.getChildren())) { |
|
|
|
|
|
buildUser(progressNode.getChildren(), userMap); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@@ -612,8 +612,8 @@ public class TodoCenterManage { |
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
|
|
|
|
|
// 查出用户已处理工作流 |
|
|
// 查出用户已处理工作流 |
|
|
List<ProcessTaskVo> userIdoList = processTaskService.getUserIdoList(param.getProcessDefId(),String.valueOf(userId)); |
|
|
|
|
|
if(CollUtil.isEmpty(userIdoList)){ |
|
|
|
|
|
|
|
|
List<ProcessTaskVo> userIdoList = processTaskService.getUserIdoList(param.getProcessDefId(), String.valueOf(userId)); |
|
|
|
|
|
if (CollUtil.isEmpty(userIdoList)) { |
|
|
return PageVo.empty(); |
|
|
return PageVo.empty(); |
|
|
} |
|
|
} |
|
|
List<String> instCodes = userIdoList.stream().map(ProcessTaskVo::getInstanceId).collect(Collectors.toList()); |
|
|
List<String> instCodes = userIdoList.stream().map(ProcessTaskVo::getInstanceId).collect(Collectors.toList()); |
|
@@ -622,7 +622,7 @@ public class TodoCenterManage { |
|
|
// 分页查询项目信息 |
|
|
// 分页查询项目信息 |
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
projectListReq.setInstCodes(instCodes); |
|
|
projectListReq.setInstCodes(instCodes); |
|
|
BeanUtils.copyProperties(param,projectListReq); |
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(param, projectListReq); |
|
|
|
|
|
|
|
|
PageVo<ProjectLibListItemVO> projectPage = projectLibManage.projectLibList(projectListReq); |
|
|
PageVo<ProjectLibListItemVO> projectPage = projectLibManage.projectLibList(projectListReq); |
|
|
if (0L == projectPage.getTotal()) { |
|
|
if (0L == projectPage.getTotal()) { |
|
@@ -637,7 +637,7 @@ public class TodoCenterManage { |
|
|
res.setProcessHandleTime(d.getUpdateOn()); |
|
|
res.setProcessHandleTime(d.getUpdateOn()); |
|
|
return res; |
|
|
return res; |
|
|
}).collect(Collectors.toList()); |
|
|
}).collect(Collectors.toList()); |
|
|
return PageVo.of(resVos,projectPage.getTotal()); |
|
|
|
|
|
|
|
|
return PageVo.of(resVos, projectPage.getTotal()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@@ -704,12 +704,12 @@ public class TodoCenterManage { |
|
|
public PageVo<ResToBeProcessedVO> mySubmittedList(ToBeProcessedReq param) { |
|
|
public PageVo<ResToBeProcessedVO> mySubmittedList(ToBeProcessedReq param) { |
|
|
|
|
|
|
|
|
// 获取登录用户ID |
|
|
// 获取登录用户ID |
|
|
Long startUserId = LoginUserUtil.getUserId(); |
|
|
|
|
|
|
|
|
Long startUserId = LoginUserUtil.getUserId(); |
|
|
// 查出登录用户已提交工作流 |
|
|
// 查出登录用户已提交工作流 |
|
|
List<ProcessInstanceVo> userSubmittedList = processInstanceService.getUserSubmittedList(String.valueOf(startUserId), param.getProcessDefId(), null); |
|
|
List<ProcessInstanceVo> userSubmittedList = processInstanceService.getUserSubmittedList(String.valueOf(startUserId), param.getProcessDefId(), null); |
|
|
Map<String, ProcessInstanceVo> instanceVoMap = userSubmittedList.stream() |
|
|
Map<String, ProcessInstanceVo> instanceVoMap = userSubmittedList.stream() |
|
|
.collect(Collectors.toMap(ProcessInstanceVo::getInstanceId, v -> v)); |
|
|
.collect(Collectors.toMap(ProcessInstanceVo::getInstanceId, v -> v)); |
|
|
if(CollUtil.isEmpty(userSubmittedList)){ |
|
|
|
|
|
|
|
|
if (CollUtil.isEmpty(userSubmittedList)) { |
|
|
return PageVo.empty(); |
|
|
return PageVo.empty(); |
|
|
} |
|
|
} |
|
|
List<String> instCodes = userSubmittedList.stream().map(ProcessInstanceVo::getInstanceId).collect(Collectors.toList()); |
|
|
List<String> instCodes = userSubmittedList.stream().map(ProcessInstanceVo::getInstanceId).collect(Collectors.toList()); |
|
@@ -717,7 +717,7 @@ public class TodoCenterManage { |
|
|
// 分页查询项目信息 |
|
|
// 分页查询项目信息 |
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
projectListReq.setInstCodes(instCodes); |
|
|
projectListReq.setInstCodes(instCodes); |
|
|
BeanUtils.copyProperties(param,projectListReq); |
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(param, projectListReq); |
|
|
|
|
|
|
|
|
PageVo<ProjectLibListItemVO> projectPage = projectLibManage.projectLibList(projectListReq); |
|
|
PageVo<ProjectLibListItemVO> projectPage = projectLibManage.projectLibList(projectListReq); |
|
|
if (0L == projectPage.getTotal()) { |
|
|
if (0L == projectPage.getTotal()) { |
|
@@ -733,7 +733,7 @@ public class TodoCenterManage { |
|
|
res.setProcessLaunchTime(d.getCreateOn()); |
|
|
res.setProcessLaunchTime(d.getCreateOn()); |
|
|
return res; |
|
|
return res; |
|
|
}).collect(Collectors.toList()); |
|
|
}).collect(Collectors.toList()); |
|
|
return PageVo.of(resVos,projectPage.getTotal()); |
|
|
|
|
|
|
|
|
return PageVo.of(resVos, projectPage.getTotal()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@@ -748,7 +748,7 @@ public class TodoCenterManage { |
|
|
public void exportMySubmittedList(HttpServletResponse response, ToBeProcessedExportReq param) { |
|
|
public void exportMySubmittedList(HttpServletResponse response, ToBeProcessedExportReq param) { |
|
|
|
|
|
|
|
|
// 获取登录用户ID |
|
|
// 获取登录用户ID |
|
|
long userId = LoginUserUtil.getUserId(); |
|
|
|
|
|
|
|
|
long userId = LoginUserUtil.getUserId(); |
|
|
|
|
|
|
|
|
param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); |
|
|
param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); |
|
|
param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); |
|
|
param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); |
|
@@ -761,7 +761,8 @@ public class TodoCenterManage { |
|
|
projectListReq.setInstCodes(instCodes); |
|
|
projectListReq.setInstCodes(instCodes); |
|
|
BeanUtils.copyProperties(param, projectListReq); |
|
|
BeanUtils.copyProperties(param, projectListReq); |
|
|
List<Project> projects = CollUtil.isEmpty(userSubmittedList) ? Collections.emptyList() : |
|
|
List<Project> projects = CollUtil.isEmpty(userSubmittedList) ? Collections.emptyList() : |
|
|
projectLibManage.projectList(projectListReq);projectLibManage.projectList(projectListReq); |
|
|
|
|
|
|
|
|
projectLibManage.projectList(projectListReq); |
|
|
|
|
|
projectLibManage.projectList(projectListReq); |
|
|
|
|
|
|
|
|
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); |
|
|
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); |
|
|
|
|
|
|
|
@@ -799,11 +800,11 @@ public class TodoCenterManage { |
|
|
*/ |
|
|
*/ |
|
|
public PageVo<ResToBeProcessedVO> ccmeList(ToBeProcessedReq param) { |
|
|
public PageVo<ResToBeProcessedVO> ccmeList(ToBeProcessedReq param) { |
|
|
// 获取当前登录用户ID |
|
|
// 获取当前登录用户ID |
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
|
|
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
|
|
|
|
|
// 查询抄送登录用户的工作流 |
|
|
// 查询抄送登录用户的工作流 |
|
|
List<ProcessInstanceVo> ccMeList = processInstanceService.getCcMeList(param.getProcessDefId(), String.valueOf(userId)); |
|
|
List<ProcessInstanceVo> ccMeList = processInstanceService.getCcMeList(param.getProcessDefId(), String.valueOf(userId)); |
|
|
if(CollUtil.isEmpty(ccMeList)){ |
|
|
|
|
|
|
|
|
if (CollUtil.isEmpty(ccMeList)) { |
|
|
return PageVo.empty(); |
|
|
return PageVo.empty(); |
|
|
} |
|
|
} |
|
|
List<String> instCodes = ccMeList.stream().map(ProcessInstanceVo::getInstanceId).collect(Collectors.toList()); |
|
|
List<String> instCodes = ccMeList.stream().map(ProcessInstanceVo::getInstanceId).collect(Collectors.toList()); |
|
@@ -813,7 +814,7 @@ public class TodoCenterManage { |
|
|
// 分页查询项目信息 |
|
|
// 分页查询项目信息 |
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
projectListReq.setInstCodes(instCodes); |
|
|
projectListReq.setInstCodes(instCodes); |
|
|
BeanUtils.copyProperties(param,projectListReq); |
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(param, projectListReq); |
|
|
|
|
|
|
|
|
PageVo<ProjectLibListItemVO> projectPage = projectLibManage.projectLibList(projectListReq); |
|
|
PageVo<ProjectLibListItemVO> projectPage = projectLibManage.projectLibList(projectListReq); |
|
|
if (0L == projectPage.getTotal()) { |
|
|
if (0L == projectPage.getTotal()) { |
|
@@ -830,7 +831,7 @@ public class TodoCenterManage { |
|
|
res.setProcessLaunchTime(d.getCreateOn()); |
|
|
res.setProcessLaunchTime(d.getCreateOn()); |
|
|
return res; |
|
|
return res; |
|
|
}).collect(Collectors.toList()); |
|
|
}).collect(Collectors.toList()); |
|
|
return PageVo.of(resVos,projectPage.getTotal()); |
|
|
|
|
|
|
|
|
return PageVo.of(resVos, projectPage.getTotal()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|