외사활동 관리대장 작업중.

master
강석 최 2023-04-10 18:43:18 +09:00
parent d1f4b2112a
commit 46785fc5f6
8 changed files with 339 additions and 6 deletions

View File

@ -132,4 +132,27 @@ public class ActivityCaseController {
return 0; return 0;
} }
} }
@GetMapping("/activityCaseMgt")
public ModelAndView activityCaseMgt(@AuthenticationPrincipal UserInfo loginUser, ActivityCaseBoard activityCase){
ModelAndView mav = new ModelAndView("counterIntelligence/activityCase/activityCaseMgt");
mav.addObject("searchUrl", "/counterIntelligence/activityCaseMgt");
String accessAuth = authMgtService.selectAccessConfigList
(loginUser.getUserSeq(), "/counterIntelligence/activityCaseMgt").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
mav.addObject("ogCd", loginUser.getOgCd());
if(accessAuth.equals("ACC003")){
activityCase.setDownOrganCdList(loginUser.getDownOrganCdList());
}else{
activityCase.setWrtOrgan(loginUser.getOgCd());
}
activityCase.setWrtUserSeq(loginUser.getUserSeq());
activityCase.setQueryInfo();
mav.addObject("activityCaseList", activityCaseService.selectActivityCaseMgt(activityCase));
activityCase.setContentCnt(activityCaseService.selectActivityCaseMgtCnt(activityCase));
activityCase.setPaginationInfo();
mav.addObject("searchParams", activityCase);
return mav;
}
} }

View File

@ -19,4 +19,7 @@ public interface ActivityCaseMapper {
Integer selectReceiptNum(int year); Integer selectReceiptNum(int year);
Integer selectCaseNum(Map<String, Object> map); Integer selectCaseNum(Map<String, Object> map);
List<ActivityCaseBoard> selectActivityCaseMgt(ActivityCaseBoard activityCase);
Integer selectActivityCaseMgtCnt(ActivityCaseBoard activityCase);
} }

View File

@ -23,9 +23,18 @@ public class ActivityCaseBoard extends BaseModel {
private String caseType; private String caseType;
private String caseNum; private String caseNum;
private String title; private String title;
private String content;
private LocalDate reportDate; private LocalDate reportDate;
private LocalDate activityStartDate;
private LocalDate activityEndDate;
private LocalDateTime wrtDt; private LocalDateTime wrtDt;
private String status; private String status;
private String suspectNm; private String suspectNm;
private String suspectBirthDate;
private String suspectAddress;
private Integer suspectCnt; private Integer suspectCnt;
private String activityResult;
private String apprvType;
private String apprvUserNm;
private String description;
} }

View File

@ -162,4 +162,12 @@ public class ActivityCaseService extends BaseService {
acaRepository.save(savedApprv); acaRepository.save(savedApprv);
} }
} }
public List<ActivityCaseBoard> selectActivityCaseMgt(ActivityCaseBoard activityCase) {
return acMapper.selectActivityCaseMgt(activityCase);
}
public Integer selectActivityCaseMgtCnt(ActivityCaseBoard activityCase) {
return acMapper.selectActivityCaseMgtCnt(activityCase);
}
} }

View File

@ -188,4 +188,88 @@
where a.receipt_num = #{receiptNum} where a.receipt_num = #{receiptNum}
and b.case_num like #{year}||'%' and b.case_num like #{year}||'%'
</select> </select>
<sql id="selectActivityCaseMgtWhere">
<where>
</where>
</sql>
<select id="selectActivityCaseMgt" resultType="ActivityCaseBoard" parameterType="ActivityCaseBoard">
select c.case_type , -- 구분
a.receipt_num , -- 접수번호
c.report_date , --접수일시
c.case_num , -- 문서번호
e.name as suspectNm, --혐의자이름
e.birth_date as suspectBirthDate , --생년월일
e.address as suspectAddress , --주소
c.content , -- 외사활동사항
d.report_date as activity_start_date, --착수일시
c.report_date as activity_end_date, --종료일시
c.activity_result , -- 처리결과
a.wrt_user_nm , -- 담당자
f.apprv_type, --결재구분
f.user_nm as apprvUserNm, --지휘자
c.description -- 비고
from activity_case a
inner join (
select receipt_key,
count(*) as reportCnt,
max(case_key) as max_case_key,
min(case_key) as min_case_key
from activity_case_info
group by receipt_key
) b on a.receipt_key = b.receipt_key
inner join activity_case_info c
on c.case_key = b.max_case_key
inner join activity_case_info d
on d.case_key = b.min_case_key
inner join (
select receipt_key,
STRING_AGG(CAST(name AS VARCHAR), ', ') as name,
STRING_AGG(CAST(birth_date AS VARCHAR), ', ') as birth_date,
STRING_AGG(CAST(address AS VARCHAR), ', ') as address
from activity_case_suspect
group by receipt_key
) e on a.receipt_key = e.receipt_key
inner join (
select case_key,
STRING_AGG(CAST(apprv_type AS VARCHAR), ', ') as apprv_type,
STRING_AGG(CAST(title_cd||user_nm AS VARCHAR), ', ') as user_nm
from activity_case_apprv
group by case_key
) f on c.case_key = f.case_key
<include refid="selectActivityCaseMgtWhere"></include>
order by a.receipt_key
</select>
<select id="selectActivityCaseMgtCnt" resultType="int" parameterType="ActivityCaseBoard">
select count(*)
from activity_case a
inner join (
select receipt_key,
count(*) as reportCnt,
max(case_key) as max_case_key,
min(case_key) as min_case_key
from activity_case_info
group by receipt_key
) b on a.receipt_key = b.receipt_key
inner join activity_case_info c
on c.case_key = b.max_case_key
inner join activity_case_info d
on d.case_key = b.min_case_key
inner join (
select receipt_key,
STRING_AGG(CAST(name AS VARCHAR), ', ') as name,
STRING_AGG(CAST(birth_date AS VARCHAR), ', ') as birth_date,
STRING_AGG(CAST(address AS VARCHAR), ', ') as address
from activity_case_suspect
group by receipt_key
) e on a.receipt_key = e.receipt_key
inner join (
select case_key,
STRING_AGG(CAST(apprv_type AS VARCHAR), ', ') as apprv_type,
STRING_AGG(CAST(title_cd||user_nm AS VARCHAR), ', ') as user_nm
from activity_case_apprv
group by case_key
) f on c.case_key = f.case_key
</select>
</mapper> </mapper>

View File

@ -64,8 +64,8 @@
<div class="col-sm-2"> <div class="col-sm-2">
<select class="form-select form-select-sm" id="activityResult" name="activityResult"> <select class="form-select form-select-sm" id="activityResult" name="activityResult">
<option value="">선택</option> <option value="">선택</option>
<th:block th:each="code:${session.commonCode.get('ACAT')}"> <th:block th:each="code:${session.commonCode.get('ACR')}">
<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>
@ -169,9 +169,7 @@
</div> </div>
</div> </div>
<div class="row mb-1"> <div class="row mb-1">
<label for="description" class="col-sm-1 col-form-label col-form-label-sm text-center"> <label for="description" class="col-sm-1 col-form-label col-form-label-sm text-center">비고</label>
비고
</label>
<div class="col-sm-11"> <div class="col-sm-11">
<textarea class="form-control form-control-sm" id="description" name="description" th:value="${activityCaseInfo.description}"></textarea> <textarea class="form-control form-control-sm" id="description" name="description" th:value="${activityCaseInfo.description}"></textarea>
</div> </div>

View File

@ -0,0 +1,204 @@
<!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/counterIntelligence/activityCase.js}"></script>
<script type="text/javascript" th:src="@{/js/modal/userModal.js}"></script>
</th:block>
<div layout:fragment="content">
<main>
<input type="hidden" id="menuKey" value="12">
<div class="row justify-content-between">
<div class="col-auto mb-2">
<div class="d-inline align-middle"><i class="bi bi-square-fill"></i></div>
<h5 class="d-inline align-middle"> 관리대장</h5>
</div>
<div class="col-auto">
<p class="mb-0 mt-2">외사방첩관리 > 외사활동 > 관리대장</p>
</div>
</div>
<div class="row mx-0">
<div class="col-12 card bg-light text-center">
<div class="card-body">
<form method="get" th:action="${searchUrl}">
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
<div class="row justify-content-between py-1">
<div class="col-auto">
<select class="form-select form-select-sm" 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 eq num*10}"></option>
</th:block>
</select>
</div>
<div class="col-8">
<div class="row">
<div class="col-11">
<div class="row justify-content-end pb-1">
<div class="col-2">
<select class="form-select form-select-sm" name="caseType">
<option value="">구분</option>
<th:block th:each="code:${session.commonCode.get('ACT')}">
<option th:value="${code.itemCd}" th:text="${#strings.replace(code.itemValue, '보고서', '')}"></option>
</th:block>
</select>
</div>
<div class="col-2">
<input type="text" class="form-control form-control-sm" placeholder="접수번호" name="receiptNum" th:value="${searchParams.receiptNum}">
</div>
<div class="col-2">
<input type="text" class="form-control form-control-sm" placeholder="혐의자 이름" name="suspectNm" th:value="${searchParams.suspectNm}">
</div>
<div class="col-2">
<input type="text" class="form-control form-control-sm" placeholder="혐의자 주소" name="suspectAddress" th:value="${searchParams.suspectAddress}">
</div>
</div>
<div class="row justify-content-end">
<div class="col-2">
<select class="form-select form-select-sm" name="caseType">
<option value="">처리결과</option>
<th:block th:each="code:${session.commonCode.get('ACR')}">
<option th:value="${code.itemCd}" th:text="${code.itemValue}"></option>
</th:block>
</select>
</div>
<div class="col-2">
<input type="text" class="form-control form-control-sm" placeholder="담당자" name="wrtUserNm" th:value="${searchParams.wrtUserNm}">
</div>
<div class="col-2">
<input type="text" class="form-control form-control-sm" placeholder="지휘자" name="apprvUserNm" th:value="${searchParams.apprvUserNm}">
</div>
<div class="col-4">
<div class="input-group input-daterange" id="dateSelectorDiv">
<select class="form-select form-select-sm w-30" name="dateSelector">
<option value="reportDate" th:selected="${searchParams.dateSelector eq 'reportDate'}">접수일</option>
<option value="activityStartDate" th:selected="${searchParams.dateSelector eq 'activityStartDate'}">착수일</option>
<option value="activityEndDate" th:selected="${searchParams.dateSelector eq 'activityEndDate'}">종료일</option>
</select>
<input type="text" class="form-control form-control-sm w-35" id="startDate" name="startDate" placeholder="시작일" autocomplete="off" readonly th:value="${searchParams.startDate}">
<input type="text" class="form-control form-control-sm w-35" id="endDate" name="endDate" placeholder="종료일" autocomplete="off" readonly th:value="${searchParams.endDate}">
</div>
</div>
</div>
</div>
<div class="col-1 d-grid gap-2">
<input type="submit" class="btn btn-sm btn-primary" id="searchBtn" value="검색">
</div>
</div>
</div>
</div>
</form>
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-12 overflow-auto">
<table class="table table-sm table-bordered table-hover">
<colgroup>
<col style="width: 5%">
<col style="width: 11%">
<col style="width: 11%">
<col style="width: 8%">
<col style="width: 20%">
<col style="width: 11%">
<col style="width: 8%">
<col style="width: 11%">
<col style="width: 15%">
</colgroup>
<thead class="align-middle">
<tr class="table-secondary">
<th rowspan="3">구분</th>
<th>접수번호</th>
<th colspan="2">혐의자</th>
<th rowspan="3">외사활동 사항</th>
<th>착수일</th>
<th rowspan="3">처리결과</th>
<th>담당자</th>
<th rowspan="3">비고</th>
</tr>
<tr class="table-secondary">
<th rowspan="2">접수일</th>
<th>성명</th>
<th rowspan="2">주소</th>
<th rowspan="2">종료일</th>
<th rowspan="2">지휘자</th>
</tr>
<tr class="table-secondary">
<th>생년월일</th>
</tr>
</thead>
<tbody class="table-group-divider">
<th:block th:each="case,cnt:${activityCaseList}">
<tr>
<td rowspan="2">
<th:block th:each="code:${session.commonCode.get('ACT')}">
<th:block th:if="${code.itemCd eq case.caseType}" th:text="${#strings.replace(code.itemValue, '보고서', '')}"></th:block>
</th:block>
</td>
<td th:text="${case.receiptNum}"></td>
<td th:text="${case.suspectNm}"></td>
<td rowspan="2" th:text="${case.suspectAddress}"></td>
<td rowspan="2" th:utext="${case.content}"></td>
<td th:text="${case.activityStartDate}"></td>
<td rowspan="2">
<th:block th:each="code:${session.commonCode.get('ACR')}">
<th:block th:if="${code.itemCd eq case.activityResult}" th:text="${code.itemValue}"></th:block>
</th:block>
</td>
<td th:text="${case.wrtUserNm}"></td>
<td rowspan="2" th:text="${case.description}"></td>
</tr>
<tr>
<td th:text="${case.reportDate}"></td>
<td th:text="${case.suspectBirthDate}"></td>
<td>
<th:block th:if="${case.caseType eq 'ACT003'}" th:text="${case.activityEndDate}"></th:block>
</td>
<td>
<th:block th:each="userNm,cnt:${#strings.arraySplit(case.apprvUserNm, ', ')}">
<th:block th:each="code:${session.commonCode.get('JT')}">
<th:block th:if="${#strings.contains(userNm, code.itemCd)}" th:text="${#strings.replace(userNm, code.itemCd, code.itemValue+' ')}"></th:block>
</th:block>
<th:block th:unless="${cnt.last}">, </th:block>
</th:block>
</td>
</tr>
</th:block>
</tbody>
</table>
</div>
</div>
<div class="row justify-content-center">
<div class="col-auto">
<nav aria-label="Page navigation">
<ul class="pagination mb-0">
<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 eq 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>
</main>
</div>
</html>

View File

@ -38,7 +38,7 @@
<th:block th:if="${activityCaseInfo.caseType eq 'ACT003'}"> <th:block th:if="${activityCaseInfo.caseType eq 'ACT003'}">
<label class="col-sm-1 col-form-label col-form-label-sm text-center fw-bold">결과</label> <label class="col-sm-1 col-form-label col-form-label-sm text-center fw-bold">결과</label>
<label class="col-sm-2 col-form-label col-form-label-sm text-start"> <label class="col-sm-2 col-form-label col-form-label-sm text-start">
<th:block th:each="code:${session.commonCode.get('ACAT')}"> <th:block th:each="code:${session.commonCode.get('ACR')}">
<th:block th:if="${code.itemCd eq activityCaseInfo.activityResult}" th:text="${code.itemValue}"></th:block> <th:block th:if="${code.itemCd eq activityCaseInfo.activityResult}" th:text="${code.itemValue}"></th:block>
</th:block> </th:block>
</label> </label>
@ -95,6 +95,10 @@
<div th:utext="${activityCaseInfo.content}"></div> <div th:utext="${activityCaseInfo.content}"></div>
</div> </div>
</div> </div>
<div class="row mb-1">
<label class="col-sm-1 col-form-label col-form-label-sm text-center fw-bold">비고</label>
<label class="col-sm-11 col-form-label col-form-label-sm text-start" th:text="${activityCaseInfo.description}"></label>
</div>
<div class="row mb-1"> <div class="row mb-1">
<label class="col-sm-1 col-form-label col-form-label-sm text-center fw-bold">결제</label> <label class="col-sm-1 col-form-label col-form-label-sm text-center fw-bold">결제</label>
<div class="col-sm-11"> <div class="col-sm-11">