외사경찰견문관리 > 청산보고서 묶음인쇄 기능 추가.
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,10 +1,111 @@
|
||||||
$(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 = makePlanPrintData(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 = "planBoard";
|
||||||
|
form.json.value = JSON.stringify(plan);
|
||||||
|
form.method = "post";
|
||||||
|
form.submit();
|
||||||
|
},
|
||||||
|
error:function(e){
|
||||||
|
ajaxErrorAction(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
$(document).on('click', '#affairPrintBtn', function (){
|
||||||
|
// window.open(location.origin+"/affair/print?affairKey="+$(this).attr("data-affairkey"));
|
||||||
|
$.ajax({
|
||||||
|
url: '/affair/affairBoardJson',
|
||||||
|
type: 'GET',
|
||||||
|
data: {affairKey: $(this).attr('data-affairkey')},
|
||||||
|
dataType:"json",
|
||||||
|
success: function(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 = "affairBoard";
|
||||||
|
form.json.value = JSON.stringify(data);
|
||||||
|
form.method = "post";
|
||||||
|
form.submit();
|
||||||
|
},
|
||||||
|
error:function(e){
|
||||||
|
ajaxErrorAction(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).on('click', '#resultPrintBtn', function (){
|
||||||
|
$.ajax({
|
||||||
|
url: '/affairResult/resultBoardJson',
|
||||||
|
type: 'GET',
|
||||||
|
data: {resultKey: $(this).attr('data-resultkey')},
|
||||||
|
dataType:"json",
|
||||||
|
success: function(data){
|
||||||
|
data = makeResultPrintData(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 = "resultBoard";
|
||||||
|
form.json.value = JSON.stringify(data);
|
||||||
|
form.method = "post";
|
||||||
|
form.submit();
|
||||||
|
},
|
||||||
|
error:function(e){
|
||||||
|
ajaxErrorAction(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).on('click', '#bundlePrintBtn', function (){
|
||||||
|
$.ajax({
|
||||||
|
url: '/affairResult/resultBundleJson',
|
||||||
|
type: 'GET',
|
||||||
|
data: {resultKey: $(this).attr('data-resultkey')},
|
||||||
|
dataType:"json",
|
||||||
|
success: function(data){
|
||||||
|
for(let i=0; i<data.planBoard.length; i++){
|
||||||
|
data.planBoard[i] = makePlanPrintData(data.planBoard[i]);
|
||||||
|
}
|
||||||
|
data.resultBoard[0] = makeResultPrintData(data.resultBoard[0]);
|
||||||
|
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 = "bundle";
|
||||||
|
form.json.value = JSON.stringify(data);
|
||||||
|
form.method = "post";
|
||||||
|
form.submit();
|
||||||
|
},
|
||||||
|
error:function(e){
|
||||||
|
ajaxErrorAction(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
function makePlanPrintData(data){
|
||||||
const plan = {};
|
const plan = {};
|
||||||
plan.contentTitle = data.contentTitle;
|
plan.contentTitle = data.contentTitle;
|
||||||
plan.planDt = data.planDt;
|
plan.planDt = data.planDt;
|
||||||
|
|
@ -43,112 +144,16 @@ $(document).on('click', '#printBtn', function (){
|
||||||
fileList.push({origNm: data.fileList[i].origNm+"."+data.fileList[i].fileExtn});
|
fileList.push({origNm: data.fileList[i].origNm+"."+data.fileList[i].fileExtn});
|
||||||
}
|
}
|
||||||
plan.fileList = fileList;
|
plan.fileList = fileList;
|
||||||
|
return plan;
|
||||||
var url = $("#printUrl").attr("data-printurl")+"/singlePrint.jsp";
|
}
|
||||||
var title = "계획 보고서 인쇄";
|
function makeResultPrintData(resultBoard){
|
||||||
var status = "width=900px,height=800px,scrollbars=yes";
|
resultBoard.planPrice = priceNumberToKorean(resultBoard.planPrice);
|
||||||
window.open("", title, status);
|
resultBoard.usePrice = priceNumberToKorean(resultBoard.usePrice);
|
||||||
const form = $("#printForm")[0];
|
for(let i=0; i<resultBoard.clearInfoList.length; i++){
|
||||||
form.target = title;
|
resultBoard.clearInfoList[i].price = "₩ "+resultBoard.clearInfoList[i].price.toLocaleString('ko-KR')
|
||||||
form.action = url;
|
|
||||||
form.crfName.value = "planBoard";
|
|
||||||
form.json.value = JSON.stringify(plan);
|
|
||||||
form.method = "post";
|
|
||||||
form.submit();
|
|
||||||
},
|
|
||||||
error:function(e){
|
|
||||||
ajaxErrorAction(e);
|
|
||||||
}
|
}
|
||||||
});
|
return resultBoard;
|
||||||
})
|
}
|
||||||
|
|
||||||
|
|
||||||
$(document).on('click', '#printBtn', function (){
|
|
||||||
// window.open(location.origin+"/affair/print?affairKey="+$(this).attr("data-affairkey"));
|
|
||||||
$.ajax({
|
|
||||||
url: '/affair/affairBoardJson',
|
|
||||||
type: 'GET',
|
|
||||||
data: {affairKey: $(this).attr('data-affairkey')},
|
|
||||||
dataType:"json",
|
|
||||||
success: function(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 = "affairBoard";
|
|
||||||
form.json.value = JSON.stringify(data);
|
|
||||||
form.method = "post";
|
|
||||||
form.submit();
|
|
||||||
},
|
|
||||||
error:function(e){
|
|
||||||
ajaxErrorAction(e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
$(document).on('click', '#printBtn', function (){
|
|
||||||
$.ajax({
|
|
||||||
url: '/affairResult/resultBoardJson',
|
|
||||||
type: 'GET',
|
|
||||||
data: {resultKey: $(this).attr('data-resultkey')},
|
|
||||||
dataType:"json",
|
|
||||||
success: function(data){
|
|
||||||
data.planPrice = priceNumberToKorean(data.planPrice);
|
|
||||||
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 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 = "resultBoard";
|
|
||||||
form.json.value = JSON.stringify(data);
|
|
||||||
form.method = "post";
|
|
||||||
form.submit();
|
|
||||||
},
|
|
||||||
error:function(e){
|
|
||||||
ajaxErrorAction(e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
$(document).on('click', '#printBundleBtn', function (){
|
|
||||||
$.ajax({
|
|
||||||
url: '/affairResult/resultBundleJson',
|
|
||||||
type: 'GET',
|
|
||||||
data: {resultKey: $(this).attr('data-resultkey')},
|
|
||||||
dataType:"json",
|
|
||||||
success: function(data){
|
|
||||||
/*data.planPrice = priceNumberToKorean(data.planPrice);
|
|
||||||
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 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 = "bundle";
|
|
||||||
form.json.value = JSON.stringify(data);
|
|
||||||
form.method = "post";
|
|
||||||
form.submit();
|
|
||||||
},
|
|
||||||
error:function(e){
|
|
||||||
ajaxErrorAction(e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
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