경력현황 작업중.

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

View File

@ -32,7 +32,7 @@ public class PoliceService {
public void saveCareer(UserCareer career) { public void saveCareer(UserCareer career) {
UserCareer lastCareer = userCareerRepository.findTop1ByUserSeqOrderByCareerSeqDesc(career.getUserSeq()).orElse(null); UserCareer lastCareer = userCareerRepository.findTop1ByUserSeqOrderByCareerSeqDesc(career.getUserSeq()).orElse(null);
career.setCareerSeq(lastCareer==null?1:(lastCareer.getCareerSeq()+1)); 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.setWorkMonth((int) ChronoUnit.MONTHS.between(career.getStartDate(), career.getEndDate()));
career.setWorkDay((int) ChronoUnit.DAYS.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> <label for="careerCd" class="col-sm-2 col-form-label col-form-label-sm text-center">경력구분</label>
<div class="col-sm-4"> <div class="col-sm-4">
<select class="form-select form-select-sm" id="careerCd" name="careerCd"> <select class="form-select form-select-sm" id="careerCd" name="careerCd">
<th:block th:each="code:${crcList}"> <th:block th:each="code, idx:${session.commonCode.get('CRC')}">
<option th:value="${code.itemCd}" th:text="${code.itemValue}" th:selected="${code.itemCd eq career.careerCd}"></option> <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> </th:block>
</select> </select>
</div> </div>
@ -20,8 +20,8 @@
<div class="col-sm-4"> <div class="col-sm-4">
<select class="form-select form-select-sm" id="designationCd" name="designationCd"> <select class="form-select form-select-sm" id="designationCd" name="designationCd">
<option value="">선택</option> <option value="">선택</option>
<th:block th:each="code:${dsnList}"> <th:block th:each="code:${session.commonCode.get('DSN')}">
<option th:value="${code.itemCd}" th:text="${code.itemValue}"></option> <option th:if="${code.useChk eq 'T'}" th:value="${code.itemCd}" th:text="${code.itemValue}"></option>
</th:block> </th:block>
</select> </select>
</div> </div>
@ -41,8 +41,8 @@
<div class="col-sm-3 selectInputDiv"> <div class="col-sm-3 selectInputDiv">
<select class="form-select form-select-sm" id="workOrgan" name="workOrgan"> <select class="form-select form-select-sm" id="workOrgan" name="workOrgan">
<option value="">선택</option> <option value="">선택</option>
<th:block th:each="code:${ogList}"> <th:block th:each="code:${session.commonCode.get('OG')}">
<option th:value="${code.itemCd}" th:text="${code.itemValue}"></option> <option th:if="${code.useChk eq 'T'}" th:value="${code.itemCd}" th:text="${code.itemValue}"></option>
</th:block> </th:block>
</select> </select>
</div> </div>
@ -50,8 +50,10 @@
<div class="col-sm-3 selectInputDiv"> <div class="col-sm-3 selectInputDiv">
<select class="form-select form-select-sm" id="workPart" name="workPart"> <select class="form-select form-select-sm" id="workPart" name="workPart">
<option value="">선택</option> <option value="">선택</option>
<th:block th:each="code:${ofcList}"> <th:block th:each="parent:${session.commonCode.get('OG')}">
<option th:value="${code.itemCd}" th:text="${code.itemValue}"></option> <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> </th:block>
</select> </select>
</div> </div>
@ -59,8 +61,8 @@
<div class="col-sm-3"> <div class="col-sm-3">
<select class="form-select form-select-sm" id="workTitle" name="workTitle"> <select class="form-select form-select-sm" id="workTitle" name="workTitle">
<option value="">선택</option> <option value="">선택</option>
<th:block th:each="code:${jtList}"> <th:block th:each="code:${session.commonCode.get('JT')}">
<option th:value="${code.itemCd}" th:text="${code.itemValue}"></option> <option th:if="${code.useChk eq 'T'}" th:value="${code.itemCd}" th:text="${code.itemValue}"></option>
</th:block> </th:block>
</select> </select>
</div> </div>

View File

@ -21,7 +21,8 @@
<div class="card"> <div class="card">
<div class="card-body text-center"> <div class="card-body text-center">
<ul class="nav nav-tabs" id="userTab" role="tablist"> <ul class="nav nav-tabs" id="userTab" role="tablist">
<th:block th:each="code, idx:${crcList}"> <th:block th:each="code, idx:${session.commonCode.get('CRC')}">
<th:block th:if="${code.useChk eq 'T'}">
<li class="nav-item" role="presentation"> <li class="nav-item" role="presentation">
<button class="nav-link" type="button" role="tab" data-bs-toggle="tab" th:id="|${code.itemCd}Tab|" <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:data-bs-target="${#strings.concat('#', code.itemCd, 'TabPanel')}" th:aria-controls="|${code.itemCd}TabPanel|"
@ -29,12 +30,14 @@
th:text="${code.itemValue}"></button> th:text="${code.itemValue}"></button>
</li> </li>
</th:block> </th:block>
</th:block>
</ul> </ul>
<div class="tab-content bg-white border border-top-0"> <div class="tab-content bg-white border border-top-0">
<th:block th:each="code, idx:${crcList}"> <th:block th:each="tabCode, idx:${session.commonCode.get('CRC')}">
<div class="tab-pane fade p-2" th:classappend="${code.itemCd eq selectedTab?'show active':''}" <th:block th:if="${tabCode.useChk eq 'T'}">
th:id="|${code.itemCd}TabPanel|" role="tabpanel" <div class="tab-pane fade p-2" th:classappend="${tabCode.itemCd eq selectedTab?'show active':''}"
th:aria-labelledby="|${code.itemCd}Tab|" tabindex="0"> th:id="|${tabCode.itemCd}TabPanel|" role="tabpanel"
th:aria-labelledby="|${tabCode.itemCd}Tab|" tabindex="0">
<table class="table table-sm table-hover"> <table class="table table-sm table-hover">
<thead> <thead>
<tr> <tr>
@ -51,72 +54,67 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<th:block th:each="career:${careerList}"> <tr th:each="career:${careerList}">
<th:block th:if="${code.itemCd eq career.careerCd}"> <th:block th:if="${tabCode.itemCd eq career.careerCd}">
<tr>
<td> <td>
<th:block th:each="code:${session.commonCode.get('DSN')}"> <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 th:if="${code.itemCd eq career.designationCd}" th:text="${code.itemValue}"></th:block>
</th:block> </th:block>
</td> </td>
<th:block th:if="${#strings.isEmpty(career.workPositionStr)}"> <th:block th:if="${#strings.isEmpty(career.workPositionStr)}">
<td>
<th:block th:each="code:${session.commonCode.get('OG')}"> <th:block th:each="code:${session.commonCode.get('OG')}">
<th:block th:if="${code.itemCd eq career.workOrgan}"> <th:block th:if="${code.itemCd eq career.workOrgan}" th:text="${code.itemValue}"></th:block>
<td th:text="${code.itemValue}"></td>
</th:block>
</th:block> </th:block>
</td>
<td>
<th:block th:each="code:${session.commonCode.get(career.workOrgan)}"> <th:block th:each="code:${session.commonCode.get(career.workOrgan)}">
<th:block th:if="${code.itemCd eq career.workPart}"> <th:block th:if="${code.itemCd eq career.workPart}" th:text="${code.itemValue}"></th:block>
<td th:text="${code.itemValue}"></td>
</th:block>
</th:block> </th:block>
</td>
</th:block> </th:block>
<th:block th:unless="${#strings.isEmpty(career.workPositionStr)}"> <th:block th:unless="${#strings.isEmpty(career.workPositionStr)}">
<td colspan="2" th:text="${career.workPositionStr}"></td> <td colspan="2" th:text="${career.workPositionStr}"></td>
</th:block> </th:block>
<td>
<th:block th:each="code:${session.commonCode.get('JT')}"> <th:block th:each="code:${session.commonCode.get('JT')}">
<th:block th:if="${code.itemCd eq career.workTitle}"> <th:block th:if="${code.itemCd eq career.workTitle}" th:text="${code.itemValue}"></th:block>
<td th:text="${code.itemValue}"></td>
</th:block>
</th:block> </th:block>
</td>
<td th:text="${#temporals.format(career.startDate, 'yyyy-MM-dd')}"></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.inOfficeYn eq 'Y'?'재직중':#temporals.format(career.endDate, 'yyyy-MM-dd')}"></td>
<td th:text="${career.workDay}"></td> <td th:text="${career.workDay}"></td>
<td th:text="${career.workMonth}"></td> <td th:text="${career.workMonth}"></td>
<td> <td>
<th:block th:each="code:${session.commonCode.get('OG')}"> <th:block th:each="code:${session.commonCode.get('OG')}">
<th:block th:if="${code.itemCd eq career.wrtOrgan}"> <th:block th:if="${code.itemCd eq career.wrtOrgan}" th:text="${code.itemValue}"></th:block>
<th:block th:text="${code.itemValue}"></th:block>
</th:block>
</th:block> </th:block>
<th:block th:each="code:${session.commonCode.get(career.workOrgan)}"> <th:block th:each="code:${session.commonCode.get(career.workOrgan)}">
<th:block th:if="${code.itemCd eq career.workPart}"> <th:block th:if="${code.itemCd eq career.workPart}" th:text="${code.itemValue}"></th:block>
<th:block th:text="${code.itemValue}"></th:block>
</th:block>
</th:block> </th:block>
<th:block th:text="${career.wrtUserNm}"></th:block> <th:block th:text="${career.wrtUserNm}"></th:block>
</td> </td>
<td th:text="${#temporals.format(career.wrtDt, 'yyyy-MM-dd HH:mm:ss')}"></td> <td th:text="${#temporals.format(career.wrtDt, 'yyyy-MM-dd HH:mm:ss')}"></td>
<td> <td>
<button type="button" class="btn btn-sm btn-outline-danger deleteCareerBtn" <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> <i class="bi bi-trash"></i>
</button> </button>
</td> </td>
</th:block>
</tr> </tr>
</th:block>
</th:block>
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="11"> <td colspan="11">
<button type="button" class="btn btn-sm btn-primary careerAddBtn" th:data-careercd="${code.itemCd}">추가</button> <button type="button" class="btn btn-sm btn-primary careerAddBtn" th:data-careercd="${tabCode.itemCd}">추가</button>
</td> </td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
</div> </div>
</th:block> </th:block>
</th:block>
</div> </div>
</div> </div>
</div> </div>