From 6c235963d6fc46b38ea59d9b19c6519b892e080b Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Mon, 16 May 2022 09:42:06 +0800 Subject: [PATCH] 20220516 逻辑删除,更新字段IS_Delete字段为已删除,默认为空,删除后其余信息从查询中过滤了 --- zq-erp/src/main/java/com/matrix/component/tools/CodeUtil.java | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/zq-erp/src/main/java/com/matrix/component/tools/CodeUtil.java b/zq-erp/src/main/java/com/matrix/component/tools/CodeUtil.java index b29e7ba..06ad9e1 100644 --- a/zq-erp/src/main/java/com/matrix/component/tools/CodeUtil.java +++ b/zq-erp/src/main/java/com/matrix/component/tools/CodeUtil.java @@ -5,10 +5,11 @@ import com.google.zxing.MultiFormatWriter; import com.google.zxing.common.BitMatrix; import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; -import com.matrix.core.tools.PropertiesUtil; import com.matrix.core.tools.StringUtils; import com.matrix.core.tools.UUIDUtil; import com.matrix.system.common.constance.AppConstance; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; import javax.imageio.ImageIO; import java.awt.*; @@ -20,9 +21,16 @@ import java.util.Date; import java.util.Hashtable; - +@Component public class CodeUtil { - + + @Value("${file_storage_path}") + private String fileStoragePath; + + @Value("${static_resource_url}") + private String staticResourceUrl; + + private static final String CHARSET = "utf-8"; private static final String FORMAT_NAME = "JPG"; // 二维码尺寸 @@ -151,7 +159,7 @@ * 是否压缩LOGO * @throws Exception */ - public static void encode(String content, String imgPath, String destPath, + public static void encode(String content, String imgPath, String destPath, boolean needCompress) throws Exception { BufferedImage image = CodeUtil.createImage(content, imgPath, needCompress,null); @@ -161,14 +169,14 @@ ImageIO.write(image, FORMAT_NAME, new File(destPath+"/"+file)); } - public static String encode(String content, String imgPath, boolean needCompress, + public String encode(String content, String imgPath, boolean needCompress, String title) throws Exception { BufferedImage image = CodeUtil.createImage(content, imgPath, needCompress,title); // 图片保存目录路径 - String savePath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); + String savePath = fileStoragePath; // 图片保存目录URL - String saveUrl = PropertiesUtil.getString(AppConstance.NGINX_URL); + String saveUrl = staticResourceUrl; // 以账号ID命名创建文件夹 savePath+="qrCode" + File.separatorChar; saveUrl+="qrCode" + File.separatorChar; -- Gitblit v1.9.1