feat:重新生成发票位置
This commit is contained in:
1 parent
640a075742
commit
19e7b42c4f
1 file changed
+8
-4
+8
-4
@@ -86,9 +86,13 @@ import java.util.Map;
|
||||
public class WalletRechargeInvoiceServiceImpl extends ServiceImpl<WalletRechargeInvoiceMapper, WalletRechargeInvoiceEntity> implements WalletRechargeInvoiceService {
|
||||
|
||||
static private final String TAG = "充值/扣款发票";
|
||||
private static final double INVOICE_STAMP_WIDTH_RATIO = 500D / (661.5D * 3D);
|
||||
private static final double INVOICE_STAMP_X_RATIO = (500D + 661.5D * 3D * 0.15D + 80D) / (661.5D * 3D);
|
||||
private static final double INVOICE_STAMP_BOTTOM_MARGIN_RATIO = 50D / (359.1D * 3D);
|
||||
private static final double CSS_PX_PER_CM = 96D / 2.54D;
|
||||
private static final double INVOICE_WIDTH_CSS_PX = 17.5D * CSS_PX_PER_CM;
|
||||
private static final double INVOICE_HEIGHT_CSS_PX = 9.5D * CSS_PX_PER_CM;
|
||||
private static final double INVOICE_TABLE_WIDTH_CSS_PX = 15D * CSS_PX_PER_CM;
|
||||
private static final double INVOICE_STAMP_WIDTH_RATIO = 2.5D * 0.8D / 17.5D;
|
||||
private static final double INVOICE_STAMP_X_RATIO = ((INVOICE_WIDTH_CSS_PX - INVOICE_TABLE_WIDTH_CSS_PX) / 2D + 140D) / INVOICE_WIDTH_CSS_PX;
|
||||
private static final double INVOICE_STAMP_Y_RATIO = (24D + 36D + 24D + 4D + 4.5D * CSS_PX_PER_CM - 8D) / INVOICE_HEIGHT_CSS_PX;
|
||||
|
||||
private final FlowUtil flowUtil;
|
||||
|
||||
@@ -478,7 +482,7 @@ public class WalletRechargeInvoiceServiceImpl extends ServiceImpl<WalletRecharge
|
||||
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
|
||||
g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
|
||||
int x = (int) Math.round(baseMapWidth * INVOICE_STAMP_X_RATIO);
|
||||
int y = baseMapHeight - stampHeight - (int) Math.round(baseMapHeight * INVOICE_STAMP_BOTTOM_MARGIN_RATIO);
|
||||
int y = (int) Math.round(baseMapHeight * INVOICE_STAMP_Y_RATIO);
|
||||
x = clamp(x, 0, baseMapWidth - stampWidth);
|
||||
y = clamp(y, 0, baseMapHeight - stampHeight);
|
||||
g2d.drawImage(scaledStamp, x, y, null);
|
||||
|
||||
Reference in new issue
Block a user