admin
2019-11-16 a6f34b99ee20e528b766c8ed5a61bd9c5aa0e7ae
fanli/src/main/java/com/yeshi/fanli/util/ImageUtil.java
@@ -805,12 +805,13 @@
      
      
      try {
         boolean index = true;
         // 画第一张
         for (int i = 0; i < goodsList.size(); i++) {
            CommonGoods goods = goodsList.get(i);
            BigDecimal couplePrice = CommonGoodsUtil.getAfterUseCouplePrice(goods);
            // 第一张图需要有价格信息
            if (i == 0) {
            if (i == 0 || index) {
               int topX = 50;
               int topY = 50;
               
@@ -819,6 +820,9 @@
               int widht = 650;
               int height = 650;
               InputStream goodsPicture = TaoBaoHttpUtil.getAsInputStream(goods.getPicture().replace("_.webp", "").replace("_220x220", ""));
               if (goodsPicture == null)
                  continue;
               BufferedImage picImage = ImageIO.read(goodsPicture);
               picImage = ImageUtil.zoomInImage(picImage, widht, height);
               g2d.drawImage(picImage, topX, topX, null);
@@ -885,6 +889,8 @@
                  g2d.drawString("¥ " + withNoZera + "", quanBGWidht + 70, quanBGHeight + 48);
               }
               index = false;
            } else {
               // 计算左上角坐标
               int topX = 0;
@@ -906,8 +912,10 @@
                  topY = 50 + (315 + 20) * 2;
               // 画大图
               InputStream goodsPicture = TaoBaoHttpUtil
                     .getAsInputStream(goods.getPicture().replace("_.webp", ""));
               InputStream goodsPicture = TaoBaoHttpUtil.getAsInputStream(goods.getPicture().replace("_.webp", ""));
               if (goodsPicture == null)
                  continue;
               BufferedImage picImage = ImageIO.read(goodsPicture);
               picImage = ImageUtil.zoomInImage(picImage, 315, 315);
               g2d.drawImage(picImage, topX, topY, null);