해양외사 모니터링 > 지정보고 인쇄기능 추가.
parent
ce167cf154
commit
e67fdfd50d
|
|
@ -1,6 +1,7 @@
|
||||||
package com.dbnt.faisp.main.fpiMgt.monitoring;
|
package com.dbnt.faisp.main.fpiMgt.monitoring;
|
||||||
|
|
||||||
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
|
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
|
||||||
|
import com.dbnt.faisp.main.codeMgt.model.CodeMgt;
|
||||||
import com.dbnt.faisp.main.codeMgt.service.CodeMgtService;
|
import com.dbnt.faisp.main.codeMgt.service.CodeMgtService;
|
||||||
import com.dbnt.faisp.main.fpiMgt.affair.model.AffairBoard;
|
import com.dbnt.faisp.main.fpiMgt.affair.model.AffairBoard;
|
||||||
import com.dbnt.faisp.main.fpiMgt.affairPlan.model.PlanApprv;
|
import com.dbnt.faisp.main.fpiMgt.affairPlan.model.PlanApprv;
|
||||||
|
|
@ -18,8 +19,10 @@ import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
|
@ -318,4 +321,13 @@ public class MonitoringController { // 첩보수집활동 > 해양외사모니
|
||||||
monitoringService.deleteMonitoringResult(mr.getMrKey());
|
monitoringService.deleteMonitoringResult(mr.getMrKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/designationJson")
|
||||||
|
public MonitoringDesignation monitoringDesignationJson(MonitoringDesignation md, HttpSession session){
|
||||||
|
Map<String, List<CodeMgt>> codeMap = (Map<String, List<CodeMgt>>) session.getAttribute("commonCode");
|
||||||
|
md = monitoringService.selectDesignation(md.getMdKey());
|
||||||
|
md = monitoringService.getPrintTypeDesignation(md, codeMap);
|
||||||
|
return md;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ package com.dbnt.faisp.main.fpiMgt.monitoring.service;
|
||||||
import com.dbnt.faisp.config.BaseService;
|
import com.dbnt.faisp.config.BaseService;
|
||||||
import com.dbnt.faisp.config.FileInfo;
|
import com.dbnt.faisp.config.FileInfo;
|
||||||
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
|
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
|
||||||
|
import com.dbnt.faisp.main.codeMgt.model.CodeMgt;
|
||||||
import com.dbnt.faisp.main.fpiMgt.affairPlan.mapper.PlanMapper;
|
import com.dbnt.faisp.main.fpiMgt.affairPlan.mapper.PlanMapper;
|
||||||
import com.dbnt.faisp.main.fpiMgt.affairPlan.model.PlanApprv;
|
import com.dbnt.faisp.main.fpiMgt.affairPlan.model.PlanApprv;
|
||||||
import com.dbnt.faisp.main.fpiMgt.affairPlan.model.PlanBoard;
|
import com.dbnt.faisp.main.fpiMgt.affairPlan.model.PlanBoard;
|
||||||
|
|
@ -51,6 +52,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
|
@ -347,4 +349,14 @@ public class MonitoringService extends BaseService {
|
||||||
public void deleteMonitoringResult(Integer mrKey) {
|
public void deleteMonitoringResult(Integer mrKey) {
|
||||||
monitoringResultRepository.bulkModifyingByMrKeyToMrState(mrKey, "DST008");
|
monitoringResultRepository.bulkModifyingByMrKeyToMrState(mrKey, "DST008");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MonitoringDesignation getPrintTypeDesignation(MonitoringDesignation md, Map<String, List<CodeMgt>> codeMap) {
|
||||||
|
md.setWrtPart(Utils.searchCodeValue(md.getWrtPart(), codeMap.get(md.getWrtOrgan())));
|
||||||
|
md.setWrtOrgan(Utils.searchCodeValue(md.getWrtOrgan(), codeMap.get("OG")));
|
||||||
|
md.setWrtUserGrd(Utils.searchCodeValue(md.getWrtUserGrd(), codeMap.get("JT")));
|
||||||
|
for(MonitoringDesignationApprv apprv : md.getApprvList()){
|
||||||
|
apprv.setUserGrd(Utils.searchCodeValue(apprv.getUserGrd(), codeMap.get("JT")));
|
||||||
|
}
|
||||||
|
return md;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,111 @@
|
||||||
|
$(document).on('click', '#designationPrintBtn', function (){
|
||||||
|
$.ajax({
|
||||||
|
url: '/monitoring/designationJson',
|
||||||
|
type: 'GET',
|
||||||
|
data: {mdKey: $(this).attr('data-mdkey')},
|
||||||
|
dataType:"json",
|
||||||
|
success: function(data){
|
||||||
|
const md = makeDesignationPrintData(data);
|
||||||
|
var url = $("#printUrl").attr("data-printurl")+"/singlePrint.jsp";
|
||||||
|
var title = "지정보고 인쇄";
|
||||||
|
var status = "width=900px,height=800px,scrollbars=yes";
|
||||||
|
window.open("", title, status);
|
||||||
|
const form = $("#printForm")[0];
|
||||||
|
form.target = title;
|
||||||
|
form.action = url;
|
||||||
|
form.crfName.value = "designation";
|
||||||
|
form.json.value = JSON.stringify(md);
|
||||||
|
form.method = "post";
|
||||||
|
form.submit();
|
||||||
|
},
|
||||||
|
error:function(e){
|
||||||
|
ajaxErrorAction(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).on('click', '#analyzePrintBtn', function (){
|
||||||
|
$.ajax({
|
||||||
|
url: '/intelligenceNetwork/intelligenceAnalyzeJson',
|
||||||
|
type: 'GET',
|
||||||
|
data: {iaKey: $(this).attr('data-iakey')},
|
||||||
|
dataType:"json",
|
||||||
|
success: function(data){
|
||||||
|
const analyze = makeAnalyzePrintData(data);
|
||||||
|
var url = $("#printUrl").attr("data-printurl")+"/singlePrint.jsp";
|
||||||
|
var title = "분석평가서 인쇄";
|
||||||
|
var status = "width=900px,height=800px,scrollbars=yes";
|
||||||
|
window.open("", title, status);
|
||||||
|
const form = $("#printForm")[0];
|
||||||
|
form.target = title;
|
||||||
|
form.action = url;
|
||||||
|
form.crfName.value = "intelligenceAnalyze";
|
||||||
|
form.json.value = JSON.stringify(analyze);
|
||||||
|
form.method = "post";
|
||||||
|
form.submit();
|
||||||
|
},
|
||||||
|
error:function(e){
|
||||||
|
ajaxErrorAction(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
function makeDesignationPrintData(data){
|
||||||
|
const md = {
|
||||||
|
mdDt: data.mdDt,
|
||||||
|
mdTitle: data.mdTitle,
|
||||||
|
mdName: data.mdName,
|
||||||
|
mdNationality: data.mdNationality,
|
||||||
|
mdRank: data.mdRank,
|
||||||
|
mdBirth: data.mdBirth,
|
||||||
|
mdAddress: data.mdAddress,
|
||||||
|
mdCareer: data.mdCareer,
|
||||||
|
mdEtc: data.mdEtc,
|
||||||
|
mdReason: data.mdReason,
|
||||||
|
mdPlan: data.mdPlan,
|
||||||
|
wrtDt: data.wrtDt.replace("T", " ").substring(0, 16),
|
||||||
|
wrtPart: data.wrtOrgan+" "+data.wrtPart,
|
||||||
|
wrtUserGrd: data.wrtUserGrd,
|
||||||
|
wrtUserNm: data.wrtUserNm
|
||||||
|
};
|
||||||
|
const sectionApprv = data.apprvList[0];
|
||||||
|
md.sectionNm = sectionApprv.userGrd+" "+sectionApprv.userNm;
|
||||||
|
const headApprv = data.apprvList[1];
|
||||||
|
md.headNm = headApprv.userGrd+" "+headApprv.userNm;
|
||||||
|
return md;
|
||||||
|
}
|
||||||
|
|
||||||
|
function makeAnalyzePrintData(data){
|
||||||
|
const analyze = {};
|
||||||
|
analyze.iaSdate = data.iaSdate;
|
||||||
|
analyze.iaEdate = data.iaEdate;
|
||||||
|
analyze.fiCnt = data.fiCnt;
|
||||||
|
analyze.faCnt = data.faCnt;
|
||||||
|
analyze.workCnt = data.workCnt;
|
||||||
|
analyze.arrestCnt = data.arrestCnt;
|
||||||
|
analyze.totalCnt = data.totalCnt
|
||||||
|
analyze.specialCnt = data.specialCnt;
|
||||||
|
analyze.middleCnt = data.middleCnt;
|
||||||
|
analyze.tongCnt = data.tongCnt;
|
||||||
|
analyze.joCnt = data.joCnt;
|
||||||
|
analyze.muCnt = data.muCnt;
|
||||||
|
analyze.iaTotal = data.iaTotal;
|
||||||
|
analyze.foreignAffairs = data.foreignAffairs;
|
||||||
|
analyze.work = data.work;
|
||||||
|
analyze.arrestOffenders = data.arrestOffenders;
|
||||||
|
analyze.analysisEvaluation = data.analysisEvaluation;
|
||||||
|
analyze.measures = data.measures;
|
||||||
|
|
||||||
|
analyze.wrtDt = data.wrtDt.replace("T", " ").substring(0, 16);
|
||||||
|
analyze.wrtPart = data.wrtOrgan+" "+data.wrtPart;
|
||||||
|
analyze.wrtUserGrd = data.wrtUserGrd;
|
||||||
|
analyze.wrtUserNm = data.wrtUserNm;
|
||||||
|
|
||||||
|
const apprv = data.apprvList[0];
|
||||||
|
analyze.opinion = apprv.opinion;
|
||||||
|
analyze.instruction = apprv.instruction;
|
||||||
|
analyze.headPart = apprv.ogCd+" "+apprv.ofcCd;
|
||||||
|
analyze.headGrd = apprv.userGrd;
|
||||||
|
analyze.headNm = apprv.userNm;
|
||||||
|
return analyze;
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
layout:decorate="~{layout/layout}">
|
layout:decorate="~{layout/layout}">
|
||||||
<th:block layout:fragment="script">
|
<th:block layout:fragment="script">
|
||||||
<script type="text/javascript" th:src="@{/js/igActivities/monitoring/designation.js}"></script>
|
<script type="text/javascript" th:src="@{/js/igActivities/monitoring/designation.js}"></script>
|
||||||
|
<script type="text/javascript" th:src="@{/js/igActivities/monitoring/monitoringPrint.js}"></script>
|
||||||
</th:block>
|
</th:block>
|
||||||
<div layout:fragment="content">
|
<div layout:fragment="content">
|
||||||
<main>
|
<main>
|
||||||
|
|
@ -175,5 +176,11 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="d-none">
|
||||||
|
<form id="printForm">
|
||||||
|
<input type="hidden" name="crfName">
|
||||||
|
<input type="hidden" name="json">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -157,6 +157,9 @@
|
||||||
</th:block>
|
</th:block>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
|
<th:block th:if="${md.mdState eq 'DST006'}">
|
||||||
|
<button type="button" class="btn btn-secondary" id="designationPrintBtn" th:data-mdkey="${md.mdKey}">인쇄</button>
|
||||||
|
</th:block>
|
||||||
<th:block th:unless="${md.mdState eq 'DST004' or md.mdState eq 'DST006'}"><!--승인 상태일때는 수정 불가 -->
|
<th:block th:unless="${md.mdState eq 'DST004' or md.mdState eq 'DST006'}"><!--승인 상태일때는 수정 불가 -->
|
||||||
<th:block th:if="${userSeq eq md.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
|
<th:block th:if="${userSeq eq md.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
|
||||||
<button type="button" class="btn btn-warning" th:data-mdkey="${md.mdKey}" id="editBtn">수정</button>
|
<button type="button" class="btn btn-warning" th:data-mdkey="${md.mdKey}" id="editBtn">수정</button>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue