| | |
| | | * @param goods |
| | | * @return |
| | | */ |
| | | public static InputStream drawGoodsPoster(InputStream qrcode, InputStream portraitStream, String inviteCode, GoodsDetailVO goods) { |
| | | public static InputStream drawGoodsPoster(InputStream qrcode, InputStream portraitStream, String inviteCode, |
| | | String mainPic, GoodsDetailVO goods) { |
| | | try { |
| | | String fontPath = "/usr/share/fonts/PingFang_Medium.ttf"; |
| | | String os = System.getProperty("os.name"); |
| | |
| | | int spacing = 20; // 右边距 |
| | | |
| | | // 1、画商品主图 |
| | | InputStream picStream = HttpUtil.getAsInputStream(goods.getPicUrl().replace("https://", "http://")); |
| | | InputStream picStream = HttpUtil.getAsInputStream(mainPic); |
| | | // InputStream picStream = ImageUtil.class.getClassLoader().getResourceAsStream("image/share/test_pic1.jpg"); |
| | | g2d.drawImage(ImageIO.read(picStream), 0, 0, x, y, null); |
| | | |
| | |
| | | InputStream ziying = null; |
| | | if (goods.getShopType() == 21) { |
| | | ziying = ImageUtil.class.getClassLoader().getResourceAsStream("image/icon_ziying.png"); |
| | | g2d.drawImage(ImageIO.read(ziying), baoYouLength, y + 150, 60, 30, null); |
| | | } else if (goods.isBaoyou()) { |
| | | ziying = ImageUtil.class.getClassLoader().getResourceAsStream("image/icon_baoyou.png"); |
| | | g2d.drawImage(ImageIO.read(ziying), baoYouLength, y + 150, 60, 30, null); |
| | | } |
| | | g2d.drawImage(ImageIO.read(ziying), baoYouLength, y + 150, 60, 30, null); |
| | | |
| | | |
| | | // 销量 |
| | | String sale = null; |