Browse Source

modify:

1. 待办推送;
tags/24091901
WendyYang 2 months ago
parent
commit
c04e4edab2
2 changed files with 21 additions and 41 deletions
  1. +7
    -19
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/enumeration/IsAppendProjectEnum.java
  2. +14
    -22
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/TodoCenterManage.java

+ 7
- 19
hz-pm-api/src/main/java/com/hz/pm/api/todocenter/enumeration/IsAppendProjectEnum.java View File

@@ -1,9 +1,7 @@
package com.hz.pm.api.todocenter.enumeration;

import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.util.Objects;
@@ -15,44 +13,34 @@ import java.util.Objects;
*/
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "IsAppendProjectEnum", description = "是否增补项目-枚举")
public enum IsAppendProjectEnum {
/**
* 非增补项目
*/
NOT_APPEND_PROJECT(0, "非增补项目"),
NOT_APPEND(0, "非增补项目"),

/**
* 增补项目
*/
APPEND_PROJECT(1, "增补项目");
APPEND(1, "增补项目");


private Integer code;
private String desc;
private final Integer code;
private final String val;

public String getDesc() {
return desc;
}

public void setDesc(String desc) {
this.desc = desc;
}

public static String getDescByCode(Integer code) {
public static String getVal(Integer code) {
if (Objects.isNull(code)) {
return StringUtils.EMPTY;
}
for (IsAppendProjectEnum t : IsAppendProjectEnum.values()) {
if (code.equals(t.getCode())) {
return t.desc;
return t.val;
}
}
return StringUtils.EMPTY;
}

public static IsAppendProjectEnum getEnumByValue(Integer code) {
public static IsAppendProjectEnum get(Integer code) {
if (Objects.isNull(code)) {
return null;
}


+ 14
- 22
hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/TodoCenterManage.java View File

@@ -49,7 +49,6 @@ import com.hz.pm.api.sys.service.IRegionService;
import com.hz.pm.api.todocenter.constant.TodoCenterConst;
import com.hz.pm.api.todocenter.constant.TodoCenterConst.Declared;
import com.hz.pm.api.todocenter.constant.TodoCenterConst.SealTemplate;
import com.hz.pm.api.todocenter.enumeration.IsAppendProjectEnum;
import com.hz.pm.api.todocenter.handle.PassHandle;
import com.hz.pm.api.todocenter.handle.WithDrawHandle;
import com.hz.pm.api.todocenter.model.dto.AdjustHandleDTO;
@@ -122,6 +121,9 @@ import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static com.hz.pm.api.todocenter.enumeration.IsAppendProjectEnum.APPEND;
import static com.hz.pm.api.todocenter.enumeration.IsAppendProjectEnum.NOT_APPEND;

/**
* @author ZPF
* @since 2023/02/19 16:09
@@ -413,9 +415,9 @@ public class TodoCenterManage {
}
ExcelExportWriter excelExportWriter = new ExcelExportWriter();
String fileName;
if (IsAppendProjectEnum.APPEND_PROJECT.eq(param.getIsTemporaryAugment())) {
if (APPEND.eq(param.getIsTemporaryAugment())) {
fileName = "待办中心_待我处理_增补项目列表";
} else if (IsAppendProjectEnum.NOT_APPEND_PROJECT.eq(param.getIsTemporaryAugment())) {
} else if (NOT_APPEND.eq(param.getIsTemporaryAugment())) {
fileName = "待办中心_待我处理_非增补项目列表";
} else {
fileName = "待办中心_待我处理_全部项目列表";
@@ -546,7 +548,7 @@ public class TodoCenterManage {
}
break;
default:
throw new IllegalStateException("Unexpected value: " + param.getAction());
throw BizException.wrap("暂不支持该操作:%s", param.getAction());
}
return "操作成功";
}
@@ -1069,9 +1071,9 @@ public class TodoCenterManage {
ExcelExportWriter excelExportWriter = new ExcelExportWriter();

String fileName = null;
if (IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) {
if (APPEND.eq(param.getIsTemporaryAugment())) {
fileName = "待办中心_我已处理_增补项目列表";
} else if (IsAppendProjectEnum.NOT_APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) {
} else if (NOT_APPEND.eq(param.getIsTemporaryAugment())) {
fileName = "待办中心_我已处理_非增补项目列表";
}
excelExportWriter.setFileName(fileName);
@@ -1281,9 +1283,9 @@ public class TodoCenterManage {
ExcelExportWriter excelExportWriter = new ExcelExportWriter();

String fileName = null;
if (IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) {
if (APPEND.getCode().equals(param.getIsTemporaryAugment())) {
fileName = "待办中心_我发起的_增补项目列表";
} else if (IsAppendProjectEnum.NOT_APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) {
} else if (NOT_APPEND.getCode().equals(param.getIsTemporaryAugment())) {
fileName = "待办中心_我发起的_非增补项目列表";
}
excelExportWriter.setFileName(fileName);
@@ -1488,9 +1490,9 @@ public class TodoCenterManage {
ExcelExportWriter excelExportWriter = new ExcelExportWriter();

String fileName = null;
if (IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) {
if (APPEND.getCode().equals(param.getIsTemporaryAugment())) {
fileName = "待办中心_抄送我的_增补项目列表";
} else if (IsAppendProjectEnum.NOT_APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) {
} else if (NOT_APPEND.getCode().equals(param.getIsTemporaryAugment())) {
fileName = "待办中心_抄送我的_非增补项目列表";
}
excelExportWriter.setFileName(fileName);
@@ -1734,18 +1736,8 @@ public class TodoCenterManage {
retTodoNum.setTotalNum(projectList.size());
}
// 筛选出增补项目和非增补项目
List<Project> appendProjects = projectList.stream()
.filter(p -> IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(p.getIsTemporaryAugment()))
.collect(Collectors.toList());
if (CollUtil.isNotEmpty(appendProjects)) {
retTodoNum.setAppendNum(appendProjects.size());
}
List<Project> notAppendProjects = projectList.stream()
.filter(p -> IsAppendProjectEnum.NOT_APPEND_PROJECT.getCode().equals(p.getIsTemporaryAugment()))
.collect(Collectors.toList());
if (CollUtil.isNotEmpty(notAppendProjects)) {
retTodoNum.setNotAppendNum(notAppendProjects.size());
}
retTodoNum.setAppendNum(CollUtil.count(projectList, p -> APPEND.eq(p.getIsTemporaryAugment())));
retTodoNum.setNotAppendNum(CollUtil.count(projectList, p -> NOT_APPEND.eq(p.getIsTemporaryAugment())));
return retTodoNum;
}



Loading…
Cancel
Save