외사경찰견문관리 > 청산보고서 묶음인쇄 기능 추가.
parent
c32ecb1be9
commit
5f05d5663c
|
|
@ -286,7 +286,10 @@ public class ResultController { // 첩보수집활동 > 외사경찰 견문관
|
||||||
}
|
}
|
||||||
bundleMap.put("planBoard", planBoardList);
|
bundleMap.put("planBoard", planBoardList);
|
||||||
bundleMap.put("affairBoard", affairBoardList);
|
bundleMap.put("affairBoard", affairBoardList);
|
||||||
bundleMap.put("resultBoard", resultService.getPrintTypeResultBoard(resultBoard, codeMap));
|
resultBoard = resultService.getPrintTypeResultBoard(resultBoard, codeMap);
|
||||||
|
List<ResultBoard> resultBoardList = new ArrayList<>();
|
||||||
|
resultBoardList.add(resultBoard);
|
||||||
|
bundleMap.put("resultBoard", resultBoardList);
|
||||||
return bundleMap;
|
return bundleMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import java.io.Serializable;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@DynamicInsert
|
@DynamicInsert
|
||||||
@DynamicUpdate
|
@DynamicUpdate
|
||||||
@Table(name = "result_info")
|
@Table(name = "result_to_plan")
|
||||||
@IdClass(ResultToPlan.ResultToPlanId.class)
|
@IdClass(ResultToPlan.ResultToPlanId.class)
|
||||||
public class ResultToPlan {
|
public class ResultToPlan {
|
||||||
@Id
|
@Id
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
||||||
|
|
@ -1,49 +1,11 @@
|
||||||
$(document).on('click', '#printBtn', function (){
|
$(document).on('click', '#planPrintBtn', function (){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/affairPlan/planBoardJson',
|
url: '/affairPlan/planBoardJson',
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
data: {planKey: $(this).attr('data-plankey')},
|
data: {planKey: $(this).attr('data-plankey')},
|
||||||
dataType:"json",
|
dataType:"json",
|
||||||
success: function(data){
|
success: function(data){
|
||||||
const plan = {};
|
const plan = makePlanPrintData(data);
|
||||||
plan.contentTitle = data.contentTitle;
|
|
||||||
plan.planDt = data.planDt;
|
|
||||||
plan.wrtOrgan = data.wrtOrgan;
|
|
||||||
plan.wrtPart = data.wrtPart;
|
|
||||||
plan.wrtUserGrd = data.wrtUserGrd;
|
|
||||||
plan.wrtUserNm = data.wrtUserNm;
|
|
||||||
for(let i=0; i<data.apprvList.length; i++){
|
|
||||||
const apprv = data.apprvList[i];
|
|
||||||
switch (apprv.state) {
|
|
||||||
case "DST004":
|
|
||||||
plan.sectionApprv = apprv.userNm
|
|
||||||
break;
|
|
||||||
case "DST006":
|
|
||||||
plan.headApprv = apprv.userNm
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plan.sectionApprv === plan.headApprv){
|
|
||||||
plan.sectionApprv = "전결"
|
|
||||||
}
|
|
||||||
const planInfoSummery = [];
|
|
||||||
const planInfoDetail = [];
|
|
||||||
for(let i=0; i<data.mainInfoList.length; i++){
|
|
||||||
const info = data.mainInfoList[i];
|
|
||||||
if(info.planType === "S"){
|
|
||||||
planInfoSummery.push({planInfo: info.planInfo})
|
|
||||||
}else if(info.planType === "D"){
|
|
||||||
planInfoDetail.push({planInfo: info.planInfo})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
plan.planInfoSummery = planInfoSummery;
|
|
||||||
plan.planInfoDetail = planInfoDetail;
|
|
||||||
const fileList = [];
|
|
||||||
for(let i=0; i<data.fileList.length; i++){
|
|
||||||
fileList.push({origNm: data.fileList[i].origNm+"."+data.fileList[i].fileExtn});
|
|
||||||
}
|
|
||||||
plan.fileList = fileList;
|
|
||||||
|
|
||||||
var url = $("#printUrl").attr("data-printurl")+"/singlePrint.jsp";
|
var url = $("#printUrl").attr("data-printurl")+"/singlePrint.jsp";
|
||||||
var title = "계획 보고서 인쇄";
|
var title = "계획 보고서 인쇄";
|
||||||
var status = "width=900px,height=800px,scrollbars=yes";
|
var status = "width=900px,height=800px,scrollbars=yes";
|
||||||
|
|
@ -63,7 +25,7 @@ $(document).on('click', '#printBtn', function (){
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
$(document).on('click', '#printBtn', function (){
|
$(document).on('click', '#affairPrintBtn', function (){
|
||||||
// window.open(location.origin+"/affair/print?affairKey="+$(this).attr("data-affairkey"));
|
// window.open(location.origin+"/affair/print?affairKey="+$(this).attr("data-affairkey"));
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/affair/affairBoardJson',
|
url: '/affair/affairBoardJson',
|
||||||
|
|
@ -89,18 +51,14 @@ $(document).on('click', '#printBtn', function (){
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
$(document).on('click', '#printBtn', function (){
|
$(document).on('click', '#resultPrintBtn', function (){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/affairResult/resultBoardJson',
|
url: '/affairResult/resultBoardJson',
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
data: {resultKey: $(this).attr('data-resultkey')},
|
data: {resultKey: $(this).attr('data-resultkey')},
|
||||||
dataType:"json",
|
dataType:"json",
|
||||||
success: function(data){
|
success: function(data){
|
||||||
data.planPrice = priceNumberToKorean(data.planPrice);
|
data = makeResultPrintData(data);
|
||||||
data.usePrice = priceNumberToKorean(data.usePrice);
|
|
||||||
for(let i=0; i<data.clearInfoList.length; i++){
|
|
||||||
data.clearInfoList[i].price = "₩ "+data.clearInfoList[i].price.toLocaleString('ko-KR')
|
|
||||||
}
|
|
||||||
var url = $("#printUrl").attr("data-printurl")+"/singlePrint.jsp";
|
var url = $("#printUrl").attr("data-printurl")+"/singlePrint.jsp";
|
||||||
var title = "청산 보고서 인쇄";
|
var title = "청산 보고서 인쇄";
|
||||||
var status = "width=900px,height=800px,scrollbars=yes";
|
var status = "width=900px,height=800px,scrollbars=yes";
|
||||||
|
|
@ -119,18 +77,17 @@ $(document).on('click', '#printBtn', function (){
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
$(document).on('click', '#printBundleBtn', function (){
|
$(document).on('click', '#bundlePrintBtn', function (){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/affairResult/resultBundleJson',
|
url: '/affairResult/resultBundleJson',
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
data: {resultKey: $(this).attr('data-resultkey')},
|
data: {resultKey: $(this).attr('data-resultkey')},
|
||||||
dataType:"json",
|
dataType:"json",
|
||||||
success: function(data){
|
success: function(data){
|
||||||
/*data.planPrice = priceNumberToKorean(data.planPrice);
|
for(let i=0; i<data.planBoard.length; i++){
|
||||||
data.usePrice = priceNumberToKorean(data.usePrice);
|
data.planBoard[i] = makePlanPrintData(data.planBoard[i]);
|
||||||
for(let i=0; i<data.clearInfoList.length; i++){
|
}
|
||||||
data.clearInfoList[i].price = "₩ "+data.clearInfoList[i].price.toLocaleString('ko-KR')
|
data.resultBoard[0] = makeResultPrintData(data.resultBoard[0]);
|
||||||
}*/
|
|
||||||
var url = $("#printUrl").attr("data-printurl")+"/singlePrint.jsp";
|
var url = $("#printUrl").attr("data-printurl")+"/singlePrint.jsp";
|
||||||
var title = "청산 보고서 인쇄";
|
var title = "청산 보고서 인쇄";
|
||||||
var status = "width=900px,height=800px,scrollbars=yes";
|
var status = "width=900px,height=800px,scrollbars=yes";
|
||||||
|
|
@ -148,7 +105,55 @@ $(document).on('click', '#printBundleBtn', function (){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
function makePlanPrintData(data){
|
||||||
|
const plan = {};
|
||||||
|
plan.contentTitle = data.contentTitle;
|
||||||
|
plan.planDt = data.planDt;
|
||||||
|
plan.wrtOrgan = data.wrtOrgan;
|
||||||
|
plan.wrtPart = data.wrtPart;
|
||||||
|
plan.wrtUserGrd = data.wrtUserGrd;
|
||||||
|
plan.wrtUserNm = data.wrtUserNm;
|
||||||
|
for(let i=0; i<data.apprvList.length; i++){
|
||||||
|
const apprv = data.apprvList[i];
|
||||||
|
switch (apprv.state) {
|
||||||
|
case "DST004":
|
||||||
|
plan.sectionApprv = apprv.userNm
|
||||||
|
break;
|
||||||
|
case "DST006":
|
||||||
|
plan.headApprv = apprv.userNm
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(plan.sectionApprv === plan.headApprv){
|
||||||
|
plan.sectionApprv = "전결"
|
||||||
|
}
|
||||||
|
const planInfoSummery = [];
|
||||||
|
const planInfoDetail = [];
|
||||||
|
for(let i=0; i<data.mainInfoList.length; i++){
|
||||||
|
const info = data.mainInfoList[i];
|
||||||
|
if(info.planType === "S"){
|
||||||
|
planInfoSummery.push({planInfo: info.planInfo})
|
||||||
|
}else if(info.planType === "D"){
|
||||||
|
planInfoDetail.push({planInfo: info.planInfo})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
plan.planInfoSummery = planInfoSummery;
|
||||||
|
plan.planInfoDetail = planInfoDetail;
|
||||||
|
const fileList = [];
|
||||||
|
for(let i=0; i<data.fileList.length; i++){
|
||||||
|
fileList.push({origNm: data.fileList[i].origNm+"."+data.fileList[i].fileExtn});
|
||||||
|
}
|
||||||
|
plan.fileList = fileList;
|
||||||
|
return plan;
|
||||||
|
}
|
||||||
|
function makeResultPrintData(resultBoard){
|
||||||
|
resultBoard.planPrice = priceNumberToKorean(resultBoard.planPrice);
|
||||||
|
resultBoard.usePrice = priceNumberToKorean(resultBoard.usePrice);
|
||||||
|
for(let i=0; i<resultBoard.clearInfoList.length; i++){
|
||||||
|
resultBoard.clearInfoList[i].price = "₩ "+resultBoard.clearInfoList[i].price.toLocaleString('ko-KR')
|
||||||
|
}
|
||||||
|
return resultBoard;
|
||||||
|
}
|
||||||
function priceNumberToKorean(price){
|
function priceNumberToKorean(price){
|
||||||
const koreanNumber = ['', '일','이','삼','사','오','육','칠','팔','구'];
|
const koreanNumber = ['', '일','이','삼','사','오','육','칠','팔','구'];
|
||||||
const tenThousandUnit = ['', '만', '억', '조'];
|
const tenThousandUnit = ['', '만', '억', '조'];
|
||||||
|
|
@ -4,7 +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/fpiMgt/affairMgt.js}"></script>
|
<script type="text/javascript" th:src="@{/js/igActivities/fpiMgt/affairMgt.js}"></script>
|
||||||
<script type="text/javascript" th:src="@{/js/igActivities/fpiMgt/print.js}"></script>
|
<script type="text/javascript" th:src="@{/js/igActivities/fpiMgt/fpiPrint.js}"></script>
|
||||||
</th:block>
|
</th:block>
|
||||||
<div layout:fragment="content">
|
<div layout:fragment="content">
|
||||||
<main>
|
<main>
|
||||||
|
|
|
||||||
|
|
@ -335,7 +335,7 @@
|
||||||
<th:block th:if="${modalType ne 'viewOnly'}">
|
<th:block th:if="${modalType ne 'viewOnly'}">
|
||||||
<div class="modal-footer bg-light">
|
<div class="modal-footer bg-light">
|
||||||
<th:block th:if="${affair.affairStatus eq 'DST006'}">
|
<th:block th:if="${affair.affairStatus eq 'DST006'}">
|
||||||
<button type="button" class="btn btn-secondary" id="printBtn" th:data-affairkey="${affair.affairKey}">인쇄</button>
|
<button type="button" class="btn btn-secondary" id="affairPrintBtn" th:data-affairkey="${affair.affairKey}">인쇄</button>
|
||||||
</th:block>
|
</th:block>
|
||||||
<th:block th:if="${userOrgan eq 'OG001' and accessAuth eq 'ACC003'}">
|
<th:block th:if="${userOrgan eq 'OG001' and accessAuth eq 'ACC003'}">
|
||||||
<!--본청 관리자 상시 수정 허용-->
|
<!--본청 관리자 상시 수정 허용-->
|
||||||
|
|
|
||||||
|
|
@ -4,7 +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/fpiMgt/planMgt.js}"></script>
|
<script type="text/javascript" th:src="@{/js/igActivities/fpiMgt/planMgt.js}"></script>
|
||||||
<script type="text/javascript" th:src="@{/js/igActivities/fpiMgt/print.js}"></script>
|
<script type="text/javascript" th:src="@{/js/igActivities/fpiMgt/fpiPrint.js}"></script>
|
||||||
</th:block>
|
</th:block>
|
||||||
<div layout:fragment="content">
|
<div layout:fragment="content">
|
||||||
<main>
|
<main>
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@
|
||||||
<th:block th:if="${modalType ne 'viewOnly'}">
|
<th:block th:if="${modalType ne 'viewOnly'}">
|
||||||
<div class="modal-footer bg-light">
|
<div class="modal-footer bg-light">
|
||||||
<th:block th:if="${plan.planState eq 'DST006'}">
|
<th:block th:if="${plan.planState eq 'DST006'}">
|
||||||
<button type="button" class="btn btn-secondary" id="printBtn" th:data-plankey="${plan.planKey}">인쇄</button>
|
<button type="button" class="btn btn-secondary" id="planPrintBtn" th:data-plankey="${plan.planKey}">인쇄</button>
|
||||||
</th:block>
|
</th:block>
|
||||||
<th:block th:unless="${plan.planState eq 'DST004' or plan.planState eq 'DST006'}"><!--승인 상태일때는 수정 불가-->
|
<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'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
|
<th:block th:if="${userSeq eq plan.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
|
||||||
|
|
|
||||||
|
|
@ -4,7 +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/fpiMgt/resultMgt.js}"></script>
|
<script type="text/javascript" th:src="@{/js/igActivities/fpiMgt/resultMgt.js}"></script>
|
||||||
<script type="text/javascript" th:src="@{/js/igActivities/fpiMgt/print.js}"></script>
|
<script type="text/javascript" th:src="@{/js/igActivities/fpiMgt/fpiPrint.js}"></script>
|
||||||
</th:block>
|
</th:block>
|
||||||
<div layout:fragment="content">
|
<div layout:fragment="content">
|
||||||
<main>
|
<main>
|
||||||
|
|
|
||||||
|
|
@ -298,8 +298,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer bg-light">
|
<div class="modal-footer bg-light">
|
||||||
<th:block th:if="${result.resultState eq 'DST006'}">
|
<th:block th:if="${result.resultState eq 'DST006'}">
|
||||||
<button type="button" class="btn btn-secondary" id="printBundleBtn" th:data-resultkey="${result.resultKey}">묶음인쇄</button>
|
<button type="button" class="btn btn-secondary" id="bundlePrintBtn" th:data-resultkey="${result.resultKey}">묶음인쇄</button>
|
||||||
<button type="button" class="btn btn-secondary" id="printBtn" th:data-resultkey="${result.resultKey}">개별인쇄</button>
|
<button type="button" class="btn btn-secondary" id="resultPrintBtn" th:data-resultkey="${result.resultKey}">개별인쇄</button>
|
||||||
</th:block>
|
</th:block>
|
||||||
<th:block th:unless="${result.resultState eq 'DST004' or result.resultState eq 'DST006'}"><!--승인 상태일때는 수정 불가-->
|
<th:block th:unless="${result.resultState eq 'DST004' or result.resultState eq 'DST006'}"><!--승인 상태일때는 수정 불가-->
|
||||||
<th:block th:if="${userSeq eq result.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
|
<th:block th:if="${userSeq eq result.wrtUserSeq or accessAuth eq 'ACC003'}"><!--작성자일 경우 수정 허용--><!--관리자일 경우 수정 허용-->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue