|
@ -107,6 +107,23 @@ public class PrescriptionExpressageService {
|
|
|
returnStatus = -2;
|
|
|
return returnStatus;
|
|
|
}
|
|
|
|
|
|
// if (prescriptionDispensaryCode.getIsUse() == 1) {
|
|
|
// //判断编码是否使用过
|
|
|
// PrescriptionLog prescriptionLog = new PrescriptionLog();
|
|
|
// prescriptionLog.setCode(UUID.randomUUID().toString());
|
|
|
// prescriptionLog.setPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
|
|
|
// prescriptionLog.setCreateTime(new Date());
|
|
|
// prescriptionLog.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
|
|
|
// prescriptionLog.setFlag(1);
|
|
|
// prescriptionLog.setUserCode(userCode);
|
|
|
// prescriptionLog.setUserType(2);
|
|
|
// prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
|
|
|
// prescriptionLog.setRemark("编码重复扫描");
|
|
|
// prescriptionLogDao.save(prescriptionLog);
|
|
|
// returnStatus = -2;
|
|
|
// return returnStatus;
|
|
|
// }
|
|
|
switch (prescriptionDispensaryCode.getType()) {
|
|
|
case 1: {
|
|
|
//判断是1 居民取药码
|
|
@ -154,6 +171,20 @@ public class PrescriptionExpressageService {
|
|
|
|
|
|
//修改处方状态为完成
|
|
|
Prescription prescription = prescriptionDao.findByCode(prescriptionDispensaryCode.getPrescriptionCode());
|
|
|
if(prescription.getStatus()<=65){
|
|
|
PrescriptionLog prescriptionLog = new PrescriptionLog();
|
|
|
prescriptionLog.setCode(UUID.randomUUID().toString());
|
|
|
prescriptionLog.setPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
|
|
|
prescriptionLog.setCreateTime(new Date());
|
|
|
prescriptionLog.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
|
|
|
prescriptionLog.setFlag(1);
|
|
|
prescriptionLog.setUserCode(userCode);
|
|
|
prescriptionLog.setUserType(2);
|
|
|
prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
|
|
|
prescriptionLog.setRemark("该状态不可取药");
|
|
|
prescriptionLogDao.save(prescriptionLog);
|
|
|
return -4;
|
|
|
}
|
|
|
Date finshTime = new Date();
|
|
|
prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.finish.getValue());
|
|
|
prescription.setFinishTime(finshTime);
|
|
@ -193,8 +224,23 @@ public class PrescriptionExpressageService {
|
|
|
//获取配送的医生信息
|
|
|
Doctor doctor = doctorDao.findByCode(userCode);
|
|
|
|
|
|
//修改处方状态为配送中
|
|
|
|
|
|
Prescription prescription = prescriptionDao.findByCode(prescriptionDispensaryCode.getPrescriptionCode());
|
|
|
if(prescription.getStatus()<=50){
|
|
|
PrescriptionLog prescriptionLog = new PrescriptionLog();
|
|
|
prescriptionLog.setCode(UUID.randomUUID().toString());
|
|
|
prescriptionLog.setPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
|
|
|
prescriptionLog.setCreateTime(new Date());
|
|
|
prescriptionLog.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
|
|
|
prescriptionLog.setFlag(1);
|
|
|
prescriptionLog.setUserCode(userCode);
|
|
|
prescriptionLog.setUserType(2);
|
|
|
prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
|
|
|
prescriptionLog.setRemark("该状态不可配送");
|
|
|
prescriptionLogDao.save(prescriptionLog);
|
|
|
return -5;
|
|
|
}
|
|
|
//修改处方状态为配送中
|
|
|
Date expressageing = new Date();
|
|
|
prescription.setExpressageTime(expressageing);
|
|
|
prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
|