|
|
|
@ -1,13 +1,11 @@
|
|
|
|
|
package com.sztzjy.financial_bigdata.util;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import com.sztzjy.financial_bigdata.util.file.LocalFileUtil;
|
|
|
|
|
import com.sztzjy.financial_bigdata.util.seal.SealCircle;
|
|
|
|
|
import com.sztzjy.financial_bigdata.util.seal.SealFont;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.io.File;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -18,33 +16,32 @@ import java.io.File;
|
|
|
|
|
@Component
|
|
|
|
|
public class SealUtil {
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
LocalFileUtil localFileUtil;
|
|
|
|
|
|
|
|
|
|
@Value("${file.path}")
|
|
|
|
|
private String filePath;
|
|
|
|
|
|
|
|
|
|
public String genertSealB(String name) throws Exception{
|
|
|
|
|
String file = filePath+"/seal/";
|
|
|
|
|
public String genertSealB(String name) throws Exception {
|
|
|
|
|
String file = filePath + "/seal/";
|
|
|
|
|
// 创建 File 对象
|
|
|
|
|
File infoFile = new File(file);
|
|
|
|
|
if (!infoFile.exists()) {
|
|
|
|
|
infoFile.mkdir();
|
|
|
|
|
}
|
|
|
|
|
File infoFile = new File(file);
|
|
|
|
|
if (!infoFile.exists()) {
|
|
|
|
|
infoFile.mkdir();
|
|
|
|
|
}
|
|
|
|
|
String s = IdUtil.fastSimpleUUID();
|
|
|
|
|
com.sztzjy.financial_bigdata.util.seal.SealUtil.builder()
|
|
|
|
|
.size(200)
|
|
|
|
|
.borderCircle(SealCircle.builder().line(4).width(95).height(95).build())
|
|
|
|
|
.mainFont(SealFont.builder().text(name+"有限公司").size(22).space(30.0).margin(4).build())
|
|
|
|
|
.mainFont(SealFont.builder().text(name + "有限公司").size(22).space(30.0).margin(4).build())
|
|
|
|
|
.centerFont(SealFont.builder().text("★").size(60).build())
|
|
|
|
|
.titleFont(SealFont.builder().text("电子签章").size(16).space(8.0).margin(54).build())
|
|
|
|
|
.build()
|
|
|
|
|
.draw(filePath+"/seal/"+ s +".png");
|
|
|
|
|
System.out.println(name+"公章已生成");
|
|
|
|
|
return s;
|
|
|
|
|
.draw(filePath + "/seal/" + s + ".png");
|
|
|
|
|
System.out.println(name + "公章已生成");
|
|
|
|
|
return s;
|
|
|
|
|
}
|
|
|
|
|
public String genertSealA(String name) throws Exception{
|
|
|
|
|
String file = filePath+"/seal/";
|
|
|
|
|
|
|
|
|
|
public String genertSealA(String name) throws Exception {
|
|
|
|
|
String file = filePath + "/seal/";
|
|
|
|
|
// 创建 File 对象
|
|
|
|
|
File infoFile = new File(file);
|
|
|
|
|
if (!infoFile.exists()) {
|
|
|
|
@ -58,8 +55,8 @@ public class SealUtil {
|
|
|
|
|
.centerFont(SealFont.builder().text("★").size(60).build())
|
|
|
|
|
.titleFont(SealFont.builder().text("电子签章").size(16).space(8.0).margin(54).build())
|
|
|
|
|
.build()
|
|
|
|
|
.draw(filePath+"/seal/"+ s +".png");
|
|
|
|
|
System.out.println(name+"公章已生成");
|
|
|
|
|
.draw(filePath + "/seal/" + s + ".png");
|
|
|
|
|
System.out.println(name + "公章已生成");
|
|
|
|
|
return s;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|