외사경찰 정원/현원 작업중.
parent
caac765231
commit
e59b0d3fa9
|
|
@ -7,6 +7,7 @@ import com.dbnt.faisp.main.codeMgt.model.CodeMgt;
|
|||
import com.dbnt.faisp.main.codeMgt.service.CodeMgtService;
|
||||
import com.dbnt.faisp.main.fipTarget.model.PartInfo;
|
||||
import com.dbnt.faisp.main.fipTarget.model.ShipInfo;
|
||||
import com.dbnt.faisp.main.userInfo.model.PersonnelStatus;
|
||||
import com.dbnt.faisp.main.userInfo.model.UserInfo;
|
||||
import com.dbnt.faisp.main.userInfo.model.UserInfoHistory;
|
||||
import com.dbnt.faisp.main.userInfo.service.UserInfoService;
|
||||
|
|
@ -16,6 +17,7 @@ import com.dbnt.faisp.util.Utils;
|
|||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
|
@ -149,11 +151,20 @@ public class FaispController {
|
|||
}
|
||||
|
||||
@GetMapping("/personnelStatus")
|
||||
public ModelAndView personnelStatus(@AuthenticationPrincipal UserInfo loginUser){
|
||||
public ModelAndView personnelStatus(@AuthenticationPrincipal UserInfo loginUser, PersonnelStatus personnelStatus){
|
||||
ModelAndView mav = new ModelAndView("faisp/personnelStatus");
|
||||
if(personnelStatus.getYear()==null){
|
||||
personnelStatus.setYear(Integer.toString(LocalDateTime.now().getYear()));
|
||||
}
|
||||
personnelStatus.setDownOrganCdList(loginUser.getDownOrganCdList());
|
||||
mav.addObject("searchParams", personnelStatus);
|
||||
List<CodeMgt> jtList = codeMgtService.selectCodeMgtList("JT");
|
||||
jtList.sort((o1, o2) -> o2.getItemCd().compareTo(o1.getItemCd()));
|
||||
mav.addObject("jtList", jtList);
|
||||
mav.addObject("mgtOgList", loginUser.getDownOrganCdList());
|
||||
List<PersonnelStatus> statusList = userInfoService.selectPersonnelStatusList(personnelStatus);
|
||||
statusList = calcStatusList(statusList);
|
||||
mav.addObject("statusList", statusList);
|
||||
return mav;
|
||||
}
|
||||
@GetMapping("/careerMgt")
|
||||
|
|
@ -196,4 +207,12 @@ public class FaispController {
|
|||
mav.addObject("searchParams", userInfo);
|
||||
return mav;
|
||||
}
|
||||
|
||||
private List<PersonnelStatus> calcStatusList(List<PersonnelStatus> statusList){
|
||||
for(PersonnelStatus status: statusList){
|
||||
status.setSumMax(status.getJt001Max()+status.getJt002Max()+status.getJt003Max()+status.getJt004Max()+status.getJt005Max()+status.getJt006Max()+status.getJt007Max());
|
||||
status.setSumNow(status.getJt001Now()+status.getJt002Now()+status.getJt003Now()+status.getJt004Now()+status.getJt005Now()+status.getJt006Now()+status.getJt007Now());
|
||||
}
|
||||
return statusList;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.dbnt.faisp.main.userInfo.mapper;
|
||||
|
||||
import com.dbnt.faisp.main.userInfo.model.DashboardConfig;
|
||||
import com.dbnt.faisp.main.userInfo.model.PersonnelStatus;
|
||||
import com.dbnt.faisp.main.userInfo.model.UserInfo;
|
||||
import com.dbnt.faisp.main.userInfo.model.UserInfoHistory;
|
||||
import com.dbnt.faisp.util.ParamMap;
|
||||
|
|
@ -26,4 +27,6 @@ public interface UserInfoMapper {
|
|||
List<UserInfoHistory> selectPoliceHisList(UserInfoHistory userInfoHistory);
|
||||
|
||||
UserInfoHistory selectpoliceHistoryView(UserInfoHistory userInfoHistory);
|
||||
|
||||
List<PersonnelStatus> selectPersonnelStatusList(PersonnelStatus personnelStatus);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
package com.dbnt.faisp.main.userInfo.model;
|
||||
|
||||
import com.dbnt.faisp.config.BaseModel;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name = "personnel_status")
|
||||
@IdClass(PersonnelStatus.personnelStatusId.class)
|
||||
public class PersonnelStatus extends BaseModel {
|
||||
@Id
|
||||
@Column(name = "year")
|
||||
private String year;
|
||||
@Id
|
||||
@Column(name = "og_cd")
|
||||
private String ogCd;
|
||||
@Id
|
||||
@Column(name = "version_no")
|
||||
private Integer versionNo;
|
||||
@Column(name = "jt007_max")
|
||||
private Integer jt007Max = 0;
|
||||
@Column(name = "jt007_now")
|
||||
private Integer jt007Now = 0;
|
||||
@Column(name = "jt006_max")
|
||||
private Integer jt006Max = 0;
|
||||
@Column(name = "jt006_now")
|
||||
private Integer jt006Now = 0;
|
||||
@Column(name = "jt005_max")
|
||||
private Integer jt005Max = 0;
|
||||
@Column(name = "jt005_now")
|
||||
private Integer jt005Now = 0;
|
||||
@Column(name = "jt004_max")
|
||||
private Integer jt004Max = 0;
|
||||
@Column(name = "jt004_now")
|
||||
private Integer jt004Now = 0;
|
||||
@Column(name = "jt003_max")
|
||||
private Integer jt003Max = 0;
|
||||
@Column(name = "jt003_now")
|
||||
private Integer jt003Now = 0;
|
||||
@Column(name = "jt002_max")
|
||||
private Integer jt002Max = 0;
|
||||
@Column(name = "jt002_now")
|
||||
private Integer jt002Now = 0;
|
||||
@Column(name = "jt001_max")
|
||||
private Integer jt001Max = 0;
|
||||
@Column(name = "jt001_now")
|
||||
private Integer jt001Now = 0;
|
||||
@Column(name = "organ_cd")
|
||||
private String organCd;
|
||||
@Column(name = "part_cd")
|
||||
private String partCd;
|
||||
@Column(name = "wrt_user_seq")
|
||||
private Integer wrtUserSeq;
|
||||
@Column(name = "wrt_user_grd")
|
||||
private String wrtUserGrd;
|
||||
@Column(name = "wrt_user_nm")
|
||||
private String wrtUserNm;
|
||||
@Column(name = "wrt_dt")
|
||||
private LocalDateTime wrtDt;
|
||||
|
||||
@Transient
|
||||
private Integer sumMax;
|
||||
@Transient
|
||||
private Integer sumNow;
|
||||
@Embeddable
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class personnelStatusId implements Serializable {
|
||||
private String year;
|
||||
private String ogCd;
|
||||
private Integer versionNo;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.dbnt.faisp.main.userInfo.repository;
|
||||
|
||||
import com.dbnt.faisp.main.userInfo.model.PersonnelStatus;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface PersonnelStatusRepository extends JpaRepository<PersonnelStatus, PersonnelStatus.personnelStatusId> {
|
||||
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@ import com.dbnt.faisp.main.fipTarget.model.PartInfo;
|
|||
import com.dbnt.faisp.main.fipTarget.model.ShipInfo;
|
||||
import com.dbnt.faisp.main.userInfo.mapper.UserInfoMapper;
|
||||
import com.dbnt.faisp.main.userInfo.model.DashboardConfig;
|
||||
import com.dbnt.faisp.main.userInfo.model.PersonnelStatus;
|
||||
import com.dbnt.faisp.main.userInfo.model.UserInfo;
|
||||
import com.dbnt.faisp.main.userInfo.model.UserInfoHistory;
|
||||
import com.dbnt.faisp.main.userInfo.repository.DashboardConfigRepository;
|
||||
|
|
@ -291,4 +292,8 @@ public class UserInfoService implements UserDetailsService {
|
|||
public String selectuserStatus(UserInfoHistory userInfoHistory) {
|
||||
return userInfoRepository.getUserStatus(userInfoHistory.getUserSeq());
|
||||
}
|
||||
|
||||
public List<PersonnelStatus> selectPersonnelStatusList(PersonnelStatus personnelStatus) {
|
||||
return userInfoMapper.selectPersonnelStatusList(personnelStatus);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,4 +184,48 @@
|
|||
where user_seq = #{userSeq}
|
||||
and version_no = #{versionNo}
|
||||
</select>
|
||||
<select id="selectPersonnelStatusList" parameterType="PersonnelStatus" resultType="PersonnelStatus">
|
||||
select
|
||||
case
|
||||
when a.year is null then #{year}
|
||||
else a.year
|
||||
end as year,
|
||||
case
|
||||
when a.og_cd is null then c.organ_cd
|
||||
else a.og_cd
|
||||
end as og_cd,
|
||||
a.version_no,
|
||||
jt007_max,
|
||||
jt007_now,
|
||||
jt006_max,
|
||||
jt006_now,
|
||||
jt005_max,
|
||||
jt005_now,
|
||||
jt004_max,
|
||||
jt004_now,
|
||||
jt003_max,
|
||||
jt003_now,
|
||||
jt002_max,
|
||||
jt002_now,
|
||||
jt001_max,
|
||||
jt001_now,
|
||||
a.organ_cd,
|
||||
part_cd,
|
||||
wrt_user_seq,
|
||||
wrt_user_grd,
|
||||
wrt_user_nm,
|
||||
wrt_dt
|
||||
from personnel_status a
|
||||
inner join (select year, og_cd, max(version_no) as version_no
|
||||
from personnel_status
|
||||
group by year, og_cd) b
|
||||
on a.year = b.year and a.og_cd = b.og_cd and a.version_no = b.version_no
|
||||
right outer join organ_config c
|
||||
on a.og_cd = c.organ_cd and a.year = #{year}
|
||||
where c.organ_cd in
|
||||
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by c.organ_type, c.parent_organ, c.organ_cd
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
$(document).on('change', '#year', function (){
|
||||
$("#searchFm").submit();
|
||||
})
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
layout:decorate="~{layout/layout}">
|
||||
<th:block layout:fragment="script">
|
||||
<script type="text/javascript" th:src="@{/js/faisp/police.js}"></script>
|
||||
<script type="text/javascript" th:src="@{/js/faisp/personnelStatus.js}"></script>
|
||||
</th:block>
|
||||
<div layout:fragment="content">
|
||||
<main class="pt-3">
|
||||
|
|
@ -13,14 +13,13 @@
|
|||
<div class="row mx-0">
|
||||
<div class="col-12 card text-center">
|
||||
<div class="card-body">
|
||||
<form id="searchFm" method="get" th:action="@{/faisp/policeList}">
|
||||
<form id="searchFm" method="get" th:action="@{/faisp/personnelStatus}">
|
||||
<div class="row justify-content-start pe-3 py-1">
|
||||
<div class="col-auto">
|
||||
<select class="form-select" name="rowCnt" id="rowCnt">
|
||||
<option value="">연도</option>
|
||||
<!--<th:block th:each="year : ${#numbers.sequence(2020, 2030)}">
|
||||
<option th:value="${year}" th:text="${year}" th:selected="${searchParams.year eq year}"></option>
|
||||
</th:block>-->
|
||||
<select class="form-select" name="year" id="year">
|
||||
<th:block th:each="year : ${#numbers.sequence(2020, 2040)}">
|
||||
<option th:value="${year}" th:text="${year}" th:selected="${#strings.toString(year) eq searchParams.year}"></option>
|
||||
</th:block>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -55,82 +54,42 @@
|
|||
<th>cnt</th>
|
||||
<th>cnt</th>
|
||||
<th:block th:each="code:${jtList}">
|
||||
<th>정원</th>
|
||||
<th>현원</th>
|
||||
<th>cnt</th>
|
||||
<th>cnt</th>
|
||||
</th:block>
|
||||
<th>cnt</th>
|
||||
<th>cnt</th>
|
||||
<th>cnt</th>
|
||||
<th>cnt</th>
|
||||
<th>cnt</th>
|
||||
<th>cnt</th>
|
||||
<th>cnt</th>
|
||||
<th>cnt</th>
|
||||
<th>cnt</th>
|
||||
<th>cnt</th>
|
||||
<th>cnt</th>
|
||||
<th>cnt</th>
|
||||
<th>cnt</th>
|
||||
<th>cnt</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="table-group-divider">
|
||||
<!--<tr class="policeTr" th:each="list:${policeList}">
|
||||
<th:block>
|
||||
<input type="hidden" class="userSeq" th:value="${list.userSeq}">
|
||||
<tr class="statusTr" th:each="status:${statusList}">
|
||||
<th:block th:each="code:${session.commonCode.get('OG')}">
|
||||
<th:block th:if="${code.itemCd eq status.ogCd}">
|
||||
<td th:text="${code.itemValue}"></td>
|
||||
</th:block>
|
||||
</th:block>
|
||||
<td th:text="${list.rownum}"></td>
|
||||
<td th:text="${list.titleCd}"></td>
|
||||
<td th:text="${list.userNm}"></td>
|
||||
<td th:text="${list.organNm}"></td>
|
||||
<td th:text="${list.ofcCd}"></td>
|
||||
<td th:text="${list.birthDate}"></td>
|
||||
<td th:text="${list.sex}"></td>
|
||||
<td th:text="${list.policeInDate}"></td>
|
||||
<td th:text="${list.titleInDate}"></td>
|
||||
<td th:text="${list.ofcInDate}"></td>
|
||||
<td th:text="${list.outturnCd}"></td>
|
||||
<td></td>
|
||||
<td th:text="${list.jobInCd}"></td>
|
||||
<td th:text="${#temporals.format(list.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
|
||||
<th:block th:if="${userStatus eq 'USC003'} and ${accessAuth eq 'ACC003'}">
|
||||
<td class="checkBoxTd"><input type="checkbox" name="policeChk" class="policeCheckBox"></td>
|
||||
</th:block>
|
||||
<th:block th:if="${accessAuth eq 'ACC003'} and (${userStatus eq 'USC006'} or ${userStatus eq 'USC007'})">
|
||||
<td class="checkBoxTd"><input type="checkbox" name="policeChk" class="policeCheckBox"></td>
|
||||
</th:block>
|
||||
</tr>-->
|
||||
<td th:text="${status.sumMax}"></td>
|
||||
<td th:text="${status.sumNow}"></td>
|
||||
<td th:text="${status.sumNow-status.sumMax}" th:classappend="${status.sumNow-status.sumMax>0?'text-primary':'text-danger'}"></td>
|
||||
<th th:text="${status.jt007Max}"></th>
|
||||
<th th:text="${status.jt007Now}"></th>
|
||||
<th th:text="${status.jt006Max}"></th>
|
||||
<th th:text="${status.jt006Now}"></th>
|
||||
<th th:text="${status.jt005Max}"></th>
|
||||
<th th:text="${status.jt005Now}"></th>
|
||||
<th th:text="${status.jt004Max}"></th>
|
||||
<th th:text="${status.jt004Now}"></th>
|
||||
<th th:text="${status.jt003Max}"></th>
|
||||
<th th:text="${status.jt003Now}"></th>
|
||||
<th th:text="${status.jt002Max}"></th>
|
||||
<th th:text="${status.jt002Now}"></th>
|
||||
<th th:text="${status.jt001Max}"></th>
|
||||
<th th:text="${status.jt001Now}"></th>
|
||||
<td th:text="${#temporals.format(status.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row justify-content-between">
|
||||
<div class="col-auto">
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<nav aria-label="Page navigation">
|
||||
<!--<ul class="pagination">
|
||||
<th:block th:if="${searchParams.pageIndex>3}">
|
||||
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)-3}">
|
||||
<a class="page-link" href="#" aria-label="Previous">
|
||||
<span aria-hidden="true">«</span>
|
||||
</a>
|
||||
</li>
|
||||
</th:block>
|
||||
<th:block th:each="num : ${#numbers.sequence(searchParams.startNum, searchParams.endNum)}">
|
||||
<li class="page-item" th:data-pageindex="${num}" th:classappend="${searchParams.pageIndex==num?'active':''}">
|
||||
<a class="page-link" href="#" th:text="${num}"></a>
|
||||
</li>
|
||||
</th:block>
|
||||
<th:block th:if="${searchParams.maxNum>searchParams.endNum+2}">
|
||||
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)+3}">
|
||||
<a class="page-link" href="#" aria-label="Next">
|
||||
<span aria-hidden="true">»</span>
|
||||
</a>
|
||||
</li>
|
||||
</th:block>
|
||||
</ul>-->
|
||||
</nav>
|
||||
</div>
|
||||
<div class="row justify-content-end">
|
||||
<div class="col-auto">
|
||||
<button type="button" class="btn btn-sm btn-primary">등록</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue