浏览代码

DecimalUtil优化

tags/24080901
WendyYang 9 个月前
父节点
当前提交
acb887a27a
共有 3 个文件被更改,包括 7 次插入4 次删除
  1. +2
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/common/util/DecimalUtil.java
  2. +3
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/workbench/controller/WorkbenchController.java
  3. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java

+ 2
- 0
hz-pm-api/src/main/java/com/hz/pm/api/common/util/DecimalUtil.java 查看文件

@@ -8,6 +8,7 @@ import java.math.RoundingMode;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.Objects;
import java.util.function.Function;

/**
@@ -31,6 +32,7 @@ public class DecimalUtil {
return objs.stream()
.map(w -> Arrays.stream(functions)
.map(f -> f.apply(w))
.filter(Objects::nonNull)
.reduce(BigDecimal::add)
.orElse(BigDecimal.ZERO))
.reduce(BigDecimal::add)


+ 3
- 2
hz-pm-api/src/main/java/com/hz/pm/api/workbench/controller/WorkbenchController.java 查看文件

@@ -46,8 +46,9 @@ public class WorkbenchController {

@GetMapping("/projectTotalView")
@ApiOperation("获取项目总览")
public ProjectTotalViewVO projectTotalView(@RequestParam(required = false) Long unitId) {
return workbenchManage.projectTotalView(unitId);
public ProjectTotalViewVO projectTotalView(@RequestParam(required = false) Long unitId,
@RequestParam(required = false) Integer projectYear) {
return workbenchManage.projectTotalView(unitId, projectYear);
}

}

+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/workbench/manage/WorkbenchManage.java 查看文件

@@ -353,7 +353,7 @@ public class WorkbenchManage {
return "催办成功了" + employees.length + "个人";
}

public ProjectTotalViewVO projectTotalView(Long unitId) {
public ProjectTotalViewVO projectTotalView(Long unitId, Integer projectYear) {
ProjectTotalViewVO retDetail = new ProjectTotalViewVO();
if (unitId == null) {
unitId = LoginUserUtil.loginUserDetail().getMhUnitId();
@@ -381,7 +381,7 @@ public class WorkbenchManage {
.map(w -> StrUtil.split(w.getReplaceType(), ","))
.flatMap(Collection::stream)
.collect(Collectors.groupingBy(w -> {
if (NumberUtil.isNumber(w)) {
if (!NumberUtil.isNumber(w)) {
return "其他";
} else {
return GovSystemReplaceTypeEnum.get(Integer.parseInt(w))


正在加载...
取消
保存