优化小票打印模板,调整参数
This commit is contained in:
@@ -147,8 +147,8 @@ public class TemplateUtils {
|
||||
String[] split = key.split("_");
|
||||
if (split.length > 1 && split[1].equals("2base64Type")) {
|
||||
int type = split.length > 2 ? Integer.parseInt(split[2]) : 1;
|
||||
int width = split.length > 2 ? Integer.parseInt(split[3]) : 100;
|
||||
int height = split.length > 3 ? Integer.parseInt(split[4]) : 100;
|
||||
int width = split.length > 2 ? (Integer.parseInt(split[3]) + 50) : 150;// 台式的二维码宽高需要比壁挂的多加50
|
||||
int height = split.length > 3 ? (Integer.parseInt(split[4]) + 50) : 150;// 台式的二维码宽高需要比壁挂的多加50
|
||||
// 如果是图片类型,需要进行base64转换
|
||||
String base64 = this.generateQRCode(type, String.valueOf(data.get(key)), width, height);
|
||||
context.setVariable(split[0], "data:image/jpeg;base64," + base64);
|
||||
|
||||
Reference in New Issue
Block a user