|
@@ -804,7 +804,7 @@ public class EmergencyRepairController {
|
|
|
public void export(@Val @RequestBody RepairRequest request, HttpServletResponse response) {
|
|
|
log.info("headerAlias: {}", headerAlias);
|
|
|
List<RepairResponse> repairs = emergencyRepairService.listByIdList(request);
|
|
|
- Validate.notNull(repairs, "急修记录不存在,请核查");
|
|
|
+ Validate.notNull(repairs, ValuePool.EMERGENCY_NOT_EXIST);
|
|
|
|
|
|
fillLiftFaults(repairs);
|
|
|
|
|
@@ -815,10 +815,9 @@ public class EmergencyRepairController {
|
|
|
File zipFile = null;
|
|
|
try {
|
|
|
//获取根目录
|
|
|
- String export = ResourceUtils.getURL("classpath:export").getPath();
|
|
|
- String missing = export + File.separator + "missing.jpg";
|
|
|
- String base = "repair";
|
|
|
- String dir = StrUtil.join(File.separator, export, base, IdWorker.getIdStr());
|
|
|
+ String templates = ResourceUtils.getURL("classpath:templates").getPath();
|
|
|
+ String missing = templates + File.separator + "missing.jpg";
|
|
|
+ String dir = StrUtil.join(File.separator, System.getProperty("user.dir"), "repair", IdWorker.getIdStr());
|
|
|
String zip = dir + ".zip";
|
|
|
baseDir = new File(dir);
|
|
|
zipFile = new File(zip);
|
|
@@ -893,7 +892,7 @@ public class EmergencyRepairController {
|
|
|
//生成急修单
|
|
|
String doc = imgDir + "1.急修单.doc";
|
|
|
log.info("生成急修单: {}", doc);
|
|
|
- WordUtil.createWord(dataMap, ResourceUtils.getURL("classpath:templates").getPath(), "repair.doc.ftl", doc);
|
|
|
+ WordUtil.createWord(dataMap, templates, "repair.doc.ftl", doc);
|
|
|
}
|
|
|
|
|
|
//压缩文件夹
|