提交 13197dfa authored 作者: 杨凯's avatar 杨凯

feat:家庭医生初始化

上级 dbe48757
package com.ebaiyihui.family.doctor.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @ClassName: SearchDoctorDayScheduleReqDTO
* @Author:yanliang
* @Date:2024/3/22 14:25
* @Description
*/
@Data
public class SearchDoctorDayScheduleReqDTO {
private Long hospitalId;
private String doctorName;
private Integer servType;
@ApiModelProperty("选择的日期")
@NotBlank(message = "选择的日期不能为空")
private String scheduleTime;
private Integer pageNum;
private Integer pageSize;
private Integer week;
}
package com.ebaiyihui.family.doctor.common.vo;
import lombok.Data;
import java.util.List;
/**
* @ClassName: DoctorScheduleInfoResVo
* @Author:yanliang
* @Date:2024/3/22 14:27
* @Description
*/
@Data
public class DoctorScheduleInfoResVo {
List<ScheduleInfoVo> scheduleInfos;
private String scheduleTime;
}
...@@ -2,8 +2,10 @@ package com.ebaiyihui.family.doctor.server.controller; ...@@ -2,8 +2,10 @@ package com.ebaiyihui.family.doctor.server.controller;
import com.ebaiyihui.family.doctor.common.dto.DoctorListForScheduleReqDTO; import com.ebaiyihui.family.doctor.common.dto.DoctorListForScheduleReqDTO;
import com.ebaiyihui.family.doctor.common.dto.QueryDoctorsDTO; import com.ebaiyihui.family.doctor.common.dto.QueryDoctorsDTO;
import com.ebaiyihui.family.doctor.common.dto.SearchDoctorDayScheduleReqDTO;
import com.ebaiyihui.family.doctor.common.vo.DoctorListForScheduleResVo; import com.ebaiyihui.family.doctor.common.vo.DoctorListForScheduleResVo;
import com.ebaiyihui.family.doctor.common.vo.DoctorListVo; import com.ebaiyihui.family.doctor.common.vo.DoctorListVo;
import com.ebaiyihui.family.doctor.common.vo.DoctorScheduleInfoResVo;
import com.ebaiyihui.family.doctor.server.service.DoctorService; import com.ebaiyihui.family.doctor.server.service.DoctorService;
import com.ebaiyihui.framework.page.PageResult; import com.ebaiyihui.framework.page.PageResult;
import com.ebaiyihui.framework.response.BaseResponse; import com.ebaiyihui.framework.response.BaseResponse;
...@@ -55,8 +57,13 @@ public class DoctorController { ...@@ -55,8 +57,13 @@ public class DoctorController {
public BaseResponse<List<DoctorListForScheduleResVo>> getDoctorListForSchedule(@RequestBody DoctorListForScheduleReqDTO req) { public BaseResponse<List<DoctorListForScheduleResVo>> getDoctorListForSchedule(@RequestBody DoctorListForScheduleReqDTO req) {
return doctorService.getDoctorListForSchedule(req); return doctorService.getDoctorListForSchedule(req);
}
@ApiOperation(value = "管理端搜索医生某天的排班")
@RequestMapping(value = "/searchDoctorDaySchedule", method = RequestMethod.POST)
public BaseResponse<DoctorScheduleInfoResVo> searchDoctorDaySchedule(@RequestBody SearchDoctorDayScheduleReqDTO reqDTO) {
return doctorService.searchDoctorDaySchedule(reqDTO);
} }
} }
...@@ -2,8 +2,10 @@ package com.ebaiyihui.family.doctor.server.service; ...@@ -2,8 +2,10 @@ package com.ebaiyihui.family.doctor.server.service;
import com.ebaiyihui.family.doctor.common.dto.DoctorListForScheduleReqDTO; import com.ebaiyihui.family.doctor.common.dto.DoctorListForScheduleReqDTO;
import com.ebaiyihui.family.doctor.common.dto.QueryDoctorsDTO; import com.ebaiyihui.family.doctor.common.dto.QueryDoctorsDTO;
import com.ebaiyihui.family.doctor.common.dto.SearchDoctorDayScheduleReqDTO;
import com.ebaiyihui.family.doctor.common.vo.DoctorListForScheduleResVo; import com.ebaiyihui.family.doctor.common.vo.DoctorListForScheduleResVo;
import com.ebaiyihui.family.doctor.common.vo.DoctorListVo; import com.ebaiyihui.family.doctor.common.vo.DoctorListVo;
import com.ebaiyihui.family.doctor.common.vo.DoctorScheduleInfoResVo;
import com.ebaiyihui.framework.page.PageResult; import com.ebaiyihui.framework.page.PageResult;
import com.ebaiyihui.framework.response.BaseResponse; import com.ebaiyihui.framework.response.BaseResponse;
...@@ -21,4 +23,6 @@ public interface DoctorService { ...@@ -21,4 +23,6 @@ public interface DoctorService {
BaseResponse<PageResult<DoctorListVo>> getSignedDoctorList(QueryDoctorsDTO reqVo); BaseResponse<PageResult<DoctorListVo>> getSignedDoctorList(QueryDoctorsDTO reqVo);
BaseResponse<List<DoctorListForScheduleResVo>> getDoctorListForSchedule(DoctorListForScheduleReqDTO req); BaseResponse<List<DoctorListForScheduleResVo>> getDoctorListForSchedule(DoctorListForScheduleReqDTO req);
BaseResponse<DoctorScheduleInfoResVo> searchDoctorDaySchedule(SearchDoctorDayScheduleReqDTO reqDTO);
} }
...@@ -9,8 +9,9 @@ import com.doctor.basedata.api.vo.DoctorBasicRespVO; ...@@ -9,8 +9,9 @@ import com.doctor.basedata.api.vo.DoctorBasicRespVO;
import com.doctor.basedata.api.vo.ServiceCheckReqVo; import com.doctor.basedata.api.vo.ServiceCheckReqVo;
import com.ebaiyihui.family.doctor.common.dto.DoctorListForScheduleReqDTO; import com.ebaiyihui.family.doctor.common.dto.DoctorListForScheduleReqDTO;
import com.ebaiyihui.family.doctor.common.dto.QueryDoctorsDTO; import com.ebaiyihui.family.doctor.common.dto.QueryDoctorsDTO;
import com.ebaiyihui.family.doctor.common.vo.DoctorListForScheduleResVo; import com.ebaiyihui.family.doctor.common.dto.ScheduleForWeekReqDTO;
import com.ebaiyihui.family.doctor.common.vo.DoctorListVo; import com.ebaiyihui.family.doctor.common.dto.SearchDoctorDayScheduleReqDTO;
import com.ebaiyihui.family.doctor.common.vo.*;
import com.ebaiyihui.family.doctor.server.common.constants.ImConstants; import com.ebaiyihui.family.doctor.server.common.constants.ImConstants;
import com.ebaiyihui.family.doctor.server.common.enums.SignStatus; import com.ebaiyihui.family.doctor.server.common.enums.SignStatus;
import com.ebaiyihui.family.doctor.server.entity.PatientSignEntity; import com.ebaiyihui.family.doctor.server.entity.PatientSignEntity;
...@@ -20,6 +21,7 @@ import com.ebaiyihui.family.doctor.server.feign.DoctorWorkingServiceClient; ...@@ -20,6 +21,7 @@ import com.ebaiyihui.family.doctor.server.feign.DoctorWorkingServiceClient;
import com.ebaiyihui.family.doctor.server.mapper.PatientSignMapper; import com.ebaiyihui.family.doctor.server.mapper.PatientSignMapper;
import com.ebaiyihui.family.doctor.server.mapper.ServiceConfigMapper; import com.ebaiyihui.family.doctor.server.mapper.ServiceConfigMapper;
import com.ebaiyihui.family.doctor.server.service.DoctorService; import com.ebaiyihui.family.doctor.server.service.DoctorService;
import com.ebaiyihui.family.doctor.server.service.ScheduleRecordService;
import com.ebaiyihui.framework.page.PageResult; import com.ebaiyihui.framework.page.PageResult;
import com.ebaiyihui.framework.response.BaseResponse; import com.ebaiyihui.framework.response.BaseResponse;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -52,6 +54,9 @@ public class DoctorServiceImpl implements DoctorService { ...@@ -52,6 +54,9 @@ public class DoctorServiceImpl implements DoctorService {
@Autowired @Autowired
private ServiceConfigMapper serviceConfigMapper; private ServiceConfigMapper serviceConfigMapper;
@Autowired
private ScheduleRecordService scheduleRecordService;
@Autowired @Autowired
private DoctorWorkingServiceClient doctorWorkingServiceClient; private DoctorWorkingServiceClient doctorWorkingServiceClient;
...@@ -217,6 +222,48 @@ public class DoctorServiceImpl implements DoctorService { ...@@ -217,6 +222,48 @@ public class DoctorServiceImpl implements DoctorService {
return BaseResponse.success(listForScheduleVos); return BaseResponse.success(listForScheduleVos);
} }
@Override
public BaseResponse<DoctorScheduleInfoResVo> searchDoctorDaySchedule(SearchDoctorDayScheduleReqDTO reqDTO) {
DoctorScheduleInfoResVo doctorScheduleInfoResVo = new DoctorScheduleInfoResVo();
doctorScheduleInfoResVo.setScheduleTime(reqDTO.getScheduleTime());
ScheduleForWeekReqDTO scheduleForWeek = new ScheduleForWeekReqDTO();
scheduleForWeek.setHospitalId(reqDTO.getHospitalId());
scheduleForWeek.setServType(reqDTO.getServType());
scheduleForWeek.setWeek(reqDTO.getWeek());
if (StringUtils.isNotEmpty(reqDTO.getDoctorName())) {
scheduleForWeek.setDoctorName(reqDTO.getDoctorName());
}
BaseResponse<List<ScheduleForWeekResVo>> pageResultBaseResponse = scheduleRecordService.scheduleForWeekNew(scheduleForWeek);
if (!pageResultBaseResponse.isSuccess()) {
return BaseResponse.error("单周排班调用失败");
}
List<ScheduleForWeekResVo> content = pageResultBaseResponse.getData();
if (CollectionUtils.isEmpty(content)) {
return BaseResponse.success();
}
content = content.stream().filter(scheduleForWeekNew -> {
if (scheduleForWeekNew.getScheduleTime().compareTo(reqDTO.getScheduleTime()) == 0) {
return true;
}
return false;
}).collect(Collectors.toList());
if (CollectionUtils.isEmpty(content)) {
return BaseResponse.success();
}
log.info("过滤出当前选择日期的content只有一条{}", content.toString());
List<ScheduleInfoVo> scheduleInfos = new ArrayList<>();
content.get(0).getScheduleInfos().stream().forEach(schedule -> {
scheduleInfos.add(schedule);
});
doctorScheduleInfoResVo.setScheduleInfos(scheduleInfos);
return BaseResponse.success(doctorScheduleInfoResVo);
}
// private void redisHistory(QueryFamousDotDTO reqVo) { // private void redisHistory(QueryFamousDotDTO reqVo) {
// //
// //把搜索的数据存在map中 // //把搜索的数据存在map中
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论