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;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
|
||||
import com.sztzjy.digital_credit.util.file.LocalFileUtil;
|
||||
import com.sztzjy.digital_credit.util.seal.SealCircle;
|
||||
import com.sztzjy.digital_credit.util.seal.SealFont;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @author 17803
|
||||
* @date 2023-12-05 15:11
|
||||
*/
|
||||
|
||||
@Component
|
||||
public class SealUtil {
|
||||
|
||||
@Resource
|
||||
LocalFileUtil localFileUtil;
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;
|
||||
|
||||
public String genertSealB(String name) throws Exception{
|
||||
String file = filePath+"/seal/";
|
||||
// 创建 File 对象
|
||||
File infoFile = new File(file);
|
||||
if (!infoFile.exists()) {
|
||||
infoFile.mkdir();
|
||||
}
|
||||
String s = IdUtil.fastSimpleUUID();
|
||||
com.sztzjy.digital_credit.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())
|
||||
.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;
|
||||
}
|
||||
public String genertSealA(String name) throws Exception{
|
||||
String file = "D:/home/"+"seal/";
|
||||
//String file = filePath+"/seal/";
|
||||
|
||||
// 创建 File 对象
|
||||
File infoFile = new File(file);
|
||||
if (!infoFile.exists()) {
|
||||
infoFile.mkdir();
|
||||
}
|
||||
String s = IdUtil.fastSimpleUUID();
|
||||
com.sztzjy.digital_credit.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())
|
||||
.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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
//package com.sztzjy.digital_credit.util;
|
||||
//
|
||||
//import cn.hutool.core.util.IdUtil;
|
||||
//
|
||||
//import com.sztzjy.digital_credit.util.file.LocalFileUtil;
|
||||
//import com.sztzjy.digital_credit.util.seal.SealCircle;
|
||||
//import com.sztzjy.digital_credit.util.seal.SealFont;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//import javax.annotation.Resource;
|
||||
//import java.io.File;
|
||||
//
|
||||
///**
|
||||
// * @author 17803
|
||||
// * @date 2023-12-05 15:11
|
||||
// */
|
||||
//
|
||||
//@Component
|
||||
//public class SealUtil {
|
||||
//
|
||||
// @Resource
|
||||
// LocalFileUtil localFileUtil;
|
||||
//
|
||||
// @Value("${file.path}")
|
||||
// private String filePath;
|
||||
//
|
||||
// public String genertSealB(String name) throws Exception{
|
||||
// String file = filePath+"/seal/";
|
||||
// // 创建 File 对象
|
||||
// File infoFile = new File(file);
|
||||
// if (!infoFile.exists()) {
|
||||
// infoFile.mkdir();
|
||||
// }
|
||||
// String s = IdUtil.fastSimpleUUID();
|
||||
// com.sztzjy.digital_credit.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())
|
||||
// .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;
|
||||
// }
|
||||
// public String genertSealA(String name) throws Exception{
|
||||
// String file = "D:/home/"+"seal/";
|
||||
// //String file = filePath+"/seal/";
|
||||
//
|
||||
// // 创建 File 对象
|
||||
// File infoFile = new File(file);
|
||||
// if (!infoFile.exists()) {
|
||||
// infoFile.mkdir();
|
||||
// }
|
||||
// String s = IdUtil.fastSimpleUUID();
|
||||
// com.sztzjy.digital_credit.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())
|
||||
// .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;
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//}
|
||||
|
@ -1,12 +1,12 @@
|
||||
package com.sztzjy.digital_credit.util.seal;
|
||||
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
@Getter
|
||||
@Builder
|
||||
public class SealCircle {
|
||||
private Integer line;
|
||||
private Integer width;
|
||||
private Integer height;
|
||||
}
|
||||
//package com.sztzjy.digital_credit.util.seal;
|
||||
//
|
||||
//
|
||||
//import lombok.Builder;
|
||||
//import lombok.Getter;
|
||||
//@Getter
|
||||
//@Builder
|
||||
//public class SealCircle {
|
||||
// private Integer line;
|
||||
// private Integer width;
|
||||
// private Integer height;
|
||||
//}
|
||||
|
@ -1,37 +1,37 @@
|
||||
package com.sztzjy.digital_credit.util.seal;/**
|
||||
* @author 17803
|
||||
* @date 2023-12-05 15:01
|
||||
*/
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class SealFont {
|
||||
|
||||
private String text;
|
||||
|
||||
private String family;
|
||||
|
||||
private Integer size;
|
||||
|
||||
private Boolean bold;
|
||||
|
||||
private Double space;
|
||||
|
||||
private Integer margin;
|
||||
|
||||
public String getFamily() {
|
||||
return family == null ? "宋体" : family;
|
||||
}
|
||||
|
||||
public boolean getBold() {
|
||||
return bold == null ? true : bold;
|
||||
}
|
||||
|
||||
public SealFont append(String text) {
|
||||
this.text += text;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
//package com.sztzjy.digital_credit.util.seal;/**
|
||||
// * @author 17803
|
||||
// * @date 2023-12-05 15:01
|
||||
// */
|
||||
//
|
||||
//import lombok.Builder;
|
||||
//import lombok.Getter;
|
||||
//
|
||||
//@Getter
|
||||
//@Builder
|
||||
//public class SealFont {
|
||||
//
|
||||
// private String text;
|
||||
//
|
||||
// private String family;
|
||||
//
|
||||
// private Integer size;
|
||||
//
|
||||
// private Boolean bold;
|
||||
//
|
||||
// private Double space;
|
||||
//
|
||||
// private Integer margin;
|
||||
//
|
||||
// public String getFamily() {
|
||||
// return family == null ? "宋体" : family;
|
||||
// }
|
||||
//
|
||||
// public boolean getBold() {
|
||||
// return bold == null ? true : bold;
|
||||
// }
|
||||
//
|
||||
// public SealFont append(String text) {
|
||||
// this.text += text;
|
||||
// return this;
|
||||
// }
|
||||
//}
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue