update
This commit is contained in:
@@ -51,14 +51,14 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String generateExperimentDoc(String experimentId, String fileName, String version) {
|
public String generateExperimentDoc(String experimentId, String fileName, String version) {
|
||||||
String absolutePath = templatePath + File.separator + version + File.separator + docTempalteMap.get(fileName);
|
String absolutePath = templatePath + File.separator + docTempalteMap.get(fileName);
|
||||||
log.info("doc template path: " + absolutePath);
|
log.info("doc template path: " + absolutePath);
|
||||||
if (!FileUtil.exist(absolutePath)) {
|
if (!FileUtil.exist(absolutePath)) {
|
||||||
throw new RuntimeException("模板文件不存在!");
|
throw new RuntimeException("模板文件不存在!");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
String tmpDirPath = FileUtil.getTmpDirPath();
|
String tmpDirPath = FileUtil.getTmpDirPath();
|
||||||
String outputFile = tmpDirPath + fileName + "-" + experimentId + ".docx";
|
String outputFile = tmpDirPath + fileName + "-" + experimentId + "-" + version + ".docx";
|
||||||
if (FileUtil.exist(outputFile)) {
|
if (FileUtil.exist(outputFile)) {
|
||||||
FileUtil.del(outputFile);
|
FileUtil.del(outputFile);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user