|
@@ -3,9 +3,17 @@ package com.caimei365.manager.service.caimei.providers.utils;
|
|
|
import com.caimei365.manager.config.utils.DateUtil;
|
|
|
import com.caimei365.manager.utils.ImageUtils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.core.env.Environment;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import javax.annotation.PostConstruct;
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.imageio.ImageIO;
|
|
|
import java.awt.*;
|
|
|
import java.awt.image.BufferedImage;
|
|
|
+import java.io.File;
|
|
|
+import java.io.IOException;
|
|
|
+import java.net.URL;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
@@ -14,10 +22,29 @@ import java.util.*;
|
|
|
* @description:Template
|
|
|
*/
|
|
|
@Slf4j
|
|
|
+@Component
|
|
|
public class ProvidersTemplate {
|
|
|
|
|
|
+ @Resource
|
|
|
+ private Environment environment;
|
|
|
+ private static String config;
|
|
|
+ private static String logoPath = "/mnt/newdatadrive/data/runtime/jar-instance/manager-api/logo/";
|
|
|
|
|
|
- public static String setQualificationImage(BufferedImage image, String name, String level, Date startDate, Date endDate, String providersId, BufferedImage realQrCodeImage) {
|
|
|
+ @PostConstruct
|
|
|
+ public void setValue() {
|
|
|
+ config = environment.getProperty("cm.config");
|
|
|
+ if ("dev".equals(config)) {
|
|
|
+ logoPath = "D:/";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static String setQualificationImage(String name, String level, Date startDate, Date endDate, String providersId, BufferedImage realQrCodeImage) {
|
|
|
+ BufferedImage image = null;
|
|
|
+ try {
|
|
|
+ image = ImageIO.read(new File(logoPath+"服务商授权书.jpg"));
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
ArrayList list = new ArrayList();
|
|
|
if (null != name) {
|
|
|
//合成文本Map
|