需求变更20250205 不使用年月字段 数据存在即汇总统计
This commit is contained in:
parent
6c54bae6f2
commit
a0675f89a3
|
|
@ -765,7 +765,7 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
|
||||
String currentYearMonth = currentDateTime.format(formatter);
|
||||
|
||||
// 部门编制人数向下汇总 20250122 优化需求
|
||||
// 部门编制人数向下汇总 20250122 优化需求 ==》需求变更20250205 不使用年月字段 数据存在即汇总统计
|
||||
List<ModeStaffPO> bzList = new ArrayList<>();
|
||||
rs.executeQuery("select bzrs,ny from uf_bzgljmb where bm in ("+value+")");
|
||||
while (rs.next()) {
|
||||
|
|
@ -778,16 +778,16 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
|
||||
int sum = 0;
|
||||
if (bzList.size() > 0) {
|
||||
Map<String, List<ModeStaffPO>> groupedByMonthYear = bzList.stream()
|
||||
.collect(Collectors.groupingBy(ModeStaffPO::getMonthYear));
|
||||
// Map<String, List<ModeStaffPO>> groupedByMonthYear = bzList.stream()
|
||||
// .collect(Collectors.groupingBy(ModeStaffPO::getMonthYear));
|
||||
//
|
||||
// // 获取最新的 monthYear
|
||||
// String latestMonthYear = groupedByMonthYear.keySet().stream()
|
||||
// .max(String::compareTo)
|
||||
// .orElse(null);
|
||||
|
||||
// 获取最新的 monthYear
|
||||
String latestMonthYear = groupedByMonthYear.keySet().stream()
|
||||
.max(String::compareTo)
|
||||
.orElse(null);
|
||||
|
||||
List<ModeStaffPO> modeStaffPOS = groupedByMonthYear.get(latestMonthYear);
|
||||
sum = modeStaffPOS.stream().mapToInt(ModeStaffPO::getCount).sum();
|
||||
// List<ModeStaffPO> modeStaffPOS = groupedByMonthYear.get(latestMonthYear);
|
||||
sum = bzList.stream().mapToInt(ModeStaffPO::getCount).sum();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue