|
@ -15,6 +15,7 @@ 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.*;
|
|
@ -46,11 +47,16 @@ public class DoctorWorkTimeService extends BaseService {
|
|
|
*/
|
|
|
public JSONObject findDoctorWorkTime(String doctor) throws Exception {
|
|
|
JSONObject result = new JSONObject();
|
|
|
Doctor doc = doctorDao.findByCode(doctor);
|
|
|
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) : "");
|
|
|
result.put("doctor", doc != null ? new JSONObject(doc) : "");
|
|
|
|
|
|
return result;
|
|
|
}
|