Browse Source

预约列表接口修改,新增医生端接口,修改患者端,预约获取从智业接口获取

8 years ago
parent
commit
4fe5e3e5e2

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

@ -23,4 +23,7 @@ public interface PatientReservationDao extends PagingAndSortingRepository<Patien
	List<PatientReservation> findByPatient(String patient, Pageable page);
	List<PatientReservation> findByPatientAndDoctor(String patient,String doctor,Pageable page);
	List<PatientReservation> findByDoctor(String doctor,Pageable page);
}

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

@ -7,6 +7,7 @@ import java.util.Map;
import javax.transaction.Transactional;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
@ -150,14 +151,27 @@ public class PatientReservationService extends BaseService {
	}
	/**
	 * 分页获取患者预约记录
	 * 分页获取患者预约记录,医生为空查患者所有
     */
	public List<PatientReservation> getReservationByPatient(String patient, int page, int pagesize) {
	public List<PatientReservation> getReservationByPatient(String patient,String doctor, int page, int pagesize) {
		// 排序
		Sort sort = new Sort(Direction.DESC, "id");
		// 分页信息
		PageRequest pageRequest = new PageRequest(page-1, pagesize, sort);
		return patientReservationDao.findByPatient(patient, pageRequest);
		if(StringUtils.isNotBlank(doctor)){//传入医生查询医生帮此患者的预约记录
			return patientReservationDao.findByPatientAndDoctor(patient, doctor, pageRequest);
		}else{
			return patientReservationDao.findByPatient(patient, pageRequest);
		}
	}
	/**
	 * 分页获取患者预约记录
	 */
	public List<PatientReservation> getReservationByDoctor(String doctor, int page, int pagesize) {
		// 排序
		Sort sort = new Sort(Direction.DESC, "id");
		// 分页信息
		PageRequest pageRequest = new PageRequest(page-1, pagesize, sort);
		return patientReservationDao.findByDoctor(doctor, pageRequest);
	}
}

+ 49 - 6
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/BookingController.java

@ -409,13 +409,17 @@ public class BookingController extends WeixinBaseController {
	 */
	@RequestMapping(value = "GetPatientReservationList",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("获取患者预约信息列表接口")
	@ApiOperation("获取患者预约信息列表接口-医生端")
	public String GetPatientReservation(@ApiParam(name="pageIndex",value="第几页",defaultValue = "1")
										@RequestParam(value="pageIndex",required = false) Integer pageIndex,
										@ApiParam(name="pageSize",value="每页记录数",defaultValue = "10")
										@RequestParam(value="pageSize",required = false) Integer pageSize) {
										@RequestParam(value="pageSize",required = false) Integer pageSize,
										@ApiParam(name="patient",value="患者编号",defaultValue = "10")
										@RequestParam(value="patient",required = false) String patient,
										@ApiParam(name="doctor",value="医生编号",defaultValue = "10")
										@RequestParam(value="doctor",required = false) String doctor) {
		try {
			List<PatientReservation> list =  patientReservationService.getReservationByPatient(getUID(),pageIndex,pageSize);
			List<PatientReservation> list =  patientReservationService.getReservationByPatient(patient,doctor,pageIndex,pageSize);
			//遍历更新预约状态
			for(PatientReservation item :list)
			{
@ -440,13 +444,52 @@ public class BookingController extends WeixinBaseController {
		}
	}
	/**
	 * 获取医生代预约信息列表接口
	 */
	@RequestMapping(value = "GetDoctorReservationList",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("获取医生代预约信息列表接口-医生端")
	public String GetDoctorReservation(@ApiParam(name="pageIndex",value="第几页",defaultValue = "1")
										@RequestParam(value="pageIndex",required = false) Integer pageIndex,
										@ApiParam(name="pageSize",value="每页记录数",defaultValue = "10")
										@RequestParam(value="pageSize",required = false) Integer pageSize,
										@ApiParam(name="doctor",value="医生编号",defaultValue = "10")
										@RequestParam(value="doctor",required = false) String doctor) {
		try {
			List<PatientReservation> list =  patientReservationService.getReservationByDoctor(doctor,pageIndex,pageSize);
			//遍历更新预约状态
			for(PatientReservation item :list)
			{
				String type = item.getType();
				String code = item.getCode();
				if (type.equals("0")) {  //医护网接口
				}
				else if (type.equals("1"))   //厦门市民健康预约接口
				{
					Integer status = guahaoXM.GetOrderStatus(item.getOrgCode(),code,item.getSsc());
					//更新状态
					if(status!=null) {
						patientReservationService.updateStatus(item.getCode(), 0);
						item.setStatus(status);
					}
				}
			}
			return write(200, "获取患者预约信息列表成功!", "data", list);
		} catch (Exception e) {
			return error(-1,e.getMessage());
		}
	}
	/**
	 * 获取患者预约信息列表接口
	 */
	@RequestMapping(value = "GetRegList",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("获取患者预约信息列表接口")
	@ApiOperation("获取患者预约信息列表接口--患者端")
	public String GetRegList(@ApiParam(name="patient",value="患者编号",defaultValue = "1")
										@RequestParam(value="patient",required = false) String patient) {
		try {
@ -471,7 +514,7 @@ public class BookingController extends WeixinBaseController {
	 */
	@RequestMapping(value = "GetPatientReservation",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("获取患者预约信息单条-医生")
	@ApiOperation("获取患者预约信息单条-医生端")
	public String GetPatientReservation(@ApiParam(name="orderId",value="订单id",defaultValue = "9")
										 @RequestParam(value="orderId",required = true) String orderId) {
		try {
@ -508,7 +551,7 @@ public class BookingController extends WeixinBaseController {
	 */
	@RequestMapping(value = "GetPatientReservationXm",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("获取患者预约信息单条-患者")
	@ApiOperation("获取患者预约信息单条-患者端")
	public String GetPatientReservationXm(@ApiParam(name="patientCode",value="患者编号")
										@RequestParam(value="patientCode",required = true) String patientCode,
										@ApiParam(name="orgCode",value="机构编码")