diff --git a/src/main/java/com/dbnt/faisp/config/FileController.java b/src/main/java/com/dbnt/faisp/config/FileController.java index 71129c38..eaf1004f 100644 --- a/src/main/java/com/dbnt/faisp/config/FileController.java +++ b/src/main/java/com/dbnt/faisp/config/FileController.java @@ -131,6 +131,22 @@ public class FileController extends BaseService{ HttpServletResponse response, @RequestParam(value="affairKeyList") List affairKeyList){ List fileList = affairService.selectAffairFileList(affairKeyList); + makeZipAndOut(request, response, "견문보고서 첨부파일_", fileList); + } + + + @GetMapping("/downloadMajorStatusFiles") + public void downloadMajorStatusFiles(HttpServletRequest request, + HttpServletResponse response, + @RequestParam(value="majorKeyList") List majorKeyList){ + List fileList = majorStatusService.selectMajorFileList(majorKeyList); + makeZipAndOut(request, response, "주요사건처리현황 첨부파일_", fileList); + + } + + private void makeZipAndOut(HttpServletRequest request, + HttpServletResponse response, + String fileName, List fileList) { List> fileInfoList = new ArrayList<>(); for(FileInfo file: fileList){ Map fileInfoMap = new HashMap<>(); @@ -145,7 +161,7 @@ public class FileController extends BaseService{ if (!saveFolder.exists() || saveFolder.isFile()) { saveFolder.mkdirs(); } - String downloadFileName = "견문보고서 첨부파일_"+ LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))+".zip"; + String downloadFileName = fileName+ LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))+".zip"; zipFile += File.separator+downloadFileName; try{ // ZipOutputStream을 FileOutputStream 으로 감쌈 diff --git a/src/main/java/com/dbnt/faisp/main/fpiMgt/affair/repository/AffairFileRepository.java b/src/main/java/com/dbnt/faisp/main/fpiMgt/affair/repository/AffairFileRepository.java index c5e1b7ee..25092326 100644 --- a/src/main/java/com/dbnt/faisp/main/fpiMgt/affair/repository/AffairFileRepository.java +++ b/src/main/java/com/dbnt/faisp/main/fpiMgt/affair/repository/AffairFileRepository.java @@ -1,5 +1,6 @@ package com.dbnt.faisp.main.fpiMgt.affair.repository; +import com.dbnt.faisp.config.FileInfo; import com.dbnt.faisp.main.fpiMgt.affair.model.AffairFile; import org.springframework.data.jpa.repository.JpaRepository; @@ -8,6 +9,8 @@ import java.util.Optional; public interface AffairFileRepository extends JpaRepository { - List findByAffairKey(Integer affairKey); - Optional findTopByAffairKeyOrderByFileSeqDesc(Integer planKey); + List findByAffairKey(Integer affairKey); + Optional findTopByAffairKeyOrderByFileSeqDesc(Integer planKey); + + List findByAffairKeyIn(List affairKeyList); } diff --git a/src/main/java/com/dbnt/faisp/main/fpiMgt/affair/service/AffairService.java b/src/main/java/com/dbnt/faisp/main/fpiMgt/affair/service/AffairService.java index e6d568ca..e5149250 100644 --- a/src/main/java/com/dbnt/faisp/main/fpiMgt/affair/service/AffairService.java +++ b/src/main/java/com/dbnt/faisp/main/fpiMgt/affair/service/AffairService.java @@ -292,12 +292,7 @@ public class AffairService extends BaseService { // 견문보고 } public List selectAffairFileList(List affairKeyList) { - List fileList = new ArrayList<>(); - for(Integer affairKey: affairKeyList){ - List affairFileList = affairFileRepository.findByAffairKey(affairKey); - fileList.addAll(affairFileList); - } - return fileList; + return affairFileRepository.findByAffairKeyIn(affairKeyList); } public List selectStatusTotal(TypeStatistics typeStatistics) { diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/IvsgtController.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/IvsgtController.java index 94d49656..0bf32037 100644 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/IvsgtController.java +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/boardInvestigation/IvsgtController.java @@ -92,7 +92,7 @@ public class IvsgtController { investigationBoard.setRowCnt(10); investigationBoard.setFirstIndex(0); investigationBoard.setQueryInfo(); - investigationBoard.setWrtUserSeq(loginUser.getUserSeq()); + investigationBoard.setWrtOrgan(loginUser.getOgCd()); mav.addObject("investigationList", ivsgtService.selectBoardInvestigationList(investigationBoard)); investigationBoard.setContentCnt(ivsgtService.selectBoardInvestigationListCnt(investigationBoard)); investigationBoard.setPaginationInfo(); diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/repository/MajorFileRepository.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/repository/MajorFileRepository.java index 7e51dc8a..99565ae3 100644 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/repository/MajorFileRepository.java +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/repository/MajorFileRepository.java @@ -1,16 +1,19 @@ package com.dbnt.faisp.main.ivsgtMgt.majorStatus.repository; +import com.dbnt.faisp.config.FileInfo; import com.dbnt.faisp.main.ivsgtMgt.majorStatus.model.MajorFile; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; import java.util.List; import java.util.Optional; public interface MajorFileRepository extends JpaRepository { - List findByMajorKey(Integer majorKey); - Optional findTopByMajorKeyOrderByFileSeq(Integer majorKey); + List findByMajorKey(Integer majorKey); + Optional findTopByMajorKeyOrderByFileSeq(Integer majorKey); - void deleteByMajorKey(Integer majorKey); + void deleteByMajorKey(Integer majorKey); + List findByMajorKeyIn(List majorKeyList); } diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/service/MajorStatusService.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/service/MajorStatusService.java index 3488c941..0916e93b 100644 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/service/MajorStatusService.java +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/service/MajorStatusService.java @@ -93,4 +93,8 @@ public class MajorStatusService extends BaseService { public FileInfo selectMajorFile(Integer majorKey, Integer fileSeq){ return majorFileRepository.findById(new MajorFile.MajorFileId(majorKey, fileSeq)).orElse(null); } + + public List selectMajorFileList(List majorKeyList) { + return majorFileRepository.findByMajorKeyIn(majorKeyList); + } } diff --git a/src/main/resources/static/js/faStatistics/asfCov.js b/src/main/resources/static/js/faStatistics/asfCov.js index e590943b..d20b5f01 100644 --- a/src/main/resources/static/js/faStatistics/asfCov.js +++ b/src/main/resources/static/js/faStatistics/asfCov.js @@ -7,12 +7,6 @@ $(document).on('change', '#pressurizedYn', function (){ } }) -$("#jqueryBtn").click(function(){ - $(".quiz-text").text("Javascript"); - $(".quiz-text").css('color', 'blue'); -}); - - $(document).on('click', '#saveBtn', function (){ if(confirm("저장하시겠습니까?")){ diff --git a/src/main/resources/static/js/igActivities/fpiMgt/affairMgt.js b/src/main/resources/static/js/igActivities/fpiMgt/affairMgt.js index 217cf427..784ed815 100644 --- a/src/main/resources/static/js/igActivities/fpiMgt/affairMgt.js +++ b/src/main/resources/static/js/igActivities/fpiMgt/affairMgt.js @@ -20,7 +20,10 @@ $(document).on('click', '.reportTypeTab', function (){ $(document).on('click', '.affairTr', function (event){ const target = event.target; - if(!(target.className === "apprvTd" || $(target).parents(".apprvTd").length>0)){ + if(!(target.className === "chkBoxTd" + || $(target).parents(".chkBoxTd").length>0 + || target.className === "apprvTd" + || $(target).parents(".apprvTd").length>0)){ const chkBox = $(this).find(".trChkBox"); if(chkBox.length>0){ $(".trChkBox").prop("checked", false); diff --git a/src/main/resources/static/js/ivsgt/majorStatus.js b/src/main/resources/static/js/ivsgt/majorStatus.js index be9c5ade..81593e15 100644 --- a/src/main/resources/static/js/ivsgt/majorStatus.js +++ b/src/main/resources/static/js/ivsgt/majorStatus.js @@ -1,11 +1,10 @@ - - -$("#jqueryBtn").click(function(){ - $(".quiz-text").text("Javascript"); - $(".quiz-text").css('color', 'blue'); -}); - - +$(function(){ + $("#dateSelectorDiv").datepicker({ + format: "yyyy-mm-dd", + language: "ko", + autoclose: true + }); +}) $(document).on('click', '#saveBtn', function (){ if(confirm("저장하시겠습니까?")){ @@ -45,10 +44,12 @@ $(document).on('click', '#addMajorBtn', function (){ getEditModal(null) }) -$(document).on('click', '.tr', function (){ - $(".trChkBox").prop("checked", false); - $(this).find(".trChkBox").prop("checked", true); +$(document).on('click', '.tr', function (event){ + const target = event.target; + if(!(target.className === "chkBoxTd" + || $(target).parents(".chkBoxTd").length>0)){ getViewModal(Number($(this).find(".majorKey").val())); + } }) @@ -63,14 +64,19 @@ $(document).on('click', '#editBtn', function (){ - - -$(function(){ - $("#dateSelectorDiv").datepicker({ - format: "yyyy-mm-dd", - language: "ko", - autoclose: true - }); +$(document).on('click', '#fileDownBtn', function (){ + const selectedList = $(".majorChkBox:checked") + if(selectedList.length<1){ + alert("대상이 없습니다."); + return false; + } + if(confirm("선택된 문서의 파일을 다운로드 하시겠습니까?")){ + let url = "/file/downloadMajorStatusFiles?majorKeyList=" + $.each(selectedList, function(idx, chkBox){ + url += $(chkBox).parents("tr").find(".majorKey").val()+","; + }) + window.open(encodeURI(url.slice(0, -1))); + } }) diff --git a/src/main/resources/templates/igActivities/fpiMgt/affair/affairMgt.html b/src/main/resources/templates/igActivities/fpiMgt/affair/affairMgt.html index 7818d517..fd6a0e1f 100644 --- a/src/main/resources/templates/igActivities/fpiMgt/affair/affairMgt.html +++ b/src/main/resources/templates/igActivities/fpiMgt/affair/affairMgt.html @@ -160,7 +160,7 @@ - + @@ -227,7 +227,7 @@
- + diff --git a/src/main/resources/templates/ivsgt/majorStatus/majorStatusPage.html b/src/main/resources/templates/ivsgt/majorStatus/majorStatusPage.html index 44cc0ebb..30dc7413 100644 --- a/src/main/resources/templates/ivsgt/majorStatus/majorStatusPage.html +++ b/src/main/resources/templates/ivsgt/majorStatus/majorStatusPage.html @@ -66,23 +66,36 @@
+ + + + + + + + + - - + + + - - + + + - - - + @@ -93,7 +106,9 @@
-
+
+ +
순번분류 순번분류 제목 내용첨부파일작성일시첨부파일작성일시
+ + + +