첩보수집활동 외사경찰견문 월간계획 페이지 작업완료.

강석 최 2022-09-16 14:35:56 +09:00
parent 58098f139c
commit f6ab73a07c
10 changed files with 203 additions and 151 deletions

View File

@ -60,6 +60,7 @@ public class FpiMgtController { // 외사경찰견문관리
planBoard = monthPlanService.selectPlanBoard(planBoard.getPlanKey());
}else{
planBoard.setWrtOrgan(loginUser.getOgCd());
planBoard.setWrtPart(loginUser.getOfcCd());
planBoard.setWrtUserSeq(loginUser.getUserSeq());
planBoard.setWrtUserNm(loginUser.getUserNm());
planBoard.setWrtDt(LocalDateTime.now());
@ -69,10 +70,17 @@ public class FpiMgtController { // 외사경찰견문관리
}
@GetMapping("/planViewModal")
public ModelAndView planViewModal(PlanBoard planBoard){
public ModelAndView planViewModal(@AuthenticationPrincipal UserInfo loginUser, PlanBoard planBoard){
ModelAndView mav = new ModelAndView("igActivities/fpiMgt/affairPlan/planViewModal");
planBoard = monthPlanService.selectPlanBoard(planBoard.getPlanKey());
mav.addObject("plan", planBoard);
mav.addObject("userSeq",loginUser.getUserSeq());
Map<String, Object> params = new HashMap<>();
params.put("userSeq", loginUser.getUserSeq());
params.put("menuUrl", "/fpiMgt/monthPlanPage");
//메뉴권한 확인
mav.addObject("accessAuth", authMgtService.selectAccessConfigList(params).get(0).getAccessAuth());
mav.addObject("approvalAuth", authMgtService.selectApprovalConfigList(params).get(0).getApprovalAuth());
return mav;
}
@ -107,7 +115,12 @@ public class FpiMgtController { // 외사경찰견문관리
//결재권한 확인
String apprvAuth = authMgtService.selectApprovalConfigList(params).get(0).getApprovalAuth();
if(apprvAuth==null) {
planBoard.setWrtUserSeq(loginUser.getUserSeq());
if(!accessAuth.equals("ACC003")){
planBoard.setWrtUserSeq(loginUser.getUserSeq());
planBoard.setUserType("normalStayList");
}else{
planBoard.setUserType("managerStayList");
}
}else{
mav.addObject("userNm", loginUser.getUserNm());
switch (apprvAuth){
@ -160,17 +173,21 @@ public class FpiMgtController { // 외사경찰견문관리
//결재권한 확인
String apprvAuth = authMgtService.selectApprovalConfigList(params).get(0).getApprovalAuth();
if(apprvAuth==null) {
planBoard.setWrtUserSeq(loginUser.getUserSeq());
planBoard.setUserType("normal");
if(!accessAuth.equals("ACC003")){
planBoard.setWrtUserSeq(loginUser.getUserSeq());
planBoard.setUserType("normalCommitList");
}else{
planBoard.setUserType("managerCommitList");
}
}else{
switch (apprvAuth) {
case "APC004": // 계장대행
case "APC003": // 계장 // 계장반려, 계장승인 문서 조회
planBoard.setUserType("section");
planBoard.setUserType("sectionCommitList");
break;
case "APC002": // 부장대행
case "APC001": // 부장 // 부장반려, 부장승인 문서 조회
planBoard.setUserType("head");
planBoard.setUserType("headCommitList");
break;
}
}

View File

@ -33,6 +33,8 @@ public class PlanBoard extends BaseModel {
private LocalDate planDt;
@Column(name = "wrt_organ")
private String wrtOrgan;
@Column(name = "wrt_part")
private String wrtPart;
@Column(name = "wrt_user_nm")
private String wrtUserNm;
@Column(name = "wrt_dt")
@ -50,6 +52,8 @@ public class PlanBoard extends BaseModel {
@Transient
private List<PlanMainInfo> mainInfoList;
@Transient
private List<PlanApprv> apprvList;
@Transient
private List<PlanFile> fileList;
@Transient
private List<MultipartFile> multipartFileList;

View File

@ -3,9 +3,12 @@ package com.dbnt.faisp.fpiMgt.monthPlan.repository;
import com.dbnt.faisp.fpiMgt.monthPlan.model.PlanApprv;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
import java.util.Optional;
public interface PlanApprvRepository extends JpaRepository<PlanApprv, PlanApprv.PlanApprvId> {
Optional<PlanApprv> findTopByPlanKeyOrderByApprvSeqDesc(Integer planKey);
List<PlanApprv> findByPlanKey(Integer planKey);
}

View File

@ -36,6 +36,7 @@ public class MonthPlanService extends BaseService {
if (savedPlan != null) {
savedPlan.setFileList(planFileRepository.findByPlanKey(planKey));
savedPlan.setMainInfoList(planMainInfoRepository.findByPlanKey(planKey));
savedPlan.setApprvList(planApprvRepository.findByPlanKey(planKey));
}
return savedPlan;
}

View File

@ -44,13 +44,22 @@
</foreach>
</if>
<if test='userType != null and userType != ""'>
<if test='userType == "normal"'>
<if test='userType == "normalStayList"'>
and a.plan_state in ('DST002', 'DST004')
</if>
<if test='userType == "normalCommitList"'>
and a.plan_state in ('DST003', 'DST005', 'DST006')
</if>
<if test='userType == "sectionCommitList"'>
and a.plan_state in ('DST003', 'DST004', 'DST005', 'DST006')
</if>
<if test='userType == "section"'>
and a.plan_state in ('DST003', 'DST004', 'DST005', 'DST006')
<if test='userType == "headCommitList"'>
and a.plan_state in ('DST003', 'DST005', 'DST006')
</if>
<if test='userType == "head"'>
<if test='userType == "managerStayList"'>
and a.plan_state in ('DST002', 'DST004')
</if>
<if test='userType == "managerCommitList"'>
and a.plan_state in ('DST003', 'DST005', 'DST006')
</if>
</if>
@ -62,7 +71,9 @@
a.plan_state,
a.plan_dt,
a.wrt_organ,
a.wrt_part,
a.wrt_user_nm,
a.wrt_user_seq,
a.wrt_dt,
b.fileCnt
from plan_board a

View File

@ -90,6 +90,8 @@
<th></th>
<th>제목</th>
<th>시행일자</th>
<th>관서</th>
<th>부서</th>
<th>작성자</th>
<th>작성일시</th>
<th>첨부파일</th>
@ -102,6 +104,12 @@
<td><input type="checkbox" class="trChkBox"></td>
<td th:text="${plan.contentTitle}"></td>
<td th:text="${#temporals.format(plan.planDt, 'yyyy-MM-dd')}"></td>
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
<td th:if="${plan.wrtOrgan eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block>
<th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<td th:if="${plan.wrtPart eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block>
<td th:text="${plan.wrtUserNm}"></td>
<td th:text="${#temporals.format(plan.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
<td th:text="${plan.fileCnt eq null?'파일 없음':#strings.concat(plan.fileCnt,' 건')}"></td>
@ -158,18 +166,8 @@
<div class="modal fade" id="planViewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="planViewModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="planViewModalLabel">월간 계획 열람</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="planViewBody">
<div class="modal-content" id="planViewBody">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-warning" id="editPlanBtn" th:unless="${accessAuth eq 'ACC001'}">수정</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
</div>
</div>
</div>
</div>

View File

@ -90,6 +90,8 @@
<th></th>
<th>제목</th>
<th>시행일자</th>
<th>관서</th>
<th>부서</th>
<th>작성자</th>
<th>작성일시</th>
<th>첨부파일</th>
@ -102,6 +104,12 @@
<td><input type="checkbox" class="trChkBox"></td>
<td th:text="${plan.contentTitle}"></td>
<td th:text="${#temporals.format(plan.planDt, 'yyyy-MM-dd')}"></td>
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
<td th:if="${plan.wrtOrgan eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block>
<th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<td th:if="${plan.wrtPart eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block>
<td th:text="${plan.wrtUserNm}"></td>
<td th:text="${#temporals.format(plan.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
<td th:text="${plan.fileCnt eq null?'파일 없음':#strings.concat(plan.fileCnt,' 건')}"></td>
@ -165,18 +173,8 @@
</div>
<div class="modal fade" id="planViewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="planViewModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="planViewModalLabel">월간 계획 열람</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="planViewBody">
<div class="modal-content" id="planViewBody">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-warning" id="editPlanBtn" th:unless="${accessAuth eq 'ACC001'}">수정</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
</div>
</div>
</div>
</div>

View File

@ -10,6 +10,7 @@
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input type="hidden" name="planKey" th:value="${plan.planKey}">
<input type="hidden" name="wrtOrgan" th:value="${plan.wrtOrgan}">
<input type="hidden" name="wrtPart" th:value="${plan.wrtPart}">
<input type="hidden" name="wrtUserSeq" th:value="${plan.wrtUserSeq}">
<input type="hidden" name="planState" id="planState" th:value="${plan.planState}">
<div class="mb-3 row">

View File

@ -1,98 +1,138 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<input type="hidden" name="planKey" id="viewModalPlanKey" th:value="${plan.planKey}">
<input type="hidden" name="wrtOrgan" th:value="${plan.wrtOrgan}">
<input type="hidden" name="planState" id="planState" th:value="${plan.planState}">
<div class="mb-3 row">
<label for="wrtUserNm" class="col-sm-1 col-form-label text-center">작성자</label>
<div class="col-sm-2">
<input type="text" class="form-control border-0" id="wrtUserNm" name="wrtUserNm" th:value="${plan.wrtUserNm}" readonly>
</div>
<label for="wrtDt" class="col-sm-1 col-form-label text-center">작성일시</label>
<div class="col-sm-2">
<input type="text" class="form-control border-0" id="wrtDt" name="wrtDt" th:value="${#temporals.format(plan.wrtDt, 'yyyy-MM-dd HH:mm')}" readonly>
</div>
<label for="planDt" class="col-sm-1 col-form-label text-center">시행일자</label>
<div class="col-sm-2">
<input type="text" class="form-control border-0" id="planDt" name="planDt" th:value="${#temporals.format(plan.planDt, 'yyyy-MM-dd')}" readonly>
</div>
<label for="planState" class="col-sm-1 col-form-label text-center">상태</label>
<div class="col-sm-2">
<th:block th:if="${plan.planState eq 'DST001'}">
<input type="text" class="form-control border-0" value="임시저장" readonly>
</th:block>
<th:block th:if="${plan.planState eq 'DST002'}">
<input type="text" class="form-control border-0" value="결재대기" readonly>
</th:block>
<th:block th:if="${plan.planState eq 'DST003'}">
<input type="text" class="form-control border-0" value="계장결재" readonly>
</th:block>
<th:block th:if="${plan.planState eq 'DST004'}">
<input type="text" class="form-control border-0" value="계장반려" readonly>
</th:block>
<th:block th:if="${plan.planState eq 'DST005'}">
<input type="text" class="form-control border-0" value="부장결재" readonly>
</th:block>
<th:block th:if="${plan.planState eq 'DST006'}">
<input type="text" class="form-control border-0" value="부장반려" readonly>
</th:block>
</div>
<div class="modal-header">
<h5 class="modal-title" id="planViewModalLabel">월간 계획 열람</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<hr>
<div class="row">
<div class="col-8">
<div class="mb-3 row">
<label for="contentTitle" class="col-sm-2 col-form-label text-center">제목</label>
<div class="col-sm-10">
<input type="text" class="form-control border-0" id="contentTitle" name="contentTitle" th:value="${plan.contentTitle}" readonly>
</div>
</div>
<hr>
<div class="mb-3 row">
<label for="planDiv" class="col-sm-2 col-form-label text-center">주요<br>사업계획</label>
<div class="col-sm-10" id="planDiv">
<th:block th:each="infoList:${plan.mainInfoList}">
<th:block th:if="${infoList.planType eq 'S'}">
<input type="text" class="form-control border-0" name="planInfo" th:value="${infoList.planInfo}" readonly>
<div class="modal-body">
<div class="row">
<div class="col-12">
<input type="hidden" name="planKey" id="viewModalPlanKey" th:value="${plan.planKey}">
<input type="hidden" name="wrtOrgan" th:value="${plan.wrtOrgan}">
<input type="hidden" name="planState" id="planState" th:value="${plan.planState}">
<div class="mb-3 row">
<label for="wrtUserNm" class="col-sm-1 col-form-label text-center">작성자</label>
<div class="col-sm-2">
<input type="text" class="form-control border-0" id="wrtUserNm" name="wrtUserNm" th:value="${plan.wrtUserNm}" readonly>
</div>
<label for="wrtDt" class="col-sm-1 col-form-label text-center">작성일시</label>
<div class="col-sm-2">
<input type="text" class="form-control border-0" id="wrtDt" name="wrtDt" th:value="${#temporals.format(plan.wrtDt, 'yyyy-MM-dd HH:mm')}" readonly>
</div>
<label for="planDt" class="col-sm-1 col-form-label text-center">시행일자</label>
<div class="col-sm-2">
<input type="text" class="form-control border-0" id="planDt" name="planDt" th:value="${#temporals.format(plan.planDt, 'yyyy-MM-dd')}" readonly>
</div>
<label for="planState" class="col-sm-1 col-form-label text-center">상태</label>
<div class="col-sm-2">
<th:block th:each="commonCode:${session.commonCode.get('DST')}">
<input type="text" class="form-control border-0" th:if="${commonCode.itemCd eq plan.planState}" th:value="${commonCode.itemValue}" readonly>
</th:block>
</th:block>
</div>
</div>
</div>
<hr>
<div class="mb-3 row">
<label for="detailPlanDiv" class="col-sm-2 col-form-label text-center">사업개요<br><br>추진계획</label>
<div class="col-sm-10" id="detailPlanDiv">
<th:block th:each="infoList:${plan.mainInfoList}">
<th:block th:if="${infoList.planType eq 'D'}">
<div th:utext="${infoList.planInfo}"></div>
</th:block>
</th:block>
<hr>
<div class="row">
<div class="col-8">
<div class="mb-3 row">
<label for="contentTitle" class="col-sm-2 col-form-label text-center">제목</label>
<div class="col-sm-10">
<input type="text" class="form-control border-0" id="contentTitle" name="contentTitle" th:value="${plan.contentTitle}" readonly>
</div>
</div>
<hr>
<div class="mb-3 row">
<label for="planDiv" class="col-sm-2 col-form-label text-center">주요<br>사업계획</label>
<div class="col-sm-10" id="planDiv">
<th:block th:each="infoList:${plan.mainInfoList}">
<th:block th:if="${infoList.planType eq 'S'}">
<input type="text" class="form-control border-0" name="planInfo" th:value="${infoList.planInfo}" readonly>
</th:block>
</th:block>
</div>
</div>
<hr>
<div class="mb-3 row">
<label for="detailPlanDiv" class="col-sm-2 col-form-label text-center">사업개요<br><br>추진계획</label>
<div class="col-sm-10" id="detailPlanDiv">
<th:block th:each="infoList:${plan.mainInfoList}">
<th:block th:if="${infoList.planType eq 'D'}">
<div th:utext="${infoList.planInfo}"></div>
</th:block>
</th:block>
</div>
</div>
</div>
<div class="col-4">
<table class="table">
<thead>
<tr>
<th>파일명</th>
<th>사이즈</th>
</tr>
</thead>
<tbody>
<th:block th:if="${#lists.isEmpty(plan.fileList)}">
<tr>
<td colspan="2">파일이 없습니다.</td>
</tr>
</th:block>
<th:block th:unless="${#lists.isEmpty(plan.fileList)}">
<th:block th:each="file:${plan.fileList}">
<tr class="fileInfoTr">
<td><a href="#" class="fileDownLink" data-board="monthPlan" th:data-fileseq="${file.fileSeq}" th:text="|${file.origNm}.${file.fileExtn}|"></a></td>
<td th:text="${file.fileSize}"></td>
</tr>
</th:block>
</th:block>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-4">
<table class="table">
<thead>
<tr>
<th>파일명</th>
<th>사이즈</th>
</tr>
</thead>
<tbody>
<th:block th:if="${#arrays.isEmpty(plan.fileList)}">
<tr>
<td colspan="2">파일이 없습니다.</td>
</tr>
</th:block>
<th:block th:unless="${#arrays.isEmpty(plan.fileList)}">
<th:block th:each="file:${plan.fileList}">
<tr class="fileInfoTr">
<td><a href="#" class="fileDownLink" data-board="monthPlan" th:data-fileseq="${file.fileSeq}" th:text="|${file.origNm}.${file.fileExtn}|"></a></td>
<td th:text="${file.fileSize}"></td>
</tr>
<th:block th:unless="${#lists.isEmpty(plan.apprvList)}">
<hr>
<th:block th:each="apprv,cnt:${plan.apprvList}">
<div class="row justify-content-between py-1">
<div class="col-auto">
<th:block th:each="commonCode:${session.commonCode.get('DST')}">
<span th:if="${commonCode.itemCd eq apprv.state}" th:text="|결재결과: ${commonCode.itemValue}|"></span>
</th:block>
<span th:text="|결재자: ${apprv.userNm}|"></span>
</div>
<div class="col-auto">
<span th:text="|결재일시: ${#temporals.format(apprv.saveDt, 'yyyy-MM-dd HH:mm:ss')}|"></span>
</div>
<div class="col-12">
<span th:text="|기타의견: ${apprv.etc}|"></span>
</div>
</div>
</th:block>
</th:block>
</tbody>
</table>
</div>
<div class="col-12" th:if="${apprvAuth ne null}">
<form action="#" method="post" id="apprvForm">
<div class="row">
<div class="col-10">
<input type="hidden" name="planKey" id="apprvFormPlanKey">
<input type="hidden" name="state" id="viewModalApprvValue">
<input type="text" class="form-control form-control-sm" name="etc" placeholder="추가의견, 반려사유 기입">
<input type="text" class="d-none" id="submitPrevention">
</div>
<div class="col-auto">
<input type="button" class="btn btn-sm btn-success apprvBtn" th:data-planstate="${apprvAuth eq 'APC004'||apprvAuth eq 'APC003'?'DST004':'DST006'}" value="승인">
</div>
<div class="col-auto">
<input type="button" class="btn btn-sm btn-danger apprvBtn" th:data-planstate="${apprvAuth eq 'APC004'||apprvAuth eq 'APC003'?'DST003':'DST005'}" value="반려">
</div>
</div>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<th:block th:unless="${plan.planState eq 'DST004' or plan.planState eq 'DST006'}"><!--승인 상태일때는 수정 불가-->
<th:block th:if="${userSeq eq plan.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
<button type="button" class="btn btn-warning" id="editPlanBtn">수정</button>
</th:block>
</th:block>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
</div>

View File

@ -90,6 +90,8 @@
<th></th>
<th>제목</th>
<th>시행일자</th>
<th>관서</th>
<th>부서</th>
<th>작성자</th>
<th>작성일시</th>
<th>첨부파일</th>
@ -102,6 +104,12 @@
<td><input type="checkbox" class="trChkBox"></td>
<td th:text="${plan.contentTitle}"></td>
<td th:text="${#temporals.format(plan.planDt, 'yyyy-MM-dd')}"></td>
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
<td th:if="${plan.wrtOrgan eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block>
<th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<td th:if="${plan.wrtPart eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block>
<td th:text="${plan.wrtUserNm}"></td>
<td th:text="${#temporals.format(plan.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
<td th:text="${plan.fileCnt eq null?'파일 없음':#strings.concat(plan.fileCnt,' 건')}"></td>
@ -165,37 +173,8 @@
</div>
<div class="modal fade" id="planViewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="planViewModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="planViewModalLabel">월간 계획 열람</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-12" id="planViewBody"></div>
<div class="col-12" th:if="${apprvAuth ne null}">
<form action="#" method="post" id="apprvForm">
<div class="row">
<div class="col-10">
<input type="hidden" name="planKey" id="apprvFormPlanKey">
<input type="hidden" name="state" id="viewModalApprvValue">
<input type="text" class="form-control form-control-sm" name="etc" placeholder="추가의견, 반려사유 기입">
<input type="text" class="d-none" id="submitPrevention">
</div>
<div class="col-auto">
<input type="button" class="btn btn-sm btn-success apprvBtn" th:data-planstate="${apprvAuth eq 'APC004'||apprvAuth eq 'APC003'?'DST004':'DST006'}" value="승인">
</div>
<div class="col-auto">
<input type="button" class="btn btn-sm btn-danger apprvBtn" th:data-planstate="${apprvAuth eq 'APC004'||apprvAuth eq 'APC003'?'DST003':'DST005'}" value="반려">
</div>
</div>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
</div>
<div class="modal-content" id="planViewBody">
</div>
</div>
</div>