| | |
| | | }
|
| | | g2d.setFont(font);
|
| | | try {
|
| | | g2d.setColor(new Color(153, 153, 153));
|
| | | // g2d.setColor(new Color(153, 153, 153));
|
| | | // 画第一张
|
| | | for (int i = 0; i < goodsList.size(); i++) {
|
| | | TaoBaoGoodsBrief goods = goodsList.get(i);
|
| | |
| | | g2d.setStroke(new BasicStroke(2.0f));
|
| | | g2d.drawLine(70 + 20, 674, 90 + 10 + textLength, 674);
|
| | |
|
| | | String quanString = "";
|
| | | BigDecimal withNoZera = MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount());
|
| | | |
| | | if (!withNoZera.toString().endsWith("0")) {
|
| | | |
| | | // 画券右侧
|
| | | BufferedImage quanRight = ImageIO
|
| | | .read(ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_right.png"));
|
| | |
| | | // 画券的内容
|
| | | g2d.setColor(new Color(229, 0, 93));
|
| | |
|
| | | String quanString = " " + MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount()) + "元券 ";
|
| | | quanString = " " + withNoZera + "元券 ";
|
| | |
|
| | | font = font.deriveFont(36.0f);
|
| | | g2d.setFont(font);
|
| | |
| | | quanLeft = zoomInImage(quanLeft, 12, 60);
|
| | | g2d.drawImage(quanLeft, topX + 630 - quanRight.getWidth() - textLength - quanLeft.getWidth(),
|
| | | topY + 630 - quanRight.getHeight(), null);
|
| | | }
|
| | |
|
| | | } else {
|
| | | // 计算左上角坐标
|
| | |
| | |
|
| | | // 画券
|
| | |
|
| | | String quanString = "";
|
| | | BigDecimal withNoZera = MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount());
|
| | | |
| | | if (!withNoZera.toString().endsWith("0")) {
|
| | | |
| | | // 画券右侧
|
| | | BufferedImage quanRight = ImageIO
|
| | | .read(ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_right.png"));
|
| | |
| | | // 画券的内容
|
| | | g2d.setColor(new Color(229, 0, 93));
|
| | |
|
| | | String quanString = " " + MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount()) + "元券 ";
|
| | | quanString = " " + withNoZera + "元券 ";
|
| | |
|
| | | font = font.deriveFont(24.0f);
|
| | | g2d.setFont(font);
|
| | |
| | | quanLeft = zoomInImage(quanLeft, 8, 40);
|
| | | g2d.drawImage(quanLeft, topX + 315 - quanRight.getWidth() - textLength - quanLeft.getWidth(),
|
| | | topY + 315 - quanRight.getHeight(), null);
|
| | | }
|
| | | |
| | | }
|
| | | }
|
| | |
|
| | |
| | | // g2d.drawString("返利券提醒您", 312, 1118 + 40);
|
| | |
|
| | | g2d.setColor(new Color(102, 102, 102));
|
| | | g2d.drawString("长按识别二维码领取优惠券", 312, 1118 + 77);
|
| | | g2d.drawString("长按识别二维码免费领券", 312, 1142);
|
| | | |
| | | g2d.setColor(new Color(102, 102, 102));
|
| | | g2d.drawString("共", 1000, 1142);
|
| | | |
| | | |
| | | g2d.setColor(new Color(229, 0, 93));
|
| | | g2d.drawString(goodsList.size()+"", 1055, 1142);
|
| | | |
| | | |
| | | g2d.setColor(new Color(102, 102, 102));
|
| | | g2d.drawString("个商品", 1090, 1142);
|
| | | |
| | | // 提示语
|
| | | BufferedImage tips = ImageIO
|
| | | .read(ImageUtil.class.getClassLoader().getResourceAsStream("image/share/tips1.png"));
|
| | | tips = zoomInImage(tips,850, 65);
|
| | | //g2d.setColor(new Color(255, 250, 250));
|
| | | g2d.drawImage(tips, 312,1180, null);
|
| | |
|
| | |
|
| | | g2d.dispose();
|
| | |
|