|
@ -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,25 @@ 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);
|
|
|
return returnStatus;
|
|
|
}
|
|
|
|
|
|
switch (prescriptionDispensaryCode.getType()) {
|
|
|
case 1: {
|
|
|
//判断是1 居民取药码
|