|
@@ -38,10 +38,13 @@ public class ProvidersTemplate {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static String setQualificationImage(String name, String level, Date startDate, Date endDate, String providersId, BufferedImage realQrCodeImage) {
|
|
|
+ public static String setQualificationImage(Integer levelNum, String name, String level,
|
|
|
+ Date startDate, Date endDate, String providersId, BufferedImage realQrCodeImage) {
|
|
|
BufferedImage image = null;
|
|
|
try {
|
|
|
- image = ImageIO.read(new File(logoPath+"服务商授权书.jpg"));
|
|
|
+ String imageName = 4 == levelNum ? "授权书2.jpg" : "服务商授权书.jpg";
|
|
|
+ imageName = logoPath + imageName;
|
|
|
+ image = ImageIO.read(new File(imageName));
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -53,7 +56,7 @@ public class ProvidersTemplate {
|
|
|
textMap.put("text", name);
|
|
|
textMap.put("font", new Font("黑体", Font.BOLD, 32));
|
|
|
textMap.put("align", "center");
|
|
|
- textMap.put("x", image.getWidth()/2);
|
|
|
+ textMap.put("x", image.getWidth() / 2);
|
|
|
textMap.put("y", 585);
|
|
|
list.add(textMap);
|
|
|
}
|
|
@@ -63,28 +66,47 @@ public class ProvidersTemplate {
|
|
|
levelMap.put("type", 2);
|
|
|
levelMap.put("text", level);
|
|
|
levelMap.put("font", new Font("方正粗黑宋简体", Font.BOLD, 40));
|
|
|
- levelMap.put("x", 943);
|
|
|
- levelMap.put("y", 672);
|
|
|
+ if (4 == levelNum) {
|
|
|
+ levelMap.put("x", 729);
|
|
|
+ levelMap.put("y", 722);
|
|
|
+ } else {
|
|
|
+ levelMap.put("x", 943);
|
|
|
+ levelMap.put("y", 672);
|
|
|
+ }
|
|
|
list.add(levelMap);
|
|
|
}
|
|
|
if (null != startDate) {
|
|
|
//合成文本Map
|
|
|
HashMap<String, Object> startDateMap = new HashMap<>();
|
|
|
startDateMap.put("type", 2);
|
|
|
- startDateMap.put("text", DateUtil.setDate(startDate, "yyyy MM dd"));
|
|
|
- startDateMap.put("font", new Font("思源黑体", Font.PLAIN, 38));
|
|
|
- startDateMap.put("x", 730);
|
|
|
- startDateMap.put("y", 835);
|
|
|
+ if (4 == levelNum) {
|
|
|
+ startDateMap.put("font", new Font("思源黑体", Font.PLAIN, 36));
|
|
|
+ startDateMap.put("text", DateUtil.setDate(startDate, "yyyy MM dd"));
|
|
|
+ startDateMap.put("x", 725);
|
|
|
+ startDateMap.put("y", 875);
|
|
|
+ } else {
|
|
|
+ startDateMap.put("font", new Font("思源黑体", Font.PLAIN, 38));
|
|
|
+ startDateMap.put("text", DateUtil.setDate(startDate, "yyyy MM dd"));
|
|
|
+ startDateMap.put("x", 730);
|
|
|
+ startDateMap.put("y", 835);
|
|
|
+ }
|
|
|
list.add(startDateMap);
|
|
|
}
|
|
|
if (null != endDate) {
|
|
|
//合成文本Map
|
|
|
HashMap<String, Object> endDateMap = new HashMap<>();
|
|
|
endDateMap.put("type", 2);
|
|
|
- endDateMap.put("text", DateUtil.setDate(endDate, "yyyy MM dd"));
|
|
|
- endDateMap.put("font", new Font("思源黑体", Font.PLAIN, 38));
|
|
|
- endDateMap.put("x", 1060);
|
|
|
- endDateMap.put("y", 835);
|
|
|
+ if (4 == levelNum) {
|
|
|
+ endDateMap.put("font", new Font("思源黑体", Font.PLAIN, 36));
|
|
|
+ endDateMap.put("text", DateUtil.setDate(endDate, "yyyy MM dd"));
|
|
|
+ endDateMap.put("x", 1055);
|
|
|
+ endDateMap.put("y", 875);
|
|
|
+ } else {
|
|
|
+ endDateMap.put("font", new Font("思源黑体", Font.PLAIN, 38));
|
|
|
+ endDateMap.put("text", DateUtil.setDate(endDate, "yyyy MM dd"));
|
|
|
+ endDateMap.put("x", 1060);
|
|
|
+ endDateMap.put("y", 835);
|
|
|
+ }
|
|
|
list.add(endDateMap);
|
|
|
}
|
|
|
if (null != providersId) {
|
|
@@ -106,7 +128,7 @@ public class ProvidersTemplate {
|
|
|
imageFileMap.put("y", 990);
|
|
|
list.add(imageFileMap);
|
|
|
}
|
|
|
- return ImageUtils.imageTemplate(ImageUtils.zoomInImage(image, 1920, 1315),list);
|
|
|
+ return ImageUtils.imageTemplate(ImageUtils.zoomInImage(image, 1920, 1315), list);
|
|
|
}
|
|
|
|
|
|
}
|