|
@@ -36,7 +36,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.jms.core.JmsMessagingTemplate;
|
|
|
-import org.springframework.util.ResourceUtils;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -814,11 +813,13 @@ public class EmergencyRepairController {
|
|
|
File zipFile = null;
|
|
|
try {
|
|
|
//获取根目录
|
|
|
- String root = System.getProperty("user.dir") + File.separator + "repair";
|
|
|
- String templates = ResourceUtils.getURL("classpath:templates").getPath();
|
|
|
- String missing = templates + File.separator + "missing.jpg";
|
|
|
+ String root = ValuePool.SYSTEM_USER_DIR + File.separator + "repair";
|
|
|
+ String missing = root + File.separator + "missing.jpg";
|
|
|
+
|
|
|
+// String templates = ResourceUtils.getURL("classpath:templates").getPath();
|
|
|
+// String missing = templates + File.separator + "missing.jpg";
|
|
|
String generateCode = DateUtils.generateCode();
|
|
|
- String dir = StrUtil.join(File.separator, System.getProperty("user.dir"), "repair", generateCode);
|
|
|
+ String dir = root + File.separator + generateCode;
|
|
|
String zip = dir + ".zip";
|
|
|
baseDir = new File(dir);
|
|
|
zipFile = new File(zip);
|
|
@@ -893,7 +894,7 @@ public class EmergencyRepairController {
|
|
|
//生成急修单
|
|
|
String doc = imgDir + "1.急修单.doc";
|
|
|
log.info("生成急修单: {}", doc);
|
|
|
- WordUtil.createWord(dataMap, templates, "repair.doc.ftl", doc);
|
|
|
+ WordUtil.createWord(dataMap, root, "repair.doc.ftl", doc);
|
|
|
}
|
|
|
|
|
|
//压缩文件夹
|