增加机构查询

This commit is contained in:
Flow 2025-05-03 16:19:52 +08:00
parent 3c5626ded0
commit 7b0f85ed56

View File

@ -85,6 +85,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.stream.Collectors;
@Tag(name = "管理后台 - 患者信息")
@RestController
@ -1904,10 +1905,21 @@ public class InspectPatientController {
@GetMapping("/getworkload")
@Operation(summary = "根据日期获取卫生院体检统计")
public CommonResult<List<WorkloadStatisticsVO>> getWorkload(@RequestParam("dates") @DateTimeFormat(pattern = "yyyy-MM-dd") List<LocalDate> dates) {
public CommonResult<List<WorkloadStatisticsVO>> getWorkload(@RequestParam("dates") @DateTimeFormat(pattern = "yyyy-MM-dd") List<LocalDate> dates,
@RequestParam(value = "examhosname", required = false) String examhosname) {
// 获取指定日期范围内的所有患者补充信息
List<PatientSupplementVO> supplements = patientService.getPatientSupplementsByDates(dates);
// 医院名称过滤
// - 若examhosname为null"null"字符串或空字符串则不过滤保留所有记录
// - 若examhosname有有效值则只保留匹配该医院名称的记录
if (examhosname != null && !examhosname.isEmpty() && !"null".equals(examhosname)) {
supplements = supplements.stream()
.filter(s -> examhosname.equals(s.getOrgname()))
.collect(Collectors.toList());
}
// 否则保持原有supplements不变
// 使用Map来存储统计结果key为卫生院名称+行政村名称
Map<String, WorkloadStatisticsVO> statisticsMap = new HashMap<>();