Browse Source

新增待预约总数汇总接口

8 years ago
parent
commit
1786714c32

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientReservationDao.java

@ -26,4 +26,7 @@ public interface PatientReservationDao extends PagingAndSortingRepository<Patien
	List<PatientReservation> findByPatientAndDoctor(String patient,String doctor,Pageable page);
	List<PatientReservation> findByPatientAndDoctor(String patient,String doctor,Pageable page);
	List<PatientReservation> findByDoctor(String doctor,Pageable page);
	List<PatientReservation> findByDoctor(String doctor,Pageable page);
	@Query("select count(1) from PatientReservation a where a.doctor = ?1 and a.patient=?2 ")
	Long  countReservationByDoctorForPatient(String doctor,String patient);
}
}

+ 4 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/reservation/PatientReservationService.java

@ -174,4 +174,8 @@ public class PatientReservationService extends BaseService {
		PageRequest pageRequest = new PageRequest(page-1, pagesize, sort);
		PageRequest pageRequest = new PageRequest(page-1, pagesize, sort);
		return patientReservationDao.findByDoctor(doctor, pageRequest);
		return patientReservationDao.findByDoctor(doctor, pageRequest);
	}
	}
	public Long countReservationByDoctorForPatient(String doctor,String patient){
		return patientReservationDao.countReservationByDoctorForPatient(doctor,patient);
	}
}
}

+ 20 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/BookingController.java

@ -567,4 +567,24 @@ public class BookingController extends WeixinBaseController {
			return error(-1,e.getMessage());
			return error(-1,e.getMessage());
		}
		}
	}
	}
	/**
	 * 获取医生为患者预约的总数
	 */
	@RequestMapping(value = "CountReservationByDoctorForPatient",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("获取患者预约信息单条-患者端")
	public String CountReservationByDoctorForPatient(@ApiParam(name="doctor",value="医生编号")
										  @RequestParam(value="doctor",required = true) String doctor,
										  @ApiParam(name="patient",value="患者编号")
										  @RequestParam(value="patient",required = true) String patient) {
		try {
			Long obj =  patientReservationService.countReservationByDoctorForPatient(doctor, patient);
			return write(200, "获取患者预约信息成功!", "data", obj);
		} catch (Exception e) {
			return error(-1,e.getMessage());
		}
	}
}
}