feat(home): 添加医生专属患者统计和菜单跳转功能

- 在HomeStatisticsDto中新增我的患者数量和待写病历数量字段
- 实现医生患者查询功能,支持按租户隔离数据
- 更新首页统计服务,为医生用户提供专属患者统计数据
- 添加菜单名称点击跳转功能,支持路由导航和外部链接打开
- 修复首页统计数据显示,确保医生看到正确的患者数量
- 添加医保日结结算相关实体、服务和前端页面
- 配置前端路由控制器,支持Vue Router History模式
This commit is contained in:
2026-02-02 16:28:31 +08:00
parent 5534a71c7d
commit 9ed43c9413
16 changed files with 1100 additions and 27 deletions

View File

@@ -66,23 +66,34 @@ public class HomeStatisticsServiceImpl implements IHomeStatisticsService {
Practitioner practitioner = practitionerList != null && !practitionerList.isEmpty() ? practitionerList.get(0) : null;
int totalPatients = 0;
int myPatients = 0;
// 如果当前用户是医生,查询该医生接诊和被挂号的所有患者
if (practitioner != null) {
// 获取当前登录用户的租户ID
Integer tenantId = SecurityUtils.getLoginUser().getTenantId().intValue();
// 查询该医生作为接诊医生ADMITTER, code="1"和挂号医生REGISTRATION_DOCTOR, code="12"的所有就诊记录的患者ID
List<Long> doctorPatientIds = patientManageMapper.getPatientIdsByPractitionerId(
practitioner.getId(),
Arrays.asList(ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode()));
totalPatients = doctorPatientIds != null ? doctorPatientIds.size() : 0;
practitioner.getId(),
Arrays.asList(ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode()),
tenantId);
myPatients = doctorPatientIds != null ? doctorPatientIds.size() : 0;
// 对于医生,"我的患者"数量即为该医生负责的患者数量
statistics.setMyPatients(myPatients);
} else {
// 如果不是医生,查询所有患者(与患者管理页面逻辑保持一致)
LambdaQueryWrapper<Patient> patientQuery = new LambdaQueryWrapper<>();
patientQuery.eq(Patient::getDeleteFlag, "0");
List<Patient> patientList = patientService.list(patientQuery);
totalPatients = patientList != null ? patientList.size() : 0;
// 如果不是医生,"我的患者"数量为0
statistics.setMyPatients(0);
}
// 查询所有患者作为总患者数
LambdaQueryWrapper<Patient> patientQuery = new LambdaQueryWrapper<>();
patientQuery.eq(Patient::getDeleteFlag, "0");
List<Patient> patientList = patientService.list(patientQuery);
totalPatients = patientList != null ? patientList.size() : 0;
statistics.setTotalPatients(totalPatients);
// 查询昨日在院患者数量(暂时简化处理)