@@ -6,7 +6,6 @@ import com.ningdatech.pmapi.organization.manage.OrganizationManage; | |||||
import com.ningdatech.pmapi.organization.model.po.ReqOrganizationListPO; | import com.ningdatech.pmapi.organization.model.po.ReqOrganizationListPO; | ||||
import com.ningdatech.pmapi.organization.model.po.ReqSynthesizePO; | import com.ningdatech.pmapi.organization.model.po.ReqSynthesizePO; | ||||
import com.ningdatech.pmapi.organization.model.vo.KeyTreeVO; | import com.ningdatech.pmapi.organization.model.vo.KeyTreeVO; | ||||
import com.ningdatech.pmapi.organization.model.vo.OrganizationSynthesizeTreeVO; | |||||
import com.ningdatech.pmapi.organization.model.vo.OrganizationTreeVO; | import com.ningdatech.pmapi.organization.model.vo.OrganizationTreeVO; | ||||
import com.ningdatech.pmapi.organization.model.vo.ResOrganizationListVO; | import com.ningdatech.pmapi.organization.model.vo.ResOrganizationListVO; | ||||
import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
@@ -50,15 +49,9 @@ public class DingOrganizationController { | |||||
return organizationManage.getChildOrganizationList(parentCode); | return organizationManage.getChildOrganizationList(parentCode); | ||||
} | } | ||||
@ApiOperation("综合列表筛选") | |||||
@PostMapping("/synthesize-list") | |||||
public List<OrganizationSynthesizeTreeVO> organizationSynthesizeList(@Valid @RequestBody ReqSynthesizePO request) { | |||||
return organizationManage.organizationSynthesizeList(request); | |||||
} | |||||
@ApiOperation("组织树状列表筛选") | |||||
@ApiOperation("组织树状列表筛选(前端定制化接口不可复用)") | |||||
@PostMapping("/tree-list") | @PostMapping("/tree-list") | ||||
public List<KeyTreeVO> treeVOList(@Valid @RequestBody ReqSynthesizePO request) { | public List<KeyTreeVO> treeVOList(@Valid @RequestBody ReqSynthesizePO request) { | ||||
return organizationManage.treeVOList(request); | |||||
return organizationManage.treeRubbishVOList(request); | |||||
} | } | ||||
} | } |
@@ -13,8 +13,6 @@ import com.ningdatech.pmapi.organization.model.entity.DingOrganization; | |||||
import com.ningdatech.pmapi.organization.model.po.ReqOrganizationListPO; | import com.ningdatech.pmapi.organization.model.po.ReqOrganizationListPO; | ||||
import com.ningdatech.pmapi.organization.model.po.ReqSynthesizePO; | import com.ningdatech.pmapi.organization.model.po.ReqSynthesizePO; | ||||
import com.ningdatech.pmapi.organization.model.vo.KeyTreeVO; | import com.ningdatech.pmapi.organization.model.vo.KeyTreeVO; | ||||
import com.ningdatech.pmapi.organization.model.vo.OrganizationSynthesizeTreeVO; | |||||
import com.ningdatech.pmapi.organization.model.vo.OrganizationSynthesizeTreeVO.OrganizationMemberInfo; | |||||
import com.ningdatech.pmapi.organization.model.vo.OrganizationTreeVO; | import com.ningdatech.pmapi.organization.model.vo.OrganizationTreeVO; | ||||
import com.ningdatech.pmapi.organization.model.vo.ResOrganizationListVO; | import com.ningdatech.pmapi.organization.model.vo.ResOrganizationListVO; | ||||
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService; | import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService; | ||||
@@ -26,7 +24,6 @@ import org.springframework.stereotype.Component; | |||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.Comparator; | import java.util.Comparator; | ||||
import java.util.List; | import java.util.List; | ||||
import java.util.Map; | |||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
/** | /** | ||||
@@ -110,106 +107,63 @@ public class OrganizationManage { | |||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
} | } | ||||
public List<OrganizationSynthesizeTreeVO> organizationSynthesizeList(ReqSynthesizePO request) { | |||||
String parentCode = request.getParentCode(); | |||||
Boolean needMember = request.getNeedMember(); | |||||
public List<KeyTreeVO> treeRubbishVOList(ReqSynthesizePO request) { | |||||
String organizationCode = request.getOrganizationCode(); | |||||
List<OrganizationTreeVO> childOrganizationList = getChildOrganizationList(parentCode); | |||||
List<OrganizationSynthesizeTreeVO> organizationSynthesizeTreeVOList = childOrganizationList.stream().map(r -> { | |||||
OrganizationSynthesizeTreeVO organizationSynthesizeTreeVO = new OrganizationSynthesizeTreeVO(); | |||||
organizationSynthesizeTreeVO.setName(r.getName()); | |||||
organizationSynthesizeTreeVO.setOrganizationCode(r.getOrganizationCode()); | |||||
organizationSynthesizeTreeVO.setParentCode(r.getParentCode()); | |||||
return organizationSynthesizeTreeVO; | |||||
}).collect(Collectors.toList()); | |||||
if (needMember && organizationSynthesizeTreeVOList.size() > 0) { | |||||
List<String> organizationCodeList = organizationSynthesizeTreeVOList.stream() | |||||
.map(OrganizationSynthesizeTreeVO::getOrganizationCode).collect(Collectors.toList()); | |||||
List<DingEmployeeInfo> dingEmployeeInfoList = iDingEmployeeInfoService.list(Wrappers.lambdaQuery(DingEmployeeInfo.class) | |||||
.eq(DingEmployeeInfo::getMainJob, "true") | |||||
.in(DingEmployeeInfo::getOrganizationCode, organizationCodeList)); | |||||
Map<String, List<DingEmployeeInfo>> organizationCodeGroupMap = dingEmployeeInfoList.stream() | |||||
.collect(Collectors.groupingBy(DingEmployeeInfo::getOrganizationCode)); | |||||
for (OrganizationSynthesizeTreeVO organizationSynthesizeTreeVO : organizationSynthesizeTreeVOList) { | |||||
String organizationCode = organizationSynthesizeTreeVO.getOrganizationCode(); | |||||
List<DingEmployeeInfo> dingEmployeeInfoGroupList = organizationCodeGroupMap.get(organizationCode); | |||||
if (CollUtil.isNotEmpty(dingEmployeeInfoGroupList)) { | |||||
List<OrganizationMemberInfo> organizationMemberInfoList = dingEmployeeInfoGroupList.stream().map(r -> { | |||||
OrganizationMemberInfo organizationMemberInfo = new OrganizationMemberInfo(); | |||||
organizationMemberInfo.setEmployeeCode(r.getEmployeeCode()); | |||||
organizationMemberInfo.setName(r.getEmployeeName()); | |||||
return organizationMemberInfo; | |||||
}).collect(Collectors.toList()); | |||||
organizationSynthesizeTreeVO.setMemberList(organizationMemberInfoList); | |||||
} | |||||
} | |||||
List<DingOrganization> dingOrganizationList = new ArrayList<>(); | |||||
List<String> organizationCodeList = new ArrayList<>(); | |||||
if (StrUtils.isBlank(organizationCode)) { | |||||
organizationCodeList = dingOrganizationProperties.getDeptVisibleScopes(); | |||||
} else { | |||||
organizationCodeList = CollectionUtil.toList(organizationCode); | |||||
} | } | ||||
dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class) | |||||
.in(DingOrganization::getOrganizationCode, organizationCodeList)); | |||||
return organizationSynthesizeTreeVOList; | |||||
} | |||||
public List<KeyTreeVO> treeVOList(ReqSynthesizePO request) { | |||||
String parentCode = request.getParentCode(); | |||||
Boolean needMember = request.getNeedMember(); | |||||
List<OrganizationTreeVO> childOrganizationList = getChildOrganizationList(parentCode); | |||||
List<KeyTreeVO> orgKeyTreeVOList = childOrganizationList.stream().map(r -> { | |||||
List<KeyTreeVO> orgKeyTreeVOList = dingOrganizationList.stream().map(r -> { | |||||
KeyTreeVO keyTreeVO = new KeyTreeVO(); | KeyTreeVO keyTreeVO = new KeyTreeVO(); | ||||
keyTreeVO.setTitle(r.getName()); | |||||
keyTreeVO.setTitle(r.getOrganizationName()); | |||||
keyTreeVO.setKey(r.getOrganizationCode()); | keyTreeVO.setKey(r.getOrganizationCode()); | ||||
keyTreeVO.setType("ORGANIZATION"); | keyTreeVO.setType("ORGANIZATION"); | ||||
return keyTreeVO; | return keyTreeVO; | ||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
treeVOList(request.getNeedMember(), orgKeyTreeVOList); | |||||
return orgKeyTreeVOList; | |||||
} | |||||
if (StringUtils.isNotBlank(parentCode) && !needMember){ | |||||
List<DingEmployeeInfo> dingEmployeeInfoList = iDingEmployeeInfoService.list(Wrappers.lambdaQuery(DingEmployeeInfo.class) | |||||
.eq(DingEmployeeInfo::getMainJob, "true") | |||||
.eq(DingEmployeeInfo::getOrganizationCode, parentCode)); | |||||
List<KeyTreeVO> memberChildren = dingEmployeeInfoList.stream().map(r -> { | |||||
KeyTreeVO child = new KeyTreeVO(); | |||||
child.setKey(r.getEmployeeCode()); | |||||
child.setTitle(r.getEmployeeName()); | |||||
child.setType("MEMBER"); | |||||
return child; | |||||
public void treeVOList(Boolean needMember, List<KeyTreeVO> basicOrgKeyTreeVOList) { | |||||
for (KeyTreeVO basicOrgKeyTreeVO : basicOrgKeyTreeVOList) { | |||||
String parentCode = basicOrgKeyTreeVO.getKey(); | |||||
List<OrganizationTreeVO> childOrganizationList = getChildOrganizationList(parentCode); | |||||
List<KeyTreeVO> orgKeyTreeVOList = childOrganizationList.stream().map(r -> { | |||||
KeyTreeVO keyTreeVO = new KeyTreeVO(); | |||||
keyTreeVO.setTitle(r.getName()); | |||||
keyTreeVO.setKey(r.getOrganizationCode()); | |||||
keyTreeVO.setType("ORGANIZATION"); | |||||
return keyTreeVO; | |||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
if (CollUtil.isNotEmpty(memberChildren)) { | |||||
orgKeyTreeVOList.addAll(memberChildren); | |||||
if (StringUtils.isNotBlank(parentCode) && needMember) { | |||||
List<DingEmployeeInfo> dingEmployeeInfoList = iDingEmployeeInfoService.list(Wrappers.lambdaQuery(DingEmployeeInfo.class) | |||||
.eq(DingEmployeeInfo::getMainJob, "true") | |||||
.eq(DingEmployeeInfo::getOrganizationCode, parentCode)); | |||||
List<KeyTreeVO> memberChildren = dingEmployeeInfoList.stream().map(r -> { | |||||
KeyTreeVO child = new KeyTreeVO(); | |||||
child.setKey(r.getEmployeeCode()); | |||||
child.setTitle(r.getEmployeeName()); | |||||
child.setType("MEMBER"); | |||||
return child; | |||||
}).collect(Collectors.toList()); | |||||
if (CollUtil.isNotEmpty(memberChildren)) { | |||||
orgKeyTreeVOList.addAll(memberChildren); | |||||
} | |||||
} | } | ||||
basicOrgKeyTreeVO.setChildren(orgKeyTreeVOList); | |||||
} | } | ||||
} | |||||
// if (needMember && orgKeyTreeVOList.size() > 0) { | |||||
// List<String> organizationCodeList = orgKeyTreeVOList.stream() | |||||
// .map(KeyTreeVO::getKey).collect(Collectors.toList()); | |||||
// List<DingEmployeeInfo> dingEmployeeInfoList = iDingEmployeeInfoService.list(Wrappers.lambdaQuery(DingEmployeeInfo.class) | |||||
// .eq(DingEmployeeInfo::getMainJob, "true") | |||||
// .in(DingEmployeeInfo::getOrganizationCode, organizationCodeList)); | |||||
// | |||||
// Map<String, List<DingEmployeeInfo>> organizationCodeGroupMap = dingEmployeeInfoList.stream() | |||||
// .collect(Collectors.groupingBy(DingEmployeeInfo::getOrganizationCode)); | |||||
// | |||||
// for (KeyTreeVO keyTreeVO : orgKeyTreeVOList) { | |||||
// String organizationCode = keyTreeVO.getKey(); | |||||
// List<DingEmployeeInfo> dingEmployeeInfoGroupList = organizationCodeGroupMap.get(organizationCode); | |||||
// if (CollUtil.isNotEmpty(dingEmployeeInfoGroupList)) { | |||||
// List<KeyTreeVO> memberChildren = dingEmployeeInfoGroupList.stream().map(r -> { | |||||
// KeyTreeVO child = new KeyTreeVO(); | |||||
// child.setKey(r.getEmployeeCode()); | |||||
// child.setTitle(r.getEmployeeName()); | |||||
// child.setType("MEMBER"); | |||||
// return child; | |||||
// }).collect(Collectors.toList()); | |||||
// keyTreeVO.setChildren(memberChildren); | |||||
// } | |||||
// } | |||||
// } | |||||
return orgKeyTreeVOList; | |||||
} | |||||
} | } |
@@ -15,8 +15,8 @@ import javax.validation.constraints.NotBlank; | |||||
@ApiModel("单位列表综合筛选请求") | @ApiModel("单位列表综合筛选请求") | ||||
public class ReqSynthesizePO { | public class ReqSynthesizePO { | ||||
@ApiModelProperty("父组织code") | |||||
private String parentCode; | |||||
@ApiModelProperty("组织code") | |||||
private String organizationCode; | |||||
@ApiModelProperty("是否需要组织成员列表") | @ApiModelProperty("是否需要组织成员列表") | ||||
private Boolean needMember = false; | private Boolean needMember = false; | ||||
@@ -158,6 +158,10 @@ public class TodoCenterManage { | |||||
public PageVo<ResToBeProcessedVO> todoProjectList(ToBeProcessedReq param) { | public PageVo<ResToBeProcessedVO> todoProjectList(ToBeProcessedReq param) { | ||||
// 获取登录用户ID | // 获取登录用户ID | ||||
Long userId = LoginUserUtil.getUserId(); | Long userId = LoginUserUtil.getUserId(); | ||||
// 获取登录用户全量信息 | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
// 获取员工浙政钉code | |||||
String employeeCode = userFullInfo.getEmployeeCode(); | |||||
// 查出项目库项目 | // 查出项目库项目 | ||||
ProjectListReq projectListReq = new ProjectListReq(); | ProjectListReq projectListReq = new ProjectListReq(); | ||||
@@ -184,6 +188,7 @@ public class TodoCenterManage { | |||||
Integer pageSize = param.getPageSize(); | Integer pageSize = param.getPageSize(); | ||||
req.setProcessDefId(param.getProcessDefId()); | req.setProcessDefId(param.getProcessDefId()); | ||||
req.setUserId(String.valueOf(userId)); | req.setUserId(String.valueOf(userId)); | ||||
req.setEmployeeCode(employeeCode); | |||||
List<ProcessTaskVo> todoList = processTaskService.getUserTodoList(req); | List<ProcessTaskVo> todoList = processTaskService.getUserTodoList(req); | ||||
if (CollUtil.isEmpty(todoList)) { | if (CollUtil.isEmpty(todoList)) { | ||||
@@ -230,6 +235,10 @@ public class TodoCenterManage { | |||||
public void exportTodoList(HttpServletResponse response, ToBeProcessedExportReq param) { | public void exportTodoList(HttpServletResponse response, ToBeProcessedExportReq param) { | ||||
// 获取登录用户ID | // 获取登录用户ID | ||||
Long userId = LoginUserUtil.getUserId(); | Long userId = LoginUserUtil.getUserId(); | ||||
// 获取用户全量用户信息 | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
// 获取登录用户浙政钉code | |||||
String employeeCode = userFullInfo.getEmployeeCode(); | |||||
// 查出项目库项目 | // 查出项目库项目 | ||||
ProjectListReq projectListReq = new ProjectListReq(); | ProjectListReq projectListReq = new ProjectListReq(); | ||||
@@ -251,6 +260,7 @@ public class TodoCenterManage { | |||||
req.setInstCodes(instCodes); | req.setInstCodes(instCodes); | ||||
req.setProcessDefId(param.getProcessDefId()); | req.setProcessDefId(param.getProcessDefId()); | ||||
req.setUserId(String.valueOf(userId)); | req.setUserId(String.valueOf(userId)); | ||||
req.setEmployeeCode(employeeCode); | |||||
BeanUtils.copyProperties(param,req); | BeanUtils.copyProperties(param,req); | ||||
userTodoList = processTaskService.getUserTodoList(req); | userTodoList = processTaskService.getUserTodoList(req); | ||||
} | } | ||||
@@ -287,7 +297,10 @@ public class TodoCenterManage { | |||||
public void handler(ReqProcessHandlerDTO param) { | public void handler(ReqProcessHandlerDTO param) { | ||||
// 获取登录用户ID | // 获取登录用户ID | ||||
Long userId = LoginUserUtil.getUserId(); | Long userId = LoginUserUtil.getUserId(); | ||||
// 获取登录用户全量信息 | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
// 获取登录用户浙政钉code | |||||
String employeeCode = userFullInfo.getEmployeeCode(); | |||||
// 获取入参 | // 获取入参 | ||||
String processInstanceId = param.getInstanceId(); | String processInstanceId = param.getInstanceId(); | ||||
Long projectId = param.getProjectId(); | Long projectId = param.getProjectId(); | ||||
@@ -311,7 +324,8 @@ public class TodoCenterManage { | |||||
.singleResult(); | .singleResult(); | ||||
// 获取流程发起人信息 | // 获取流程发起人信息 | ||||
String startUserId = instance.getStartUserId(); | String startUserId = instance.getStartUserId(); | ||||
UserInfo startUserInfo = userInfoService.getById(Long.valueOf(startUserId)); | |||||
UserInfo startUserInfo = userInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) | |||||
.eq(UserInfo::getEmployeeCode, startUserId)); | |||||
// 获取流程定义名称 | // 获取流程定义名称 | ||||
String processDefinitionName = instance.getProcessDefinitionName(); | String processDefinitionName = instance.getProcessDefinitionName(); | ||||
@@ -321,7 +335,7 @@ public class TodoCenterManage { | |||||
// 盖章并通过 | // 盖章并通过 | ||||
case SEAL_PASS: | case SEAL_PASS: | ||||
// 通过该任务,流程到下一审核人处 | // 通过该任务,流程到下一审核人处 | ||||
processTaskService.handleTask(param, userId); | |||||
processTaskService.handleTask(param, employeeCode); | |||||
// 获取流程通过后的流程实例 | // 获取流程通过后的流程实例 | ||||
HistoricProcessInstance newInstance = historyService.createHistoricProcessInstanceQuery() | HistoricProcessInstance newInstance = historyService.createHistoricProcessInstanceQuery() | ||||
.processInstanceId(processInstanceId) | .processInstanceId(processInstanceId) | ||||
@@ -395,7 +409,7 @@ public class TodoCenterManage { | |||||
case REJECT: | case REJECT: | ||||
// 驳回该任务,中止流程并使项目进入对应状态,给项目创建人、流程发起人发送浙政钉工作通知: | // 驳回该任务,中止流程并使项目进入对应状态,给项目创建人、流程发起人发送浙政钉工作通知: | ||||
// 【项目名称】的【流程名称】被驳回,请及时处理。 | // 【项目名称】的【流程名称】被驳回,请及时处理。 | ||||
processTaskService.handleTask(param, userId); | |||||
processTaskService.handleTask(param, employeeCode); | |||||
// 更新项目状态和流程状态 | // 更新项目状态和流程状态 | ||||
updateRejectProjectStatus(userId, declaredProject); | updateRejectProjectStatus(userId, declaredProject); | ||||
// 获取发送浙政钉工作通知必要信息 | // 获取发送浙政钉工作通知必要信息 | ||||
@@ -410,7 +424,7 @@ public class TodoCenterManage { | |||||
// 退回 | // 退回 | ||||
case BACK: | case BACK: | ||||
// 退回该任务 | // 退回该任务 | ||||
processTaskService.handleTask(param, userId); | |||||
processTaskService.handleTask(param, employeeCode); | |||||
// 给项目创建人、流程发起人发送浙政钉工作通知:【项目名称】的【流程名称】被退回,请及时处理。 | // 给项目创建人、流程发起人发送浙政钉工作通知:【项目名称】的【流程名称】被退回,请及时处理。 | ||||
// 获取发送浙政钉工作通知必要信息 | // 获取发送浙政钉工作通知必要信息 | ||||
WorkNoticeInfo backWorkNoticeInfo = getSendWorkNoticeInfo(startUserInfo); | WorkNoticeInfo backWorkNoticeInfo = getSendWorkNoticeInfo(startUserInfo); | ||||
@@ -424,9 +438,9 @@ public class TodoCenterManage { | |||||
// 撤回(流程发起人和当前流程审核人的前一个审核人操作) | // 撤回(流程发起人和当前流程审核人的前一个审核人操作) | ||||
case WITHDRAW: | case WITHDRAW: | ||||
// 登录用户是流程发起人,且是流程发起人撤回 | // 登录用户是流程发起人,且是流程发起人撤回 | ||||
if (userId.equals(Long.valueOf(startUserId)) | |||||
if (employeeCode.equals(startUserId) | |||||
&& ProcessConstant.Field.ROOT.equals(param.getTaskId())) { | && ProcessConstant.Field.ROOT.equals(param.getTaskId())) { | ||||
processTaskService.handleTask(param, userId); | |||||
processTaskService.handleTask(param, employeeCode); | |||||
// 若是流程发起人点击撤回,项目回到上一个状态,需调用状态机更新项目状态,流程状态更新为审核通过 | // 若是流程发起人点击撤回,项目回到上一个状态,需调用状态机更新项目状态,流程状态更新为审核通过 | ||||
switch (Objects.requireNonNull(ProjectStatusEnum.getValue(projectStatus))) { | switch (Objects.requireNonNull(ProjectStatusEnum.getValue(projectStatus))) { | ||||
// 当前项目状态是单位内部审核中 | // 当前项目状态是单位内部审核中 | ||||
@@ -473,7 +487,7 @@ public class TodoCenterManage { | |||||
} else if (!userFlag) { | } else if (!userFlag) { | ||||
throw new BizException("当前登录用户无法进行撤回操作!"); | throw new BizException("当前登录用户无法进行撤回操作!"); | ||||
} else { | } else { | ||||
processTaskService.handleTask(param, userId); | |||||
processTaskService.handleTask(param, employeeCode); | |||||
} | } | ||||
} | } | ||||
break; | break; | ||||
@@ -750,6 +764,10 @@ public class TodoCenterManage { | |||||
// 获取登录用户ID | // 获取登录用户ID | ||||
Long userId = LoginUserUtil.getUserId(); | Long userId = LoginUserUtil.getUserId(); | ||||
// 获取登录用户全量信息 | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
// 获取登录用户浙政钉code | |||||
String employeeCode = userFullInfo.getEmployeeCode(); | |||||
// 查出项目库项目 | // 查出项目库项目 | ||||
ProjectListReq projectListReq = new ProjectListReq(); | ProjectListReq projectListReq = new ProjectListReq(); | ||||
@@ -773,6 +791,7 @@ public class TodoCenterManage { | |||||
Integer pageSize = param.getPageSize(); | Integer pageSize = param.getPageSize(); | ||||
req.setProcessDefId(param.getProcessDefId()); | req.setProcessDefId(param.getProcessDefId()); | ||||
req.setUserId(String.valueOf(userId)); | req.setUserId(String.valueOf(userId)); | ||||
req.setEmployeeCode(employeeCode); | |||||
req.setInstCodes(instCodes); | req.setInstCodes(instCodes); | ||||
List<ProcessTaskVo> iDoList = processTaskService.getUserIdoList(req); | List<ProcessTaskVo> iDoList = processTaskService.getUserIdoList(req); | ||||
if (CollUtil.isEmpty(iDoList)) { | if (CollUtil.isEmpty(iDoList)) { | ||||
@@ -811,6 +830,10 @@ public class TodoCenterManage { | |||||
public void idoExport(HttpServletResponse response, ToBeProcessedExportReq param) { | public void idoExport(HttpServletResponse response, ToBeProcessedExportReq param) { | ||||
// 获取登录用户ID | // 获取登录用户ID | ||||
Long userId = LoginUserUtil.getUserId(); | Long userId = LoginUserUtil.getUserId(); | ||||
// 获取登录用户全量信息 | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
// 获取登录用户浙政钉code | |||||
String employeeCode = userFullInfo.getEmployeeCode(); | |||||
//因为要解耦 不能把项目和工作流一起查 | //因为要解耦 不能把项目和工作流一起查 | ||||
// 查出项目库项目 | // 查出项目库项目 | ||||
@@ -834,6 +857,7 @@ public class TodoCenterManage { | |||||
TodoCenterListReqDTO req = new TodoCenterListReqDTO(); | TodoCenterListReqDTO req = new TodoCenterListReqDTO(); | ||||
req.setProcessDefId(param.getProcessDefId()); | req.setProcessDefId(param.getProcessDefId()); | ||||
req.setUserId(String.valueOf(userId)); | req.setUserId(String.valueOf(userId)); | ||||
req.setEmployeeCode(employeeCode); | |||||
req.setInstCodes(instCodes); | req.setInstCodes(instCodes); | ||||
userIdoList = processTaskService.getUserIdoList(req); | userIdoList = processTaskService.getUserIdoList(req); | ||||
} | } | ||||
@@ -873,9 +897,12 @@ public class TodoCenterManage { | |||||
* @since 2023/02/06 | * @since 2023/02/06 | ||||
*/ | */ | ||||
public PageVo<ResToBeProcessedVO> mySubmittedList(ToBeProcessedReq param) { | public PageVo<ResToBeProcessedVO> mySubmittedList(ToBeProcessedReq param) { | ||||
// 获取登录用户ID | // 获取登录用户ID | ||||
Long userId = LoginUserUtil.getUserId(); | Long userId = LoginUserUtil.getUserId(); | ||||
// 获取登录用户全量信息 | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
// 获取登录用户浙政钉code | |||||
String employeeCode = userFullInfo.getEmployeeCode(); | |||||
// 查出项目库项目 | // 查出项目库项目 | ||||
ProjectListReq projectListReq = new ProjectListReq(); | ProjectListReq projectListReq = new ProjectListReq(); | ||||
@@ -901,6 +928,7 @@ public class TodoCenterManage { | |||||
Integer pageSize = param.getPageSize(); | Integer pageSize = param.getPageSize(); | ||||
req.setProcessDefId(param.getProcessDefId()); | req.setProcessDefId(param.getProcessDefId()); | ||||
req.setUserId(String.valueOf(userId)); | req.setUserId(String.valueOf(userId)); | ||||
req.setEmployeeCode(employeeCode); | |||||
req.setInstCodes(instCodes); | req.setInstCodes(instCodes); | ||||
List<ProcessInstanceVo> submittedList = processInstanceService.getUserSubmittedList(req); | List<ProcessInstanceVo> submittedList = processInstanceService.getUserSubmittedList(req); | ||||
@@ -913,7 +941,6 @@ public class TodoCenterManage { | |||||
.limit(pageSize) | .limit(pageSize) | ||||
.collect(Collectors.toList()); | .collect(Collectors.toList()); | ||||
List<ResToBeProcessedVO> resVos = userSubmittedList.stream().map(d -> { | List<ResToBeProcessedVO> resVos = userSubmittedList.stream().map(d -> { | ||||
ResToBeProcessedVO res = new ResToBeProcessedVO(); | ResToBeProcessedVO res = new ResToBeProcessedVO(); | ||||
Project project = projectInfoMap.get(d.getInstanceId()); | Project project = projectInfoMap.get(d.getInstanceId()); | ||||
@@ -941,6 +968,10 @@ public class TodoCenterManage { | |||||
// 获取登录用户ID | // 获取登录用户ID | ||||
long userId = LoginUserUtil.getUserId(); | long userId = LoginUserUtil.getUserId(); | ||||
// 获取登录用户全量信息 | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
// 获取登录用户浙政钉code | |||||
String employeeCode = userFullInfo.getEmployeeCode(); | |||||
// 查出项目库项目 | // 查出项目库项目 | ||||
ProjectListReq projectListReq = new ProjectListReq(); | ProjectListReq projectListReq = new ProjectListReq(); | ||||
@@ -963,6 +994,7 @@ public class TodoCenterManage { | |||||
TodoCenterListReqDTO req = new TodoCenterListReqDTO(); | TodoCenterListReqDTO req = new TodoCenterListReqDTO(); | ||||
req.setProcessDefId(param.getProcessDefId()); | req.setProcessDefId(param.getProcessDefId()); | ||||
req.setUserId(String.valueOf(userId)); | req.setUserId(String.valueOf(userId)); | ||||
req.setEmployeeCode(employeeCode); | |||||
req.setInstCodes(instCodes); | req.setInstCodes(instCodes); | ||||
userSubmittedList = processInstanceService.getUserSubmittedList(req); | userSubmittedList = processInstanceService.getUserSubmittedList(req); | ||||
} | } | ||||
@@ -1005,6 +1037,10 @@ public class TodoCenterManage { | |||||
// 获取登录用户ID | // 获取登录用户ID | ||||
Long userId = LoginUserUtil.getUserId(); | Long userId = LoginUserUtil.getUserId(); | ||||
// 获取登录用户全量信息 | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
// 获取登录用户浙政钉code | |||||
String employeeCode = userFullInfo.getEmployeeCode(); | |||||
// 查出项目库项目 | // 查出项目库项目 | ||||
ProjectListReq projectListReq = new ProjectListReq(); | ProjectListReq projectListReq = new ProjectListReq(); | ||||
@@ -1030,7 +1066,8 @@ public class TodoCenterManage { | |||||
Integer pageSize = param.getPageSize(); | Integer pageSize = param.getPageSize(); | ||||
req.setProcessDefId(param.getProcessDefId()); | req.setProcessDefId(param.getProcessDefId()); | ||||
req.setUserId(String.valueOf(userId)); | req.setUserId(String.valueOf(userId)); | ||||
// req.setInstCodes(instCodes); | |||||
req.setEmployeeCode(employeeCode); | |||||
req.setInstCodes(instCodes); | |||||
BeanUtils.copyProperties(param,req); | BeanUtils.copyProperties(param,req); | ||||
List<ProcessInstanceVo> ccMeList = processInstanceService.getCcMeList(req); | List<ProcessInstanceVo> ccMeList = processInstanceService.getCcMeList(req); | ||||
@@ -1071,6 +1108,10 @@ public class TodoCenterManage { | |||||
// 获取登录用户ID | // 获取登录用户ID | ||||
Long userId = LoginUserUtil.getUserId(); | Long userId = LoginUserUtil.getUserId(); | ||||
// 获取登录用户全量信息 | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
// 获取登录用户浙政钉code | |||||
String employeeCode = userFullInfo.getEmployeeCode(); | |||||
// 查出项目库项目 | // 查出项目库项目 | ||||
ProjectListReq projectListReq = new ProjectListReq(); | ProjectListReq projectListReq = new ProjectListReq(); | ||||
@@ -1093,13 +1134,12 @@ public class TodoCenterManage { | |||||
TodoCenterListReqDTO req = new TodoCenterListReqDTO(); | TodoCenterListReqDTO req = new TodoCenterListReqDTO(); | ||||
req.setProcessDefId(param.getProcessDefId()); | req.setProcessDefId(param.getProcessDefId()); | ||||
req.setUserId(String.valueOf(userId)); | req.setUserId(String.valueOf(userId)); | ||||
req.setEmployeeCode(employeeCode); | |||||
req.setInstCodes(instCodes); | req.setInstCodes(instCodes); | ||||
BeanUtils.copyProperties(param,req); | BeanUtils.copyProperties(param,req); | ||||
ccMeList = processInstanceService.getCcMeList(req); | ccMeList = processInstanceService.getCcMeList(req); | ||||
} | } | ||||
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); | ExcelExportWriter excelExportWriter = new ExcelExportWriter(); | ||||
String fileName = null; | String fileName = null; | ||||
@@ -1343,9 +1383,13 @@ public class TodoCenterManage { | |||||
//获取当前登录人的 待办中心统计数据 | //获取当前登录人的 待办中心统计数据 | ||||
public TodoCenterStatisticsVO todoCenterStatistics(){ | public TodoCenterStatisticsVO todoCenterStatistics(){ | ||||
Long userId = LoginUserUtil.getUserId(); | Long userId = LoginUserUtil.getUserId(); | ||||
// 获取登录用户全量信息 | |||||
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); | |||||
// 获取登录用户浙政钉code | |||||
String employeeCode = userFullInfo.getEmployeeCode(); | |||||
//为了查询效率 还是自己去写统计接口 | //为了查询效率 还是自己去写统计接口 | ||||
TodoCenterStatisticsPO statistics = statisticsService.getStatistics(userId); | |||||
TodoCenterStatisticsPO statistics = statisticsService.getStatistics(employeeCode); | |||||
TodoCenterStatisticsVO statisticsVO = BeanUtil.copyProperties(statistics,TodoCenterStatisticsVO.class); | TodoCenterStatisticsVO statisticsVO = BeanUtil.copyProperties(statistics,TodoCenterStatisticsVO.class); | ||||
return statisticsVO; | return statisticsVO; | ||||
@@ -7,11 +7,11 @@ import org.apache.ibatis.annotations.Param; | |||||
public interface StatisticsMapper extends BaseMapper { | public interface StatisticsMapper extends BaseMapper { | ||||
TodoCenterStatisticsPO getStatistics(@Param("userId") String userId); | |||||
TodoCenterStatisticsPO getStatistics(@Param("employeeCode") String employeeCode); | |||||
TodoCenterStatisticsPO getTodoOrIdo(@Param("userId") String userId); | |||||
TodoCenterStatisticsPO getTodoOrIdo(@Param("employeeCode") String employeeCode); | |||||
TodoCenterStatisticsPO mysubmitNum(@Param("userId") String userId); | |||||
TodoCenterStatisticsPO mysubmitNum(@Param("employeeCode") String employeeCode); | |||||
TodoCenterStatisticsPO ccNums(@Param("userId") String userId); | |||||
TodoCenterStatisticsPO ccNums(@Param("employeeCode") String employeeCode); | |||||
} | } |
@@ -10,10 +10,10 @@ | |||||
sum(CASE WHEN tol.ccmeNum IS NOT NULL AND tol.ccmeNum > 0 THEN 1 ELSE 0 end) ccmeNum | sum(CASE WHEN tol.ccmeNum IS NOT NULL AND tol.ccmeNum > 0 THEN 1 ELSE 0 end) ccmeNum | ||||
FROM ( | FROM ( | ||||
SELECT | SELECT | ||||
sum(CASE WHEN ht.assignee_ = #{userId} AND ht.end_time_ is NULL THEN 1 end) todoNum, | |||||
sum(CASE WHEN ht.assignee_ = #{userId} AND ht.end_time_ IS not NULL THEN 1 end) idoNum, | |||||
sum(CASE WHEN hp.start_user_id_ = #{userId} THEN 1 end) mysubmitNum, | |||||
sum(CASE WHEN cc.user_id = #{userId} THEN 1 end) ccmeNum | |||||
sum(CASE WHEN ht.assignee_ = #{employeeCode} AND ht.end_time_ is NULL THEN 1 end) todoNum, | |||||
sum(CASE WHEN ht.assignee_ = #{employeeCode} AND ht.end_time_ IS not NULL THEN 1 end) idoNum, | |||||
sum(CASE WHEN hp.start_user_id_ = #{employeeCode} THEN 1 end) mysubmitNum, | |||||
sum(CASE WHEN cc.user_id = #{employeeCode} THEN 1 end) ccmeNum | |||||
FROM | FROM | ||||
act_hi_procinst hp | act_hi_procinst hp | ||||
LEFT JOIN | LEFT JOIN | ||||
@@ -27,8 +27,8 @@ | |||||
<select id="getTodoOrIdo" parameterType="java.lang.String" | <select id="getTodoOrIdo" parameterType="java.lang.String" | ||||
resultType="com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO"> | resultType="com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO"> | ||||
SELECT | SELECT | ||||
sum(CASE WHEN ht.assignee_ = #{userId} AND ht.end_time_ is NULL THEN 1 end) todoNum, | |||||
sum(CASE WHEN ht.assignee_ = #{userId} AND ht.end_time_ IS not NULL THEN 1 end) idoNum | |||||
sum(CASE WHEN ht.assignee_ = #{employeeCode} AND ht.end_time_ is NULL THEN 1 end) todoNum, | |||||
sum(CASE WHEN ht.assignee_ = #{employeeCode} AND ht.end_time_ IS not NULL THEN 1 end) idoNum | |||||
FROM | FROM | ||||
act_hi_taskinst ht | act_hi_taskinst ht | ||||
</select> | </select> | ||||
@@ -44,7 +44,7 @@ | |||||
act_hi_procinst hp | act_hi_procinst hp | ||||
LEFT JOIN | LEFT JOIN | ||||
act_hi_taskinst ht ON hp.proc_inst_id_ = ht.proc_inst_id_ | act_hi_taskinst ht ON hp.proc_inst_id_ = ht.proc_inst_id_ | ||||
where start_user_id_ = #{userId} | |||||
where start_user_id_ = #{employeeCode} | |||||
GROUP BY hp.id_) tol | GROUP BY hp.id_) tol | ||||
</select> | </select> | ||||
@@ -55,6 +55,6 @@ | |||||
count(0) ccmeNum | count(0) ccmeNum | ||||
FROM | FROM | ||||
wflow_cc_tasks cc | wflow_cc_tasks cc | ||||
where cc.user_id = #{userId} | |||||
where cc.employee_code = #{employeeCode} | |||||
</select> | </select> | ||||
</mapper> | </mapper> |
@@ -11,5 +11,5 @@ import com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO; | |||||
public interface StatisticsService { | public interface StatisticsService { | ||||
//根据用户id 去查询 一些统计数据 | //根据用户id 去查询 一些统计数据 | ||||
TodoCenterStatisticsPO getStatistics(Long userId); | |||||
TodoCenterStatisticsPO getStatistics(String employeeCode); | |||||
} | } |
@@ -21,21 +21,21 @@ public class StatisticsServiceImpl implements StatisticsService { | |||||
private final StatisticsMapper mapper; | private final StatisticsMapper mapper; | ||||
@Override | @Override | ||||
public TodoCenterStatisticsPO getStatistics(Long userId) { | |||||
public TodoCenterStatisticsPO getStatistics(String employeeCode) { | |||||
TodoCenterStatisticsPO res = new TodoCenterStatisticsPO(); | TodoCenterStatisticsPO res = new TodoCenterStatisticsPO(); | ||||
TodoCenterStatisticsPO todoOrIdo = mapper.getTodoOrIdo(String.valueOf(userId)); | |||||
TodoCenterStatisticsPO todoOrIdo = mapper.getTodoOrIdo(employeeCode); | |||||
if(Objects.nonNull(todoOrIdo)){ | if(Objects.nonNull(todoOrIdo)){ | ||||
res.setTodoNum(todoOrIdo.getTodoNum()); | res.setTodoNum(todoOrIdo.getTodoNum()); | ||||
res.setIdoNum(todoOrIdo.getIdoNum()); | res.setIdoNum(todoOrIdo.getIdoNum()); | ||||
} | } | ||||
TodoCenterStatisticsPO submit = mapper.mysubmitNum(String.valueOf(userId)); | |||||
TodoCenterStatisticsPO submit = mapper.mysubmitNum(employeeCode); | |||||
if(Objects.nonNull(submit)){ | if(Objects.nonNull(submit)){ | ||||
res.setMysubmitNum(submit.getMysubmitNum()); | res.setMysubmitNum(submit.getMysubmitNum()); | ||||
} | } | ||||
TodoCenterStatisticsPO ccMe = mapper.ccNums(String.valueOf(userId)); | |||||
TodoCenterStatisticsPO ccMe = mapper.ccNums(employeeCode); | |||||
if(Objects.nonNull(ccMe)){ | if(Objects.nonNull(ccMe)){ | ||||
res.setCcmeNum(ccMe.getCcmeNum()); | res.setCcmeNum(ccMe.getCcmeNum()); | ||||
} | } | ||||