|  | @ -5,11 +5,13 @@ import java.util.*;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.entity.doctor.profile.Doctor;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeamMember;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.entity.message.Message;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.entity.patient.Patient;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.entity.patient.SignFamily;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.entity.patient.SignFamilyRenew;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.repository.doctor.DoctorDao;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.repository.doctor.DoctorTeamMemberDao;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.repository.message.MessageDao;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.repository.patient.SignFamilyDao;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.repository.patient.SignFamilyRenewDao;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.service.app.team.AdminTeamService;
 | 
	
	
		
			
				|  | @ -67,6 +69,8 @@ public class SignWebService extends BaseService {
 | 
	
		
			
				|  |  |     private SignFamilyRenewDao signFamilyRenewDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private DoctorDao doctorDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private MessageDao messageDao;
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 根据医生代码及签约状态编码 获取该医生签约患者的信息列表
 | 
	
		
			
				|  |  |      *
 | 
	
	
		
			
				|  | @ -894,7 +898,7 @@ public class SignWebService extends BaseService {
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public int agreeRenew(String access_token,String dotorCode,String patientCode,String state) throws Exception{
 | 
	
		
			
				|  |  |     public int agreeRenew(String access_token,String dotorCode,String patientCode,String state,Long mesId) throws Exception{
 | 
	
		
			
				|  |  |         List<SignFamilyRenew> renews =  signFamilyRenewDao.findByDoctorAndPatient(dotorCode,patientCode);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         if(renews==null||renews.size()==0){
 | 
	
	
		
			
				|  | @ -913,6 +917,14 @@ 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);
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 //发送微信模板消息
 | 
	
		
			
				|  |  |                 JSONObject data = new JSONObject();
 | 
	
		
			
				|  |  |                 data.put("doctorName",renew.getDoctorName());
 |