사건보고서 작업중.

master
강석 최 2023-03-27 18:39:09 +09:00
parent 8db6bf0f66
commit 0e9052e232
11 changed files with 196 additions and 117 deletions

View File

@ -51,7 +51,6 @@ public class IvsgtController {
if(investigationBoard.getIvsgtKey()!=null){
investigationBoard = ivsgtService.selectBoardInvestigation(investigationBoard.getIvsgtKey());
}else{
investigationBoard.setWrtOrgan(loginUser.getOgCd());
investigationBoard.setWrtPart(loginUser.getOfcCd());
investigationBoard.setWrtUserSeq(loginUser.getUserSeq());
@ -70,7 +69,7 @@ public class IvsgtController {
mav.addObject("investigation", investigationBoard);
mav.addObject("userSeq",loginUser.getUserSeq());
//메뉴권한 확인
mav.addObject("accessAuth", authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/arrest").get(0).getAccessAuth());
mav.addObject("accessAuth", authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/arrestReport").get(0).getAccessAuth());
return mav;
}
@ -89,12 +88,13 @@ public class IvsgtController {
public ModelAndView searchViewModal(@AuthenticationPrincipal UserInfo loginUser, InvestigationBoard investigationBoard){
ModelAndView mav = new ModelAndView("ivsgt/searchViewModal");
mav.addObject("userSeq",loginUser.getUserSeq());
//메뉴권한 확인
mav.addObject("accessAuth", authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/arrest").get(0).getAccessAuth());
investigationBoard.setFirstIndex(0);
investigationBoard.setRowCnt(Integer.MAX_VALUE);
investigationBoard.setQueryInfo();
investigationBoard.setWrtUserSeq(loginUser.getUserSeq());
mav.addObject("boardInvestigationList", ivsgtService.selectBoardInvestigationList(investigationBoard));
mav.addObject("investigationList", ivsgtService.selectBoardInvestigationList(investigationBoard));
investigationBoard.setContentCnt(ivsgtService.selectBoardInvestigationListCnt(investigationBoard));
investigationBoard.setPaginationInfo();
mav.addObject("searchParams", investigationBoard);
return mav;
}

View File

@ -3,9 +3,11 @@ package com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
@Getter
@ -22,8 +24,20 @@ public class InvestigationRelatedReports{
@Column(name = "parent_ivsgt_key")
private Integer parentIvsgtKey;
@Id
@Column(name = "related_reports_key")
private Integer childReportsKey;
@Column(name = "related_report_key")
private Integer relatedReportKey;
@Transient
private String ivsgtType;
@Transient
private String title;
@Transient
private String arrestCd;
@Transient
private String arrestCd2;
@Transient
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime wrtDt;
@Embeddable
@ -32,6 +46,6 @@ public class InvestigationRelatedReports{
@AllArgsConstructor
public static class InvestigationRelatedReportsId implements Serializable {
private Integer parentIvsgtKey;
private Integer childReportsKey;
private Integer relatedReportKey;
}
}

View File

@ -56,6 +56,9 @@ public class IvsgtService extends BaseService {
}
if(investigationBoard.getRelatedReportsList() != null && investigationBoard.getRelatedReportsList().size()>0){
ivsgtRelatedReportsRepository.deleteByParentIvsgtKey(ivsgtKey);
for(InvestigationRelatedReports report: investigationBoard.getRelatedReportsList()){
report.setParentIvsgtKey(ivsgtKey);
}
ivsgtRelatedReportsRepository.saveAll(investigationBoard.getRelatedReportsList());
}
if(investigationBoard.getMultipartFileList()!=null){

View File

@ -14,7 +14,7 @@ spring.servlet.multipart.max-file-size=200MB
spring.servlet.multipart.max-request-size=500MB
site.domain=10.187.58.12
clipReport.print.url=http://118.219.150.34:50570/ClipReport5
clipReport.print.url=http://10.187.58.47:8085/ClipReport5
#file
file.dir.publicBoard=/publicBoard

View File

@ -14,7 +14,7 @@ spring.servlet.multipart.max-file-size=200MB
spring.servlet.multipart.max-request-size=500MB
site.domain=10.187.58.12
clipReport.print.url=http://118.219.150.34:50570/ClipReport5
clipReport.print.url=http://10.187.58.48:8085/ClipReport5
#file
file.dir.publicBoard=/publicBoard

View File

@ -98,14 +98,16 @@
</select>
<select id="selectRelatedReportsList" resultType="InvestigationRelatedReports" parameterType="int">
SELECT a.child_ivsgt_key,
a.parent_ivsgt_key,
i.ivsgt_type,
i.title,
i.wrt_dt
FROM investigation_related_reports a
INNER JOIN investigation_board i
ON i.ivsgt_key = a.child_ivsgt_key
WHERE a.parent_ivsgt_key = #{ivsgtKey}
SELECT a.related_report_key,
a.parent_ivsgt_key,
i.ivsgt_type,
i.title,
i.arrest_cd,
i.arrest_cd2,
i.wrt_dt
FROM investigation_related_reports a
INNER JOIN investigation_board i
ON i.ivsgt_key = a.related_report_key
WHERE a.parent_ivsgt_key = #{ivsgtKey}
</select>
</mapper>

View File

@ -30,29 +30,24 @@ $(document).on('click', '#relatedReportSearchBtn', function (){
});
$(document).on('click', '#completeBtn', function (){
const checkbox = document.getElementsByClassName('reportChk');
Array.from(checkbox).forEach(function(element) {
if (element.checked) {
$('#relatedReportSearchDiv').append(
'<div class="col-auto">' +
' <input type="hidden" name="relatedReportsKeyList" value="0">'+
' <input type="hidden" name="childIvsgtKeyList" value="' + element.value + '">'+
' <input type="hidden" name="relatedReportsText" value="' + element.name + '" readonly>'+
' <div class="row">' +
' <label class="col-sm-auto col-form-label col-form-label-sm">' + element.name + '</label>'+
' <button class="btn btn-sm btn-primary col-auto cancel-btn" ><i class="bi-x"></i></button>' +
' </div>' +
'</div>'
)
}
});
$.each($('.reportChk:checked'), function (idx, chkBox){
const tr = $(chkBox).parents('tr');
$('#relatedReportTbody').append(
'<tr class="col-auto">' +
' <input type="hidden" class="ivsgtKey" value="' + $(chkBox).attr('data-ivsgtkey') + '">'+
' <td>'+tr.find('.ivsgtType')[0].innerText+'</td>' +
' <td>'+tr.find('.title')[0].innerText+'</td>' +
' <td>'+tr.find('.arrestCd')[0].innerText+'</td>' +
' <td>'+tr.find('.arrestCd2')[0].innerText+'</td>' +
' <td>'+tr.find('.wrtDt')[0].innerText+'</td>' +
' <td><button type="button" class="btn btn-sm btn-primary deleteRelationBtn" ><i class="bi-x"></i></button></td>'+
'</tr>'
)
})
});
$(document).on('click', '.cancel-btn', function (){
$(this).parent().remove();
let deleteKey = $(this).parent().children("input[name='relatedReportsKeyList']").val();
$("#ivsgtEditForm").append('<input type="hidden" name="deleteKeyList" value="' + deleteKey + '">');
$(document).on('click', '.deleteRelationBtn', function (){
$(this).parents('tr').remove();
});
$(document).on('change', '#arrestCd', function (){
@ -139,6 +134,9 @@ function saveBoardInvestigation(state){
formData.append('fileSeq', $(el).attr("data-fileseq"));
})
formData.append('content', CrossEditor.GetBodyValue());
$.each($("#relatedReportTbody").find('.ivsgtKey'), function (idx, ivsgtKey){
formData.append('relatedReportsList['+idx+'].relatedReportKey', $(ivsgtKey).val());
})
$.ajax({
type : 'POST',
data : formData,
@ -175,13 +173,6 @@ function contentCheck(){
alert("위반유형을 선택해주세요.")
flag = false;
}
else if(!$("#relatedReport").is(':checked') && $("input[name='ivsgtType']").val() != "arrest") {
if ($('input[name="relatedReportsText"]').length < 1) {
alert("연관보고서를 확인해 주세요.")
flag = false;
}
}
flag = fileCheck(flag, files);
return flag;
}

View File

@ -209,9 +209,18 @@
</div>
</div>
<div class="modal fade" id="searchViewModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="searchViewModalLabel" aria-hidden="true">
<div class="modal-dialog modal-s modal-dialog-scrollable">
<div class="modal-content" id="searchViewBody">
<div class="modal-dialog modal-lg modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header bg-dark">
<h5 class="modal-title text-white" id="arrestViewModalLabel">연관보고서 불러오기</h5>
<button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="searchViewBody">
</div>
<div class="modal-footer bg-light">
<button type="button" class="btn btn-primary" id="completeBtn" data-bs-dismiss="modal">선택완료</button>
<!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>-->
</div>
</div>
</div>
</div>

View File

@ -3,24 +3,24 @@
<div class="modal-header bg-dark">
<h5 class="modal-title text-white" id="planEditModalLabel">
<th:block th:if="${investigationBoard.ivsgtKey eq null}">
<th:block th:if="${investigationBoard.ivsgtType eq 'arrest'}">
<th:block th:if="${investigationBoard.ivsgtType eq 'IVT001'}">
검거보고서 작성
</th:block>
<th:block th:if="${investigationBoard.ivsgtType eq 'proceeding'}">
<th:block th:if="${investigationBoard.ivsgtType eq 'IVT002'}">
진행보고서 작성
</th:block>
<th:block th:if="${investigationBoard.ivsgtType eq 'result'}">
<th:block th:if="${investigationBoard.ivsgtType eq 'IVT003'}">
결과보고서 작성
</th:block>
</th:block>
<th:block th:if="${investigationBoard.ivsgtKey != null}">
<th:block th:if="${investigationBoard.ivsgtType eq 'arrest'}">
<th:block th:if="${investigationBoard.ivsgtType eq 'IVT001'}">
검거보고서 수정
</th:block>
<th:block th:if="${investigationBoard.ivsgtType eq 'proceeding'}">
<th:block th:if="${investigationBoard.ivsgtType eq 'IVT002'}">
진행보고서 수정
</th:block>
<th:block th:if="${investigationBoard.ivsgtType eq 'result'}">
<th:block th:if="${investigationBoard.ivsgtType eq 'IVT003'}">
결과보고서 수정
</th:block>
</th:block>
@ -32,7 +32,7 @@
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input type="hidden" name="ivsgtKey" th:value="${investigation.ivsgtKey}">
<input type="hidden" name="ivsgtType" th:value="${investigation.ivsgtType}">
<input type="hidden" name="ivsgtType" id="ivsgtType" th:value="${investigation.ivsgtType}">
<input type="hidden" name="wrtOrgan" th:value="${investigation.wrtOrgan}">
<input type="hidden" name="wrtPart" th:value="${investigation.wrtPart}">
<input type="hidden" name="wrtUserSeq" th:value="${investigation.wrtUserSeq}">
@ -116,11 +116,30 @@
<input type="file" class="d-none" id="fileInputer" multiple>
</div>
</div>
<th:block th:if="${investigation.ivsgtType ne 'arrest'}">
<th:block th:if="${investigation.ivsgtType ne 'IVT001'}">
<div class="row mb-1">
<label for="relatedReportDiv" class="col-sm-1 col-form-label col-form-label-sm text-center">연관보고서</label>
<label for="relatedReportDiv" class="col-sm-1 col-form-label col-form-label-sm text-center">
연관보고서
<button type="button" class="border-0 bg-white " id="relatedReportSearchBtn">
<i class="bi bi-plus-square text-primary"></i>
</button>
</label>
<div class="col-sm-11" id="relatedReportDiv">
<div class="row justify-content-start">
<table class="table table-hover">
<thead>
<tr>
<th>보고서유형</th>
<th>제목</th>
<th>범죄테마</th>
<th>위반유형</th>
<th>작성일</th>
<th></th>
</tr>
</thead>
<tbody id="relatedReportTbody">
</tbody>
</table>
<!--<div class="row justify-content-start">
<div class="col-4">
<input type="text" class="form-control form-control-sm" placeholder="" name="searchTitle">
</div>
@ -129,10 +148,10 @@
<input type="checkbox" id="relatedReport" th:checked="${#lists.isEmpty(investigation.relatedReportsList)}">
<label for="relatedReport">연관보고서 없음</label>
</div>
</div>
</div>-->
</div>
</div>
<div class="row">
<!--<div class="row">
<label for="relatedReportDiv" class="col-sm-1 col-form-label col-form-label-sm text-center border-0 bg-white"></label>
<div class="col-sm-11 row mb-1" id="relatedReportSearchDiv">
<th:block th:each="relatedReports:${investigation.relatedReportsList}">
@ -147,7 +166,7 @@
</div>
</th:block>
</div>
</div>
</div>-->
</th:block>
</form>
</div>

View File

@ -93,15 +93,43 @@
</tbody>
</table>
</div>
<th:block th:if="${investigation.ivsgtType eq 'proceeding' or investigation.ivsgtType eq 'result'}">
<th:block th:if="${investigation.ivsgtType ne 'IVT001'}">
<div class="p-2 row mb-3">
<label class="col-sm-1 col-form-label col-form-label-sm text-center">연관보고서</label>
<div class="col-sm-11" id="relatedReportDiv">
<div class="row justify-content-start">
<th:block th:each="relatedReports:${investigationBoard.relatedReportsList}">
<label class="col-sm-auto col-form-label col-form-label-sm" th:text="${relatedReports.contentTitle}"></label>
</th:block>
</div>
<table class="table table-hover">
<thead>
<tr>
<th>보고서유형</th>
<th>제목</th>
<th>범죄테마</th>
<th>위반유형</th>
<th>작성일</th>
</tr>
</thead>
<tbody id="relatedReportTbody">
<tr class="relatedReportTr" th:each="relatedReport:${investigation.relatedReportsList}">
<input type="hidden" class="reportChk" th:value="${relatedReport.relatedReportKey}">
<td>
<th:block th:each="code:${session.commonCode.get('IVT')}">
<th:block th:if="${code.itemCd eq relatedReport.ivsgtType}" th:text="${code.itemValue}"></th:block>
</th:block>
</td>
<td class="title" th:text="${relatedReport.title}"></td>
<td class="arrestCd">
<th:block th:each="code:${session.commonCode.get('CTH')}">
<th:block th:if="${code.itemCd eq relatedReport.arrestCd}" th:text="${code.itemValue}"></th:block>
</th:block>
</td>
<td class="arrestCd2">
<th:block th:each="code:${session.commonCode.get(relatedReport.arrestCd)}">
<th:block th:if="${code.itemCd eq relatedReport.arrestCd2}" th:text="${code.itemValue}"></th:block>
</th:block>
</td>
<td class="wrtDt" th:text="${#temporals.format(relatedReport.wrtDt, 'yyyy-MM-dd')}"></td>
</tr>
</tbody>
</table>
</div>
</div>
</th:block>

View File

@ -1,54 +1,67 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header bg-dark">
<h5 class="modal-title text-white" id="arrestViewModalLabel">검거보고서</h5>
<button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="searchViewBody">
<table>
<thead>
<tr>
<th></th>
<th>보고서유형</th>
<th>제목</th>
<th>범죄테마</th>
<th>위반유형</th>
<th>작성일</th>
</tr>
</thead>
<tbody>
<tr th:if="${#lists.isEmpty(boardInvestigationList)}">
<td colspan="6">검색된 보고서가 없습니다.</td>
</tr>
<tr th:each="investigation:${boardInvestigationList}">
<td><input type="checkbox" class="reportChk" th:id="'reportChk'+${investigationBoard.ivsgtKey}" th:name="${investigation.contentTitle}" th:value="${investigation.ivsgtKey}"></td>
<td>
<th:block th:each="code:${session.commonCode.get('')}">
<th:block th:if="${code.itemCd eq investigation.ivsgtType}" th:text="${code.itemValue}"></th:block>
<table class="table table-hover">
<thead>
<tr>
<th></th>
<th>보고서유형</th>
<th>제목</th>
<th>범죄테마</th>
<th>위반유형</th>
<th>작성일</th>
</tr>
</thead>
<tbody>
<tr th:if="${#lists.isEmpty(investigationList)}">
<td colspan="6">검색된 보고서가 없습니다.</td>
</tr>
<tr th:each="ivsgt:${investigationList}">
<td><input type="checkbox" class="reportChk" th:data-ivsgtkey="${ivsgt.ivsgtKey}"></td>
<td class="ivsgtType">
<th:block th:each="code:${session.commonCode.get('IVT')}">
<th:block th:if="${code.itemCd eq ivsgt.ivsgtType}" th:text="${code.itemValue}"></th:block>
</th:block>
</td>
<td class="title" th:text="${ivsgt.title}"></td>
<td class="arrestCd">
<th:block th:each="code:${session.commonCode.get('CTH')}">
<th:block th:if="${code.itemCd eq ivsgt.arrestCd}" th:text="${code.itemValue}"></th:block>
</th:block>
</td>
<td class="arrestCd2">
<th:block th:each="code:${session.commonCode.get(ivsgt.arrestCd)}">
<th:block th:if="${code.itemCd eq ivsgt.arrestCd2}" th:text="${code.itemValue}"></th:block>
</th:block>
</td>
<td class="wrtDt" th:text="${#temporals.format(ivsgt.wrtDt, 'yyyy-MM-dd')}"></td>
</tr>
</tbody>
</table>
<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 modalPage" th:data-pageindex="${(searchParams.pageIndex)-3}">
<a class="page-link" href="#" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
</th:block>
</td>
<td th:text="${investigation.contentTitle}"></td>
<td>
<th:block th:each="code:${session.commonCode.get('')}">
<th:block th:if="${code.itemCd eq investigation.}" th:text="${code.itemValue}"></th:block>
<th:block th:each="num : ${#numbers.sequence(searchParams.startNum, searchParams.endNum)}">
<li class="page-item modalPage" th:data-pageindex="${num}" th:classappend="${searchParams.pageIndex eq num?'active':''}">
<a class="page-link" href="#" th:text="${num}"></a>
</li>
</th:block>
</td>
<td>
<th:block th:each="code:${session.commonCode.get('')}">
<th:block th:if="${code.itemCd eq investigation.}" th:text="${code.itemValue}"></th:block>
<th:block th:if="${searchParams.maxNum>searchParams.endNum+2}">
<li class="page-item modalPage" th:data-pageindex="${(searchParams.pageIndex)+3}">
<a class="page-link" href="#" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
</th:block>
</td>
<td>
<th:block th:each="code:${session.commonCode.get('')}">
<th:block th:if="${code.itemCd eq investigation.}" th:text="${code.itemValue}"></th:block>
</th:block>
</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer bg-light">
<button type="button" class="btn btn-primary" id="completeBtn" data-bs-dismiss="modal">선택완료</button>
<!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>-->
</ul>
</nav>
</div>
</div>
</html>