|
@ -4,7 +4,6 @@ import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
import com.yihu.wlyy.entity.doctor.schedule.DoctorFamousConsultTimesRemain;
|
|
|
import com.yihu.wlyy.entity.doctor.schedule.WlyyDoctorWorkTime;
|
|
|
import com.yihu.wlyy.entity.doctor.schedule.WlyyDoctorWorkWeek;
|
|
|
import com.yihu.wlyy.entity.message.MessageNoticeSetting;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorDao;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorWorkTimeDao;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorWorkWeekDao;
|
|
@ -13,13 +12,11 @@ import com.yihu.wlyy.repository.message.MessageNoticeSettingDao;
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
import com.yihu.wlyy.service.app.message.MessageService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.poi.ss.formula.eval.StringValueEval;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.print.Doc;
|
|
|
import javax.transaction.Transactional;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
@ -69,11 +66,6 @@ public class DoctorWorkTimeService extends BaseService {
|
|
|
if (doc == null) {
|
|
|
throw new Exception("doctor not exist");
|
|
|
}
|
|
|
WlyyDoctorWorkTime workTime = doctorWorkTimeDao.findDoctorWorkTime(doctor);
|
|
|
List<WlyyDoctorWorkWeek> workWeekList = doctorWorkWeekDao.findDoctorWorkWeeks(doctor);
|
|
|
|
|
|
result.put("workTime", workTime != null ? new JSONObject(workTime) : "");
|
|
|
result.put("workWeeks", workWeekList != null ? new JSONArray(workWeekList) : "");
|
|
|
JSONObject docJson = new JSONObject(doc);
|
|
|
if (docJson.has("password")) {
|
|
|
docJson.remove("password");
|
|
@ -83,6 +75,17 @@ public class DoctorWorkTimeService extends BaseService {
|
|
|
}
|
|
|
result.put("doctor", doc != null ? docJson : "");
|
|
|
|
|
|
WlyyDoctorWorkTime workTime = doctorWorkTimeDao.findDoctorWorkTime(doctor);
|
|
|
if(workTime!=null&&"0".equals(workTime.getReceiveConsult())){
|
|
|
result.put("workTime", "");
|
|
|
result.put("workWeeks", "");
|
|
|
}else{
|
|
|
List<WlyyDoctorWorkWeek> workWeekList = doctorWorkWeekDao.findDoctorWorkWeeks(doctor);
|
|
|
|
|
|
result.put("workTime", workTime != null ? new JSONObject(workTime) : "");
|
|
|
result.put("workWeeks", workWeekList != null ? new JSONArray(workWeekList) : "");
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@ -775,12 +778,12 @@ public class DoctorWorkTimeService extends BaseService {
|
|
|
json.put("msg","全科医生和健管师当前都不在工作时间");
|
|
|
}
|
|
|
//健管师在工作时间,全科不在
|
|
|
if ("2".equals(doctorStatus) && "1".equals(doctorHealthStatus)){
|
|
|
if ("2".equals(doctorStatus) || "0".equals(doctorStatus)){
|
|
|
json.put("status","3");
|
|
|
json.put("msg","全科医生当前不在工作时间");
|
|
|
}
|
|
|
//全科在工作时间,健管师不在
|
|
|
if ("1".equals(doctorStatus) && "2".equals(doctorHealthStatus)){
|
|
|
if ("0".equals(doctorHealthStatus) || "2".equals(doctorHealthStatus)){
|
|
|
json.put("status","4");
|
|
|
json.put("msg","健管师当前不在工作时间");
|
|
|
}
|