|
@ -49,6 +49,7 @@ public class PrescriptionDispensaryCodeService extends BaseService {
|
|
|
private HttpUtil httpUtil;
|
|
|
|
|
|
private static Object obj = new Object();
|
|
|
private static Object obj2 = new Object();
|
|
|
|
|
|
@Value("${fastDFS.fastdfs_file_url}")
|
|
|
String fastdfs_file_url;
|
|
@ -66,16 +67,16 @@ public class PrescriptionDispensaryCodeService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
List<Object> params = new ArrayList<>();
|
|
|
String precriptionSql = "select * from wlyy_prescription p1 LEFT JOIN wlyy_prescription_expressage p3 on p1.code=p3.prescription_code where 1=1 ";
|
|
|
String precriptionSql = "select * from wlyy_prescription_dispensary_code p2 left join wlyy_prescription p1 on p2.prescription_code=p1.code LEFT JOIN wlyy_prescription_expressage p3 on p1.code=p3.prescription_code where 1=1 ";
|
|
|
|
|
|
if(status!=null){
|
|
|
precriptionSql += " and b.status = ? ";
|
|
|
precriptionSql += " and p1.status = ? ";
|
|
|
params.add(status);
|
|
|
}else {
|
|
|
precriptionSql += " and b.status in (20,21,100)" ;
|
|
|
precriptionSql += " and p1.status in (20,21,100)" ;
|
|
|
}
|
|
|
if(timeType!=null){
|
|
|
precriptionSql += "and TIMESTAMPDIFF(SECOND, a.create_Time, CURRENT_TIME) > ? ORDER BY b.status desc ,a.create_Time desc ";
|
|
|
precriptionSql += "and TIMESTAMPDIFF(SECOND, a.create_Time, CURRENT_TIME) > ? ORDER BY p1.status desc ,p2.create_Time desc ";
|
|
|
params.add(timeLimit);
|
|
|
}
|
|
|
precriptionSql += " limit "+(page-1)*pagesize+","+pagesize;
|
|
@ -144,9 +145,17 @@ public class PrescriptionDispensaryCodeService extends BaseService {
|
|
|
|
|
|
//生成配送员(健管师)取药码
|
|
|
public PrescriptionDispensaryCode saveDoctorQRCode(String code,String token,String prescriptionCode){
|
|
|
|
|
|
String jgsID= "";//配送员用户ID后4位
|
|
|
String jgsCode = code+jgsID.substring(jgsID.length()-4);
|
|
|
String jgsCode= "";
|
|
|
synchronized (obj2){
|
|
|
boolean bl = true;
|
|
|
while (bl){
|
|
|
String randomNum = randomString("0123456789",2);
|
|
|
jgsCode = code +randomNum;
|
|
|
bl = getResidentQRCodeCount(jgsCode);
|
|
|
}
|
|
|
}
|
|
|
//String jgsID= "";//配送员用户ID后4位
|
|
|
// String jgsCode = code+"1234";//code+jgsID.substring(jgsID.length()-4);
|
|
|
ObjectNode imgNode2 = makeQrcodeFromWeiXin(token,jgsCode);
|
|
|
String fileUrl = fastdfs_file_url + imgNode2.get("groupName").toString().replaceAll("\"","")
|
|
|
+ "/" + imgNode2.get("remoteFileName").toString().replaceAll("\"","");
|
|
@ -191,6 +200,7 @@ public class PrescriptionDispensaryCodeService extends BaseService {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
//随机生成匹配数字
|
|
|
public String randomString(String base, int length) {
|
|
|
Random random = new Random();
|
|
|
StringBuffer sb = new StringBuffer();
|