통합검색 작업중.
parent
f4ae40d781
commit
59806a5a0d
|
|
@ -1,25 +1,43 @@
|
|||
package com.dbnt.faisp.config;
|
||||
|
||||
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
|
||||
import com.dbnt.faisp.main.counterIntelligence.model.CounterIntelligenceActivity;
|
||||
import com.dbnt.faisp.main.counterIntelligence.model.CounterIntelligenceWork;
|
||||
import com.dbnt.faisp.main.counterIntelligence.service.CounterIntelligenceService;
|
||||
import com.dbnt.faisp.main.faRpt.model.FaRptBoard;
|
||||
import com.dbnt.faisp.main.faRpt.model.Sri;
|
||||
import com.dbnt.faisp.main.faRpt.service.FaRptService;
|
||||
import com.dbnt.faisp.main.faStatistics.unlawfulFishing.model.sailor.Sailor;
|
||||
import com.dbnt.faisp.main.faStatistics.unlawfulFishing.service.FishingBoatService;
|
||||
import com.dbnt.faisp.main.faStatistics.unlawfulFishing.service.SailorService;
|
||||
import com.dbnt.faisp.main.fpiMgt.affair.model.AffairBoard;
|
||||
import com.dbnt.faisp.main.fpiMgt.affair.service.AffairService;
|
||||
import com.dbnt.faisp.main.fpiMgt.affairPlan.model.PlanBoard;
|
||||
import com.dbnt.faisp.main.fpiMgt.affairPlan.service.PlanService;
|
||||
import com.dbnt.faisp.main.fpiMgt.affairResult.model.ResultBoard;
|
||||
import com.dbnt.faisp.main.fpiMgt.affairResult.service.ResultService;
|
||||
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.OperationPlan;
|
||||
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.service.IntelligenceNetworkService;
|
||||
import com.dbnt.faisp.main.fpiMgt.monitoring.model.MonitoringDesignation;
|
||||
import com.dbnt.faisp.main.fpiMgt.monitoring.model.MonitoringResult;
|
||||
import com.dbnt.faisp.main.fpiMgt.monitoring.service.MonitoringService;
|
||||
import com.dbnt.faisp.main.faRpt.service.SriService;
|
||||
import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.InvestigationBoard;
|
||||
import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.service.IvsgtService;
|
||||
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.model.MajorStatus;
|
||||
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.service.MajorStatusService;
|
||||
import com.dbnt.faisp.main.publicBoard.model.PublicBoard;
|
||||
import com.dbnt.faisp.main.publicBoard.service.PublicBoardService;
|
||||
import com.dbnt.faisp.main.userInfo.model.UserInfo;
|
||||
import com.dbnt.faisp.util.Utils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import ognl.Ognl;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
@ -56,6 +74,7 @@ public class FileController extends BaseService{
|
|||
private final MajorStatusService majorStatusService;
|
||||
private final IntelligenceNetworkService inrelligenceNetworkService;
|
||||
private final MonitoringService monitoringService;
|
||||
private final AuthMgtService authMgtService;
|
||||
|
||||
@GetMapping("/editorFileDisplay")
|
||||
public ResponseEntity<Resource> editorFileDisplay(HttpServletRequest request,
|
||||
|
|
@ -105,10 +124,30 @@ public class FileController extends BaseService{
|
|||
public void fileDownload(HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
String board,
|
||||
Integer menuKey,
|
||||
Integer parentKey,
|
||||
Integer fileSeq) {
|
||||
|
||||
FileInfo fileInfo = getFileInfo(board, parentKey, fileSeq);
|
||||
Integer fileSeq,
|
||||
@AuthenticationPrincipal UserInfo loginUser) throws Exception {
|
||||
FileInfo fileInfo = null;
|
||||
if(Utils.isEmpty(menuKey)){
|
||||
fileInfo = getFileInfo(board, parentKey, fileSeq);
|
||||
}else{
|
||||
if(menuKey!=0){
|
||||
String accessAuth = authMgtService.selectAccessAuth(menuKey, loginUser.getUserSeq());
|
||||
Map<String, Object> wrtInfo = getWrtInfo(menuKey, parentKey);
|
||||
if(!Utils.isEmpty(accessAuth)){
|
||||
if(wrtOrganCheck(loginUser.getUserSeq(), accessAuth, wrtInfo, loginUser.getDownOrganCdList())){
|
||||
fileInfo = getFileInfoToMenuKey(menuKey, parentKey, fileSeq);
|
||||
}else{
|
||||
throw new Exception();
|
||||
}
|
||||
}else{
|
||||
throw new Exception();
|
||||
}
|
||||
}else{
|
||||
fileInfo = getFileInfoToMenuKey(menuKey, parentKey, fileSeq);
|
||||
}
|
||||
}
|
||||
BufferedInputStream in;
|
||||
BufferedOutputStream out;
|
||||
try {
|
||||
|
|
@ -126,6 +165,15 @@ public class FileController extends BaseService{
|
|||
}
|
||||
}
|
||||
|
||||
private boolean wrtOrganCheck(Integer userSeq, String accessAuth, Map<String, Object> wrtInfo, List<String> mgtOrganList) {
|
||||
if (accessAuth.equals("ACC003")){
|
||||
return mgtOrganList.contains(wrtInfo.get("wrtOrgan").toString());
|
||||
}else if(accessAuth.equals("ACC002")||accessAuth.equals("ACC001")){
|
||||
return userSeq.equals(wrtInfo.get("wrtUserSeq"));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@GetMapping("/downloadAffairFiles")
|
||||
public void downloadAffairFiles(HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
|
|
@ -214,52 +262,121 @@ public class FileController extends BaseService{
|
|||
private FileInfo getFileInfo(String board, Integer parentKey, Integer fileSeq){
|
||||
FileInfo downloadFile = null;
|
||||
switch (board){
|
||||
case "faRpt":
|
||||
downloadFile = faRptService.selectFaRptFile(parentKey, fileSeq);
|
||||
break;
|
||||
case "affairPlan":
|
||||
downloadFile = planService.selectPlanFile(parentKey, fileSeq);
|
||||
break;
|
||||
case "publicFile":
|
||||
downloadFile = publicBoardService.selectPublicFile(parentKey, fileSeq);
|
||||
break;
|
||||
case "affair":
|
||||
downloadFile = affairService.selectAffairFile(parentKey, fileSeq);
|
||||
break;
|
||||
case "affairResult":
|
||||
downloadFile = resultService.selectResultFile(parentKey, fileSeq);
|
||||
break;
|
||||
case "ivsgt":
|
||||
downloadFile = ivsgtService.selectIvsgtFile(parentKey, fileSeq);
|
||||
break;
|
||||
case "sailor":
|
||||
downloadFile = sailorService.selectSailorFile(parentKey, fileSeq);
|
||||
break;
|
||||
case "sri":
|
||||
downloadFile = sriService.selectFaSriFile(parentKey, fileSeq);
|
||||
break;
|
||||
case "ciWork":
|
||||
downloadFile = ciService.selectCiWorkFile(parentKey, fileSeq);
|
||||
break;
|
||||
case "MajorFile" :
|
||||
downloadFile = majorStatusService.selectMajorFile(parentKey, fileSeq);
|
||||
break;
|
||||
case "ciActivity":
|
||||
downloadFile = ciService.selectCiaForeignerFile(parentKey, fileSeq);
|
||||
break;
|
||||
case "operationPlan":
|
||||
downloadFile = inrelligenceNetworkService.selectOperationPlanFile(parentKey, fileSeq);
|
||||
break;
|
||||
case "designation":
|
||||
downloadFile = monitoringService.selectDesignationFile(parentKey, fileSeq);
|
||||
break;
|
||||
case "monitoringResult":
|
||||
downloadFile = monitoringService.selectMonitoringResultFile(parentKey, fileSeq);
|
||||
break;
|
||||
case "monitoringReport":
|
||||
downloadFile = monitoringService.selectMonitoringReportFile(parentKey, fileSeq);
|
||||
break;
|
||||
case "faRpt": downloadFile = faRptService.selectFaRptFile(parentKey, fileSeq); break;
|
||||
case "affairPlan": downloadFile = planService.selectPlanFile(parentKey, fileSeq); break;
|
||||
case "publicFile": downloadFile = publicBoardService.selectPublicFile(parentKey, fileSeq); break;
|
||||
case "affair": downloadFile = affairService.selectAffairFile(parentKey, fileSeq); break;
|
||||
case "affairResult": downloadFile = resultService.selectResultFile(parentKey, fileSeq); break;
|
||||
case "ivsgt": downloadFile = ivsgtService.selectIvsgtFile(parentKey, fileSeq); break;
|
||||
case "sailor": downloadFile = sailorService.selectSailorFile(parentKey, fileSeq); break;
|
||||
case "sri": downloadFile = sriService.selectFaSriFile(parentKey, fileSeq); break;
|
||||
case "ciWork": downloadFile = ciService.selectCiWorkFile(parentKey, fileSeq); break;
|
||||
case "MajorFile" : downloadFile = majorStatusService.selectMajorFile(parentKey, fileSeq); break;
|
||||
case "ciActivity": downloadFile = ciService.selectCiaForeignerFile(parentKey, fileSeq); break;
|
||||
case "operationPlan": downloadFile = inrelligenceNetworkService.selectOperationPlanFile(parentKey, fileSeq); break;
|
||||
case "designation": downloadFile = monitoringService.selectDesignationFile(parentKey, fileSeq); break;
|
||||
case "monitoringResult": downloadFile = monitoringService.selectMonitoringResultFile(parentKey, fileSeq); break;
|
||||
case "monitoringReport": downloadFile = monitoringService.selectMonitoringReportFile(parentKey, fileSeq); break;
|
||||
}
|
||||
return downloadFile;
|
||||
}
|
||||
|
||||
private FileInfo getFileInfoToMenuKey(Integer menuKey, Integer parentKey, Integer fileSeq){
|
||||
FileInfo downloadFile = null;
|
||||
switch (menuKey){
|
||||
case 0: downloadFile = publicBoardService.selectPublicFile(parentKey, fileSeq); break;
|
||||
case 1: downloadFile = faRptService.selectFaRptFile(parentKey, fileSeq); break;
|
||||
case 29: downloadFile = planService.selectPlanFile(parentKey, fileSeq); break;
|
||||
case 30:case 33: downloadFile = affairService.selectAffairFile(parentKey, fileSeq); break;
|
||||
case 31: downloadFile = resultService.selectResultFile(parentKey, fileSeq); break;
|
||||
case 2: downloadFile = ivsgtService.selectIvsgtFile(parentKey, fileSeq); break;
|
||||
case 44: downloadFile = sailorService.selectSailorFile(parentKey, fileSeq); break;
|
||||
case 40: downloadFile = sriService.selectFaSriFile(parentKey, fileSeq); break;
|
||||
case 5: downloadFile = majorStatusService.selectMajorFile(parentKey, fileSeq); break;
|
||||
case 6: downloadFile = ciService.selectCiWorkFile(parentKey, fileSeq); break;
|
||||
case 7: case 8: case 9: case 10:downloadFile = ciService.selectCiaForeignerFile(parentKey, fileSeq); break;
|
||||
case 32: downloadFile = inrelligenceNetworkService.selectOperationPlanFile(parentKey, fileSeq); break;
|
||||
case 36: downloadFile = monitoringService.selectDesignationFile(parentKey, fileSeq); break;
|
||||
case 37: downloadFile = monitoringService.selectMonitoringResultFile(parentKey, fileSeq); break;
|
||||
case 370: downloadFile = monitoringService.selectMonitoringReportFile(parentKey, fileSeq); break;
|
||||
}
|
||||
return downloadFile;
|
||||
}
|
||||
|
||||
private Map<String, Object> getWrtInfo(Integer menuKey, Integer parentKey){
|
||||
Map<String, Object> wrtInfo = new HashMap<>();
|
||||
switch (menuKey){
|
||||
case 0:
|
||||
PublicBoard board = publicBoardService.selectPublicBoard(parentKey);
|
||||
wrtInfo.put("wrtOrgan", board.getWrtOrgan());
|
||||
wrtInfo.put("wrtUserSeq", board.getWrtUserSeq());
|
||||
break;
|
||||
case 1:
|
||||
FaRptBoard faRpt = faRptService.selectFaRptBoard(parentKey, null);
|
||||
wrtInfo.put("wrtOrgan", faRpt.getWrtOrgan());
|
||||
wrtInfo.put("wrtUserSeq", faRpt.getWrtUserSeq());
|
||||
break;
|
||||
case 2:
|
||||
InvestigationBoard invest = ivsgtService.selectBoardInvestigation(parentKey);
|
||||
wrtInfo.put("wrtOrgan", invest.getWrtOrgan());
|
||||
wrtInfo.put("wrtUserSeq", invest.getWrtUserSeq());
|
||||
break;
|
||||
case 5:
|
||||
MajorStatus major = majorStatusService.selectMajor(parentKey);
|
||||
wrtInfo.put("wrtOrgan", major.getWrtOrgan());
|
||||
wrtInfo.put("wrtUserSeq", major.getWrtUserSeq());
|
||||
break;
|
||||
case 6:
|
||||
CounterIntelligenceWork ciw = ciService.selectCounterIntelligenceWork(parentKey);
|
||||
wrtInfo.put("wrtOrgan", ciw.getWrtOrgan());
|
||||
wrtInfo.put("wrtUserSeq", ciw.getWrtUserSeq());
|
||||
break;
|
||||
case 7: case 8: case 9: case 10:
|
||||
CounterIntelligenceActivity cia = ciService.selectCia(parentKey);
|
||||
wrtInfo.put("wrtOrgan", cia.getWrtOrgan());
|
||||
wrtInfo.put("wrtUserSeq", cia.getWrtUserSeq());
|
||||
break;
|
||||
case 29:
|
||||
PlanBoard plan = planService.selectPlanBoard(parentKey);
|
||||
wrtInfo.put("wrtOrgan", plan.getWrtOrgan());
|
||||
wrtInfo.put("wrtUserSeq", plan.getWrtUserSeq());
|
||||
break;
|
||||
case 30:case 33:
|
||||
AffairBoard affair = affairService.selectAffairBoard(parentKey);
|
||||
wrtInfo.put("wrtOrgan", affair.getWrtOrgan());
|
||||
wrtInfo.put("wrtUserSeq", affair.getWrtUserSeq());
|
||||
break;
|
||||
case 31:
|
||||
ResultBoard affairResult = resultService.selectResultBoard(parentKey);
|
||||
wrtInfo.put("wrtOrgan", affairResult.getWrtOrgan());
|
||||
wrtInfo.put("wrtUserSeq", affairResult.getWrtUserSeq());
|
||||
break;
|
||||
case 32:
|
||||
OperationPlan operationPlan = inrelligenceNetworkService.selectOperationPlan(parentKey);
|
||||
wrtInfo.put("wrtOrgan", operationPlan.getWrtOrgan());
|
||||
wrtInfo.put("wrtUserSeq", operationPlan.getWrtUserSeq());
|
||||
break;
|
||||
case 36:
|
||||
MonitoringDesignation designation = monitoringService.selectDesignation(parentKey);
|
||||
wrtInfo.put("wrtOrgan", designation.getWrtOrgan());
|
||||
wrtInfo.put("wrtUserSeq", designation.getWrtUserSeq());
|
||||
break;
|
||||
case 37:case 370:
|
||||
MonitoringResult monitoringResult = monitoringService.selectResult(parentKey);
|
||||
wrtInfo.put("wrtOrgan", monitoringResult.getWrtOrgan());
|
||||
wrtInfo.put("wrtUserSeq", monitoringResult.getWrtUserSeq());
|
||||
break;
|
||||
case 40:
|
||||
Sri sri = sriService.selectFaSriBoard(parentKey, null);
|
||||
wrtInfo.put("wrtOrgan", sri.getWrtOrgan());
|
||||
wrtInfo.put("wrtUserSeq", sri.getWrtUserSeq());
|
||||
break;
|
||||
case 44:
|
||||
Sailor sailor = sailorService.selectSailor(parentKey);
|
||||
wrtInfo.put("wrtOrgan", sailor.getWrtOrgan());
|
||||
wrtInfo.put("wrtUserSeq", sailor.getWrtUserSeq());
|
||||
break;
|
||||
}
|
||||
return wrtInfo;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ public class AuthMgtService {
|
|||
return authMgtMapper.selectAccessConfigList(params);
|
||||
}
|
||||
|
||||
public String selectAccessAuth(Integer menuKey, Integer userSeq){
|
||||
return accessConfigRepository.findById(new AccessConfig.AccessConfigId(menuKey, userSeq)).orElse(new AccessConfig()).getAccessAuth();
|
||||
}
|
||||
|
||||
public List<ApprovalConfig> selectApprovalConfigList(Integer userSeq, String url) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("userSeq", userSeq);
|
||||
|
|
|
|||
|
|
@ -353,4 +353,8 @@ public class CounterIntelligenceService extends BaseService {
|
|||
}
|
||||
return cia;
|
||||
}
|
||||
|
||||
public CounterIntelligenceActivity selectCia(Integer ciaKey) {
|
||||
return counterIntelligenceActivityRepository.findById(ciaKey).orElse(new CounterIntelligenceActivity());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public class FaRptService extends BaseService {
|
|||
faRptBoard.setFileList(faRptFileRepository.findByFaRptKey(faRptKey));
|
||||
faRptBoard.setHashTags(faRptMapper.selectHashTags(faRptKey));
|
||||
faRptBoard.setReadUserList(faRptReadUserRepository.findByFaRptKey(faRptKey));
|
||||
if(faRptBoard.getStatus().equals("DST007")){
|
||||
if(faRptBoard.getStatus().equals("DST007") && userSeq != null){
|
||||
for(FaRptReadUser readUser: faRptBoard.getReadUserList()){
|
||||
if(readUser.getUserSeq().equals(userSeq) && !readUser.getReadYn().equals("T")){
|
||||
readUser.setReadYn("T");
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class SriService extends BaseService {
|
|||
if(sri.getRefKey()!=null){
|
||||
sri.setRefSri(sriRepository.findById(sri.getRefKey()).orElse(null));
|
||||
}
|
||||
if(sri.getStatus().equals("DST007")){
|
||||
if(sri.getStatus().equals("DST007") && userSeq != null){
|
||||
for(SriReadUser readUser: sri.getReadUserList()){
|
||||
if(readUser.getUserSeq().equals(userSeq)){
|
||||
readUser.setReadYn("T");
|
||||
|
|
|
|||
|
|
@ -23,15 +23,30 @@ public class PublicBoardController {
|
|||
private final PublicBoardService publicBoardService;
|
||||
private final CodeMgtService codeMgtService;
|
||||
|
||||
@GetMapping("/noticePage")
|
||||
public ModelAndView organMgtPage(@AuthenticationPrincipal UserInfo loginUser, PublicBoard publicBoard) {
|
||||
ModelAndView mav;
|
||||
if(publicBoard.getDashboardFlag()){
|
||||
mav = new ModelAndView("publicBoard/notice/noticePageDashBoard");
|
||||
publicBoard.setRowCnt(5);
|
||||
}else{
|
||||
mav = new ModelAndView("publicBoard/notice/noticePage");
|
||||
@GetMapping("/findPage")
|
||||
public ModelAndView findPublicBoardPage(@AuthenticationPrincipal UserInfo loginUser, PublicBoard publicBoard){
|
||||
publicBoard = publicBoardService.selectPublicBoard(publicBoard.getPublicKey());
|
||||
ModelAndView mav = new ModelAndView();
|
||||
switch (publicBoard.getPublicType()){
|
||||
case "PLB001":
|
||||
mav.setViewName("redirect:/publicBoard/noticePage?refDocKey="+publicBoard.getPublicKey());
|
||||
break;
|
||||
case "PLB002":
|
||||
mav.setViewName("redirect:/publicBoard/boardPage?refDocKey="+publicBoard.getPublicKey());
|
||||
break;
|
||||
case "PLB003":
|
||||
mav.setViewName("redirect:/publicBoard/referencePage?refDocKey="+publicBoard.getPublicKey());
|
||||
break;
|
||||
case "PLB004":
|
||||
mav.setViewName("redirect:/publicBoard/qnaPage?refDocKey="+publicBoard.getPublicKey());
|
||||
break;
|
||||
}
|
||||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping("/noticePage")
|
||||
public ModelAndView noticePage(@AuthenticationPrincipal UserInfo loginUser, PublicBoard publicBoard) {
|
||||
ModelAndView mav = new ModelAndView("publicBoard/notice/noticePage");
|
||||
publicBoard.setQueryInfo();
|
||||
publicBoard.setPublicType("PLB001");
|
||||
publicBoard.setDownOrganCdList(loginUser.getDownOrganCdList());
|
||||
|
|
@ -125,6 +140,7 @@ public class PublicBoardController {
|
|||
@GetMapping("/viewModal")
|
||||
public ModelAndView viewModal (@AuthenticationPrincipal UserInfo loginUser, PublicBoard publicBoard){
|
||||
ModelAndView mav = null;
|
||||
publicBoard = publicBoardService.selectPublicBoard(publicBoard.getPublicKey());
|
||||
switch (publicBoard.getPublicType()) {
|
||||
case "PLB001": // 공지사항
|
||||
mav = new ModelAndView("publicBoard/notice/noticeViewModal");
|
||||
|
|
@ -140,7 +156,6 @@ public class PublicBoardController {
|
|||
break;
|
||||
}
|
||||
mav.addObject("modalType", publicBoard.getModalType());
|
||||
publicBoard = publicBoardService.selectPublicBoard(publicBoard.getPublicKey());
|
||||
mav.addObject("userSeq", loginUser.getUserSeq());
|
||||
mav.addObject("userRole", loginUser.getUserRole());
|
||||
mav.addObject("info", publicBoard);
|
||||
|
|
|
|||
|
|
@ -1,24 +1,18 @@
|
|||
package com.dbnt.faisp.main.searchEngine;
|
||||
|
||||
import com.dbnt.faisp.main.codeMgt.service.CodeMgtService;
|
||||
import com.dbnt.faisp.main.menuMgt.model.MenuMgt;
|
||||
import com.dbnt.faisp.main.menuMgt.service.MenuMgtService;
|
||||
import com.dbnt.faisp.main.publicBoard.model.PublicBoard;
|
||||
import com.dbnt.faisp.main.publicBoard.model.PublicComment;
|
||||
import com.dbnt.faisp.main.publicBoard.service.PublicBoardService;
|
||||
import com.dbnt.faisp.main.searchEngine.model.*;
|
||||
import com.dbnt.faisp.main.searchEngine.service.SearchEngineService;
|
||||
import com.dbnt.faisp.main.userInfo.model.UserInfo;
|
||||
import com.dbnt.faisp.util.Utils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
|
|
@ -37,7 +31,6 @@ public class SearchEngineController {
|
|||
}
|
||||
int totalCnt = 0;
|
||||
SearchResult result = null;
|
||||
MenuMgt menuParam = new MenuMgt();
|
||||
switch (params.getActiveTab()){
|
||||
case "all":
|
||||
params.setQueryInfo();
|
||||
|
|
@ -53,11 +46,6 @@ public class SearchEngineController {
|
|||
result = searchEngineService.getData(params, SearchFileView.class);
|
||||
totalCnt += result.getTotalCount();
|
||||
mav.addObject("fileResult", result);
|
||||
|
||||
menuParam.setUserSeq(loginUser.getUserSeq());
|
||||
menuParam.setFirstIndex(0);
|
||||
menuParam.setRowCnt(Integer.MAX_VALUE);
|
||||
mav.addObject("menuList", menuMgtService.selectMenuMgtList(null));
|
||||
break;
|
||||
case "menu":
|
||||
params.setQueryInfo();
|
||||
|
|
@ -76,11 +64,6 @@ public class SearchEngineController {
|
|||
params.setContentCnt(totalCnt);
|
||||
mav.addObject("boardResult", result);
|
||||
params.setPaginationInfo();
|
||||
|
||||
menuParam.setUserSeq(loginUser.getUserSeq());
|
||||
menuParam.setFirstIndex(0);
|
||||
menuParam.setRowCnt(Integer.MAX_VALUE);
|
||||
mav.addObject("menuList", menuMgtService.selectMenuMgtList(null));
|
||||
break;
|
||||
case "file":
|
||||
params.setQueryInfo();
|
||||
|
|
@ -92,6 +75,11 @@ public class SearchEngineController {
|
|||
params.setPaginationInfo();
|
||||
break;
|
||||
}
|
||||
MenuMgt menuParam = new MenuMgt();
|
||||
menuParam.setUserSeq(loginUser.getUserSeq());
|
||||
menuParam.setFirstIndex(0);
|
||||
menuParam.setRowCnt(Integer.MAX_VALUE);
|
||||
mav.addObject("menuList", menuMgtService.selectMenuMgtList(menuParam));
|
||||
mav.addObject("searchParams", params);
|
||||
mav.addObject("totalCnt", totalCnt);
|
||||
return mav;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import lombok.NoArgsConstructor;
|
|||
@Data
|
||||
@NoArgsConstructor
|
||||
public class SearchFileView {
|
||||
private Integer menu_key;
|
||||
private Integer menu_key=0;
|
||||
private Integer main_key;
|
||||
private Integer file_seq;
|
||||
private String orig_nm;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,14 @@
|
|||
|
||||
$(function(){
|
||||
if(location.search.includes("refDocKey")){
|
||||
const params = location.search.split('&');
|
||||
$.each(params, function (idx, param){
|
||||
if(param.includes("refDocKey")){
|
||||
const key = param.slice(param.indexOf("=")+1, param.length);
|
||||
getViewModal(key);
|
||||
}
|
||||
})
|
||||
}
|
||||
$("#dateSelectorDiv").datepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
language: "ko",
|
||||
|
|
|
|||
|
|
@ -27,3 +27,26 @@ $(document).on('click', '.searchTabLink', function (){
|
|||
$("#activeTabInput").val($(this).attr('data-activetab'))
|
||||
searchPageFormSubmit(1);
|
||||
})
|
||||
|
||||
$(document).on('click', '.boardLink', function (){
|
||||
let menuUrl = $(this).find(".menuUrl").val()
|
||||
if(menuUrl === undefined){
|
||||
location.href= "/publicBoard/findPage?publicKey="+$(this).find(".refDocKey").val()
|
||||
}else{
|
||||
if(menuUrl.includes("?")){
|
||||
menuUrl += "&refDocKey="
|
||||
}else{
|
||||
menuUrl += "?refDocKey="
|
||||
}
|
||||
location.href = menuUrl+$(this).find(".refDocKey").val()
|
||||
}
|
||||
})
|
||||
|
||||
$(document).on('click', '.fileLink', function (){
|
||||
const target = $(this)
|
||||
let url = "/file/fileDownload?"
|
||||
url += "menuKey="+target.attr("data-menukey");
|
||||
url += "&parentKey="+target.attr("data-mainkey");
|
||||
url += "&fileSeq="+target.attr("data-fileseq");
|
||||
window.open(encodeURI(url));
|
||||
})
|
||||
|
|
@ -149,11 +149,13 @@
|
|||
<h3>게시판<span th:text="|${boardResult.totalCount}건|"></span></h3>
|
||||
<ul class="boardList">
|
||||
<li th:each="board:${boardResult.rowList}">
|
||||
<dl>
|
||||
<dl class="boardLink">
|
||||
<input type="hidden" class="refDocKey" th:value="${board.main_key}">
|
||||
<dt>
|
||||
<th:block th:if="${board.menu_key ne 0}">
|
||||
[<th:block th:each="menu:${menuList}">
|
||||
<th:block th:if="${menu.menuKey eq board.menu_key}">
|
||||
<input type="hidden" class="menuUrl" th:value="${menu.menuUrl}">
|
||||
<th:block th:if="${!#strings.isEmpty(menu.cat3Cd)}">
|
||||
<th:block th:each="code:${session.commonCode.get('CAT3')}">
|
||||
<th:block th:if="${menu.cat3Cd eq code.itemCd}" th:text="${code.itemValue}"></th:block>
|
||||
|
|
@ -176,11 +178,11 @@
|
|||
<span class="titleDate" th:text="${#temporals.format(board.wrt_dt, 'yyyy-MM-dd HH:mm')}"></span>
|
||||
</dt>
|
||||
<dt th:if="${!#strings.isEmpty(board.title2)}"><a href="#" th:text="${board.title2}"></a></dt>
|
||||
<dd th:if="${!#strings.isEmpty(board.content1)}" th:utext="${board.content1}"></dd>
|
||||
<!--<dd th:if="${!#strings.isEmpty(board.content1)}" th:utext="${board.content1}"></dd>
|
||||
<dd th:if="${!#strings.isEmpty(board.content2)}" th:utext="${board.content2}"></dd>
|
||||
<dd th:if="${!#strings.isEmpty(board.content3)}" th:utext="${board.content3}"></dd>
|
||||
<dd th:if="${!#strings.isEmpty(board.content4)}" th:utext="${board.content4}"></dd>
|
||||
<dd th:if="${!#strings.isEmpty(board.content5)}" th:utext="${board.content5}"></dd>
|
||||
<dd th:if="${!#strings.isEmpty(board.content5)}" th:utext="${board.content5}"></dd>-->
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
@ -219,7 +221,28 @@
|
|||
<h3>첨부파일<span th:text="|${fileResult.totalCount}건|"></span></h3>
|
||||
<ul class="boardList boardFileList">
|
||||
<li th:each="file:${fileResult.rowList}">
|
||||
<dl>
|
||||
<dl class="fileLink" th:data-menukey="${file.menu_key eq null?'0':file.menu_key}" th:data-mainkey="${file.main_key}" th:data-fileseq="${file.file_seq}">
|
||||
<th:block th:if="${file.menu_key ne null}">
|
||||
[<th:block th:each="menu:${menuList}">
|
||||
<th:block th:if="${menu.menuKey eq file.menu_key}">
|
||||
<th:block th:if="${!#strings.isEmpty(menu.cat3Cd)}">
|
||||
<th:block th:each="code:${session.commonCode.get('CAT3')}">
|
||||
<th:block th:if="${menu.cat3Cd eq code.itemCd}" th:text="${code.itemValue}"></th:block>
|
||||
</th:block>
|
||||
</th:block>
|
||||
<th:block th:if="${!#strings.isEmpty(menu.cat2Cd) and #strings.isEmpty(menu.cat3Cd)}">
|
||||
<th:block th:each="code:${session.commonCode.get('CAT2')}">
|
||||
<th:block th:if="${menu.cat2Cd eq code.itemCd}" th:text="${code.itemValue}"></th:block>
|
||||
</th:block>
|
||||
</th:block>
|
||||
<th:block th:if="${!#strings.isEmpty(menu.cat1Cd) and #strings.isEmpty(menu.cat2Cd) and #strings.isEmpty(menu.cat3Cd)}">
|
||||
<th:block th:each="code:${session.commonCode.get('CAT1')}">
|
||||
<th:block th:if="${menu.cat1Cd eq code.itemCd}" th:text="${code.itemValue}"></th:block>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</th:block>]
|
||||
</th:block>
|
||||
<dt><a href="#" th:text="${#strings.concat(file.orig_nm, '.', file.file_extn)}"></a><a href="#" class="downBtn">내려받기</a></dt>
|
||||
<dd th:text="${file.file_content}"></dd>
|
||||
</dl>
|
||||
|
|
|
|||
Loading…
Reference in New Issue