|
@ -975,16 +975,18 @@ public class SignWebService extends BaseService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public int agreeRenew(String access_token, String dotorCode, String patientCode, String state, Long mesId, String signYear) throws Exception {
|
|
|
|
|
|
List<SignFamilyRenew> renews = signFamilyRenewDao.findByDoctorAndPatientStatus0(dotorCode, patientCode, signYear);
|
|
|
|
|
|
if (renews == null || renews.size() == 0) {
|
|
|
renews = signFamilyRenewDao.findByDoctorHealthAndPatientStatus0(dotorCode, patientCode, signYear);
|
|
|
}
|
|
|
|
|
|
if (renews != null && renews.size() > 0) {
|
|
|
for (SignFamilyRenew renew : renews) {
|
|
|
public int agreeRenew(String access_token, String dotorCode, String patientCode, String state, Long mesId, String signYear,String code) throws Exception {
|
|
|
|
|
|
// List<SignFamilyRenew> renews = signFamilyRenewDao.findByDoctorAndPatientStatus0(dotorCode, patientCode, signYear);
|
|
|
//
|
|
|
// if (renews == null || renews.size() == 0) {
|
|
|
// renews = signFamilyRenewDao.findByDoctorHealthAndPatientStatus0(dotorCode, patientCode, signYear);
|
|
|
// }
|
|
|
SignFamilyRenew renew = signFamilyRenewDao.findByCode(code);
|
|
|
|
|
|
if (renew != null) {
|
|
|
int status = renew.getStatus();
|
|
|
if (status == 0) {
|
|
|
if (StringUtils.isNotBlank(state)) {
|
|
|
if ("0".equals(state)) {
|
|
|
renew.setStatus(-2);
|
|
@ -995,13 +997,7 @@ public class SignWebService extends BaseService {
|
|
|
renew.setApplyDate(new Date());
|
|
|
signFamilyRenewDao.save(renew);
|
|
|
|
|
|
if (mesId != null && mesId > 0) {
|
|
|
Message mes = messageDao.findOne(mesId);
|
|
|
mes.setRead(0);//设置已读
|
|
|
mes.setOver("0");//设置消息操作结束
|
|
|
mes.setCzrq(new Date());
|
|
|
messageDao.save(mes);
|
|
|
}
|
|
|
setMessState(mesId);
|
|
|
|
|
|
//发送微信模板消息
|
|
|
JSONObject data = new JSONObject();
|
|
@ -1047,10 +1043,32 @@ public class SignWebService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//-1患者已取消,-2已拒绝,-3已解约,-4已到期,0待签约,1已签约,2患者申请取消签约,3医生申请取消签约
|
|
|
}else if(status==1){
|
|
|
//已经同意
|
|
|
return 2;
|
|
|
}else if(status==-1){
|
|
|
//-1患者已取消
|
|
|
return 3;
|
|
|
}else if(status ==-2){
|
|
|
//已拒绝
|
|
|
return 4;
|
|
|
}else if(status ==-3){
|
|
|
//已解约
|
|
|
return 5;
|
|
|
}else if(status ==-4){
|
|
|
//已到期
|
|
|
return 6;
|
|
|
}else{
|
|
|
//已申请取消
|
|
|
return 7;
|
|
|
}
|
|
|
} else {
|
|
|
} else{
|
|
|
//未找到签约关系
|
|
|
return 0;
|
|
|
}
|
|
|
//成功
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
@ -1063,16 +1081,18 @@ public class SignWebService extends BaseService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public int agreeRenewOverDue(String access_token, String dotorCode, String patientCode, String state, Long mesId, String signYear) throws Exception {
|
|
|
|
|
|
List<SignFamily> renews = signFamilyDao.findByDoctorAndPatientOverDue(dotorCode, patientCode, signYear);
|
|
|
|
|
|
if (renews == null || renews.size() == 0) {
|
|
|
renews = signFamilyDao.findByDoctorHealthAndPatient(dotorCode, patientCode, signYear);
|
|
|
}
|
|
|
|
|
|
if (renews != null && renews.size() > 0) {
|
|
|
for (SignFamily renew : renews) {
|
|
|
public int agreeRenewOverDue(String access_token, String dotorCode, String patientCode, String state, Long mesId, String signYear ,String signCode) throws Exception {
|
|
|
|
|
|
// List<SignFamily> renews = signFamilyDao.findByDoctorAndPatientOverDue(dotorCode, patientCode, signYear);
|
|
|
//
|
|
|
// if (renews == null || renews.size() == 0) {
|
|
|
// renews = signFamilyDao.findByDoctorHealthAndPatient(dotorCode, patientCode, signYear);
|
|
|
// }
|
|
|
SignFamily renew = signFamilyDao.findByCode(signCode);
|
|
|
|
|
|
if (renew != null) {
|
|
|
int status = renew.getStatus();
|
|
|
if (status == 0) {
|
|
|
if (StringUtils.isNotBlank(state)) {
|
|
|
if ("0".equals(state)) {
|
|
|
renew.setStatus(-2);
|
|
@ -1082,14 +1102,8 @@ public class SignWebService extends BaseService {
|
|
|
}
|
|
|
renew.setApplyDate(new Date());
|
|
|
signFamilyDao.save(renew);
|
|
|
|
|
|
if (mesId != null && mesId > 0) {
|
|
|
Message mes = messageDao.findOne(mesId);
|
|
|
mes.setRead(0);//设置已读
|
|
|
mes.setOver("0");//设置消息操作结束
|
|
|
mes.setCzrq(new Date());
|
|
|
messageDao.save(mes);
|
|
|
}
|
|
|
//消息设为已读
|
|
|
setMessState(mesId);
|
|
|
|
|
|
//发送微信模板消息
|
|
|
JSONObject data = new JSONObject();
|
|
@ -1135,6 +1149,24 @@ public class SignWebService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}else if(status==1){
|
|
|
//已经同意
|
|
|
return 2;
|
|
|
}else if(status==-1){
|
|
|
//已拒绝
|
|
|
return 3;
|
|
|
}else if(status ==-2){
|
|
|
//已拒绝
|
|
|
return 4;
|
|
|
}else if(status ==-3){
|
|
|
//已解约
|
|
|
return 5;
|
|
|
}else if(status ==-4){
|
|
|
//已到期
|
|
|
return 6;
|
|
|
}else{
|
|
|
//已取消
|
|
|
return 7;
|
|
|
}
|
|
|
} else {
|
|
|
return 0;
|