|
@ -1,14 +1,21 @@
|
|
package com.yihu.wlyy.service.app.reservation;
|
|
package com.yihu.wlyy.service.app.reservation;
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
import javax.transaction.Transactional;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
|
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeamMember;
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
|
import com.yihu.wlyy.entity.patient.PatientReservation;
|
|
|
|
import com.yihu.wlyy.entity.patient.PatientReservationDoctor;
|
|
|
|
import com.yihu.wlyy.entity.patient.SignFamily;
|
|
import com.yihu.wlyy.repository.doctor.DoctorDao;
|
|
import com.yihu.wlyy.repository.doctor.DoctorDao;
|
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorTeamMemberDao;
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
|
|
import com.yihu.wlyy.repository.patient.PatientReservationDao;
|
|
|
|
import com.yihu.wlyy.repository.patient.PatientReservationDoctorDao;
|
|
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
import com.yihu.wlyy.service.third.guahao.GuahaoXMService;
|
|
import com.yihu.wlyy.service.third.guahao.GuahaoXMService;
|
|
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
@ -23,12 +30,8 @@ import org.springside.modules.persistence.DynamicSpecifications;
|
|
import org.springside.modules.persistence.SearchFilter;
|
|
import org.springside.modules.persistence.SearchFilter;
|
|
import org.springside.modules.persistence.SearchFilter.Operator;
|
|
import org.springside.modules.persistence.SearchFilter.Operator;
|
|
|
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
|
import com.yihu.wlyy.entity.patient.PatientReservation;
|
|
|
|
import com.yihu.wlyy.entity.patient.PatientReservationDoctor;
|
|
|
|
import com.yihu.wlyy.repository.patient.PatientReservationDao;
|
|
|
|
import com.yihu.wlyy.repository.patient.PatientReservationDoctorDao;
|
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
|
|
|
import javax.transaction.Transactional;
|
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 预约挂号业务处理类
|
|
* 预约挂号业务处理类
|
|
@ -52,7 +55,10 @@ public class PatientReservationService extends BaseService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private PatientDao patientDao;
|
|
private PatientDao patientDao;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private SignFamilyDao signFamilyDao;
|
|
|
|
@Autowired
|
|
|
|
private DoctorTeamMemberDao doctorTeamDoctor;
|
|
@Autowired
|
|
@Autowired
|
|
private DoctorDao doctorDao;
|
|
private DoctorDao doctorDao;
|
|
|
|
|
|
@ -91,6 +97,40 @@ public class PatientReservationService extends BaseService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 医生取消预约
|
|
|
|
*/
|
|
|
|
@Transactional
|
|
|
|
public void doctorCancelOrder(Long id,String doctor) {
|
|
|
|
PatientReservation obj = patientReservationDao.findOne(id);
|
|
|
|
if (obj.getStatus()!=0) {
|
|
|
|
obj.setStatus(0);
|
|
|
|
String patient = obj.getPatient();
|
|
|
|
SignFamily signFamily = signFamilyDao.findByPatient(patient);//得到患者的签约信息
|
|
|
|
DoctorTeamMember doctorTeamMember = doctorTeamDoctor.findMemberByTeamAndCode(signFamily.getTeamCode(), doctor);//得到服务团队的医生信息
|
|
|
|
obj.setCanceler(doctorTeamMember.getMemberCode());
|
|
|
|
obj.setCancelerName(doctorTeamMember.getName());
|
|
|
|
obj.setCancelerType(doctorTeamMember.getType());
|
|
|
|
obj.setCancelerTime(DateUtil.dateToStrLong(new Date()));
|
|
|
|
patientReservationDao.save(obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 居民取消预约
|
|
|
|
*/
|
|
|
|
@Transactional
|
|
|
|
public void patientCancelOrder(Long id,String patient) {
|
|
|
|
PatientReservation obj = patientReservationDao.findOne(id);
|
|
|
|
if (obj.getStatus()!=0) {
|
|
|
|
obj.setCanceler(patient);
|
|
|
|
obj.setCancelerName(obj.getName());
|
|
|
|
obj.setCancelerType(5);
|
|
|
|
obj.setCancelerTime(DateUtil.dateToStrLong(new Date()));
|
|
|
|
patientReservationDao.save(obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 保存预约挂号记录
|
|
* 保存预约挂号记录
|
|
*
|
|
*
|