|
@@ -45,7 +45,6 @@ public class DoctorServiceImpl implements IDoctorService {
|
45
|
45
|
*/
|
46
|
46
|
@Override
|
47
|
47
|
public List<DoctorVO> list(String selectDateStr) throws ParseException {
|
48
|
|
- Date date = new Date();
|
49
|
48
|
// 获取医生列表
|
50
|
49
|
List<SysUser> sysUsers = sysUserMapper.selectUserList(new SysUser());
|
51
|
50
|
List<DoctorVO> list = new ArrayList<>();
|
|
@@ -64,17 +63,38 @@ public class DoctorServiceImpl implements IDoctorService {
|
64
|
63
|
if (!PatientUtil.checkDoctorWorkStatus(String.valueOf(sysUser.getUserId()), selectDate)) {
|
65
|
64
|
continue;
|
66
|
65
|
}
|
67
|
|
- DoctorVO vo = new DoctorVO();
|
68
|
|
- BeanUtils.copyProperties(sysUser, vo);
|
69
|
|
- long count = patientAppointmentService.count(Wrappers.<PatientAppointment>lambdaQuery()
|
70
|
|
- .lt(PatientAppointment::getAppointmentStartTime, date)
|
71
|
|
- .gt(PatientAppointment::getAppointmentEndTime, date)
|
72
|
|
- .eq(PatientAppointment::getAttendingDoctorId, sysUser.getUserId()));
|
73
|
|
-
|
74
|
|
- vo.setIsFree(count > 0 ? 1 : 0);
|
75
|
|
- vo.setDeptName(UserCacheUtil.getSysDeptById(sysUser.getDeptId()).getDeptName());
|
|
66
|
+ DoctorVO vo = getDoctorVO(sysUser);
|
76
|
67
|
list.add(vo);
|
77
|
68
|
}
|
78
|
69
|
return list;
|
79
|
70
|
}
|
|
71
|
+
|
|
72
|
+ private DoctorVO getDoctorVO(SysUser sysUser) {
|
|
73
|
+ Date date = new Date();
|
|
74
|
+ DoctorVO vo = new DoctorVO();
|
|
75
|
+ BeanUtils.copyProperties(sysUser, vo);
|
|
76
|
+ long count = patientAppointmentService.count(Wrappers.<PatientAppointment>lambdaQuery()
|
|
77
|
+ .lt(PatientAppointment::getAppointmentStartTime, date)
|
|
78
|
+ .gt(PatientAppointment::getAppointmentEndTime, date)
|
|
79
|
+ .eq(PatientAppointment::getAttendingDoctorId, sysUser.getUserId()));
|
|
80
|
+
|
|
81
|
+ vo.setIsFree(count > 0 ? 1 : 0);
|
|
82
|
+ vo.setDeptName(UserCacheUtil.getSysDeptById(sysUser.getDeptId()).getDeptName());
|
|
83
|
+ vo.setReceivePatientNum(patientAppointmentService.count(Wrappers.<PatientAppointment>lambdaQuery()
|
|
84
|
+ .eq(PatientAppointment::getAttendingDoctorId, sysUser.getUserId())));
|
|
85
|
+ return vo;
|
|
86
|
+ }
|
|
87
|
+
|
|
88
|
+ /**
|
|
89
|
+ * 根据医生id查询医生信息
|
|
90
|
+ * @param doctorId 医生id
|
|
91
|
+ * @return 返回结果
|
|
92
|
+ * @author mtx
|
|
93
|
+ * @date: 2024/6/13 15:01
|
|
94
|
+ */
|
|
95
|
+ @Override
|
|
96
|
+ public DoctorVO getById(Long doctorId) {
|
|
97
|
+ SysUser sysUser = sysUserMapper.selectUserById(doctorId);
|
|
98
|
+ return getDoctorVO(sysUser);
|
|
99
|
+ }
|
80
|
100
|
}
|