|  | @ -10,6 +10,7 @@ import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
 | 
												
													
														
															|  | import com.yihu.wlyy.repository.message.MessageDao;
 |  | import com.yihu.wlyy.repository.message.MessageDao;
 | 
												
													
														
															|  | import com.yihu.wlyy.repository.patient.PatientDao;
 |  | import com.yihu.wlyy.repository.patient.PatientDao;
 | 
												
													
														
															|  | import com.yihu.wlyy.repository.prescription.PrescriptionDao;
 |  | import com.yihu.wlyy.repository.prescription.PrescriptionDao;
 | 
												
													
														
															|  | 
 |  | import com.yihu.wlyy.repository.prescription.PrescriptionDispensaryCodeDao;
 | 
												
													
														
															|  | import com.yihu.wlyy.repository.prescription.PrescriptionExpressageDao;
 |  | import com.yihu.wlyy.repository.prescription.PrescriptionExpressageDao;
 | 
												
													
														
															|  | import com.yihu.wlyy.service.BaseService;
 |  | import com.yihu.wlyy.service.BaseService;
 | 
												
													
														
															|  | import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
 |  | import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
 | 
												
											
												
													
														
															|  | @ -19,6 +20,7 @@ import org.apache.commons.lang3.StringUtils;
 | 
												
													
														
															|  | import org.slf4j.Logger;
 |  | import org.slf4j.Logger;
 | 
												
													
														
															|  | import org.slf4j.LoggerFactory;
 |  | import org.slf4j.LoggerFactory;
 | 
												
													
														
															|  | import org.springframework.beans.factory.annotation.Autowired;
 |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
												
													
														
															|  | 
 |  | import org.springframework.beans.factory.annotation.Value;
 | 
												
													
														
															|  | import org.springframework.stereotype.Service;
 |  | import org.springframework.stereotype.Service;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | import java.util.Date;
 |  | import java.util.Date;
 | 
												
											
												
													
														
															|  | @ -45,7 +47,10 @@ public class PrescriptionService extends BaseService {
 | 
												
													
														
															|  |     private PatientDao patientDao;
 |  |     private PatientDao patientDao;
 | 
												
													
														
															|  |     @Autowired
 |  |     @Autowired
 | 
												
													
														
															|  |     private JwPrescriptionService jwPrescriptionService;
 |  |     private JwPrescriptionService jwPrescriptionService;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     @Value("${wechat.wechat_base_url}")
 | 
												
													
														
															|  | 
 |  |     private String wechat_base_url;
 | 
												
													
														
															|  | 
 |  |     @Autowired
 | 
												
													
														
															|  | 
 |  |     private PrescriptionDispensaryCodeDao prescriptionDispensaryCodeDao;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     /**
 |  |     /**
 | 
												
													
														
															|  |      *  获取处方信息
 |  |      *  获取处方信息
 | 
												
											
												
													
														
															|  | @ -68,7 +73,15 @@ public class PrescriptionService extends BaseService {
 | 
												
													
														
															|  |                 //自取
 |  |                 //自取
 | 
												
													
														
															|  |                 Patient patient = patientDao.findByCode(prescription.getPatient());
 |  |                 Patient patient = patientDao.findByCode(prescription.getPatient());
 | 
												
													
														
															|  |                 try {
 |  |                 try {
 | 
												
													
														
															|  |                     prescriptionNoticesService.sendMessages(patient.getCode(), patient.getName(), null, null, 2, 0, "");
 |  | 
 | 
												
													
														
															|  | 
 |  |                     String dispensaryCode = prescriptionDispensaryCodeDao.getCodeByPrescriptionCodeAndType(code,1);
 | 
												
													
														
															|  | 
 |  |                     StringBuffer url = new StringBuffer();
 | 
												
													
														
															|  | 
 |  |                     url.append(wechat_base_url);
 | 
												
													
														
															|  | 
 |  |                     url.append("wx/prescription/html/code-detail.html?dispensaryCode=").append(dispensaryCode);
 | 
												
													
														
															|  | 
 |  |                     url.append("&openid=").append(patient.getOpenid());
 | 
												
													
														
															|  | 
 |  |                     url.append("&toUser=").append(patient.getCode());
 | 
												
													
														
															|  | 
 |  |                     url.append("&toName=").append(patient.getName());
 | 
												
													
														
															|  | 
 |  |                     url.append("&represented=").append(patient.getCode());
 | 
												
													
														
															|  | 
 |  |                     prescriptionNoticesService.sendMessages(patient.getCode(), patient.getName(), null, null, 2, 0, url.toString());
 | 
												
													
														
															|  |                 }catch (Exception e){
 |  |                 }catch (Exception e){
 | 
												
													
														
															|  |                     logger.info("微信模板发送失败,续方code"+code);
 |  |                     logger.info("微信模板发送失败,续方code"+code);
 | 
												
													
														
															|  |                 }
 |  |                 }
 |