Просмотр исходного кода

信创审核 优化 debug

tags/24080901
PoffyZhang 6 месяцев назад
Родитель
Сommit
a6c30e4c5e
2 измененных файлов: 86 добавлений и 16 удалений
  1. +5
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/controller/TodoCenterController.java
  2. +81
    -16
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/TodoCenterManage.java

+ 5
- 0
hz-pm-api/src/main/java/com/hz/pm/api/todocenter/controller/TodoCenterController.java Просмотреть файл

@@ -189,6 +189,11 @@ public class TodoCenterController {
return todoCenterManage.ccmeList(param);
}

@GetMapping("/ccme-list-xinchuang")
public PageVo<ResToBeProcessedVO> ccmeListXinchuang(@Valid @ModelAttribute ToBeProcessedReq param) {
return todoCenterManage.ccmeListXinchuang(param);
}

/**
* 待办中心-抄送我的项目列表导出
*


+ 81
- 16
hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/TodoCenterManage.java Просмотреть файл

@@ -244,23 +244,24 @@ public class TodoCenterManage {
public PageVo<ResToBeProcessedVO> todoXinchuangList(ToBeProcessedReq param) {
Long userId = Optional.ofNullable(param.getUserId()).orElseGet(LoginUserUtil::getUserId);
String userIdStr = String.valueOf(userId);
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId);

// 查出信创信息
// 查出信创
List<Xinchuang> xinchuangs = xinchuangService.list(Wrappers.lambdaQuery(Xinchuang.class)
.isNotNull(Xinchuang::getInstCode));

if (CollUtil.isEmpty(xinchuangs)) {
return PageVo.empty();
}
Map<Long, Xinchuang> xinchuangMap = CollUtils.listToMap(xinchuangs, Xinchuang::getId);
List<Long> xinchuangIds = CollUtils.fieldList(xinchuangs, Xinchuang::getId);
List<XinchuangInst> xinchuangInsts = xinchuangInstService.listByXinchuangIds(xinchuangIds);

Map<String, Xinchuang> xinchuangMap = CollUtils.listToMap(xinchuangs, Xinchuang::getInstCode);
Map<String, XinchuangInst> xinchuangInstMap = CollUtils.listToMap(xinchuangInsts, XinchuangInst::getInstCode);
List<String> instCodes = CollUtils.fieldList(xinchuangInsts, XinchuangInst::getInstCode);
if (CollUtil.isEmpty(instCodes)) {
return PageVo.empty();
}

// 查出用户工作流
TodoCenterListReqDTO req = new TodoCenterListReqDTO();
req.setInstCodes(instCodes);
@@ -296,9 +297,10 @@ public class TodoCenterManage {
List<String> instanceIds = CollUtils.fieldList(userTodoList, ProcessTaskVo::getInstanceId);

List<ResToBeProcessedVO> resVos = userTodoList.stream().map(d -> {
Xinchuang xinchuang = xinchuangMap.get(d.getInstanceId());
XinchuangInst xinchuangInst = xinchuangInstMap.get(d.getInstanceId());
ResToBeProcessedVO res = new ResToBeProcessedVO();
if(Objects.nonNull(xinchuang)){
if(Objects.nonNull(xinchuangInst) && xinchuangMap.containsKey(xinchuangInst.getXinchuangId())){
Xinchuang xinchuang = xinchuangMap.get(xinchuangInst.getXinchuangId());
res.setXinchuangId(xinchuang.getId());
res.setProjectName(xinchuang.getProjectName());
res.setBuildOrg(xinchuang.getBuildOrgName());
@@ -931,19 +933,19 @@ public class TodoCenterManage {
Long userId = LoginUserUtil.getUserId();
// 获取登录用户浙政钉code
String userIdStr = String.valueOf(userId);
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId);

// 查出信创信息
// 查出信创
List<Xinchuang> xinchuangs = xinchuangService.list(Wrappers.lambdaQuery(Xinchuang.class)
.isNotNull(Xinchuang::getInstCode));

if (xinchuangs.isEmpty()) {
if (CollUtil.isEmpty(xinchuangs)) {
return PageVo.empty();
}
Map<Long, Xinchuang> xinchuangMap = CollUtils.listToMap(xinchuangs, Xinchuang::getId);
List<Long> xinchuangIds = CollUtils.fieldList(xinchuangs, Xinchuang::getId);
List<XinchuangInst> xinchuangInsts = xinchuangInstService.listByXinchuangIds(xinchuangIds);

Map<String, Xinchuang> xinchuangMap = CollUtils.listToMap(xinchuangs, Xinchuang::getInstCode);
Map<String, XinchuangInst> xinchuangInstMap = CollUtils.listToMap(xinchuangInsts, XinchuangInst::getInstCode);
List<String> instCodes = CollUtils.fieldList(xinchuangInsts, XinchuangInst::getInstCode);
if (CollUtil.isEmpty(instCodes)) {
return PageVo.empty();
@@ -967,8 +969,9 @@ public class TodoCenterManage {
.collect(Collectors.toList());
List<ResToBeProcessedVO> resVos = userIdoList.stream().map(d -> {
ResToBeProcessedVO res = new ResToBeProcessedVO();
Xinchuang xinchuang = xinchuangMap.get(d.getInstanceId());
if(Objects.nonNull(xinchuang)){
XinchuangInst xinchuangInst = xinchuangInstMap.get(d.getInstanceId());
if(Objects.nonNull(xinchuangInst) && xinchuangMap.containsKey(xinchuangInst.getXinchuangId())){
Xinchuang xinchuang = xinchuangMap.get(xinchuangInst.getXinchuangId());
res.setXinchuangId(xinchuang.getId());
res.setProjectName(xinchuang.getProjectName());
res.setBuildOrg(xinchuang.getBuildOrgName());
@@ -1132,7 +1135,6 @@ public class TodoCenterManage {
Long userId = LoginUserUtil.getUserId();
// 获取登录用户浙政钉code
String userIdStr = String.valueOf(userId);
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId);

// 查出信创
List<Xinchuang> xinchuangs = xinchuangService.list(Wrappers.lambdaQuery(Xinchuang.class)
@@ -1141,10 +1143,11 @@ public class TodoCenterManage {
if (CollUtil.isEmpty(xinchuangs)) {
return PageVo.empty();
}
Map<Long, Xinchuang> xinchuangMap = CollUtils.listToMap(xinchuangs, Xinchuang::getId);
List<Long> xinchuangIds = CollUtils.fieldList(xinchuangs, Xinchuang::getId);
List<XinchuangInst> xinchuangInsts = xinchuangInstService.listByXinchuangIds(xinchuangIds);

Map<String, Xinchuang> xinchuangMap = CollUtils.listToMap(xinchuangs, Xinchuang::getInstCode);
Map<String, XinchuangInst> xinchuangInstMap = CollUtils.listToMap(xinchuangInsts, XinchuangInst::getInstCode);
List<String> instCodes = CollUtils.fieldList(xinchuangInsts, XinchuangInst::getInstCode);
if (CollUtil.isEmpty(instCodes)) {
return PageVo.empty();
@@ -1171,8 +1174,9 @@ public class TodoCenterManage {

List<ResToBeProcessedVO> resVos = userSubmittedList.stream().map(d -> {
ResToBeProcessedVO res = new ResToBeProcessedVO();
Xinchuang xinchuang = xinchuangMap.get(d.getInstanceId());
if(Objects.nonNull(xinchuang)){
XinchuangInst xinchuangInst = xinchuangInstMap.get(d.getInstanceId());
if(Objects.nonNull(xinchuangInst) && xinchuangMap.containsKey(xinchuangInst.getXinchuangId())){
Xinchuang xinchuang = xinchuangMap.get(xinchuangInst.getXinchuangId());
res.setXinchuangId(xinchuang.getId());
res.setProjectName(xinchuang.getProjectName());
res.setBuildOrg(xinchuang.getBuildOrgName());
@@ -1327,6 +1331,67 @@ public class TodoCenterManage {
return PageVo.of(resVos, ccMeList.size());
}

public PageVo<ResToBeProcessedVO> ccmeListXinchuang(ToBeProcessedReq param) {

// 获取登录用户ID
Long userId = LoginUserUtil.getUserId();
// 获取登录用户全量信息
String userIdStr = String.valueOf(userId);
// 查出信创
List<Xinchuang> xinchuangs = xinchuangService.list(Wrappers.lambdaQuery(Xinchuang.class)
.isNotNull(Xinchuang::getInstCode));

if (CollUtil.isEmpty(xinchuangs)) {
return PageVo.empty();
}
Map<Long, Xinchuang> xinchuangMap = CollUtils.listToMap(xinchuangs, Xinchuang::getId);
List<Long> xinchuangIds = CollUtils.fieldList(xinchuangs, Xinchuang::getId);
List<XinchuangInst> xinchuangInsts = xinchuangInstService.listByXinchuangIds(xinchuangIds);

Map<String, XinchuangInst> xinchuangInstMap = CollUtils.listToMap(xinchuangInsts, XinchuangInst::getInstCode);
List<String> instCodes = CollUtils.fieldList(xinchuangInsts, XinchuangInst::getInstCode);
if (CollUtil.isEmpty(instCodes)) {
return PageVo.empty();
}
// 查出用户工作流
TodoCenterListReqDTO req = new TodoCenterListReqDTO();
Integer pageNumber = param.getPageNumber();
Integer pageSize = param.getPageSize();
req.setProcessDefId(param.getProcessDefId());
req.setUserId(userIdStr);
req.setEmployeeCode(userIdStr);
req.setInstCodes(instCodes);
List<ProcessInstanceVo> ccMeList = processInstanceService.getCcMeList(req);

if (CollUtil.isEmpty(ccMeList)) {
return PageVo.empty();
}

List<ProcessInstanceVo> ccMeInstList = ccMeList.stream()
.skip((long) (pageNumber - 1) * pageSize)
.limit(pageSize)
.collect(Collectors.toList());

List<ResToBeProcessedVO> resVos = ccMeInstList.stream().map(d -> {
ResToBeProcessedVO res = new ResToBeProcessedVO();
XinchuangInst xinchuangInst = xinchuangInstMap.get(d.getInstanceId());
if(Objects.nonNull(xinchuangInst) && xinchuangMap.containsKey(xinchuangInst.getXinchuangId())){
Xinchuang xinchuang = xinchuangMap.get(xinchuangInst.getXinchuangId());
BeanUtils.copyProperties(xinchuang, res);
res.setXinchuangId(xinchuang.getId());
res.setBuildOrg(xinchuang.getBuildOrgName());
res.setBuildOrgCode(xinchuang.getBuildOrgCode());
}
res.setInstCode(d.getInstanceId());
res.setNodeId(d.getNodeId());

res.setProcessStatusName(d.getStatus());
res.setProcessLaunchTime(d.getStartTime());
return res;
}).collect(Collectors.toList());
return PageVo.of(resVos, ccMeList.size());
}

/**
* 待办中心-抄送我的项目列表导出
*


Загрузка…
Отмена
Сохранить