替换logo图片

This commit is contained in:
GYJ 2024-07-29 16:01:33 +08:00
parent 6a29563de0
commit bd9d3f0eea
1 changed files with 5 additions and 2 deletions

View File

@ -20,6 +20,7 @@ import com.chaozhanggui.system.cashierservice.util.*;
import com.chaozhanggui.system.cashierservice.wxUtil.WxAccountUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
@ -263,8 +264,10 @@ public class UserService {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Resource resource = resourceLoader.getResource("classpath:/static/logo.jpg");
InputStream inputStream = resource.getInputStream();
QrCodeUtil.generate(wxAccountUtil.getRadarQrCode(Integer.valueOf(shopId)), new QrConfig(250, 250).setImg(ImageIO.read(inputStream)), "png", outputStream);
QrCodeUtil.generate(wxAccountUtil.getRadarQrCode(Integer.valueOf(shopId)), new QrConfig(500, 500).
setImg(ImageIO.read(inputStream)).setErrorCorrection(ErrorCorrectionLevel.H).setRatio(4), "png", outputStream);
return fileService.uploadFileByInputStream(".png", new ByteArrayInputStream(outputStream.toByteArray()));
return fileService.uploadFileByInputStream("png", new ByteArrayInputStream(outputStream.toByteArray()));
}
}