외사 통계 하위 페이지 접근 권한별 등록, 수정 버튼 동작 추가.

master
강석 최 2023-03-14 14:28:08 +09:00
parent e4befe8898
commit 2107603416
9 changed files with 208 additions and 183 deletions

View File

@ -2,6 +2,7 @@ package com.dbnt.faisp.main.faStatistics.crackdownsStatus;
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
import com.dbnt.faisp.main.codeMgt.service.CodeMgtService; import com.dbnt.faisp.main.codeMgt.service.CodeMgtService;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.asfCov.AsfCov; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.asfCov.AsfCov;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatus; import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatus;
@ -29,11 +30,14 @@ public class AsfCovController {
private final AsfCovService asfCovService; private final AsfCovService asfCovService;
private final CodeMgtService codeMgtService; private final CodeMgtService codeMgtService;
private final AuthMgtService authMgtService;
@GetMapping("/asfCov") @GetMapping("/asfCov")
public ModelAndView asfCove(@AuthenticationPrincipal UserInfo loginUser, AsfCov asfCov) { public ModelAndView asfCove(@AuthenticationPrincipal UserInfo loginUser, AsfCov asfCov) {
ModelAndView mav = new ModelAndView("faStatistics/asfCov/asfCov"); ModelAndView mav = new ModelAndView("faStatistics/asfCov/asfCov");
//메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/faStatistics/asfCov").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList()); mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
mav.addObject("searchParams", asfCov); mav.addObject("searchParams", asfCov);
@ -67,6 +71,11 @@ public class AsfCovController {
public ModelAndView asfCovViewModal(@AuthenticationPrincipal UserInfo loginUser, AsfCov asfCov){ public ModelAndView asfCovViewModal(@AuthenticationPrincipal UserInfo loginUser, AsfCov asfCov){
ModelAndView mav= new ModelAndView("faStatistics/asfCov/asfCovViewModal"); ModelAndView mav= new ModelAndView("faStatistics/asfCov/asfCovViewModal");
//메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/faStatistics/asfCov").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
mav.addObject("userSeq",loginUser.getUserSeq()); mav.addObject("userSeq",loginUser.getUserSeq());
mav.addObject("asfCov", asfCovService.selectAsfCov(asfCov.getAsfCovKey())); mav.addObject("asfCov", asfCovService.selectAsfCov(asfCov.getAsfCovKey()));
mav.addObject("asfCovHistory", asfCovService.selectAsfCovHistory(asfCov.getAsfCovKey())); mav.addObject("asfCovHistory", asfCovService.selectAsfCovHistory(asfCov.getAsfCovKey()));

View File

@ -40,7 +40,7 @@ public class FishingBoatController {
//메뉴권한 확인 //메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/faStatistics/fishingBoat").get(0).getAccessAuth(); String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/faStatistics/fishingBoat").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth); mav.addObject("accessAuth", accessAuth);
mav.addObject("loginUserOrgan", loginUser.getOgCd());
params.setQueryInfo(); params.setQueryInfo();
if(params.getYear()==null){ if(params.getYear()==null){
params.setYear(LocalDateTime.now().getYear()); params.setYear(LocalDateTime.now().getYear());
@ -101,6 +101,7 @@ public class FishingBoatController {
mav.addObject("bdtList", codeMgtService.selectCodeMgtList("BDT")); mav.addObject("bdtList", codeMgtService.selectCodeMgtList("BDT"));
mav.addObject("boatList", codeMgtService.selectCodeMgtList(crackdownStatus.getCrackdownPolice())); mav.addObject("boatList", codeMgtService.selectCodeMgtList(crackdownStatus.getCrackdownPolice()));
mav.addObject("userSeq", loginUser.getUserSeq()); mav.addObject("userSeq", loginUser.getUserSeq());
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
return mav; return mav;
} }

View File

@ -64,6 +64,7 @@ public class SailorController {
mav.addObject("userSeq",loginUser.getUserSeq()); mav.addObject("userSeq",loginUser.getUserSeq());
//메뉴권한 확인 //메뉴권한 확인
mav.addObject("accessAuth", authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/faStatistics/sailor").get(0).getAccessAuth()); mav.addObject("accessAuth", authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/faStatistics/sailor").get(0).getAccessAuth());
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
return mav; return mav;
} }

View File

@ -166,7 +166,9 @@
<button class="btn btn-success" id="asfCovDownExcel">엑셀 다운로드</button> <button class="btn btn-success" id="asfCovDownExcel">엑셀 다운로드</button>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<th:block th:if="${accessAuth ne 'ACC001'}">
<button class="btn btn-primary" id="addAsfCovBtn" >등록</button> <button class="btn btn-primary" id="addAsfCovBtn" >등록</button>
</th:block>
</div> </div>
</div> </div>
</div> </div>

View File

@ -121,15 +121,17 @@
</div> </div>
</div> </div>
</div> </div>
<div class="modal-footer row justify-content-between bg-light"> <th:block th:if="${userSeq eq asfCov.wrtUserSeq
or (accessAuth eq 'ACC003' and #lists.contains(mgtOrganList, asfCov.wrtOrgan))}">
<!--작성자, 관리자일 경우 수정, 삭제 허용-->
<div class="modal-footer row justify-content-between bg-light">
<div class="col-auto"> <div class="col-auto">
<button type="button" class="btn btn-danger" id="deleteMajorBtn">삭제</button> <button type="button" class="btn btn-danger" id="deleteMajorBtn">삭제</button>
<!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>--> <!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>-->
</div> </div>
<div class="col-auto"> <div class="col-auto">
<th:block th:if="${userSeq eq asfCov.wrtUserSeq}"><!--작성자일 경우 수정 허용-->
<button type="button" class="btn btn-warning" id="editBtn" th:data-asfCovkey="${asfCov.asfCovKey}">수정</button> <button type="button" class="btn btn-warning" id="editBtn" th:data-asfCovkey="${asfCov.asfCovKey}">수정</button>
</th:block>
</div> </div>
</div> </div>
</th:block>
</html> </html>

View File

@ -246,7 +246,9 @@
</div> </div>
<div class="row justify-content-between"> <div class="row justify-content-between">
<div class="col-auto"> <div class="col-auto">
<button class="btn btn-warning" id="deadlineBtn" data-menukey="51" th:data-deadlinechk="${deadlineState}" th:if="${accessAuth eq 'ACC003'}" th:text="${deadlineState eq 'F'?'마감':'등록허용'}"></button> <th:block th:if="${accessAuth eq 'ACC003' and loginUserOrgan eq 'OG001'}">
<button class="btn btn-warning" id="deadlineBtn" data-menukey="51" th:data-deadlinechk="${deadlineState}" th:text="${deadlineState eq 'F'?'마감':'등록허용'}"></button>
</th:block>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<nav aria-label="Page navigation"> <nav aria-label="Page navigation">
@ -274,7 +276,9 @@
</nav> </nav>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<th:block th:if="${accessAuth ne 'ACC001'}">
<input type="button" class="btn btn-success" value="등록" id="getFishingBoatEditModalBtn" th:disabled="${deadlineState eq 'T'}"> <input type="button" class="btn btn-success" value="등록" id="getFishingBoatEditModalBtn" th:disabled="${deadlineState eq 'T'}">
</th:block>
</div> </div>
</div> </div>
</div> </div>

View File

@ -590,7 +590,9 @@
</div> </div>
</div> </div>
<div class="modal-footer bg-light"> <div class="modal-footer bg-light">
<th:block th:if="${userSeq eq crackdownStatus.fishingBoat.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용--> <th:block th:if="${userSeq eq crackdownStatus.fishingBoat.wrtUserSeq
or (accessAuth eq 'ACC003' and #lists.contains(mgtOrganList, crackdownStatus.fishingBoat.wrtOrgan))}">
<!--작성자, 관리자일 경우 수정 허용-->
<button type="button" class="btn btn-warning" id="editFishingBoatBtn">수정</button> <button type="button" class="btn btn-warning" id="editFishingBoatBtn">수정</button>
</th:block> </th:block>
<!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>--> <!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>-->

View File

@ -333,7 +333,9 @@
<button class="btn btn-success" id="sailorDownExcel">엑셀 다운로드</button> <button class="btn btn-success" id="sailorDownExcel">엑셀 다운로드</button>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<th:block th:if="${accessAuth ne 'ACC001'}">
<button class="btn btn-primary" id="sailorAddBtn">등록</button> <button class="btn btn-primary" id="sailorAddBtn">등록</button>
</th:block>
</div> </div>
</div> </div>
</div> </div>

View File

@ -219,7 +219,9 @@
</div> </div>
</div> </div>
<div class="modal-footer bg-light"> <div class="modal-footer bg-light">
<th:block th:if="${userSeq eq sailor.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용--> <th:block th:if="${userSeq eq sailor.wrtUserSeq
or (accessAuth eq 'ACC003' and #lists.contains(mgtOrganList, sailor.wrtOrgan))}">
<!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
<button type="button" class="btn btn-warning" id="sailorEditBtn">수정</button> <button type="button" class="btn btn-warning" id="sailorEditBtn">수정</button>
</th:block> </th:block>
<!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>--> <!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>-->