| | |
| | |
|
| | |
|
| | | 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;
|
| | |
|
| | |
| | | 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);
|
| | |
| | | g2d.drawString("¥ " + withNoZera + "", quanBGWidht + 70, quanBGHeight + 48);
|
| | | }
|
| | |
|
| | | index = false;
|
| | | |
| | | } else {
|
| | | // 计算左上角坐标
|
| | | int topX = 0;
|
| | |
| | | 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);
|