|  | @ -2,9 +2,12 @@ package com.yihu.jw.care.service.consult;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.alibaba.fastjson.JSONObject;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.util.MessageUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.im.ConsultDo;
 | 
	
		
			
				|  |  | import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.im.ConsultTeamDo;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
 | 
	
		
			
				|  |  | import com.yihu.jw.im.dao.ConsultDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.im.dao.ConsultTeamDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.im.util.ImUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.util.date.DateUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.wechat.dao.BasePatientWechatDao;
 | 
	
	
		
			
				|  | @ -12,7 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Value;
 | 
	
		
			
				|  |  | import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import java.util.Date;
 | 
	
		
			
				|  |  | import java.util.List;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | /**
 | 
	
	
		
			
				|  | @ -32,14 +34,18 @@ public class WxPushService {
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private ConsultDao consultDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private ConsultTeamDao consultTeamDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private BasePatientWechatDao basePatientWechatDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private BaseDoctorHospitalDao doctorHospitalDao;
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 发送微信模板
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void sendWXTemplate(String userName,String idCard, String phone,String title, String url,String content,
 | 
	
		
			
				|  |  |                                String topidId,String sessionId,String contentString){
 | 
	
		
			
				|  |  |         JSONObject json = new JSONObject();
 | 
	
		
			
				|  |  |         ConsultDo consult =  consultDao.findOne(topidId);
 | 
	
		
			
				|  |  |         ConsultTeamDo consult =  consultTeamDao.findByConsult(topidId);
 | 
	
		
			
				|  |  |         if(consult == null) {
 | 
	
		
			
				|  |  |            return;
 | 
	
		
			
				|  |  |         }
 | 
	
	
		
			
				|  | @ -61,6 +67,12 @@ public class WxPushService {
 | 
	
		
			
				|  |  |         if(ImUtil.SESSION_TYPE_DOOR_COACH.equals(consultType)){
 | 
	
		
			
				|  |  |             first = userName +"的上门辅导服务咨询有新的回复";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         List<BaseDoctorHospitalDO> list = doctorHospitalDao.findByDoctorCode(consult.getDoctor());
 | 
	
		
			
				|  |  |         if(list.size()>0){
 | 
	
		
			
				|  |  |             json.put("orgCode",list.get(0).getOrgCode());
 | 
	
		
			
				|  |  |         }else {
 | 
	
		
			
				|  |  |             json.put("orgCode","");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         json.put("sessionId",sessionId);
 | 
	
		
			
				|  |  |         json.put("consultType",consultType);
 | 
	
		
			
				|  |  |         List<BasePatientWechatDo> basePatientWechatDos = basePatientWechatDao.findByWechatIdAndPatientId(wxId,consult.getPatient());
 |