강석 최 2022-10-12 17:40:51 +09:00
commit 79ae27796e
13 changed files with 389 additions and 28 deletions

View File

@ -2,10 +2,13 @@ package com.dbnt.faisp.equip;
import com.dbnt.faisp.authMgt.service.AuthMgtService;
import com.dbnt.faisp.equip.model.CellPhone;
import com.dbnt.faisp.equip.model.Equip;
import com.dbnt.faisp.equip.model.EquipLog;
import com.dbnt.faisp.equip.service.EquipService;
import com.dbnt.faisp.organMgt.service.OrganConfigService;
import com.dbnt.faisp.userInfo.model.UserInfo;
import com.dbnt.faisp.userInfo.service.UserInfoService;
import com.dbnt.faisp.util.ParamMap;
import com.dbnt.faisp.util.Utils;
@ -35,6 +38,8 @@ public class EquipController {
private final EquipService equipService;
private final AuthMgtService authMgtService;
private final OrganConfigService organConfigService;
private final UserInfoService userInfoService;
@GetMapping("/equipStatus")
public ModelAndView equipStatus(@AuthenticationPrincipal UserInfo loginUser, Equip equip) {
@ -204,6 +209,40 @@ public class EquipController {
}
}
@GetMapping("/cellPhoneList")
public ModelAndView cellPhoneList(@AuthenticationPrincipal UserInfo loginUser,CellPhone cellPhone) {
ModelAndView mav = new ModelAndView("equip/cellPhoneList");
//메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/cellPhoneList").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
cellPhone.setDownOrganCdList(loginUser.getDownOrganCdList());
cellPhone.setQueryInfo();
cellPhone.setPaginationInfo();
mav.addObject("searchParams", cellPhone);
return mav;
}
@GetMapping("/cellPhoneEditModal")
public ModelAndView cellPhoneEditModal(@AuthenticationPrincipal UserInfo loginUser,CellPhone cellPhone,String ogCd) {
ModelAndView mav = new ModelAndView("equip/cellPhoneEditModal");
//메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/equipStatus").get(0).getAccessAuth();
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
mav.addObject("userOrgan", loginUser.getOgCd());
mav.addObject("accessAuth", accessAuth);
//사용자 리스트
ParamMap param = new ParamMap();
param.put("downOrganCdList", organConfigService.selectDownOrganListWhereUserOgCd(ogCd));
mav.addObject("managerList", userInfoService.selectManagerList(param));
return mav;
}

View File

@ -0,0 +1,78 @@
package com.dbnt.faisp.equip.model;
import com.dbnt.faisp.config.BaseModel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.time.LocalDateTime;
@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "cellphone_mgt")
public class CellPhone extends BaseModel{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "phone_key")
private Integer phoneKey;
@Column(name = "mgt_organ")
private String mgtOrgan;
@Column(name = "tel_no")
private String telNo;
@Column(name = "p_user_seq")
private Integer pUserSeq;
@Column(name = "ext_mail")
private String extMail;
@Column(name = "webex_no")
private Integer webexNo;
@Column(name = "wrt_organ")
private String wrtOrgan;
@Column(name = "wrt_part")
private String wrtPart;
@Column(name = "wrt_user_seq")
private String wrtUserSeq;
@Column(name = "wrt_nm")
private String wrtNm;
@Column(name = "wrt_dt")
private LocalDateTime wrtDt;
}

View File

@ -9,6 +9,7 @@ import com.dbnt.faisp.fipTarget.model.PartWorkFile;
import com.dbnt.faisp.fipTarget.service.FipTargetService;
import com.dbnt.faisp.organMgt.service.OrganConfigService;
import com.dbnt.faisp.userInfo.model.UserInfo;
import com.dbnt.faisp.userInfo.service.UserInfoService;
import com.dbnt.faisp.util.ParamMap;
import com.dbnt.faisp.util.Utils;
@ -41,6 +42,7 @@ public class FipTargetController {
private final OrganConfigService organConfigService;
private final AuthMgtService authMgtService;
private final FipTargetService fipTargetService;
private final UserInfoService userInfoService;
// 외사분실운영현황 시작
@GetMapping("/partInfoList")
@ -107,7 +109,7 @@ public class FipTargetController {
ModelAndView mav = new ModelAndView("fipTarget/partInfoSelecBox");
ParamMap param = new ParamMap();
param.put("downOrganCdList", organConfigService.selectDownOrganListWhereUserOgCd(ogCd));
mav.addObject("managerList", fipTargetService.selectPartInfoManagerList(param));
mav.addObject("managerList", userInfoService.selectManagerList(param));
return mav;
}
@ -129,7 +131,7 @@ public class FipTargetController {
PartInfo partInfoView = fipTargetService.selectPartInfo(partInfo);
ParamMap param = new ParamMap();
param.put("downOrganCdList", organConfigService.selectDownOrganListWhereUserOgCd(partInfoView.getMgtOrgan()));
mav.addObject("managerList", fipTargetService.selectPartInfoManagerList(param));
mav.addObject("managerList", userInfoService.selectManagerList(param));
partInfoView.setFileList(fipTargetService.selectPartInfoFile(partInfo));
mav.addObject("partInfo", partInfoView);
//메뉴권한 확인

View File

@ -3,9 +3,6 @@ package com.dbnt.faisp.fipTarget.service;
import com.dbnt.faisp.config.BaseService;
import com.dbnt.faisp.config.FileInfo;
import com.dbnt.faisp.equip.model.Equip;
import com.dbnt.faisp.equip.model.Equip.EquipId;
import com.dbnt.faisp.fipTarget.mapper.FipTargetMapper;
import com.dbnt.faisp.fipTarget.model.PartInfo;
import com.dbnt.faisp.fipTarget.model.PartInfo.PartInfoId;
@ -19,7 +16,6 @@ import com.dbnt.faisp.fipTarget.repository.PartInfoFileRepository;
import com.dbnt.faisp.fipTarget.repository.PartInfoRepository;
import com.dbnt.faisp.fipTarget.repository.PartWorkFileRepository;
import com.dbnt.faisp.fipTarget.repository.PartWorkRepository;
import com.dbnt.faisp.publicBoard.model.PublicFile;
import com.dbnt.faisp.util.ParamMap;
import lombok.RequiredArgsConstructor;
@ -27,12 +23,9 @@ import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.time.LocalDateTime;
import java.util.*;
@Service
@ -47,10 +40,6 @@ public class FipTargetService extends BaseService {
private final PartWorkFileRepository partWorkFileRepository;
private final FipTargetMapper fipTargetMapper;
public List<ParamMap> selectPartInfoManagerList(ParamMap param) {
return fipTargetMapper.selectPartInfoManagerList(param);
}
@Transactional
public void savePartInfo(PartInfo partInfo) {
PartInfo dbPart = partInfoRepository.findFirstByOrderByPiSeqDesc();

View File

@ -1,6 +1,8 @@
package com.dbnt.faisp.userInfo.mapper;
import com.dbnt.faisp.userInfo.model.UserInfo;
import com.dbnt.faisp.util.ParamMap;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@ -10,4 +12,6 @@ public interface UserInfoMapper {
List<UserInfo> selectUserInfoList(UserInfo userInfo);
Integer selectUserInfoListCnt(UserInfo userInfo);
List<ParamMap> selectManagerList(ParamMap param);
}

View File

@ -4,6 +4,8 @@ import com.dbnt.faisp.config.Role;
import com.dbnt.faisp.userInfo.mapper.UserInfoMapper;
import com.dbnt.faisp.userInfo.model.UserInfo;
import com.dbnt.faisp.userInfo.repository.UserInfoRepository;
import com.dbnt.faisp.util.ParamMap;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
@ -107,4 +109,7 @@ public class UserInfoService implements UserDetailsService {
public void userDelete(List<UserInfo> userInfo) {
userInfoRepository.deleteAll(userInfo);
}
public List<ParamMap> selectManagerList(ParamMap param) {
return userInfoMapper.selectManagerList(param);
}
}

View File

@ -5,18 +5,6 @@
<mapper namespace="com.dbnt.faisp.fipTarget.mapper.FipTargetMapper">
<select id="selectPartInfoManagerList" resultType="com.dbnt.faisp.util.ParamMap" parameterType="com.dbnt.faisp.util.ParamMap">
select user_seq,
user_id
user_name
from user_info
where og_cd in
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
order by user_nm asc
</select>
<select id="selectPartInfoList" resultType="PartInfo" parameterType="PartInfo">
select pi.pi_seq,
version_no,

View File

@ -66,4 +66,16 @@
and ofc_cd = #{ofcCd}
</if>
</select>
<select id="selectManagerList" resultType="com.dbnt.faisp.util.ParamMap" parameterType="com.dbnt.faisp.util.ParamMap">
select user_seq,
user_id
user_name
from user_info
where og_cd in
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
order by user_nm asc
</select>
</mapper>

View File

@ -0,0 +1,46 @@
$(document).on('click', '#addEquip', function (){
$.ajax({
url: '/equip/cellPhoneEditModal',
type: 'GET',
dataType:"html",
success: function(html){
$("#cellPhoneEditModalContent").empty().append(html);
$("#cellPhoneEditModal").modal('show');
},
error:function(){
}
});
})
$(document).on('change', '#mgtOrgan', function (){
const ogCd = $(this).val();
if(ogCd != ''){
changeManager(ogCd);
}else{
$("#pUserSeq").prop('disabled',true);
$("#pUserSeq").val('');
}
});
function changeManager(ogCd){
$.ajax({
url: '/target/partInfoSelecBox',
data: {
ogCd,
},
type: 'GET',
dataType:"html",
success: function(html){
$("#pUserSeq").empty().append(html);
$("#pUserSeq").prop('disabled',false);
},
error:function(){
}
});
}

View File

@ -191,7 +191,7 @@ function contentCheck(){
alert("검거유형2를 선택해주세요.")
flag = false;
}
else if(!$("#relatedReport").is(':checked')) {
else if(!$("#relatedReport").is(':checked') && $("input[name='ivsgtType']").val() != "arrest") {
if ($('input[name="relatedReportsText"]').length < 1) {
alert("연관보고서를 확인해 주세요.")
flag = false;

View File

@ -0,0 +1,81 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header">
<h5 class="modal-title" id="menuEditModalLabel">등록</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="equipEditForm" th:action="@{/equip/saveEquip}" method="post" enctype="multipart/form-data">
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<div class="row mb-3">
<label for="cat1Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">관리처</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" id="mgtOrgan" name="mgtOrgan" th:disabled="${accessAuth ne 'ACC003'}">
<option value="">선택</option>
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
<th:block th:if="${#lists.contains(mgtOrganList, commonCode.itemCd)}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq userOrgan}"></option>
</th:block>
</th:block>
</select>
</div>
</div>
<div class="mb-2 row">
<label for="ogCd" class="col-sm-2 col-form-label text-center">담당자</label>
<div class="col-sm-3">
<select class="form-select form-select-sm" id="pUserSeq" name="pUserSeq" disabled>
<option value="">선택</option>
</select>
</div>
</div>
<div class="row mb-3">
<label for="cat1Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">분류</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" id="equType" name="equType">
<option value="">-분류 선택-</option>
<th:block th:each="commonCode:${session.commonCode.get('IT')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
</select>
</div>
</div>
<div class="row mb-3">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">취득연도</label>
<div class="col-sm-6">
<input type="text" class="form-control storedYear" name="storedYear">
</div>
</div>
<div class="row mb-3">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">보유량</label>
<div class="col-sm-6">
<input type="number" class="form-control" id="itemQty" name="itemQty" placeholder="수량 직접입력">
</div>
</div>
<div class="row mb-3">
<label for="cat2Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">상태</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" name="itemCondition">
<option value="">상태 선택</option>
<th:block th:each="commonCode:${session.commonCode.get('ITCON')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
</select>
</div>
</div>
<div class="row mb-3">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">비고</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="note">
</div>
</div>
</form>
</div>
<div class="modal-footer justify-content-between">
<div class="col-auto">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
<button type="button" class="btn btn-primary" id="saveEquip">저장</button>
</div>
</div>
</html>

View File

@ -0,0 +1,117 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
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/equip/cellPhone.js}"></script>
</th:block>
<div layout:fragment="content">
<main class="pt-3">
<h4>업무용 휴대전화 현황</h4>
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<div class="row mx-0">
<div class="col-12 card text-center">
<div class="card-body">
<form method="get" th:action="@{/equip/List}">
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
<div class="row justify-content-between pe-3 py-1">
<div class="col-auto">
<select class="form-select" name="rowCnt" id="rowCnt">
<th:block th:each="num : ${#numbers.sequence(1,5)}">
<option th:value="${num*10}" th:text="${num*10}" th:selected="${searchParams.rowCnt==num*10}"></option>
</th:block>
</select>
</div>
<div class="col-auto">
<div class="row justify-content-end">
<div class="col-auto">
<input type="text" class="form-control form-control-sm">
</div>
<input type="submit" class="btn btn-sm btn-primary col-auto" id="searchBtn" value="검색">
</div>
</div>
</div>
</form>
<div class="row justify-content-start">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row">
<table class="table table-striped">
<thead>
<tr>
<th> <input type="checkbox" id="chk-all" class="equInfoCheckBox"></th>
<th>연번</th>
<th>소속</th>
<th>전화번호</th>
<th>사용자(관리자)</th>
<th>등록 외부메일</th>
<th>웹엑스 미팅번호</th>
<th>카카오톡 ID</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="checkbox" name="equChk" class="equInfoCheckBox">
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-auto">
<button type="button" class="btn btn-success"id="addEquip" th:unless="${accessAuth eq 'ACC001'}">등록</button>
</div>
<div class="row justify-content-center">
<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">&laquo;</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">&raquo;</span>
</a>
</li>
</th:block>
</ul>
</nav>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<div class="modal fade" id="cellPhoneEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="userEditModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-scrollable">
<div class="modal-content" id="cellPhoneEditModalContent">
<div class="modal-header">
</div>
<div class="modal-body">
<div class="tab-content border border-top-0" id="configCellPhone">
</div>
</div>
</div>
</div>
</div>
</div>
</html>

View File

@ -58,13 +58,13 @@
<div class="mb-3 row">
<label for="contentInfoDiv" class="col-sm-2 col-form-label text-center">사건개요</label>
<div class="col-sm-10" id="contentInfoDiv">
<textarea type='text' class="col-sm-10" name='contentInfos'th:utext="${boardInvestigation.contentInfo}" readonly></textarea>
<div type='text' class="col-sm-10" name='contentInfos'th:utext="${boardInvestigation.contentInfo}" readonly></div>
</div>
</div>
<div class="mb-3 row">
<label for="contentMainDiv" class="col-sm-2 col-form-label text-center">주요내용</label>
<div class="col-sm-10" id="contentMainDiv">
<textarea type='text' class="col-sm-10" name='contentMain' th:utext="${boardInvestigation.contentMain}" readonly></textarea>
<div type='text' class="col-sm-10" name='contentMain' th:utext="${boardInvestigation.contentMain}" readonly></div>
</div>
</div>
</div>