권한설정 페이지 사용자 목록 오류 수정.

master
강석 최 2023-01-20 11:28:55 +09:00
parent d90bee7272
commit 6132e3f532
2 changed files with 10 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import com.dbnt.faisp.main.authMgt.model.AuthMgt;
import com.dbnt.faisp.main.userInfo.service.UserInfoService; import com.dbnt.faisp.main.userInfo.service.UserInfoService;
import com.dbnt.faisp.main.userInfo.model.UserInfo; import com.dbnt.faisp.main.userInfo.model.UserInfo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -18,12 +19,16 @@ public class AuthMgtController {
private final AuthMgtService authMgtService; private final AuthMgtService authMgtService;
@GetMapping("/authMgtPage") @GetMapping("/authMgtPage")
public ModelAndView authMgtPage(UserInfo userInfo) { public ModelAndView authMgtPage(@AuthenticationPrincipal UserInfo loginUser, UserInfo userInfo) {
ModelAndView mav = new ModelAndView("adminPage/authMgt/authMgt"); ModelAndView mav = new ModelAndView("adminPage/authMgt/authMgt");
userInfo.setQueryInfo(); userInfo.setQueryInfo();
userInfo.setDownOrganCdList(loginUser.getDownOrganCdList());
mav.addObject("userInfoList", userInfoService.selectUserInfoList(userInfo)); mav.addObject("userInfoList", userInfoService.selectUserInfoList(userInfo));
userInfo.setContentCnt(userInfoService.selectUserInfoListCnt(userInfo)); userInfo.setContentCnt(userInfoService.selectUserInfoListCnt(userInfo));
userInfo.setPaginationInfo(); userInfo.setPaginationInfo();
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
mav.addObject("searchParams", userInfo); mav.addObject("searchParams", userInfo);
return mav; return mav;
} }

View File

@ -28,8 +28,10 @@
<div class="col-auto"> <div class="col-auto">
<select class="form-select form-select-sm" name="ogCd"> <select class="form-select form-select-sm" name="ogCd">
<option value="">관서 선택</option> <option value="">관서 선택</option>
<th:block th:each="commonCode:${session.commonCode.get('OG')}"> <th:block th:each="code:${session.commonCode.get('OG')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${searchParams.ogCd==commonCode.itemCd}"></option> <th:block th:if="${code.useChk eq 'T' and #lists.contains(mgtOrganList, code.itemCd)}">
<option th:value="${code.itemCd}" th:text="${code.itemValue}" th:selected="${searchParams.ogCd eq code.itemCd}"></option>
</th:block>
</th:block> </th:block>
</select> </select>
</div> </div>