瀏覽代碼

预约修改

yeshijie 8 年之前
父節點
當前提交
d3e77a563e

+ 8 - 6
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/PatientReservation.java

@ -42,9 +42,9 @@ public class PatientReservation extends IdEntity {
	// 预约时间段:AM (上午)或者PM (下午)
	private String sectionType;
	// 一次预约段的开始时间
	private String startTime;
	private Date startTime;
	// 一次预约段的结束时间
	private String endTime;
	private Date endTime;
	// 医生所在医疗机构编码
	private String orgCode;
	// 医疗机构名称
@ -154,20 +154,22 @@ public class PatientReservation extends IdEntity {
	}
	@Column(name = "start_time")
	public String getStartTime() {
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getStartTime() {
		return startTime;
	}
	public void setStartTime(String startTime) {
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	@Column(name = "end_time")
	public String getEndTime() {
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getEndTime() {
		return endTime;
	}
	public void setEndTime(String endTime) {
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

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

@ -35,6 +35,6 @@ public interface PatientReservationDao extends PagingAndSortingRepository<Patien
	PatientReservation findByPatientAndCancelerAndCancelTime(String patient,String canceler,String cancelerTime);
	//根据患者医获取近三个月的已取消的预约记录
	@Query("select a from PatientReservation a where a.patient = ?1 and (a.startTime between ?2 and ?3 or a.startTime between ?4 and ?5 ) and a.status = 0 order by a.startTime desc")
	List<PatientReservation> findByPatientAndStartTime(String patientCode, String strStart, String strEnd,String startTime,String endTime);
	@Query("select a from PatientReservation a where a.patient = ?1 and a.startTime between ?2 and ?3 and a.status = 0 order by a.startTime desc")
	List<PatientReservation> findByPatientAndStartTime(String patientCode,Date startTime,Date endTime);
}

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

@ -179,7 +179,7 @@ public class PatientReservationService extends BaseService {
            reservation.setPhone(phone);
            reservation.setSectionType(section_type);
            reservation.setSsc(ssc);
            reservation.setStartTime(start_time);
            reservation.setStartTime(DateUtil.strToDate(start_time,DateUtil.YYYY_M_D_HH_MM_SS));
            reservation.setStatus(1);
            // 保存记录
            PatientReservation temp = patientReservationDao.save(reservation);

+ 16 - 8
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/guahao/GuahaoXMService.java

@ -100,8 +100,8 @@ public class GuahaoXMService implements IGuahaoService {
        reservation.setPhone(patientPhone);
        reservation.setSectionType(sectionType);
        reservation.setSsc(clinicCard);
        reservation.setStartTime(startTime);
        reservation.setEndTime(endTime);
        reservation.setStartTime(DateUtil.strToDate(startTime,DateUtil.YYYY_M_D_HH_MM_SS));
        reservation.setEndTime(DateUtil.strToDate(endTime,DateUtil.YYYY_M_D_HH_MM_SS));
        reservation.setStatus(1);
        if (StringUtils.isNotEmpty(dcode)) {
            SignFamily signFamily = signFamilyDao.findByjiatingPatient(patient);
@ -868,7 +868,7 @@ public class GuahaoXMService implements IGuahaoService {
    /**
     * 根据患者医保卡获取近三个月的预约记录
     */
    public List<PatientReservation> GetRegList(String patientCode, String strStart, String strEnd,String strStartTime,String strEndTime) throws Exception {
    public List<PatientReservation> GetRegList(String patientCode, String strStart, String strEnd,Date strStartTime,Date strEndTime) throws Exception {
        Patient patient = patientService.findByCode(patientCode);
        if (patient == null) {
            throw new Exception("不存在该用户!");
@ -947,8 +947,8 @@ public class GuahaoXMService implements IGuahaoService {
                patientReservation.setDeptName(dept);
                patientReservation.setDoctorCode(DoctorCode);
                patientReservation.setDoctorName(doctor);
                patientReservation.setStartTime(regBegin);
                patientReservation.setEndTime(regEnd);
                patientReservation.setStartTime(DateUtil.strToDate(regBegin,DateUtil.YYYY_M_D_HH_MM_SS));
                patientReservation.setEndTime(DateUtil.strToDate(regEnd,DateUtil.YYYY_M_D_HH_MM_SS));
                patientReservation.setOrgCode(OrgCode);
                patientReservation.setOrgName(org);
                patientReservation.setType("1");
@ -982,9 +982,17 @@ public class GuahaoXMService implements IGuahaoService {
        }
        //根据患者医保卡获取近三个月的已取消的预约记录
        List<PatientReservation> list = patientReservationDao.findByPatientAndStartTime(patientCode,strStart,strEnd,strStartTime,strEndTime);
        List<PatientReservation> list = patientReservationDao.findByPatientAndStartTime(patientCode,strStartTime,strEndTime);
        if(list.size()>0){
            patientRegList.addAll(list);
            patientRegList.sort(new Comparator<PatientReservation>() {
                public int compare(PatientReservation o1, PatientReservation o2) {
                    Date startTime1 = o1.getStartTime();
                    Date startTime2 = o2.getStartTime();
                    return startTime2.compareTo(startTime1);
                }
            });
        }
        //保存http日志
@ -1072,8 +1080,8 @@ public class GuahaoXMService implements IGuahaoService {
            patientReservation.setDeptName(dept);
            patientReservation.setDoctorCode(DoctorCode);
            patientReservation.setDoctorName(doctor);
            patientReservation.setStartTime(regBegin);
            patientReservation.setEndTime(regEnd);
            patientReservation.setStartTime(DateUtil.strToDate(regBegin,DateUtil.YYYY_M_D_HH_MM_SS));
            patientReservation.setEndTime(DateUtil.strToDate(regEnd,DateUtil.YYYY_M_D_HH_MM_SS));
            patientReservation.setOrgCode(OrgCode);
            patientReservation.setOrgName(org);
            patientReservation.setType("1");

+ 2 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/DateUtil.java

@ -23,6 +23,8 @@ public class DateUtil {
	public static final String YYYY_MM_DD_HH = "yyyy-MM-dd HH";
	public static final String YYYY_MM_DD_HH_MM = "yyyy-MM-dd HH:mm";
	public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
	public static final String YYYY_M_D_HH_MM_SS = "yyyy/M/d HH:mm:ss";
	/**
	 * 字符串转时间格式

+ 1 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/BookingController.java

@ -574,11 +574,10 @@ public class BookingController extends WeixinBaseController {
                             @RequestParam(value = "patient", required = false) String patient) {
        try {
            SimpleDateFormat sm = new SimpleDateFormat("yyyy-MM-dd");
            SimpleDateFormat sm2 = new SimpleDateFormat("yyyy/M/d");
            Date nowDate = new Date();
            Date oneMonthAfter = getMonthBefore(nowDate, -1);
            Date threeMonthBefore = getMonthBefore(nowDate, 3);        //三个月历史记录
            List<PatientReservation> list = guahaoXM.GetRegList(patient, sm.format(threeMonthBefore), sm.format(oneMonthAfter), sm2.format(threeMonthBefore), sm2.format(oneMonthAfter));
            List<PatientReservation> list = guahaoXM.GetRegList(patient, sm.format(threeMonthBefore), sm.format(oneMonthAfter), threeMonthBefore, oneMonthAfter);
            return write(200, "获取患者预约信息列表成功!", "data", list);
        } catch (Exception e) {
            return error(-1, e.getMessage());