|
@ -4,6 +4,7 @@ import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
import com.yihu.wlyy.entity.patient.prescription.*;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorDao;
|
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
|
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
|
|
|
import com.yihu.wlyy.repository.prescription.PrescriptionDispensaryCodeDao;
|
|
|
import com.yihu.wlyy.repository.prescription.PrescriptionExpressageDao;
|
|
@ -38,6 +39,8 @@ public class PrescriptionExpressageService {
|
|
|
private PrescriptionNoticesService prescriptionNoticesService;
|
|
|
@Autowired
|
|
|
private DoctorDao doctorDao;
|
|
|
@Autowired
|
|
|
private PatientDao patientDao;
|
|
|
@Value("${wechat.wechat_base_url}")
|
|
|
private String wechat_base_url;
|
|
|
@Value("${wechat.appId}")
|
|
@ -175,12 +178,13 @@ public class PrescriptionExpressageService {
|
|
|
Doctor doctor=doctorDao.findByCode(userCode);
|
|
|
|
|
|
//修改处方状态为配送中
|
|
|
//修改处方状态为完成
|
|
|
Prescription prescription = prescriptionDao.findByCode(prescriptionDispensaryCode.getPrescriptionCode());
|
|
|
Date expressageing=new Date();
|
|
|
prescription.setExpressageTime(expressageing);
|
|
|
prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
|
|
|
|
|
|
//得到patient
|
|
|
Patient patient=patientDao.findByCode(prescription.getPatient());
|
|
|
|
|
|
//保存配送成功的日志
|
|
|
PrescriptionLog prescriptionLog = new PrescriptionLog();
|
|
@ -199,11 +203,10 @@ public class PrescriptionExpressageService {
|
|
|
prescriptionDispensaryCode.setIsUse(1);
|
|
|
|
|
|
//发送模板消息通知患者药品开始配送
|
|
|
String url=SystemConf.getInstance().getSystemProperties().getProperty("patient_prescription_expressageing");
|
|
|
url = url.replace("{server}",wechat_base_url)
|
|
|
.replace("{appId}",appId)
|
|
|
.replace("{prescriptionCode}",prescriptionDispensaryCode.getPrescriptionCode());
|
|
|
Patient patient = prescriptionDao.findPatientByPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
|
|
|
String url=wechat_base_url+ "/wx/html/prescription/html/order_tracking.html?openid=" + patient.getOpenid() + "" +
|
|
|
"&code=" + prescriptionDispensaryCode.getPrescriptionCode() + "&toUser=" + patient.getCode() + "&toName=" + patient.getName() ;
|
|
|
|
|
|
|
|
|
prescriptionNoticesService.sendMessages(patient.getOpenid(),patient.getName(),doctor.getName(), DateUtil.dateToStrLong(expressageing),3, 0,url );
|
|
|
|
|
|
return prescriptionDispensaryCode.getType();
|
|
@ -226,6 +229,9 @@ public class PrescriptionExpressageService {
|
|
|
prescription.setExpressageTime(expressage2hospitalDate);
|
|
|
prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.expressage2hospital.getValue());
|
|
|
|
|
|
//得到patient
|
|
|
Patient patient=patientDao.findByCode(prescription.getPatient());
|
|
|
|
|
|
//保存配送成功的日志
|
|
|
PrescriptionLog prescriptionLog = new PrescriptionLog();
|
|
|
prescriptionLog.setPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
|
|
@ -244,12 +250,11 @@ public class PrescriptionExpressageService {
|
|
|
|
|
|
|
|
|
//发送模板消息通知患者取药
|
|
|
String url=SystemConf.getInstance().getSystemProperties().getProperty("patient_prescription_expressage2hospital");
|
|
|
url = url.replace("{server}",wechat_base_url)
|
|
|
.replace("{appId}",appId)
|
|
|
.replace("{prescriptionCode}",prescriptionDispensaryCode.getPrescriptionCode());
|
|
|
//发送模板消息通知患者药品开始配送
|
|
|
String url=wechat_base_url+ "/wx/html/prescription/html/order_tracking.html?openid=" + patient.getOpenid() + "" +
|
|
|
"&code=" + prescriptionDispensaryCode.getPrescriptionCode() + "&toUser=" + patient.getCode() + "&toName=" + patient.getName() ;
|
|
|
|
|
|
|
|
|
Patient patient = prescriptionDao.findPatientByPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
|
|
|
prescriptionNoticesService.sendMessages(patient.getOpenid(),patient.getName(),doctor.getName(), DateUtil.dateToStrLong(expressage2hospitalDate),4, 0, url);
|
|
|
|
|
|
return prescriptionDispensaryCode.getType();
|