|
@ -1,14 +1,9 @@
|
|
|
package com.yihu.wlyy.service.app.prescription;
|
|
|
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
|
import com.yihu.wlyy.entity.patient.prescription.Prescription;
|
|
|
import com.yihu.wlyy.entity.patient.prescription.PrescriptionDispensaryCode;
|
|
|
import com.yihu.wlyy.entity.patient.prescription.PrescriptionInfo;
|
|
|
import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
|
|
|
import com.yihu.wlyy.entity.patient.prescription.*;
|
|
|
import com.yihu.wlyy.repository.message.MessageDao;
|
|
|
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
|
|
|
import com.yihu.wlyy.repository.prescription.PrescriptionDispensaryCodeDao;
|
|
|
import com.yihu.wlyy.repository.prescription.PrescriptionInfoDao;
|
|
|
import com.yihu.wlyy.repository.prescription.*;
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
import com.yihu.wlyy.util.HttpUtil;
|
|
|
import com.yihu.wlyy.util.QrcodeUtil;
|
|
@ -44,6 +39,10 @@ public class PrescriptionDispensaryCodeService extends BaseService {
|
|
|
private PrescriptionDao prescriptionDao;
|
|
|
@Autowired
|
|
|
private MessageDao messageDao;
|
|
|
@Autowired
|
|
|
private PrescriptionLogDao prescriptionLogDao;
|
|
|
@Autowired
|
|
|
private PrescriptionExpressageLogDao prescriptionExpressageLogDao;
|
|
|
|
|
|
private static Object obj = new Object();
|
|
|
private static Object obj2 = new Object();
|
|
@ -241,12 +240,47 @@ public class PrescriptionDispensaryCodeService extends BaseService {
|
|
|
prescriptionDispensaryCode.setIsUse(1);
|
|
|
prescriptionDispensaryCodeDao.save(prescriptionDispensaryCode);
|
|
|
|
|
|
//新增log表
|
|
|
// PrescriptionLog log = new PrescriptionLog();
|
|
|
Prescription prescription = prescriptionDao.findByCode(prescriptionDispensaryCode.getPrescriptionCode());
|
|
|
if(prescriptionDispensaryCode.getType()==1){
|
|
|
prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.finish.getValue());
|
|
|
// log.setRemark("配送到患者手中/已完成");
|
|
|
// log.setType(PrescriptionLog.PrescriptionLogType.finish.getValue());
|
|
|
// log.setStatus(PrescriptionLog.PrescriptionLogStatus.finish.getValue());
|
|
|
}else if(prescription.getDispensaryType()==2){
|
|
|
prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
|
|
|
// log.setRemark("配送中");
|
|
|
// log.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
|
|
|
// log.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
|
|
|
}else{
|
|
|
prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.expressage2hospital.getValue());
|
|
|
// log.setRemark("配送到服务站");
|
|
|
// log.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
|
|
|
// log.setStatus(PrescriptionLog.PrescriptionLogStatus.expressage2hospital.getValue());
|
|
|
}
|
|
|
|
|
|
if(prescription.getDispensaryType()==3){
|
|
|
//健管师配送
|
|
|
//修改系统的续方消息的审核状态
|
|
|
messageDao.updatePreScriptionMessage(prescription.getCode(), "1", 7);
|
|
|
// log.setUserType(2);
|
|
|
}
|
|
|
// else{
|
|
|
// log.setUserType(1);
|
|
|
// }
|
|
|
|
|
|
// log.setPrescriptionCode(prescription.getCode());
|
|
|
// log.setCode(getCode());
|
|
|
// log.setCreateTime(new Date());
|
|
|
// log.setHospital(prescription.getHospital());
|
|
|
// log.setHospitalName(prescription.getHospitalName());
|
|
|
// log.setUserName(prescription.getDoctorName());
|
|
|
// log.setFlag(1);
|
|
|
// log.setUserCode(prescription.getDoctor());
|
|
|
// prescriptionLogDao.save(log);
|
|
|
|
|
|
|
|
|
}else{
|
|
|
throw new Exception("二维码输入错误或者已过期!");
|
|
|
}
|