@@ -8,6 +8,7 @@ import java.math.RoundingMode; | |||||
import java.util.Arrays; | import java.util.Arrays; | ||||
import java.util.Collection; | import java.util.Collection; | ||||
import java.util.Comparator; | import java.util.Comparator; | ||||
import java.util.Objects; | |||||
import java.util.function.Function; | import java.util.function.Function; | ||||
/** | /** | ||||
@@ -31,6 +32,7 @@ public class DecimalUtil { | |||||
return objs.stream() | return objs.stream() | ||||
.map(w -> Arrays.stream(functions) | .map(w -> Arrays.stream(functions) | ||||
.map(f -> f.apply(w)) | .map(f -> f.apply(w)) | ||||
.filter(Objects::nonNull) | |||||
.reduce(BigDecimal::add) | .reduce(BigDecimal::add) | ||||
.orElse(BigDecimal.ZERO)) | .orElse(BigDecimal.ZERO)) | ||||
.reduce(BigDecimal::add) | .reduce(BigDecimal::add) | ||||
@@ -46,8 +46,9 @@ public class WorkbenchController { | |||||
@GetMapping("/projectTotalView") | @GetMapping("/projectTotalView") | ||||
@ApiOperation("获取项目总览") | @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); | |||||
} | } | ||||
} | } |
@@ -353,7 +353,7 @@ public class WorkbenchManage { | |||||
return "催办成功了" + employees.length + "个人"; | return "催办成功了" + employees.length + "个人"; | ||||
} | } | ||||
public ProjectTotalViewVO projectTotalView(Long unitId) { | |||||
public ProjectTotalViewVO projectTotalView(Long unitId, Integer projectYear) { | |||||
ProjectTotalViewVO retDetail = new ProjectTotalViewVO(); | ProjectTotalViewVO retDetail = new ProjectTotalViewVO(); | ||||
if (unitId == null) { | if (unitId == null) { | ||||
unitId = LoginUserUtil.loginUserDetail().getMhUnitId(); | unitId = LoginUserUtil.loginUserDetail().getMhUnitId(); | ||||
@@ -381,7 +381,7 @@ public class WorkbenchManage { | |||||
.map(w -> StrUtil.split(w.getReplaceType(), ",")) | .map(w -> StrUtil.split(w.getReplaceType(), ",")) | ||||
.flatMap(Collection::stream) | .flatMap(Collection::stream) | ||||
.collect(Collectors.groupingBy(w -> { | .collect(Collectors.groupingBy(w -> { | ||||
if (NumberUtil.isNumber(w)) { | |||||
if (!NumberUtil.isNumber(w)) { | |||||
return "其他"; | return "其他"; | ||||
} else { | } else { | ||||
return GovSystemReplaceTypeEnum.get(Integer.parseInt(w)) | return GovSystemReplaceTypeEnum.get(Integer.parseInt(w)) | ||||