diff --git a/src/main/java/com/dbnt/faisp/config/FileController.java b/src/main/java/com/dbnt/faisp/config/FileController.java index 5269bbb2..de8773c9 100644 --- a/src/main/java/com/dbnt/faisp/config/FileController.java +++ b/src/main/java/com/dbnt/faisp/config/FileController.java @@ -1,5 +1,6 @@ package com.dbnt.faisp.config; +import com.dbnt.faisp.fpiMgt.affair.service.AffairService; import com.dbnt.faisp.fpiMgt.affairPlan.service.PlanService; import com.dbnt.faisp.publicBoard.service.PublicBoardService; import lombok.RequiredArgsConstructor; @@ -18,6 +19,7 @@ public class FileController { private final PlanService planService; private final PublicBoardService publicBoardService; + private final AffairService affairService; @GetMapping("/file/fileDownload") public void fileDownload(HttpServletRequest request, @@ -27,12 +29,15 @@ public class FileController { Integer fileSeq) { FileInfo downloadFile = null; switch (board){ - case "monthPlan": + case "affairPlan": downloadFile = planService.selectPlanFile(parentKey, fileSeq); break; case "publicFile": downloadFile = publicBoardService.selectPublicFile(parentKey, fileSeq); break; + case "affair": + downloadFile = affairService.selectAffairFile(parentKey, fileSeq); + break; } BufferedInputStream in; diff --git a/src/main/java/com/dbnt/faisp/fpiMgt/affair/service/AffairService.java b/src/main/java/com/dbnt/faisp/fpiMgt/affair/service/AffairService.java index ade9a60a..1e592116 100644 --- a/src/main/java/com/dbnt/faisp/fpiMgt/affair/service/AffairService.java +++ b/src/main/java/com/dbnt/faisp/fpiMgt/affair/service/AffairService.java @@ -2,6 +2,7 @@ package com.dbnt.faisp.fpiMgt.affair.service; import com.dbnt.faisp.config.BaseService; +import com.dbnt.faisp.config.FileInfo; import com.dbnt.faisp.fpiMgt.affair.mapper.AffairMapper; import com.dbnt.faisp.fpiMgt.affair.model.*; import com.dbnt.faisp.fpiMgt.affair.repository.*; @@ -149,4 +150,8 @@ public class AffairService extends BaseService { // 견문보고 } return rating.getAffairKey(); } + + public FileInfo selectAffairFile(Integer parentKey, Integer fileSeq) { + return affairFileRepository.findById(new AffairFile.AffairFileId(parentKey, fileSeq)).orElse(null); + } } diff --git a/src/main/resources/templates/igActivities/fpiMgt/affair/affairViewModal.html b/src/main/resources/templates/igActivities/fpiMgt/affair/affairViewModal.html index c8587881..7c1e88a0 100644 --- a/src/main/resources/templates/igActivities/fpiMgt/affair/affairViewModal.html +++ b/src/main/resources/templates/igActivities/fpiMgt/affair/affairViewModal.html @@ -127,7 +127,7 @@ - diff --git a/src/main/resources/templates/igActivities/fpiMgt/affairPlan/planViewModal.html b/src/main/resources/templates/igActivities/fpiMgt/affairPlan/planViewModal.html index 86a66c2c..3a60b1be 100644 --- a/src/main/resources/templates/igActivities/fpiMgt/affairPlan/planViewModal.html +++ b/src/main/resources/templates/igActivities/fpiMgt/affairPlan/planViewModal.html @@ -79,7 +79,7 @@ -