경력현황 작업중.

master
강석 최 2023-03-28 18:29:58 +09:00
parent 567ee1a52d
commit e11fd1e133
4 changed files with 76 additions and 78 deletions

View File

@ -173,7 +173,11 @@ public class PoliceController {
}
@GetMapping("/nowPersonnelStatus")
public PersonnelStatus nowPersonnelStatus(String ogCd){
return policeService.nowPersonnelStatus(ogCd);
PersonnelStatus ps = policeService.nowPersonnelStatus(ogCd);
if(ps == null){
return new PersonnelStatus();
}
return ps;
}
@PostMapping("/savePersonnelStatus")
@ResponseBody
@ -217,7 +221,6 @@ public class PoliceController {
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/police/careerMgt").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
mav.addObject("selectedTab", career.getCareerCd());
mav.addObject("crcList", codeMgtService.selectCodeMgtList("CRC"));
mav.addObject("userInfo", policeService.selectPoliceInfo(career.getUserSeq()));
mav.addObject("careerList", policeService.selectCareerList(career.getUserSeq()));
mav.addObject("userSeq", loginUser.getUserSeq());
@ -226,11 +229,6 @@ public class PoliceController {
@GetMapping("/careerFormModal")
public ModelAndView careerFormModal(@AuthenticationPrincipal UserInfo loginUser, UserCareer career){
ModelAndView mav = new ModelAndView("police/career/careerFormModal");
mav.addObject("crcList", codeMgtService.selectCodeMgtList("CRC"));
mav.addObject("dsnList", codeMgtService.selectCodeMgtList("DSN"));
mav.addObject("ogList", codeMgtService.selectCodeMgtList("OG"));
mav.addObject("ofcList", codeMgtService.selectCodeMgtList("OFC"));
mav.addObject("jtList", codeMgtService.selectCodeMgtList("JT"));
mav.addObject("career", career);
return mav;
}

View File

@ -32,7 +32,7 @@ public class PoliceService {
public void saveCareer(UserCareer career) {
UserCareer lastCareer = userCareerRepository.findTop1ByUserSeqOrderByCareerSeqDesc(career.getUserSeq()).orElse(null);
career.setCareerSeq(lastCareer==null?1:(lastCareer.getCareerSeq()+1));
if(!career.getInOfficeYn().equals("Y")){
if(career.getInOfficeYn() == null || career.getInOfficeYn().equals("N")){
career.setWorkMonth((int) ChronoUnit.MONTHS.between(career.getStartDate(), career.getEndDate()));
career.setWorkDay((int) ChronoUnit.DAYS.between(career.getStartDate(), career.getEndDate()));
}

View File

@ -11,8 +11,8 @@
<label for="careerCd" class="col-sm-2 col-form-label col-form-label-sm text-center">경력구분</label>
<div class="col-sm-4">
<select class="form-select form-select-sm" id="careerCd" name="careerCd">
<th:block th:each="code:${crcList}">
<option th:value="${code.itemCd}" th:text="${code.itemValue}" th:selected="${code.itemCd eq career.careerCd}"></option>
<th:block th:each="code, idx:${session.commonCode.get('CRC')}">
<option th:if="${code.useChk eq 'T'}" th:value="${code.itemCd}" th:text="${code.itemValue}" th:selected="${code.itemCd eq career.careerCd}"></option>
</th:block>
</select>
</div>
@ -20,8 +20,8 @@
<div class="col-sm-4">
<select class="form-select form-select-sm" id="designationCd" name="designationCd">
<option value="">선택</option>
<th:block th:each="code:${dsnList}">
<option th:value="${code.itemCd}" th:text="${code.itemValue}"></option>
<th:block th:each="code:${session.commonCode.get('DSN')}">
<option th:if="${code.useChk eq 'T'}" th:value="${code.itemCd}" th:text="${code.itemValue}"></option>
</th:block>
</select>
</div>
@ -41,8 +41,8 @@
<div class="col-sm-3 selectInputDiv">
<select class="form-select form-select-sm" id="workOrgan" name="workOrgan">
<option value="">선택</option>
<th:block th:each="code:${ogList}">
<option th:value="${code.itemCd}" th:text="${code.itemValue}"></option>
<th:block th:each="code:${session.commonCode.get('OG')}">
<option th:if="${code.useChk eq 'T'}" th:value="${code.itemCd}" th:text="${code.itemValue}"></option>
</th:block>
</select>
</div>
@ -50,8 +50,10 @@
<div class="col-sm-3 selectInputDiv">
<select class="form-select form-select-sm" id="workPart" name="workPart">
<option value="">선택</option>
<th:block th:each="code:${ofcList}">
<option th:value="${code.itemCd}" th:text="${code.itemValue}"></option>
<th:block th:each="parent:${session.commonCode.get('OG')}">
<th:block th:if="${parent.useChk eq 'T'}" th:each="code:${session.commonCode.get(parent.itemCd)}">
<option th:if="${code.useChk eq 'T'}" th:class="${parent.itemCd}" th:value="${code.itemCd}" th:text="${code.itemValue}" style="display: none"></option>
</th:block>
</th:block>
</select>
</div>
@ -59,8 +61,8 @@
<div class="col-sm-3">
<select class="form-select form-select-sm" id="workTitle" name="workTitle">
<option value="">선택</option>
<th:block th:each="code:${jtList}">
<option th:value="${code.itemCd}" th:text="${code.itemValue}"></option>
<th:block th:each="code:${session.commonCode.get('JT')}">
<option th:if="${code.useChk eq 'T'}" th:value="${code.itemCd}" th:text="${code.itemValue}"></option>
</th:block>
</select>
</div>

View File

@ -21,102 +21,100 @@
<div class="card">
<div class="card-body text-center">
<ul class="nav nav-tabs" id="userTab" role="tablist">
<th:block th:each="code, idx:${crcList}">
<li class="nav-item" role="presentation">
<button class="nav-link" type="button" role="tab" data-bs-toggle="tab" th:id="|${code.itemCd}Tab|"
th:data-bs-target="${#strings.concat('#', code.itemCd, 'TabPanel')}" th:aria-controls="|${code.itemCd}TabPanel|"
th:aria-selected="${code.itemCd eq selectedTab?'true':'false'}" th:classappend="${code.itemCd eq selectedTab?'active':''}"
<th:block th:each="code, idx:${session.commonCode.get('CRC')}">
<th:block th:if="${code.useChk eq 'T'}">
<li class="nav-item" role="presentation">
<button class="nav-link" type="button" role="tab" data-bs-toggle="tab" th:id="|${code.itemCd}Tab|"
th:data-bs-target="${#strings.concat('#', code.itemCd, 'TabPanel')}" th:aria-controls="|${code.itemCd}TabPanel|"
th:aria-selected="${code.itemCd eq selectedTab?'true':'false'}" th:classappend="${code.itemCd eq selectedTab?'active':''}"
th:text="${code.itemValue}"></button>
</li>
</li>
</th:block>
</th:block>
</ul>
<div class="tab-content bg-white border border-top-0">
<th:block th:each="code, idx:${crcList}">
<div class="tab-pane fade p-2" th:classappend="${code.itemCd eq selectedTab?'show active':''}"
th:id="|${code.itemCd}TabPanel|" role="tabpanel"
th:aria-labelledby="|${code.itemCd}Tab|" tabindex="0">
<table class="table table-sm table-hover">
<thead>
<tr>
<th>임용구분</th>
<th colspan="2">근무지</th>
<th>직급</th>
<th>시작일</th>
<th>종료일</th>
<th>일수</th>
<th>개월수</th>
<th>등록자</th>
<th>등록일</th>
<th></th>
</tr>
</thead>
<tbody>
<th:block th:each="career:${careerList}">
<th:block th:if="${code.itemCd eq career.careerCd}">
<th:block th:each="tabCode, idx:${session.commonCode.get('CRC')}">
<th:block th:if="${tabCode.useChk eq 'T'}">
<div class="tab-pane fade p-2" th:classappend="${tabCode.itemCd eq selectedTab?'show active':''}"
th:id="|${tabCode.itemCd}TabPanel|" role="tabpanel"
th:aria-labelledby="|${tabCode.itemCd}Tab|" tabindex="0">
<table class="table table-sm table-hover">
<thead>
<tr>
<th>임용구분</th>
<th colspan="2">근무지</th>
<th>직급</th>
<th>시작일</th>
<th>종료일</th>
<th>일수</th>
<th>개월수</th>
<th>등록자</th>
<th>등록일</th>
<th></th>
</tr>
</thead>
<tbody>
<tr th:each="career:${careerList}">
<th:block th:if="${tabCode.itemCd eq career.careerCd}">
<td>
<th:block th:each="code:${session.commonCode.get('DSN')}">
<th:block th:if="${code.itemCd eq career.designationCd}" th:text="${code.itemValue}"></th:block>
</th:block>
</td>
<th:block th:if="${#strings.isEmpty(career.workPositionStr)}">
<th:block th:each="code:${session.commonCode.get('OG')}">
<th:block th:if="${code.itemCd eq career.workOrgan}">
<td th:text="${code.itemValue}"></td>
<td>
<th:block th:each="code:${session.commonCode.get('OG')}">
<th:block th:if="${code.itemCd eq career.workOrgan}" th:text="${code.itemValue}"></th:block>
</th:block>
</th:block>
<th:block th:each="code:${session.commonCode.get(career.workOrgan)}">
<th:block th:if="${code.itemCd eq career.workPart}">
<td th:text="${code.itemValue}"></td>
</td>
<td>
<th:block th:each="code:${session.commonCode.get(career.workOrgan)}">
<th:block th:if="${code.itemCd eq career.workPart}" th:text="${code.itemValue}"></th:block>
</th:block>
</th:block>
</td>
</th:block>
<th:block th:unless="${#strings.isEmpty(career.workPositionStr)}">
<td colspan="2" th:text="${career.workPositionStr}"></td>
</th:block>
<th:block th:each="code:${session.commonCode.get('JT')}">
<th:block th:if="${code.itemCd eq career.workTitle}">
<td th:text="${code.itemValue}"></td>
<td>
<th:block th:each="code:${session.commonCode.get('JT')}">
<th:block th:if="${code.itemCd eq career.workTitle}" th:text="${code.itemValue}"></th:block>
</th:block>
</th:block>
</td>
<td th:text="${#temporals.format(career.startDate, 'yyyy-MM-dd')}"></td>
<td th:text="${career.inOfficeYn eq 'Y'?'재직중':#temporals.format(career.endDate, 'yyyy-MM-dd')}"></td>
<td th:text="${career.workDay}"></td>
<td th:text="${career.workMonth}"></td>
<td>
<th:block th:each="code:${session.commonCode.get('OG')}">
<th:block th:if="${code.itemCd eq career.wrtOrgan}">
<th:block th:text="${code.itemValue}"></th:block>
</th:block>
<th:block th:if="${code.itemCd eq career.wrtOrgan}" th:text="${code.itemValue}"></th:block>
</th:block>
<th:block th:each="code:${session.commonCode.get(career.workOrgan)}">
<th:block th:if="${code.itemCd eq career.workPart}">
<th:block th:text="${code.itemValue}"></th:block>
</th:block>
<th:block th:if="${code.itemCd eq career.workPart}" th:text="${code.itemValue}"></th:block>
</th:block>
<th:block th:text="${career.wrtUserNm}"></th:block>
</td>
<td th:text="${#temporals.format(career.wrtDt, 'yyyy-MM-dd HH:mm:ss')}"></td>
<td>
<button type="button" class="btn btn-sm btn-outline-danger deleteCareerBtn"
th:data-careerseq="${career.careerSeq}" th:data-tab="${code.itemCd}">
th:data-careerseq="${career.careerSeq}" th:data-tab="${tabCode.itemCd}">
<i class="bi bi-trash"></i>
</button>
</td>
</th:block>
</tr>
</th:block>
</th:block>
</tbody>
<tfoot>
<tr>
<td colspan="11">
<button type="button" class="btn btn-sm btn-primary careerAddBtn" th:data-careercd="${code.itemCd}">추가</button>
</td>
</tr>
</tfoot>
</table>
</div>
</th:block>
</tbody>
<tfoot>
<tr>
<td colspan="11">
<button type="button" class="btn btn-sm btn-primary careerAddBtn" th:data-careercd="${tabCode.itemCd}">추가</button>
</td>
</tr>
</tfoot>
</table>
</div>
</th:block>
</th:block>
</div>
</div>
</div>