|
@@ -31,8 +31,8 @@ import java.nio.file.Paths;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
-import java.util.List;
|
|
|
import java.util.*;
|
|
|
+import java.util.List;
|
|
|
import java.util.concurrent.CountDownLatch;
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.Executors;
|
|
@@ -364,7 +364,7 @@ public class TTsNewController extends BaseController {
|
|
|
String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss"));
|
|
|
String fileName = time + tTsNew.getNewId() + ".docx";
|
|
|
String wordPath = this.createWord(templatePath, fileDir, fileName, params, "appraisalFormWord");
|
|
|
- wordPath = this.createWord(wordPath, fileDir, fileName, genSign(appraisalFormWordData.get("signs")), "appraisalFormWord",true);
|
|
|
+ wordPath = this.createWord(wordPath, fileDir, fileName, genSign(appraisalFormWordData.get("signs")), "appraisalFormWord", true);
|
|
|
return wordPath;
|
|
|
}
|
|
|
|
|
@@ -483,18 +483,18 @@ public class TTsNewController extends BaseController {
|
|
|
private Map<String, Object> genSign(Map<String, Object> map) {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
for (String s : map.keySet()) {
|
|
|
- if (s.equals("traineeSignature")){
|
|
|
+ if (s.equals("traineeSignature")) {
|
|
|
params.put(s, map.get(s));
|
|
|
}
|
|
|
if (Objects.nonNull(map.get(s))) {
|
|
|
SysUser sysUser = new SysUser();
|
|
|
- sysUser.setNickName(map.get(s).toString().replaceAll(" ",""));
|
|
|
+ sysUser.setNickName(map.get(s).toString().replaceAll(" ", ""));
|
|
|
sysUser.setDeptId(103L);
|
|
|
List<SysUser> sysUsers = sysUserService.selectUserList(sysUser);
|
|
|
if (CollectionUtils.isNotEmpty(sysUsers)) {
|
|
|
if (sysUsers.get(0).getSignUrl() != null) {
|
|
|
- s = s.replace("{{@","");
|
|
|
- s = s.replace("}}","");
|
|
|
+ s = s.replace("{{@", "");
|
|
|
+ s = s.replace("}}", "");
|
|
|
params.put(s, Pictures.ofLocal(fileName(sysUsers.get(0).getSignUrl())).size(100, 40).create());
|
|
|
}
|
|
|
}
|
|
@@ -528,17 +528,17 @@ public class TTsNewController extends BaseController {
|
|
|
trainDate = formatter.format(firstplan.getCourseDate());
|
|
|
}
|
|
|
String tn = "";
|
|
|
- String trainerSign="";
|
|
|
- String traineeSign="";
|
|
|
+ String trainerSign = "";
|
|
|
+ String traineeSign = "";
|
|
|
if (StringUtils.isNotEmpty(firstplan.getTrainerConfirm())) {
|
|
|
- if (StringUtils.isNotEmpty(firstplan.getTrainer())){
|
|
|
- tn = firstplan.getTrainer().replaceAll(" ","");
|
|
|
+ if (StringUtils.isNotEmpty(firstplan.getTrainer())) {
|
|
|
+ tn = firstplan.getTrainer().replaceAll(" ", "");
|
|
|
trainerSign = "{{@trainSign" + tn + "}}";
|
|
|
signMap.put(trainerSign, tn);
|
|
|
}
|
|
|
}
|
|
|
- if(StringUtils.isNotEmpty(firstplan.getStudentConfirm())){
|
|
|
- traineeSign="{{@traineeSignature}}";
|
|
|
+ if (StringUtils.isNotEmpty(firstplan.getStudentConfirm())) {
|
|
|
+ traineeSign = "{{@traineeSignature}}";
|
|
|
}
|
|
|
plantList[i] = Rows.create(String.valueOf(i), planDate, firstplan.getTopic(), firstplan.getMaterialVer(), String.valueOf(firstplan.getCourseHour())
|
|
|
, firstplan.getTrainer(), trainDate, trainerSign, firstplan.getExamType(), firstplan.getAssess(), traineeSign);
|
|
@@ -558,7 +558,7 @@ public class TTsNewController extends BaseController {
|
|
|
List<TTsApprove> tTsApproves = tsApproveService.selectTTsApproveByNewId(tTsNew.getNewId());
|
|
|
if (CollectionUtils.isNotEmpty(tTsApproves)) {
|
|
|
for (TTsApprove tTsApprove : tTsApproves) {
|
|
|
- if(tTsApprove.getApprover()!=null) {
|
|
|
+ if (tTsApprove.getApprover() != null) {
|
|
|
SysUser manager = sysUserService.selectUserById(Long.valueOf(tTsApprove.getApprover()));
|
|
|
if (StringUtils.isNotEmpty(manager.getSignUrl())) {
|
|
|
params.put("mgrSign", Pictures.ofLocal(fileName(manager.getSignUrl())).size(100, 40).create());
|
|
@@ -567,12 +567,12 @@ public class TTsNewController extends BaseController {
|
|
|
params.put("traineeTime", DateUtils.dateTime(tTsApprove.getCreatedate()));
|
|
|
}
|
|
|
if (tTsNew.getPlanStatus() == 3) {// 模板路径
|
|
|
- String imgPath = "/static/word/training/commentImg/end2.png";
|
|
|
- params.put("mentorComments", Pictures.ofLocal(Objects.requireNonNull(getClass().getResource(imgPath)).getPath()).size(500, 80).create());
|
|
|
+ String imgPath = "static/word/training/commentImg/end2.png";
|
|
|
+ params.put("mentorComments", Pictures.ofStream(getClass().getClassLoader().getResourceAsStream(imgPath)).size(500, 80).create());
|
|
|
}
|
|
|
if (tTsNew.getPlanStatus() == 1) {// 模板路径
|
|
|
- String imgPath = "/static/word/training/commentImg/end1.png";
|
|
|
- params.put("mentorComments", Pictures.ofLocal(Objects.requireNonNull(getClass().getResource(imgPath)).getPath()).size(500, 80).create());
|
|
|
+ String imgPath = "static/word/training/commentImg/end1.png";
|
|
|
+ params.put("mentorComments", Pictures.ofStream(getClass().getClassLoader().getResourceAsStream(imgPath)).size(500, 80).create());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -792,11 +792,12 @@ public class TTsNewController extends BaseController {
|
|
|
logger.info("目录{}!", filePath);
|
|
|
logger.info("模板{}!", templatePath);
|
|
|
// 读取模板渲染参数
|
|
|
- InputStream is = getClass().getClassLoader().getResourceAsStream(templatePath);;
|
|
|
- if (flag.length>0&&flag[0]) {
|
|
|
+ InputStream is = getClass().getClassLoader().getResourceAsStream(templatePath);
|
|
|
+ ;
|
|
|
+ if (flag.length > 0 && flag[0]) {
|
|
|
logger.info("待签名文件地址:{}!", filePath);
|
|
|
is = new FileInputStream(filePath);
|
|
|
- fileName = fileName.replace(".docx","_sign.docx");
|
|
|
+ fileName = fileName.replace(".docx", "_sign.docx");
|
|
|
filePath = fileDir + "/" + fileName;
|
|
|
}
|
|
|
|