|
@ -1,11 +1,14 @@
|
|
|
package com.yihu.wlyy.job;
|
|
|
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
import com.yihu.wlyy.entity.patient.PhysicalExaminationRecords;
|
|
|
import com.yihu.wlyy.entity.patient.prescription.Prescription;
|
|
|
import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
|
|
|
import com.yihu.wlyy.repository.dict.SystemDictDao;
|
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
|
import com.yihu.wlyy.repository.physicalExamination.PatientPhysicalExaminationDao;
|
|
|
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
|
|
|
import com.yihu.wlyy.service.app.physicalExamination.PatientPhysicalExaminationService;
|
|
|
import com.yihu.wlyy.task.PushMsgTask;
|
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
|
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
|
|
@ -47,6 +50,10 @@ public class PatientConfirmReceiptJob implements Job {
|
|
|
private WeiXinAccessTokenUtils weiXinAccessTokenUtils;
|
|
|
@Autowired
|
|
|
private WeiXinOpenIdUtils weiXinOpenIdUtils;
|
|
|
@Autowired
|
|
|
private PatientPhysicalExaminationDao examinationDao;
|
|
|
@Autowired
|
|
|
private PatientPhysicalExaminationService examinationService;
|
|
|
|
|
|
@Override
|
|
|
public void execute(JobExecutionContext context) throws JobExecutionException {
|
|
@ -71,8 +78,13 @@ public class PatientConfirmReceiptJob implements Job {
|
|
|
//4.计算现在到预计自动确认收货时间差值
|
|
|
long days = DateUtil.getDays(today,payTime);
|
|
|
if(days == 3 && extendCount ==0){
|
|
|
//支付后第三天发送自动确认预提醒
|
|
|
sendWechatTemplate(1,patient,prescription.getCode());
|
|
|
PhysicalExaminationRecords records = examinationDao.findByType(patient,3,1);
|
|
|
if (records == null){
|
|
|
//支付后第三天发送自动确认预提醒
|
|
|
sendWechatTemplate(1,patient,prescription.getCode());
|
|
|
//发送成功保存发送记录
|
|
|
examinationService.saveRecord(patient,3,1);
|
|
|
}
|
|
|
}
|
|
|
int result = today.compareTo(confirm);
|
|
|
if (result >= 0) {
|