|
@ -29,6 +29,7 @@ import com.yihu.wlyy.repository.doctor.DoctorTeamMemberDao;
|
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
|
import com.yihu.wlyy.repository.patient.PatientSickDao;
|
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
|
import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
|
|
|
import com.yihu.wlyy.service.common.SMSService;
|
|
|
import com.yihu.wlyy.util.MD5;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@ -91,6 +92,8 @@ public class DoctorInfoService extends BaseService {
|
|
|
private ConsultTeamDao consultTeamDao;
|
|
|
@Autowired
|
|
|
SMSService smsService;
|
|
|
@Autowired
|
|
|
DoctorWorkTimeService workTimeService;
|
|
|
|
|
|
/**
|
|
|
* 获取医生的签约病人
|
|
@ -616,6 +619,7 @@ public class DoctorInfoService extends BaseService {
|
|
|
return doctorDao.findAll(spec, pageRequest);
|
|
|
}
|
|
|
|
|
|
|
|
|
public Page<Doctor> findFamousDoctor(String key, Integer type, int page, int pageSize, Integer level) {
|
|
|
if (pageSize <= 0) {
|
|
|
pageSize = 10;
|
|
@ -643,6 +647,58 @@ public class DoctorInfoService extends BaseService {
|
|
|
return doctorDao.findAll(spec, pageRequest);
|
|
|
}
|
|
|
|
|
|
|
|
|
public List<Doctor> findFamousDoctorList(String key, Integer type, int page, int pageSize, Integer level) throws Exception {
|
|
|
if (pageSize <= 0) {
|
|
|
pageSize = 10;
|
|
|
}
|
|
|
if (page <= 0) {
|
|
|
page = 1;
|
|
|
}
|
|
|
// 排序
|
|
|
Sort sort = new Sort(Sort.Direction.DESC, "name");
|
|
|
|
|
|
// 查询全部
|
|
|
Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>();
|
|
|
if (StringUtils.isNotEmpty(key)) {
|
|
|
filters.put("name", new SearchFilter("name", SearchFilter.Operator.LIKE, key));
|
|
|
}
|
|
|
|
|
|
filters.put("isFamous", new SearchFilter("isFamous", SearchFilter.Operator.EQ, type));
|
|
|
|
|
|
if (level != null && level > 0 && level < 4) {
|
|
|
filters.put("level", new SearchFilter("level", SearchFilter.Operator.EQ, level));
|
|
|
}
|
|
|
Specification<Doctor> spec = DynamicSpecifications.bySearchFilter(filters.values(), Doctor.class);
|
|
|
|
|
|
List<Doctor> doctors = doctorDao.findAll(spec, sort);
|
|
|
List<Doctor> workingDoctor = new ArrayList<>();
|
|
|
List<Doctor> returnList = new ArrayList<>();
|
|
|
|
|
|
if (doctors.size() > 0) {
|
|
|
for (Doctor doc : doctors) {
|
|
|
JSONObject iswork = type == 1 ? workTimeService.isFamousDoctorWorking(doc.getCode()) : workTimeService.isDoctorWorking(doc.getCode());
|
|
|
if (iswork.getString("status").equals("1")) {
|
|
|
workingDoctor.add(doc);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
int start = (page - 1) * pageSize;
|
|
|
int end = start + pageSize;
|
|
|
|
|
|
if(end > workingDoctor.size()){
|
|
|
end = workingDoctor.size();
|
|
|
}
|
|
|
|
|
|
if(start < workingDoctor.size()) {
|
|
|
returnList = workingDoctor.subList(start, end);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return returnList;
|
|
|
}
|
|
|
|
|
|
|
|
|
public void updateTeamHealthDoctor(String newDoctorCode, String oldDoctorCode, String patient) throws Exception {
|
|
|
//得到患者的签约信息
|
|
|
SignFamily signFamily = signFamilyDao.findByPatient(patient);
|