医生二维码入库地址修改

master
gongzhenkun 2 years ago
parent 9953f7ae3b
commit a8d9f510c3

@ -278,6 +278,7 @@ public class FileUploadUtils
public static String code(String content,String path) { public static String code(String content,String path) {
String picPath = ""; String picPath = "";
String pathFileName = "";
try { try {
String codeName = UUID.randomUUID().toString();// 二维码的图片名 String codeName = UUID.randomUUID().toString();// 二维码的图片名
String imageType = "jpg";// 图片类型 String imageType = "jpg";// 图片类型
@ -288,7 +289,7 @@ public class FileUploadUtils
BitMatrix bitMatrix = multiFormatWriter.encode(content, BarcodeFormat.QR_CODE, 400, 400, hints); BitMatrix bitMatrix = multiFormatWriter.encode(content, BarcodeFormat.QR_CODE, 400, 400, hints);
File file1 = new File(path, picPath); File file1 = new File(path, picPath);
MatrixToImageWriter.writeToFile(bitMatrix, imageType, file1); MatrixToImageWriter.writeToFile(bitMatrix, imageType, file1);
pathFileName = getPathFileName(path, picPath);
} catch (WriterException e) { } catch (WriterException e) {
logger.error("code WriterException:", e); logger.error("code WriterException:", e);
e.printStackTrace(); e.printStackTrace();
@ -296,6 +297,6 @@ public class FileUploadUtils
logger.error("code IOException:", e); logger.error("code IOException:", e);
e.printStackTrace(); e.printStackTrace();
} }
return picPath; return pathFileName;
} }
} }

Loading…
Cancel
Save