fix : 모니터링 청산보고서 중간저장

master
TaehunPark 2023-02-09 15:26:05 +09:00
parent 6b3a6ffa37
commit 9f810d14bb
8 changed files with 180 additions and 33 deletions

View File

@ -239,7 +239,10 @@ public class FileController extends BaseService{
downloadFile = monitoringService.selectDesignationFile(parentKey, fileSeq);
break;
case "monitoringResult":
downloadFile = monitoringService.selectmonitoringResultFile(parentKey, fileSeq);
downloadFile = monitoringService.selectMonitoringResultFile(parentKey, fileSeq);
break;
case "monitoringReport":
downloadFile = monitoringService.selectMonitoringReportFile(parentKey, fileSeq);
break;
}
return downloadFile;

View File

@ -36,6 +36,10 @@ public class MonitoringResult extends BaseModel {
private String mrTitle;
@Column(name = "clear_title")
private String clearTitle;
@Column(name = "monitoring_yn")
private String monitoringYn;
@Column(name = "monitoring_reason")
private String monitoringReason;
@Column(name = "mr_sdate")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate mrSdate;

View File

@ -20,6 +20,7 @@ import com.dbnt.faisp.main.fpiMgt.monitoring.model.MonitoringDesignationApprv;
import com.dbnt.faisp.main.fpiMgt.monitoring.model.MonitoringDesignationFile;
import com.dbnt.faisp.main.fpiMgt.monitoring.model.MonitoringDesignationFile.monitoringDesignationFileId;
import com.dbnt.faisp.main.fpiMgt.monitoring.model.MonitoringReport;
import com.dbnt.faisp.main.fpiMgt.monitoring.model.MonitoringReport.MonitoringReportId;
import com.dbnt.faisp.main.fpiMgt.monitoring.model.MonitoringResult;
import com.dbnt.faisp.main.fpiMgt.monitoring.model.MonitoringResultApprv;
import com.dbnt.faisp.main.fpiMgt.monitoring.model.MonitoringResultClearInfo;
@ -182,8 +183,8 @@ public class MonitoringService extends BaseService {
}
if(mr.getMrState().equals("DST002")){
//작성완료일 때 계장 결재 사용자에게 알림 발송.
userAlarmService.sendAlarmToApprvUser(mrKey, mr.getWrtOrgan(), "APC003", 37, "해양외사 모니터링 모니터링보고에 결재대기 문서가 있습니다.");
userAlarmService.sendAlarmToApprvUser(mrKey, mr.getWrtOrgan(), "APC004", 37, "해양외사 모니터링 모니터링보고에 결재대기 문서가 있습니다.");
userAlarmService.sendAlarmToApprvUser(mrKey, mr.getWrtOrgan(), "APC003", 37, "해양외사 모니터링 청산보고서에 결재대기 문서가 있습니다.");
userAlarmService.sendAlarmToApprvUser(mrKey, mr.getWrtOrgan(), "APC004", 37, "해양외사 모니터링 청산보고서에 결재대기 문서가 있습니다.");
}
return mrKey;
}
@ -237,6 +238,16 @@ public class MonitoringService extends BaseService {
}
private void saveReportList(Integer mrKey, List<MonitoringReport> reportList){
//파일삭제
List<MonitoringReport> fileList = monitoringReportRepository.findByMrKey(mrKey);
if(fileList != null) {
for(MonitoringReport file: fileList){
if(file.getOrigNm() != null) {
deleteStoredFile(new File(file.getSavePath(), file.getConvNm()));
}
}
}
monitoringReportRepository.deleteByMrKey(mrKey);
for(MonitoringReport info: reportList){
if(info.getFile() != null) {
@ -277,7 +288,8 @@ public class MonitoringService extends BaseService {
}
return savedReslut;
}
@Transactional
public Integer resultStateChange(MonitoringResultApprv apprv) {
MonitoringResult saveResult = monitoringResultRepository.findById(apprv.getMrKey()).orElse(null);
saveResult.setMrState(apprv.getState());
@ -288,8 +300,8 @@ public class MonitoringService extends BaseService {
switch (apprv.getState()){
case "DST004":
// 계장승인시 부장 결재권자에게 알림 발송.
userAlarmService.sendAlarmToApprvUser(saveResult.getMrKey(), saveResult.getWrtOrgan(), "APC001", 37, "해양외사 모니터링 모니터링보고에 결재대기 문서가 있습니다.");
userAlarmService.sendAlarmToApprvUser(saveResult.getMrKey(), saveResult.getWrtOrgan(), "APC002", 37, "해양외사 모니터링 모니터링보고에 결재대기 문서가 있습니다.");
userAlarmService.sendAlarmToApprvUser(saveResult.getMrKey(), saveResult.getWrtOrgan(), "APC001", 37, "해양외사 모니터링 청산보고서에 결재대기 문서가 있습니다.");
userAlarmService.sendAlarmToApprvUser(saveResult.getMrKey(), saveResult.getWrtOrgan(), "APC002", 37, "해양외사 모니터링 청산보고서에 결재대기 문서가 있습니다.");
break;
case "DST003":
case "DST005":
@ -304,10 +316,14 @@ public class MonitoringService extends BaseService {
return apprv.getMrKey();
}
public MonitoringResultFile selectmonitoringResultFile(Integer parentKey, Integer fileSeq) {
public MonitoringResultFile selectMonitoringResultFile(Integer parentKey, Integer fileSeq) {
return monitoringResultFileRepository.findById(new MonitoringResultFileId(parentKey,fileSeq)).orElse(null);
}
public MonitoringReport selectMonitoringReportFile(Integer parentKey, Integer infoSeq) {
return monitoringReportRepository.findById(new MonitoringReportId(parentKey,infoSeq)).orElse(null);
}

View File

@ -108,8 +108,8 @@
<if test='wrtOrgan != null and wrtOrgan != ""'>
and mr.wrt_organ = #{wrtOrgan}
</if>
<if test='mrTitle != null and mrTitle != ""'>
and mr.mr_title like '%'||#{mrTitle}||'%'
<if test='clearTitle != null and clearTitle != ""'>
and mr.clear_title like '%'||#{clearTitle}||'%'
</if>
<if test='mrState != null and mrState != ""'>
and mr.mr_state = #{mrState}
@ -161,6 +161,7 @@
<select id="selectResultList" resultType="MonitoringResult" parameterType="MonitoringResult">
select mr_key,
mr_title,
clear_title,
mr_sdate,
mr_edate,
md_dt,

View File

@ -27,7 +27,11 @@ function getResultEditModal(mrKey){
type: 'GET',
dataType:"html",
success: function(html){
$("#resultEditModalContent").empty().append(html)
$("#resultEditModalContent").empty().append(html);
$("#monitoringReason").hide();
if($("#monitoringYn").val() == 'N'){
$("#monitoringReason").show();
}
$("#mrSdate,#mrEdate").datepicker({
format: "yyyy-mm-dd",
language: "ko",
@ -78,6 +82,10 @@ $(document).on('click', '#getDesignationBtn', function (){
$("#mdName").val(tr.find(".mdName").val());
$("#mdNationality").val(tr.find(".mdNationality").val());
$("#mdRank").val(tr.find(".mdRank").val());
$("#mdDt2").val(tr.find(".mdDt").val());
$("#mdName2").val(tr.find(".mdName").val());
$("#mdNationality2").val(tr.find(".mdNationality").val());
$("#mdRank2").val(tr.find(".mdRank").val());
$("input[name=mdKey]").val(tr.find(".rowChkBox").val());
$("#designationListModal").modal("hide");
})
@ -113,15 +121,37 @@ $(document).on('click', '#editBtn', function (){
})
$(document).on('click', '#saveBtn', function (){
if($("#mrTitle").val() == ""){
alert("제목을 입력해주세요");
$('#mrTitle').focus();
if($("#clearTitle").val() == ""){
alert("결과보고서 제목을 입력해주세요");
$('#clearTitle').focus();
return false;
}
const clearInfoRowList = $("#clearInfoRow").find(".infoRow");
for(let i=0; i<clearInfoRowList.length; i++){
const div = clearInfoRowList[i];
if($(div).find(".useCatg").val() == ""){
alert("세부집행내역 구분을 선택해주세요");
return false;
}
if($(div).find(".useDetail").val() == ""){
alert("세부집행내역 상세를 선택해주세요");
return false;
}
if($(div).find(".price").val() == ""){
alert("세부집행내역 금액을 입력해주세요");
return false;
}
}
if($("input[name=mdKey]").val() == ""){
alert("모니터링 대상을 선택해주세요");
return false;
}
if($("#mrTitle").val() == ""){
alert("결과보고서 제목을 입력해주세요");
$('#mrTitle').focus();
return false;
}
const infoRowList = $("#resultInfoRow").find(".infoRow");
for(let i=0; i<infoRowList.length; i++){
const div = infoRowList[i];
@ -138,6 +168,22 @@ $(document).on('click', '#saveBtn', function (){
return false;
}
}
const monitoringInfoRowList = $("#monitoringInfoRow").find(".infoRow");
for(let i=0; i<monitoringInfoRowList.length; i++){
const div = monitoringInfoRowList[i];
if($(div).find(".contactDate").val() == ""){
alert("보니터링보고서 접촉일을 입력해주세요");
return false;
}
if($(div).find(".writeDate").val() == ""){
alert("모니터링보고서 작성일을 입력해주세요");
return false;
}
if($(div).find(".reportTitle").val() == ""){
alert("모니터링보고서 제목을 입력해주세요");
return false;
}
}
if(confirm("저장하시겠습니까?")){
saveResult('DST002');
}
@ -264,6 +310,22 @@ $(document).on('click', '.rowDeleteBtn3', function (){
$(this).parents(".infoRow").remove();
})
$(document).on('click', '#addImgBtn', function (){
$("#upload").remove();
$(document).on('click', '#addFileBtn', function (){
$(this).parents("#addFile").find("#updateFile").removeClass('d-none');
$(this).parents("#addFile").find("#fileAdd").remove();
})
$(document).on('click', '#deleteFileBtn', function (){
$(this).parents("#deleteFile").find("#updateFile").removeClass('d-none');
$(this).parents(".infoRow").find(".fileYn").val('Y');
$(this).parents("#deleteFile").find("#fileDelete").remove();
})
$(document).on('change', '#monitoringYn', function (){
if($("#monitoringYn").val() == 'N'){
$("#monitoringReason").show();
}else{
$("#monitoringReason").hide();
$("#monitoringReason").val("");
}
})

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header bg-dark">
<h5 class="modal-title text-white" id="affairEditModalLabel" th:text="${mr.mrKey eq null?'모니터링보고서 작성':'모니터링보고서 수정'}"></h5>
<h5 class="modal-title text-white" id="affairEditModalLabel" th:text="${mr.mrKey eq null?'청산보고서 작성':'청산보고서 수정'}"></h5>
<button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="affairEditBody">
@ -101,6 +101,23 @@
</div>
</div>
</th:block>
<div class="row mb-1">
<label for="usePrice" class="col-sm-2 col-form-label col-form-label-sm text-center">모니터링<br>지속여부</label>
<div class="col-sm-10">
<div class="row">
<div class="col-2 me-0">
<select class="form-select form-select-sm" id="monitoringYn" name="monitoringYn">
<option value="">선택</option>
<option value="Y" th:selected="${mr.monitoringYn eq 'Y'}">지속</option>
<option value="N" th:selected="${mr.monitoringYn eq 'N'}">지정해제</option>
</select>
</div>
<div class="col-10 me-0">
<input type="text" class="form-control form-control-sm" id="monitoringReason" name="monitoringReason" th:value="${mr.monitoringReason}">
</div>
</div>
</div>
</div>
<div class="row mb-1">
<label for="usePrice" class="col-sm-2 col-form-label col-form-label-sm text-center">집행액</label>
<div class="col-sm-4">
@ -189,19 +206,19 @@
<div class="row mb-1">
<label for="opName" class="col-sm-1 col-form-label col-form-label-sm text-center">대상지정일</label>
<div class="col-sm-2">
<input type="text" class="form-control form-control-sm" id="mdDt" disabled>
<input type="text" class="form-control form-control-sm" id="mdDt2" disabled>
</div>
<label for="opName" class="col-sm-1 col-form-label col-form-label-sm text-center">성명</label>
<div class="col-sm-2">
<input type="text" class="form-control form-control-sm" id="mdName" disabled>
<input type="text" class="form-control form-control-sm" id="mdName2" disabled>
</div>
<label for="opBirth" class="col-sm-1 col-form-label col-form-label-sm text-center">국적</label>
<div class="col-sm-2">
<input type="text" class="form-control form-control-sm" id="mdNationality" disabled>
<input type="text" class="form-control form-control-sm" id="mdNationality2" disabled>
</div>
<label for="opPosition" class="col-sm-1 col-form-label col-form-label-sm text-center">소속·계급</label>
<div class="col-sm-2">
<input type="text" class="form-control form-control-sm" id="mdRank" disabled>
<input type="text" class="form-control form-control-sm" id="mdRank2" disabled>
</div>
</div>
</th:block>
@ -293,6 +310,7 @@
<div class="col-12" id="monitoringInfoRow">
<th:block th:each="info:${mr.reportList}">
<div class="row my-1 infoRow">
<input type="hidden" class="fileYn">
<div class="col-2">
<input type="text" class="form-control form-control-sm contactDate" placeholder="YYYY-MM-DD" th:value="${info.contactDate}" readonly>
</div>
@ -304,27 +322,27 @@
</div>
<th:block th:if="${not #strings.isEmpty(info.origNm)}">
<div class="col-3">
<div class="input-group">
<div class="col-3" id="deleteFile">
<div class="input-group" id="fileDelete">
<input type="text" class="form-control form-control-sm" th:value="|${info.origNm}.${info.fileExtn}|" readonly>
<button type="button" class="btn btn-sm btn-danger" id="deleteImgBtn">
<button type="button" class="btn btn-sm btn-danger" id="deleteFileBtn">
<i class="bi bi-x"></i>
</button>
</div>
<input class="file d-none" id="updateFile" type="file">
</div>
</th:block>
<th:block th:unless="${not #strings.isEmpty(info.origNm)}">
<div class="col-3">
<div class="input-group">
<div class="col-3" id="addFile">
<div class="input-group" id="fileAdd">
<input type="text" class="form-control form-control-sm" value="등록된 파일이 없습니다." readonly>
<button type="button" class="btn btn-sm btn-primary" id="addImgBtn">
<button type="button" class="btn btn-sm btn-primary" id="addFileBtn">
<i class="bi bi-plus"></i>
</button>
</div>
<input class="file d-none" id="updateFile" type="file">
</div>
<!-- <input class="file" type="file" th:unless="${not #strings.isEmpty(info.origNm)}"> -->
</th:block>
<div class="col-1">
<button type="button" class="btn btn-sm btn-outline-danger rowDeleteBtn3"><i class="bi bi-x"></i></button>
</div>
@ -414,6 +432,7 @@
<div class="d-none" id="monitoringInfoFmOrigin">
<div class="row my-1 infoRow" id="monitoringnfoFm">
<input type="hidden" class="fileYn">
<div class="col-2">
<input type="text" class="form-control form-control-sm contactDate" placeholder="YYYY-MM-DD" readonly>
</div>

View File

@ -11,8 +11,8 @@
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<div class="row justify-content-between">
<div class="col-auto"><h4>모니터링 보고</h4></div>
<div class="col-auto"><p class="mb-0 mt-2">첩보수집활동 > 해양외사 모니터링 > 모니터링 보고</p></div>
<div class="col-auto"><h4>청산 보고서</h4></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">
@ -59,7 +59,7 @@
</div>
<div class="row justify-content-end">
<div class="col-2">
<input type="text" class="form-control form-control-sm" placeholder="제목" name="mrTitle" th:value="${searchParams.mrTitle}">
<input type="text" class="form-control form-control-sm" placeholder="제목" name="clearTitle" th:value="${searchParams.clearTitle}">
</div>
<div class="col-2">
<select class="form-select form-select-sm" name="mrState">
@ -114,7 +114,7 @@
<tbody class="table-group-divider">
<tr class="resultTr" th:each="list, cnt:${mrList}">
<td th:text="${cnt.count}"></td>
<td th:text="${list.mrTitle}"></td>
<td th:text="${list.clearTitle}"></td>
<td th:text="|${list.mrSdate}~${list.mrEdate}|"></td>
<td th:text="${list.mdDt}"></td>
<td th:text="${list.mdName}"></td>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header bg-dark">
<h5 class="modal-title text-white" id="affairViewModalLabel">해양 외사 모니터링보고서 열람</h5>
<h5 class="modal-title text-white" id="affairViewModalLabel">청산보고서 열람</h5>
<button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
@ -57,6 +57,17 @@
</div>
</div>
<hr>
<div class="row mb-1">
<label class="col-sm-1 col-form-label col-form-label-sm text-center">모니터링<br>지속여부</label>
<div class="col-sm-11 form-control-sm">
<div class="row">
<div th:if="${mr.monitoringYn eq 'Y'}">지속</div>
<div th:if="${mr.monitoringYn eq 'N'}">지정해제</div>
</div>
<div th:text="|사유 : ${mr.monitoringReason}|" th:if="${mr.monitoringYn eq 'N'}"></div>
</div>
</div>
<hr>
<div class="row mb-1">
<label class="col-sm-1 col-form-label col-form-label-sm text-center">집행액</label>
<div class="col-sm-11 form-control-sm" id="contentDiv">
@ -157,6 +168,37 @@
</div>
</div>
<div class="tab-pane fade p-2" id="affairListViewTabPanel" role="tabpanel" aria-labelledby="affairListViewTab" tabindex="0">
<div class="row mb-1">
<label for="clearTitle" class="col-sm-1 border-end border-secondary col-form-label col-form-label-sm text-center fw-bold">세부<br>집행내역</label>
<div class="col-sm-10">
<table class="table table-sm table-hover">
<thead>
<tr>
<th>접촉일자</th>
<th>작성일자</th>
<th>제목</th>
<th>첨부파일</th>
</tr>
</thead>
<tbody>
<tr th:each="report:${mr.reportList}">
<td th:text="${report.contactDate}"></td>
<td th:text="${report.writeDate}"></td>
<td th:text="${report.reportTitle}"></td>
<td>
<th:block th:if="${not #strings.isEmpty(report.origNm)}">
<a href="#" class="fileDownLink" data-board="monitoringReport"
th:data-parentkey="${report.mrKey}" th:data-fileseq="${report.infoSeq}" th:text="|${report.origNm}.${report.fileExtn}|"></a>
</th:block>
<th:block th:unless="${not #strings.isEmpty(report.origNm)}">등록된 파일이 없습니다.</th:block>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<hr>
<h5>증빙자료</h5>
<table class="table">
<thead>
<tr>