|
@ -2,9 +2,11 @@ package com.yihu.wlyy.service.app.prescription;
|
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
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.PrescriptionDispensaryCode;
|
|
import com.yihu.wlyy.entity.patient.prescription.PrescriptionInfo;
|
|
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.prescription.PrescriptionDao;
|
|
import com.yihu.wlyy.repository.prescription.PrescriptionDispensaryCodeDao;
|
|
import com.yihu.wlyy.repository.prescription.PrescriptionDispensaryCodeDao;
|
|
import com.yihu.wlyy.repository.prescription.PrescriptionInfoDao;
|
|
import com.yihu.wlyy.repository.prescription.PrescriptionInfoDao;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
@ -51,6 +53,8 @@ public class PrescriptionDispensaryCodeService extends BaseService {
|
|
private PrescriptionInfoDao prescriptionInfoDao;
|
|
private PrescriptionInfoDao prescriptionInfoDao;
|
|
@Autowired
|
|
@Autowired
|
|
private HttpUtil httpUtil;
|
|
private HttpUtil httpUtil;
|
|
|
|
@Autowired
|
|
|
|
private PrescriptionDao prescriptionDao;
|
|
|
|
|
|
private static Object obj = new Object();
|
|
private static Object obj = new Object();
|
|
private static Object obj2 = new Object();
|
|
private static Object obj2 = new Object();
|
|
@ -116,6 +120,30 @@ public class PrescriptionDispensaryCodeService extends BaseService {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public boolean saveQRCode(String token,String prescriptionCode) throws Exception {
|
|
|
|
Prescription prescription = prescriptionDao.findByCode(prescriptionCode);
|
|
|
|
//取药类型:1 自取 2快递配送 3健管师配送
|
|
|
|
Integer type = prescription.getDispensaryType();
|
|
|
|
PrescriptionDispensaryCode prescriptionDispensaryCode = savePatientQRCode(token,prescriptionCode);
|
|
|
|
if(type==3){
|
|
|
|
if(prescriptionDispensaryCode!=null){
|
|
|
|
|
|
|
|
prescriptionDispensaryCode = saveQRCode(prescriptionDispensaryCode.getCode(),token,prescriptionCode,2);
|
|
|
|
if(prescriptionDispensaryCode!=null){
|
|
|
|
prescriptionDispensaryCode = saveQRCode(prescriptionDispensaryCode.getCode(),token,prescriptionCode,3);
|
|
|
|
if(prescriptionDispensaryCode==null){
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
//生成居民端取药码
|
|
//生成居民端取药码
|
|
@Transactional
|
|
@Transactional
|
|
public PrescriptionDispensaryCode savePatientQRCode(String token,String prescriptionCode) throws Exception {
|
|
public PrescriptionDispensaryCode savePatientQRCode(String token,String prescriptionCode) throws Exception {
|