Browse Source

Merge branch 'dev' of lyr/patient-co-management into dev

lyr 8 years ago
parent
commit
013637030c

+ 4 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorDao.java

@ -128,16 +128,16 @@ public interface DoctorDao extends PagingAndSortingRepository<Doctor, Long>, Jpa
    List<Doctor> findByIsFamous(Integer isFamous);
    @Query("select p from Doctor p ,DoctorFamousConsultTimesRemain w where p.code=w.doctor and p.isFamous=1 and w.consultDate = ?1 and p.name like ?2 and w.timesRemain > 0 order by w.timesRemain desc")
    Page<Doctor> famousDoctorList(String date, String name, Pageable pageRequest);
    List<Doctor> famousDoctorList(String date, String name);
    @Query("select p from Doctor p ,DoctorFamousConsultTimesRemain w where p.code=w.doctor and p.isFamous=1 and w.consultDate = ?1  and w.timesRemain > 0  order by w.timesRemain desc")
    Page<Doctor> famousDoctorList(String date, Pageable pageRequest);
    List<Doctor> famousDoctorList(String date);
    @Query("select p from Doctor p where p.isFamous=1 and p.name like ?1 ")
    Page<Doctor> doctorFamousDoctorList(String name, Pageable pageRequest);
    List<Doctor> doctorFamousDoctorList(String name);
    @Query("select p from Doctor p where p.isFamous=1 ")
    Page<Doctor> doctorFamousDoctorList(Pageable pageRequest);
    List<Doctor> doctorFamousDoctorList();
    @Query("select p from Doctor p where p.idcard = ?1")
    Doctor findbyIdCard(String idcard);

+ 6 - 11
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/DoctorService.java

@ -78,31 +78,26 @@ public class DoctorService extends TokenService {
	}
	public Page<Doctor> famousDoctorList(String name, int page, int pagesize) {
		// 分页信息
		Pageable pageRequest = new PageRequest(page-1, pagesize);
	public List<Doctor> famousDoctorList(String name) {
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
		if (StringUtils.isNoneEmpty(name)) {
			name="%"+name+"%";
			return doctorDao.famousDoctorList(sdf.format(new Date()),name, pageRequest);
			return doctorDao.famousDoctorList(sdf.format(new Date()),name);
		}else{
			return doctorDao.famousDoctorList(sdf.format(new Date()), pageRequest);
			return doctorDao.famousDoctorList(sdf.format(new Date()));
		}
	}
	public Page<Doctor> getDoctorFamousDoctorList(String name, int page, int pagesize) {
		// 分页信息
		Pageable pageRequest = new PageRequest(page-1, pagesize);
	public List<Doctor> getDoctorFamousDoctorList(String name) {
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
		if (StringUtils.isNoneEmpty(name)) {
			name="%"+name+"%";
			return doctorDao.doctorFamousDoctorList(name, pageRequest);
			return doctorDao.doctorFamousDoctorList(name);
		}else{
			return doctorDao.doctorFamousDoctorList(pageRequest);
			return doctorDao.doctorFamousDoctorList();
		}
	}

+ 2 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultController.java

@ -257,12 +257,10 @@ public class DoctorConsultController extends WeixinBaseController {
    @RequestMapping(value = "famousDoctorList")
    @ResponseBody
    public String famousDoctorList(
            @RequestParam(required = false) String name,
            int page,
            int pagesize) {
            @RequestParam(required = false) String name) {
        try {
            JSONArray array = new JSONArray();
            Page<Doctor> list = doctorService.getDoctorFamousDoctorList(name, page, pagesize);
            List<Doctor> list = doctorService.getDoctorFamousDoctorList(name);
            if (list != null) {
                for (Doctor doctor : list) {
                    if (doctor == null) {

+ 2 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -413,12 +413,10 @@ public class ConsultController extends WeixinBaseController {
    @RequestMapping(value = "famousDoctorList")
    @ResponseBody
    public String famousDoctorList(
            @RequestParam(required = false) String name,
            int page,
            int pagesize) {
            @RequestParam(required = false) String name) {
        try {
            JSONArray array = new JSONArray();
            Page<Doctor> list = doctorService.famousDoctorList(name, page, pagesize);
            List<Doctor> list = doctorService.famousDoctorList(name);
            if (list != null) {
                for (Doctor doctor : list) {
                    if (doctor == null) {