|
@ -44,12 +44,11 @@ public class PrescriptionExpressageService {
|
|
|
*
|
|
|
* @param code 编码code
|
|
|
* @param userCode
|
|
|
* @param type 1是医生 2是患者
|
|
|
* @return 返回取药码或者配送码的类型 1 居民取药码 2 配送员(健管师)取药码 3 配送员(健管师)配送码
|
|
|
* 前端根据这个类型去跳转
|
|
|
*/
|
|
|
@Transactional
|
|
|
public Integer expressage(String code, String userCode, Integer type) throws Exception {
|
|
|
public Integer expressage(String code, String userCode) throws Exception {
|
|
|
Integer returnStatus = -1;
|
|
|
//获取根据wlyy_prescription_dispensary_code的code处方编码
|
|
|
PrescriptionDispensaryCode prescriptionDispensaryCode = prescriptionDispensaryCodeDao.finByCode(code);
|
|
@ -65,11 +64,26 @@ public class PrescriptionExpressageService {
|
|
|
prescriptionLog.setUserCode(userCode);
|
|
|
prescriptionLog.setUserType(2);
|
|
|
prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
|
|
|
prescriptionLog.setRemark("配送失败,处方编码不存在");
|
|
|
prescriptionLog.setRemark("编码不存在");
|
|
|
prescriptionLogDao.save(prescriptionLog);
|
|
|
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 居民取药码
|
|
@ -86,7 +100,7 @@ public class PrescriptionExpressageService {
|
|
|
returnStatus = dispensaryCode_3(userCode, prescriptionDispensaryCode);
|
|
|
break;
|
|
|
}
|
|
|
default:{
|
|
|
default: {
|
|
|
PrescriptionLog prescriptionLog = new PrescriptionLog();
|
|
|
prescriptionLog.setCode(UUID.randomUUID().toString());
|
|
|
prescriptionLog.setPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
|
|
@ -96,9 +110,10 @@ public class PrescriptionExpressageService {
|
|
|
prescriptionLog.setUserCode(userCode);
|
|
|
prescriptionLog.setUserType(2);
|
|
|
prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
|
|
|
prescriptionLog.setRemark("二维码类型错误");
|
|
|
prescriptionLog.setRemark("编码类型错误");
|
|
|
prescriptionLogDao.save(prescriptionLog);
|
|
|
break;
|
|
|
returnStatus = -3;
|
|
|
return returnStatus;
|
|
|
}
|
|
|
}
|
|
|
return returnStatus;
|
|
@ -192,10 +207,11 @@ public class PrescriptionExpressageService {
|
|
|
|
|
|
/**
|
|
|
* 保存快递单号和增加处方物流记录为配送
|
|
|
*
|
|
|
* @param prescriptionExpressage
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public void updatePrescriptionExpressage(PrescriptionExpressage prescriptionExpressage)throws Exception{
|
|
|
public void updatePrescriptionExpressage(PrescriptionExpressage prescriptionExpressage) throws Exception {
|
|
|
//保存处方物流记录
|
|
|
prescriptionExpressageDao.save(prescriptionExpressage);
|
|
|
|