|
@@ -270,7 +270,6 @@ public class TPssrApproveController extends BaseController {
|
|
|
@Autowired
|
|
|
private TPssrPumpOverhaulController pumpOverhaulController;
|
|
|
|
|
|
-
|
|
|
@Autowired
|
|
|
private TPssrMocController mocController;
|
|
|
|
|
@@ -283,6 +282,9 @@ public class TPssrApproveController extends BaseController {
|
|
|
@Autowired
|
|
|
private TPssrNitrogenController nitrogenController;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TPssrPatrolController patrolController;
|
|
|
+
|
|
|
@Autowired
|
|
|
private TPssrPowerController powerController;
|
|
|
|
|
@@ -689,7 +691,7 @@ public class TPssrApproveController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@PutMapping("/handleMgrApprove")
|
|
|
- public AjaxResult handleMgrApprove(@RequestBody DevTask devTask) {
|
|
|
+ public AjaxResult handleMgrApprove(@RequestBody DevTask devTask) throws IOException {
|
|
|
TPssrApprove approve = devTask.gettPssrApprove();
|
|
|
//使用任务服务完成任务(提交任务)
|
|
|
String taskId = devTask.getTaskId();
|
|
@@ -719,7 +721,7 @@ public class TPssrApproveController extends BaseController {
|
|
|
if (condition.equals("0")) {
|
|
|
aboveall.setApproveStatus(2L);
|
|
|
aboveall.setConfirmationDate(new Date());
|
|
|
- // todo:装置经理审批通过,流程结束,审批状态为“2-已审批”,生成各子项文件,保存到服务器,打压缩包
|
|
|
+ this.genZip(aboveall);//生成子项文件压缩包
|
|
|
}
|
|
|
}
|
|
|
tPssrAboveallService.updateTPssrAboveall(aboveall);
|
|
@@ -735,365 +737,481 @@ public class TPssrApproveController extends BaseController {
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/downloadAboveall")
|
|
|
- public AjaxResult downloadAboveall(TPssrAboveall aboveall) {
|
|
|
+ /**
|
|
|
+ * 生成子项文件压缩包
|
|
|
+ */
|
|
|
+ @GetMapping("/genZip")
|
|
|
+ public void genZip(TPssrAboveall aboveall) throws IOException {
|
|
|
Long id = aboveall.getId();//主表id
|
|
|
- List<File> files = new ArrayList<>();//文件名集合
|
|
|
+ AjaxResult result = null;
|
|
|
+ String msg = "";//导出方法文件名
|
|
|
+ String downloadPath = getProfile() + "/download/";//导出方法默认目录
|
|
|
+ String path = "";//导出方法默认文件路径=msg+downloadPath
|
|
|
+ String rootPath = getProfile() + "/download/pssr/" + id + "/";//即将被打包的根目录
|
|
|
+ String subTitle = "";//子表目录字符串
|
|
|
+ List<File> files = new ArrayList<>();//文件路径集合
|
|
|
TPssrSubcontent queryParams = new TPssrSubcontent();
|
|
|
queryParams.setAboveallId(id);
|
|
|
List<TPssrSubcontent> tPssrSubcontents = tPssrSubcontentService.selectTPssrSubcontentList(queryParams);//子表集合
|
|
|
- AjaxResult result = null;
|
|
|
- String msg = "";
|
|
|
- String path = "";
|
|
|
+ this.createSubitemDirectory(rootPath);//创建子表目录
|
|
|
for (TPssrSubcontent tPssrSubcontent : tPssrSubcontents) {
|
|
|
switch (tPssrSubcontent.getForShort()) {
|
|
|
case "jxxm"://检修项目
|
|
|
+ subTitle = "01检修项目/";
|
|
|
TPssrOverhaulFilter filter = new TPssrOverhaulFilter();//过滤器
|
|
|
filter.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = filterController.export(filter);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
|
|
|
TPssrOverhaulTower tower = new TPssrOverhaulTower();//塔罐
|
|
|
tower.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = towerController.export(tower);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
|
|
|
TPssrOverhaulValve valve = new TPssrOverhaulValve();//阀门
|
|
|
valve.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = valveController.export(valve);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
|
|
|
TPssrOverhaulExchanger exchanger = new TPssrOverhaulExchanger();//换热器
|
|
|
exchanger.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
exchanger.setDevType(1L);
|
|
|
result = exchangerController.export(exchanger);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
|
|
|
exchanger.setDevType(2L);
|
|
|
result = exchangerController.export(exchanger);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
|
|
|
exchanger.setDevType(3L);
|
|
|
result = exchangerController.export(exchanger);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
|
|
|
exchanger.setDevType(4L);
|
|
|
result = exchangerController.export(exchanger);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
|
|
|
exchanger.setDevType(5L);
|
|
|
result = exchangerController.export(exchanger);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "kgfa"://开工方案
|
|
|
+ subTitle = "02开工方案/";
|
|
|
TPssrProgramme programme = new TPssrProgramme();
|
|
|
programme.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = programmeController.export(programme);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
+ //todo:附件
|
|
|
break;
|
|
|
case "sjbg"://设计变更
|
|
|
+ subTitle = "03设计变更/";
|
|
|
TPssrMoc moc = new TPssrMoc();
|
|
|
moc.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = mocController.export(moc);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
+ path = downloadPath + msg;
|
|
|
files.add(new File(path));
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "mb"://盲板
|
|
|
+ subTitle = "04盲板/";
|
|
|
TPssrBlind blind = new TPssrBlind();
|
|
|
blind.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = blindController.export(blind);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "xcws"://现场卫生
|
|
|
+ subTitle = "05现场卫生/";
|
|
|
TPssrHygiene hygiene = new TPssrHygiene();
|
|
|
hygiene.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = hygieneController.export(hygiene);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "rsfh"://人身防护
|
|
|
+ subTitle = "06人身防护/";
|
|
|
TPssrProtection protection = new TPssrProtection();
|
|
|
protection.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = protectionController.export(protection);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
|
|
|
TPssrMeasure measure = new TPssrMeasure();
|
|
|
measure.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = measureController.export(measure);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "sbqjd"://设备清洁度
|
|
|
+ subTitle = "07设备清洁度/";
|
|
|
TPssrCleaning cleaning = new TPssrCleaning();
|
|
|
cleaning.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = cleaningController.export(cleaning);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "qm"://气密
|
|
|
+ subTitle = "08气密/";
|
|
|
TPssrAirtight airtight = new TPssrAirtight();
|
|
|
airtight.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = airtightController.export(airtight);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
- break;
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
+// break;
|
|
|
case "sksgfmzt"://锁开锁关阀门状态
|
|
|
+ subTitle = "09锁开锁关阀门状态/";
|
|
|
TPssrLock lock = new TPssrLock();
|
|
|
lock.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = lockController.export(lock);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "sys"://实验室
|
|
|
+ subTitle = "10实验室/";
|
|
|
TPssrLaboratory laboratory = new TPssrLaboratory();
|
|
|
laboratory.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = laboratoryController.export(laboratory);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "dj"://短接
|
|
|
+ subTitle = "11短接/";
|
|
|
TPssrCircuit circuit = new TPssrCircuit();
|
|
|
circuit.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = circuitController.export(circuit);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "dqzh"://氮气置换
|
|
|
+ subTitle = "12氮气置换/";
|
|
|
TPssrNitrogen nitrogen = new TPssrNitrogen();
|
|
|
nitrogen.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = nitrogenController.export(nitrogen);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "xqf"://消气防设施
|
|
|
-
|
|
|
+ //todo:巡检
|
|
|
break;
|
|
|
case "aqss"://安全设施
|
|
|
+ subTitle = "14安全设施/";
|
|
|
TPssrSafetyBleed bleed = new TPssrSafetyBleed();
|
|
|
bleed.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = bleedController.export(bleed);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
|
|
|
TPssrSafetyBreath breath = new TPssrSafetyBreath();
|
|
|
breath.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = breathController.export(breath);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
|
|
|
TPssrSafetyBrust brust = new TPssrSafetyBrust();
|
|
|
brust.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = brustController.export(brust);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
|
|
|
TPssrSafetyFlamearrester flamearrester = new TPssrSafetyFlamearrester();
|
|
|
flamearrester.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = flamearresterController.export(flamearrester);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
|
|
|
TPssrSafetyValve safetyValve = new TPssrSafetyValve();
|
|
|
safetyValve.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = safetyValveController.export(safetyValve);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "txjk"://通讯监控
|
|
|
-
|
|
|
+ //todo:巡检
|
|
|
break;
|
|
|
case "bxsjcy"://便携式检测仪
|
|
|
-
|
|
|
+ //todo:巡检
|
|
|
break;
|
|
|
case "gygc"://公用工程
|
|
|
+ subTitle = "17公用工程/";
|
|
|
TPssrPublic tPssrPublic = new TPssrPublic();
|
|
|
tPssrPublic.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = publicController.export(tPssrPublic);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "hbss"://环保设施
|
|
|
+ subTitle = "18环保设施/";
|
|
|
TPssrTorchvoc torchvoc = new TPssrTorchvoc();
|
|
|
torchvoc.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
torchvoc.setTorchvocType("1");
|
|
|
result = torchvocController.export(torchvoc);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
|
|
|
torchvoc.setTorchvocType("2");
|
|
|
result = torchvocController.export(torchvoc);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "yfl"://原辅料
|
|
|
+ subTitle = "19原辅料/";
|
|
|
TPssrMaterial material = new TPssrMaterial();
|
|
|
material.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = materialController.export(material);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "jb"://机泵
|
|
|
+ subTitle = "20机泵/";
|
|
|
TPssrPumpCleaning pumpCleaning = new TPssrPumpCleaning();
|
|
|
pumpCleaning.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = pumpCleaningController.export(pumpCleaning);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
|
|
|
TPssrPumpFill pumpFill = new TPssrPumpFill();
|
|
|
pumpFill.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = pumpFillController.export(pumpFill);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
|
|
|
TPssrPumpOverhaul pumpOverhaul = new TPssrPumpOverhaul();
|
|
|
pumpOverhaul.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = pumpOverhaulController.export(pumpOverhaul);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "zdj"://支(吊)架
|
|
|
+ subTitle = "21支(吊)架/";
|
|
|
TPssrFrame frame = new TPssrFrame();
|
|
|
frame.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = frameController.export(frame);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "tzsb"://压力管道/压力容器
|
|
|
+ subTitle = "22压力管道、压力容器/";
|
|
|
TPssrPipe pipe = new TPssrPipe();
|
|
|
pipe.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = pipeController.export(pipe);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
|
|
|
TPssrVessel vessel = new TPssrVessel();
|
|
|
vessel.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = vesselController.export(vessel);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "ybjy"://仪表校验
|
|
|
+ subTitle = "23仪表校验/";
|
|
|
TPssrInstrumentCalibration calibration = new TPssrInstrumentCalibration();
|
|
|
calibration.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = instrumentCalibrationController.export(calibration);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "yblscs"://仪表联锁测试
|
|
|
-
|
|
|
+ //todo:附件
|
|
|
break;
|
|
|
case "bjlszqr"://报警/联锁值确认
|
|
|
-
|
|
|
+ //todo:附件
|
|
|
break;
|
|
|
case "lsdy"://临时电源
|
|
|
+ subTitle = "26临时电源/";
|
|
|
TPssrPower power = new TPssrPower();
|
|
|
power.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = powerController.export(power);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "djsb"://电机设备
|
|
|
+ subTitle = "27电机设备/";
|
|
|
TPssrMotor motor = new TPssrMotor();
|
|
|
motor.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = motorController.export(motor);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "zmdbr"://照明、电伴热
|
|
|
+ subTitle = "28照明、电伴热/";
|
|
|
TPssrLighting lighting = new TPssrLighting();
|
|
|
lighting.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
lighting.setLightingType("1");
|
|
|
result = lightingController.export(lighting);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
|
|
|
lighting.setLightingType("2");
|
|
|
result = lightingController.export(lighting);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "jdjdkj"://静电接地/跨接
|
|
|
+ subTitle = "29静电接地、跨接/";
|
|
|
TPssrFranklinism franklinism = new TPssrFranklinism();
|
|
|
franklinism.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = franklinismController.export(franklinism);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "qtjcy"://气体检测仪
|
|
|
+ subTitle = "30气体检测仪/";
|
|
|
TPssrGasdetector gasdetector = new TPssrGasdetector();
|
|
|
gasdetector.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = gasdetectorController.export(gasdetector);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
case "zxfxy"://在线分析仪
|
|
|
+ subTitle = "31在线分析仪/";
|
|
|
TPssrAnalyzer analyzer = new TPssrAnalyzer();
|
|
|
analyzer.setSubId(tPssrSubcontent.getId());//子表id
|
|
|
result = analyzerController.export(analyzer);
|
|
|
msg = (String) result.get("msg");
|
|
|
- path = getProfile() + "/download/" + msg;
|
|
|
- files.add(new File(path));
|
|
|
+ path = downloadPath + msg;
|
|
|
+ Files.copy(Paths.get(path), Paths.get(rootPath + subTitle + msg), StandardCopyOption.REPLACE_EXISTING);//拷贝导出的文件
|
|
|
+ files.add(new File(rootPath + subTitle + msg));
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
try {
|
|
|
- ZipUtil.toZip(files, new File(getProfile() + "/download/"+ id + "pssr.zip"));//打包
|
|
|
+ ZipUtil.toZipWithDirectory(rootPath, downloadPath + id + "pssr.zip");//打包
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- return AjaxResult.success(id + "pssr.zip");//fileName
|
|
|
+ }
|
|
|
+
|
|
|
+ private void createSubitemDirectory(String rootPath) {
|
|
|
+ boolean mkdir1 = new File(rootPath + "01检修项目").mkdirs();//子项文件目录
|
|
|
+ boolean mkdir2 = new File(rootPath + "02开工方案").mkdirs();
|
|
|
+ boolean mkdir3 = new File(rootPath + "03设计变更").mkdirs();
|
|
|
+ boolean mkdir4 = new File(rootPath + "04盲板").mkdirs();
|
|
|
+ boolean mkdir5 = new File(rootPath + "05现场卫生").mkdirs();
|
|
|
+ boolean mkdir6 = new File(rootPath + "06人身防护").mkdirs();
|
|
|
+ boolean mkdir7 = new File(rootPath + "07设备清洁度").mkdirs();
|
|
|
+ boolean mkdir8 = new File(rootPath + "08气密").mkdirs();
|
|
|
+ boolean mkdir9 = new File(rootPath + "09锁开锁关阀门状态").mkdirs();
|
|
|
+ boolean mkdir10 = new File(rootPath + "10实验室").mkdirs();
|
|
|
+ boolean mkdir11 = new File(rootPath + "11短接").mkdirs();
|
|
|
+ boolean mkdir12 = new File(rootPath + "12氮气置换").mkdirs();
|
|
|
+ boolean mkdir13 = new File(rootPath + "13消气防设施").mkdirs();
|
|
|
+ boolean mkdir14 = new File(rootPath + "14安全设施").mkdirs();
|
|
|
+ boolean mkdir15 = new File(rootPath + "15通讯监控").mkdirs();
|
|
|
+ boolean mkdir16 = new File(rootPath + "16便携式检测仪").mkdirs();
|
|
|
+ boolean mkdir17 = new File(rootPath + "17公用工程").mkdirs();
|
|
|
+ boolean mkdir18 = new File(rootPath + "18环保设施").mkdirs();
|
|
|
+ boolean mkdir19 = new File(rootPath + "19原辅料").mkdirs();
|
|
|
+ boolean mkdir20 = new File(rootPath + "20机泵").mkdirs();
|
|
|
+ boolean mkdir21 = new File(rootPath + "21支(吊)架").mkdirs();
|
|
|
+ boolean mkdir22 = new File(rootPath + "22压力管道、压力容器").mkdirs();
|
|
|
+ boolean mkdir23 = new File(rootPath + "23仪表校验").mkdirs();
|
|
|
+ boolean mkdir24 = new File(rootPath + "24仪表联锁测试").mkdirs();
|
|
|
+ boolean mkdir25 = new File(rootPath + "25报警、联锁值确认").mkdirs();
|
|
|
+ boolean mkdir26 = new File(rootPath + "26临时电源").mkdirs();
|
|
|
+ boolean mkdir27 = new File(rootPath + "27电机设备").mkdirs();
|
|
|
+ boolean mkdir28 = new File(rootPath + "28照明、电伴热").mkdirs();
|
|
|
+ boolean mkdir29 = new File(rootPath + "29静电接地、跨接").mkdirs();
|
|
|
+ boolean mkdir30 = new File(rootPath + "30气体检测仪").mkdirs();
|
|
|
+ boolean mkdir31 = new File(rootPath + "31在线分析仪").mkdirs();
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/downloadAboveall")
|
|
|
+ public AjaxResult downloadAboveall(TPssrAboveall aboveall) {
|
|
|
+ return AjaxResult.success(aboveall.getId() + "pssr.zip");//fileName
|
|
|
}
|
|
|
|
|
|
/**
|