|
@ -6,6 +6,7 @@ import com.yihu.wlyy.entity.message.Message;
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
import com.yihu.wlyy.entity.patient.prescription.Prescription;
|
|
import com.yihu.wlyy.entity.patient.prescription.Prescription;
|
|
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressage;
|
|
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressage;
|
|
|
|
import com.yihu.wlyy.entity.patient.prescription.PrescriptionInfo;
|
|
import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
|
|
import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
|
|
import com.yihu.wlyy.repository.doctor.DoctorTeamDao;
|
|
import com.yihu.wlyy.repository.doctor.DoctorTeamDao;
|
|
import com.yihu.wlyy.repository.message.MessageDao;
|
|
import com.yihu.wlyy.repository.message.MessageDao;
|
|
@ -18,16 +19,19 @@ import com.yihu.wlyy.service.BaseService;
|
|
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
|
|
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
|
|
import com.yihu.wlyy.task.PushMsgTask;
|
|
import com.yihu.wlyy.task.PushMsgTask;
|
|
import com.yihu.wlyy.util.MessageType;
|
|
import com.yihu.wlyy.util.MessageType;
|
|
|
|
import net.sf.json.JSONArray;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
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.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
import org.springframework.orm.jpa.JpaTransactionManager;
|
|
import org.springframework.orm.jpa.JpaTransactionManager;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Created by chenweida on 2017/7/27.
|
|
* Created by chenweida on 2017/7/27.
|
|
@ -56,7 +60,8 @@ public class PrescriptionService extends BaseService {
|
|
private JwPrescriptionService jwPrescriptionService;
|
|
private JwPrescriptionService jwPrescriptionService;
|
|
@Autowired
|
|
@Autowired
|
|
private PrescriptionDiagnosisDao prescriptionDiagnosisDao;
|
|
private PrescriptionDiagnosisDao prescriptionDiagnosisDao;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private StringRedisTemplate redisTemplate;
|
|
@Autowired
|
|
@Autowired
|
|
private DoctorTeamDao doctorTeamDao;
|
|
private DoctorTeamDao doctorTeamDao;
|
|
@Autowired
|
|
@Autowired
|
|
@ -97,6 +102,31 @@ public class PrescriptionService extends BaseService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 设置处方redis药品信息
|
|
|
|
* @param prescriptionCode
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public boolean setPrescriptionInfo(String prescriptionCode){
|
|
|
|
try {
|
|
|
|
if(!StringUtils.isEmpty(prescriptionCode))
|
|
|
|
{
|
|
|
|
//判断该续方的药品信息redis是否存在
|
|
|
|
String key = "prescription:"+prescriptionCode+":drugInfo";
|
|
|
|
List<PrescriptionInfo> list = prescriptionInfoDao.findByPrescriptionCode(prescriptionCode);
|
|
|
|
if(list!=null&&list.size()>0){
|
|
|
|
String re = JSONArray.fromObject(list).toString();
|
|
|
|
redisTemplate.opsForValue().set(key,re,180, TimeUnit.DAYS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex) {
|
|
|
|
ex.printStackTrace();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 配药完成
|
|
* 配药完成
|
|
* @param code
|
|
* @param code
|