Merge branch 'master' of http://118.31.7.2:3000/tianzeOrg/tz_digital_credit
commit
0ad24a5d93
@ -1,71 +1,71 @@
|
|||||||
package com.sztzjy.digital_credit.util;
|
//package com.sztzjy.digital_credit.util;
|
||||||
|
//
|
||||||
import cn.hutool.core.util.IdUtil;
|
//import cn.hutool.core.util.IdUtil;
|
||||||
|
//
|
||||||
import com.sztzjy.digital_credit.util.file.LocalFileUtil;
|
//import com.sztzjy.digital_credit.util.file.LocalFileUtil;
|
||||||
import com.sztzjy.digital_credit.util.seal.SealCircle;
|
//import com.sztzjy.digital_credit.util.seal.SealCircle;
|
||||||
import com.sztzjy.digital_credit.util.seal.SealFont;
|
//import com.sztzjy.digital_credit.util.seal.SealFont;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
//import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
//import org.springframework.stereotype.Component;
|
||||||
|
//
|
||||||
import javax.annotation.Resource;
|
//import javax.annotation.Resource;
|
||||||
import java.io.File;
|
//import java.io.File;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* @author 17803
|
// * @author 17803
|
||||||
* @date 2023-12-05 15:11
|
// * @date 2023-12-05 15:11
|
||||||
*/
|
// */
|
||||||
|
//
|
||||||
@Component
|
//@Component
|
||||||
public class SealUtil {
|
//public class SealUtil {
|
||||||
|
//
|
||||||
@Resource
|
// @Resource
|
||||||
LocalFileUtil localFileUtil;
|
// LocalFileUtil localFileUtil;
|
||||||
|
//
|
||||||
@Value("${file.path}")
|
// @Value("${file.path}")
|
||||||
private String filePath;
|
// private String filePath;
|
||||||
|
//
|
||||||
public String genertSealB(String name) throws Exception{
|
// public String genertSealB(String name) throws Exception{
|
||||||
String file = filePath+"/seal/";
|
// String file = filePath+"/seal/";
|
||||||
// 创建 File 对象
|
// // 创建 File 对象
|
||||||
File infoFile = new File(file);
|
// File infoFile = new File(file);
|
||||||
if (!infoFile.exists()) {
|
// if (!infoFile.exists()) {
|
||||||
infoFile.mkdir();
|
// infoFile.mkdir();
|
||||||
}
|
// }
|
||||||
String s = IdUtil.fastSimpleUUID();
|
// String s = IdUtil.fastSimpleUUID();
|
||||||
com.sztzjy.digital_credit.util.seal.SealUtil.builder()
|
// com.sztzjy.digital_credit.util.seal.SealUtil.builder()
|
||||||
.size(200)
|
// .size(200)
|
||||||
.borderCircle(SealCircle.builder().line(4).width(95).height(95).build())
|
// .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())
|
// .centerFont(SealFont.builder().text("★").size(60).build())
|
||||||
.titleFont(SealFont.builder().text("电子签章").size(16).space(8.0).margin(54).build())
|
// .titleFont(SealFont.builder().text("电子签章").size(16).space(8.0).margin(54).build())
|
||||||
.build()
|
// .build()
|
||||||
.draw(filePath+"/seal/"+ s +".png");
|
// .draw(filePath+"/seal/"+ s +".png");
|
||||||
System.out.println(name+"公章已生成");
|
// System.out.println(name+"公章已生成");
|
||||||
return s;
|
// return s;
|
||||||
}
|
// }
|
||||||
public String genertSealA(String name) throws Exception{
|
// public String genertSealA(String name) throws Exception{
|
||||||
String file = "D:/home/"+"seal/";
|
// String file = "D:/home/"+"seal/";
|
||||||
//String file = filePath+"/seal/";
|
// //String file = filePath+"/seal/";
|
||||||
|
//
|
||||||
// 创建 File 对象
|
// // 创建 File 对象
|
||||||
File infoFile = new File(file);
|
// File infoFile = new File(file);
|
||||||
if (!infoFile.exists()) {
|
// if (!infoFile.exists()) {
|
||||||
infoFile.mkdir();
|
// infoFile.mkdir();
|
||||||
}
|
// }
|
||||||
String s = IdUtil.fastSimpleUUID();
|
// String s = IdUtil.fastSimpleUUID();
|
||||||
com.sztzjy.digital_credit.util.seal.SealUtil.builder()
|
// com.sztzjy.digital_credit.util.seal.SealUtil.builder()
|
||||||
.size(200)
|
// .size(200)
|
||||||
.borderCircle(SealCircle.builder().line(4).width(95).height(95).build())
|
// .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())
|
// .centerFont(SealFont.builder().text("★").size(60).build())
|
||||||
.titleFont(SealFont.builder().text("电子签章").size(16).space(8.0).margin(54).build())
|
// .titleFont(SealFont.builder().text("电子签章").size(16).space(8.0).margin(54).build())
|
||||||
.build()
|
// .build()
|
||||||
.draw(filePath+"/seal/"+ s +".png");
|
// .draw(filePath+"/seal/"+ s +".png");
|
||||||
System.out.println(name+"公章已生成");
|
// System.out.println(name+"公章已生成");
|
||||||
return s;
|
// return s;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package com.sztzjy.digital_credit.util.seal;
|
//package com.sztzjy.digital_credit.util.seal;
|
||||||
|
//
|
||||||
|
//
|
||||||
import lombok.Builder;
|
//import lombok.Builder;
|
||||||
import lombok.Getter;
|
//import lombok.Getter;
|
||||||
@Getter
|
//@Getter
|
||||||
@Builder
|
//@Builder
|
||||||
public class SealCircle {
|
//public class SealCircle {
|
||||||
private Integer line;
|
// private Integer line;
|
||||||
private Integer width;
|
// private Integer width;
|
||||||
private Integer height;
|
// private Integer height;
|
||||||
}
|
//}
|
||||||
|
@ -1,37 +1,37 @@
|
|||||||
package com.sztzjy.digital_credit.util.seal;/**
|
//package com.sztzjy.digital_credit.util.seal;/**
|
||||||
* @author 17803
|
// * @author 17803
|
||||||
* @date 2023-12-05 15:01
|
// * @date 2023-12-05 15:01
|
||||||
*/
|
// */
|
||||||
|
//
|
||||||
import lombok.Builder;
|
//import lombok.Builder;
|
||||||
import lombok.Getter;
|
//import lombok.Getter;
|
||||||
|
//
|
||||||
@Getter
|
//@Getter
|
||||||
@Builder
|
//@Builder
|
||||||
public class SealFont {
|
//public class SealFont {
|
||||||
|
//
|
||||||
private String text;
|
// private String text;
|
||||||
|
//
|
||||||
private String family;
|
// private String family;
|
||||||
|
//
|
||||||
private Integer size;
|
// private Integer size;
|
||||||
|
//
|
||||||
private Boolean bold;
|
// private Boolean bold;
|
||||||
|
//
|
||||||
private Double space;
|
// private Double space;
|
||||||
|
//
|
||||||
private Integer margin;
|
// private Integer margin;
|
||||||
|
//
|
||||||
public String getFamily() {
|
// public String getFamily() {
|
||||||
return family == null ? "宋体" : family;
|
// return family == null ? "宋体" : family;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public boolean getBold() {
|
// public boolean getBold() {
|
||||||
return bold == null ? true : bold;
|
// return bold == null ? true : bold;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public SealFont append(String text) {
|
// public SealFont append(String text) {
|
||||||
this.text += text;
|
// this.text += text;
|
||||||
return this;
|
// return this;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue