增加机构查询
This commit is contained in:
parent
3c5626ded0
commit
7b0f85ed56
@ -85,6 +85,7 @@ import java.text.ParseException;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 患者信息")
|
@Tag(name = "管理后台 - 患者信息")
|
||||||
@RestController
|
@RestController
|
||||||
@ -1904,9 +1905,20 @@ public class InspectPatientController {
|
|||||||
|
|
||||||
@GetMapping("/getworkload")
|
@GetMapping("/getworkload")
|
||||||
@Operation(summary = "根据日期获取卫生院体检统计")
|
@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);
|
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来存储统计结果,key为卫生院名称+行政村名称
|
||||||
Map<String, WorkloadStatisticsVO> statisticsMap = new HashMap<>();
|
Map<String, WorkloadStatisticsVO> statisticsMap = new HashMap<>();
|
||||||
|
Loading…
Reference in New Issue
Block a user