출력 설정 테이블 변경

main
이범준 12 months ago
parent b76e1dc44b
commit 54ee5dcf1e

@ -9,9 +9,9 @@ public class DefaultOtptStng {
/**
*
*/
public DefaultOtptStng(String componentType, String otptNm, String dscrp, String otptBscVl){
public DefaultOtptStng(String componentType, String otptArtclNm, String dscrp, String otptBscVl){
this.componentType = componentType;
this.otptNm=otptNm;
this.otptArtclNm=otptArtclNm;
this.dscrp=dscrp;
this.otptBscVl=otptBscVl;
@ -118,7 +118,7 @@ public class DefaultOtptStng {
private boolean forPost; //우편물 관련 요소 여부
private String dscrp; //출력항목 설명
private String otptNm; //출력항목명
private String otptArtclNm; //출력항목명
private Pstn a4; //A4 위치값
private Pstn letter; //레터 위치값
private float widthSz; //영역크기 길이

@ -27,15 +27,15 @@ public abstract class PDFFormat {
/**
* .
*/
public DefaultOtptStng text(String otptNm, String dscrp, String otptBscVl){
return new DefaultOtptStng("text", otptNm, dscrp, otptBscVl);
public DefaultOtptStng text(String otptArtclNm, String dscrp, String otptBscVl){
return new DefaultOtptStng("text", otptArtclNm, dscrp, otptBscVl);
}
/**
* .
*/
public DefaultOtptStng image(String otptNm, String dscrp, String otptBscVl){
return new DefaultOtptStng("image", otptNm, dscrp, otptBscVl);
public DefaultOtptStng image(String otptArtclNm, String dscrp, String otptBscVl){
return new DefaultOtptStng("image", otptArtclNm, dscrp, otptBscVl);
}
/**
@ -59,13 +59,13 @@ public abstract class PDFFormat {
/**
* .
*/
public abstract String getMappingValue(String otptNm, String defaultValue, boolean forPost,
public abstract String getMappingValue(String otptArtclNm, String defaultValue, boolean forPost,
DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil);
/**
* .
*/
public abstract String getValueForPost(String otptNm, String defaultValue,
public abstract String getValueForPost(String otptArtclNm, String defaultValue,
DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil);
/**
@ -76,9 +76,9 @@ public abstract class PDFFormat {
List<DefaultOtptStng> prototypeStngs = this.getPrototypeStngs();
for(DataObject otptStng : otptStngList) {
String otptNm = (String) otptStng.get("OTPT_NM");
String otptArtclNm = (String) otptStng.get("OTPT_ARTCL_NM");
DefaultOtptStng prototypeStng = prototypeStngs.stream()
.filter(item -> item.getOtptNm().equals(otptNm)).toList().get(0);
.filter(item -> item.getOtptArtclNm().equals(otptArtclNm)).toList().get(0);
otptStng.set("UNIQUE_YN", prototypeStng.isUnique() ? "Y" : "N");
otptStng.set("DSCRP", prototypeStng.getDscrp());

@ -84,15 +84,15 @@ public class Advntce extends PDFFormat {
* .
*/
@Override
public String getMappingValue(String otptNm, String defaultValue, boolean forPost,
public String getMappingValue(String otptArtclNm, String defaultValue, boolean forPost,
DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil) {
String result = "";
if(forPost) {
return this.getValueForPost(otptNm, defaultValue, dataObject, printOption, pdfPrintUtil);
return this.getValueForPost(otptArtclNm, defaultValue, dataObject, printOption, pdfPrintUtil);
}
switch(otptNm) {
switch(otptArtclNm) {
case "background" -> {
result = dataObject.string("");
}
@ -233,11 +233,11 @@ public class Advntce extends PDFFormat {
* .
*/
@Override
public String getValueForPost(String otptNm, String defaultValue,
public String getValueForPost(String otptArtclNm, String defaultValue,
DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil) {
String result = "";
switch(otptNm) {
switch(otptArtclNm) {
case "postReceiverAddr" -> {
result = dataObject.string("RTPYR_ADDR");
}

@ -8,7 +8,7 @@ import lombok.Setter;
@Setter
public class OtptStng extends AbstractEntity {
private String otptFormId; //출력항목ID
private String otptNm; //출력항목명
private String otptArtclNm; //출력항목명
private String leftPstn; //좌측 위치
private String topPstn; //상단 위치
private String widthSz; //영역크기 길이

@ -364,9 +364,9 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
for(DataObject otptItemStng : otptStng) {
String otptNm = otptItemStng.string("OTPT_NM");
String otptArtclNm = otptItemStng.string("OTPT_ARTCL_NM");
DefaultOtptStng prototypeStng = prototypeStngList.stream()
.filter(item -> item.getOtptNm().equals(otptNm)).toList().get(0);
.filter(item -> item.getOtptArtclNm().equals(otptArtclNm)).toList().get(0);
float[] pstn = pdfPrintUtil.getPstnStng(prototypeStng, otptItemStng, paperSeCd);
float[] size = pdfPrintUtil.getSize(prototypeStng, otptItemStng);
@ -381,13 +381,13 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv
RenderingMode fontStyle = pdfPrintUtil.getFontStyle(prototypeStng, otptItemStng);
PDColor fontColor = pdfPrintUtil.getFontColor(prototypeStng, otptItemStng);
String textValue = pdfFormat.getMappingValue(otptNm,defaultValue,forPost,dataObject,printOption,pdfPrintUtil);
String textValue = pdfFormat.getMappingValue(otptArtclNm,defaultValue,forPost,dataObject,printOption,pdfPrintUtil);
pdfPrintUtil.writeText(contentStream, textValue, pstn, size[0], align, font, fontSz, fontStyle, fontColor);
} else if(prototypeStng.getComponentType().equals("image")) {
String imagePath = pdfFormat.getMappingValue(otptNm,defaultValue,forPost,dataObject,printOption,pdfPrintUtil);
String imagePath = pdfFormat.getMappingValue(otptArtclNm,defaultValue,forPost,dataObject,printOption,pdfPrintUtil);
pdfPrintUtil.insertImage(doc, contentStream, imagePath, pstn, size);

@ -9,7 +9,7 @@ SELECT OTPT_FORM_ID
, TASK_SE_CD
, SNDNG_SE_CD
, PAPER_SE_CD
, OTPT_NM
, OTPT_ARTCL_NM
, LEFT_PSTN
, TOP_PSTN
, WIDTH_SZ
@ -42,7 +42,7 @@ INSERT
, TASK_SE_CD
, SNDNG_SE_CD
, PAPER_SE_CD
, OTPT_NM
, OTPT_ARTCL_NM
, LEFT_PSTN
, TOP_PSTN
, WIDTH_SZ
@ -61,7 +61,7 @@ INSERT
, #{taskSeCd}
, #{sndngSeCd}
, #{paperSeCd}
, #{otptNm}
, #{otptArtclNm}
, #{leftPstn}
, #{topPstn}
, #{widthSz}
@ -80,7 +80,7 @@ INSERT
<update id="updateStng" parameterType="cokr.xit.fims.sprt.OtptStng">
/* 출력 설정 수정(otptStngMapper.updateStng) */
UPDATE TB_OTPT_FORM_STNG
SET OTPT_NM = #{otptNm}
SET OTPT_ARTCL_NM = #{otptArtclNm}
, LEFT_PSTN = #{leftPstn}
, TOP_PSTN = #{topPstn}
, WIDTH_SZ = #{widthSz}

@ -131,7 +131,7 @@
<td data-col="checkbox" class="text-center">
<input type="checkbox" class="form-check-input" />
</td>
<td data-col="otptNm" class="text-center">
<td data-col="otptArtclNm" class="text-center">
<select class="form-select" onchange="pageObject['${pageName}'].fnChangeComponent(this);">
{COMPONENTS}
</select>
@ -268,7 +268,7 @@ $(document).ready(function(){
for(var i=0; i < prototypeList.length; i++){
var p = prototypeList[i];
components += "<option value='"+p.otptNm+"' >"+p.dscrp+"</option>";
components += "<option value='"+p.otptArtclNm+"' >"+p.dscrp+"</option>";
}
for(var i=0; i < dataList.length; i++){
@ -285,34 +285,34 @@ $(document).ready(function(){
fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontColor"));
fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontStyle"));
$($P.fnGetElement(lastTr,"otptNm")).set(data.OTPT_NM);
$($P.fnGetElement(lastTr,"otptArtclNm")).set(data.OTPT_ARTCL_NM);
$($P.fnGetElement(lastTr,"componentType")).set(data.COMPONENT_TYPE);
$($P.fnGetElement(lastTr,"leftPstn"))
.set(!isEmpty(data.LEFT_PSTN) ? data.LEFT_PSTN : $P.fnGetProto(prototypeList, data.OTPT_NM, "leftPstn"));
.set(!isEmpty(data.LEFT_PSTN) ? data.LEFT_PSTN : $P.fnGetProto(prototypeList, data.OTPT_ARTCL_NM, "leftPstn"));
$($P.fnGetElement(lastTr,"topPstn"))
.set(!isEmpty(data.TOP_PSTN) ? data.TOP_PSTN : $P.fnGetProto(prototypeList, data.OTPT_NM, "topPstn"));
.set(!isEmpty(data.TOP_PSTN) ? data.TOP_PSTN : $P.fnGetProto(prototypeList, data.OTPT_ARTCL_NM, "topPstn"));
$($P.fnGetElement(lastTr,"widthSz"))
.set(!isEmpty(data.WIDTH_SZ) ? data.WIDTH_SZ : $P.fnGetProto(prototypeList, data.OTPT_NM, "widthSz"));
.set(!isEmpty(data.WIDTH_SZ) ? data.WIDTH_SZ : $P.fnGetProto(prototypeList, data.OTPT_ARTCL_NM, "widthSz"));
$($P.fnGetElement(lastTr,"heightSz"))
.set(!isEmpty(data.HEIGHT_SZ) ? data.HEIGHT_SZ : $P.fnGetProto(prototypeList, data.OTPT_NM, "heightSz"));
.set(!isEmpty(data.HEIGHT_SZ) ? data.HEIGHT_SZ : $P.fnGetProto(prototypeList, data.OTPT_ARTCL_NM, "heightSz"));
$($P.fnGetElement(lastTr,"textSort"))
.set(!isEmpty(data.TEXT_SORT) ? data.TEXT_SORT : $P.fnGetProto(prototypeList, data.OTPT_NM, "textSort"));
.set(!isEmpty(data.TEXT_SORT) ? data.TEXT_SORT : $P.fnGetProto(prototypeList, data.OTPT_ARTCL_NM, "textSort"));
$($P.fnGetElement(lastTr,"fontNm"))
.set(!isEmpty(data.FONT_NM) ? data.FONT_NM : $P.fnGetProto(prototypeList, data.OTPT_NM, "fontNm"));
.set(!isEmpty(data.FONT_NM) ? data.FONT_NM : $P.fnGetProto(prototypeList, data.OTPT_ARTCL_NM, "fontNm"));
$($P.fnGetElement(lastTr,"fontSz"))
.set(!isEmpty(data.FONT_SZ) ? data.FONT_SZ : $P.fnGetProto(prototypeList, data.OTPT_NM, "fontSz"));
.set(!isEmpty(data.FONT_SZ) ? data.FONT_SZ : $P.fnGetProto(prototypeList, data.OTPT_ARTCL_NM, "fontSz"));
$($P.fnGetElement(lastTr,"fontColor"))
.set(!isEmpty(data.FONT_COLOR) ? data.FONT_COLOR : $P.fnGetProto(prototypeList, data.OTPT_NM, "fontColor"));
.set(!isEmpty(data.FONT_COLOR) ? data.FONT_COLOR : $P.fnGetProto(prototypeList, data.OTPT_ARTCL_NM, "fontColor"));
$($P.fnGetElement(lastTr,"fontStyle"))
.set(!isEmpty(data.FONT_STYLE) ? data.FONT_STYLE : $P.fnGetProto(prototypeList, data.OTPT_NM, "fontStyle"));
.set(!isEmpty(data.FONT_STYLE) ? data.FONT_STYLE : $P.fnGetProto(prototypeList, data.OTPT_ARTCL_NM, "fontStyle"));
}
$("#"+tbodyId).find("tr").each(function(){
if(tbodyId == "tbodyUnique--${pageName}"){
var el = $P.fnGetElement(this,"otptNm");
var el = $P.fnGetElement(this,"otptArtclNm");
$(el).attr("disabled","disabled");
$(el).addClass("no-bgi");
}
@ -328,7 +328,7 @@ $(document).ready(function(){
return $(tableRow).find("td[data-col='"+colName+"']").children("input, select").first()[0];
}
$P.fnGetProto = (prototypeList, otptNm, stngItemAttrNm) => {
$P.fnGetProto = (prototypeList, otptArtclNm, stngItemAttrNm) => {
if(stngItemAttrNm == "leftPstn" || stngItemAttrNm == "topPstn"){
var paperSeCd = $("#frmEdit--${pageName}").find("[name='paperSeCd']").val();
var paperNm = "";
@ -337,7 +337,7 @@ $(document).ready(function(){
} else if(paperSeCd == "02"){
paperNm = "letter";
}
var paperObj = prototypeList.find((item) => item.otptNm == otptNm)[paperNm];
var paperObj = prototypeList.find((item) => item.otptArtclNm == otptArtclNm)[paperNm];
if(paperObj == null){
return 0;
}
@ -348,22 +348,22 @@ $(document).ready(function(){
return paperObj["top"];
}
} else {
return prototypeList.find((item) => item.otptNm == otptNm)[stngItemAttrNm];
return prototypeList.find((item) => item.otptArtclNm == otptArtclNm)[stngItemAttrNm];
}
}
$P.choiceOtptNm = () => {
$P.choiceOtptArtclNm = () => {
$("#dropdownUniqueAdd--${pageName}").html("");
var prototypeList = $P.otptStngMap.unique.prototypeList;
var existArr = [];
$("#tbodyUnique--sprt01200-main tr").each(function(){
var el = $P.fnGetElement(this,"otptNm");
var el = $P.fnGetElement(this,"otptArtclNm");
existArr.push($(el).val());
});
var selectableArr = prototypeList.filter(item => existArr.indexOf(item.otptNm) == -1);
var selectableArr = prototypeList.filter(item => existArr.indexOf(item.otptArtclNm) == -1);
var template = document.getElementById("dropdownTemplate--${pageNmae}");
@ -375,7 +375,7 @@ $(document).ready(function(){
} else {
for(var i=0; i < selectableArr.length; i++){
var li = template.innerHTML;
li = li.replace(/{onclick}/gi, "pageObject['${pageName}'].addRow('" + selectableArr[i].otptNm + "')");
li = li.replace(/{onclick}/gi, "pageObject['${pageName}'].addRow('" + selectableArr[i].otptArtclNm + "')");
li = li.replace(/{DSCRP}/gi, selectableArr[i].dscrp);
$("#dropdownUniqueAdd--${pageName}").append(li);
}
@ -383,12 +383,12 @@ $(document).ready(function(){
}
//행 추가
$P.addRow = (otptNm) => {
$P.addRow = (otptArtclNm) => {
var paperSeCd = $("#frmEdit--${pageName}").find("[name='paperSeCd']").val();
var prototypeList;
var tbodyId;
if(otptNm == null || otptNm == ""){
if(otptArtclNm == null || otptArtclNm == ""){
prototypeList = $P.otptStngMap.multiple.prototypeList;
tbodyId = "tbodyMultiple--${pageName}";
} else {
@ -399,7 +399,7 @@ $(document).ready(function(){
var components = "<option value='' data-component-type=''>선택</option>";
for(var i=0; i < prototypeList.length; i++){
var p = prototypeList[i];
components += "<option value='"+p.otptNm+"' data-component-type='"+p.componentType+"'>"+p.dscrp+"</option>";
components += "<option value='"+p.otptArtclNm+"' data-component-type='"+p.componentType+"'>"+p.dscrp+"</option>";
}
var template = document.getElementById("found--${pageName}").innerHTML;
template = template.replace(/{OTPT_FORM_ID}/gi, "");
@ -412,36 +412,36 @@ $(document).ready(function(){
fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontColor"));
fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontStyle"));
if(otptNm != null && otptNm != ""){
if(otptArtclNm != null && otptArtclNm != ""){
$($P.fnGetElement(lastTr,"otptNm")).set(otptNm);
$($P.fnGetElement(lastTr,"otptArtclNm")).set(otptArtclNm);
$($P.fnGetElement(lastTr,"componentType"))
.set($P.fnGetProto(prototypeList, otptNm, "componentType"));
.set($P.fnGetProto(prototypeList, otptArtclNm, "componentType"));
$($P.fnGetElement(lastTr,"leftPstn"))
.set($P.fnGetProto(prototypeList, otptNm, "leftPstn"));
.set($P.fnGetProto(prototypeList, otptArtclNm, "leftPstn"));
$($P.fnGetElement(lastTr,"topPstn"))
.set($P.fnGetProto(prototypeList, otptNm, "topPstn"));
.set($P.fnGetProto(prototypeList, otptArtclNm, "topPstn"));
$($P.fnGetElement(lastTr,"widthSz"))
.set($P.fnGetProto(prototypeList, otptNm, "widthSz"));
.set($P.fnGetProto(prototypeList, otptArtclNm, "widthSz"));
$($P.fnGetElement(lastTr,"heightSz"))
.set($P.fnGetProto(prototypeList, otptNm, "heightSz"));
.set($P.fnGetProto(prototypeList, otptArtclNm, "heightSz"));
$($P.fnGetElement(lastTr,"textSort"))
.set($P.fnGetProto(prototypeList, otptNm, "textSort"));
.set($P.fnGetProto(prototypeList, otptArtclNm, "textSort"));
$($P.fnGetElement(lastTr,"fontNm"))
.set($P.fnGetProto(prototypeList, otptNm, "fontNm"));
.set($P.fnGetProto(prototypeList, otptArtclNm, "fontNm"));
$($P.fnGetElement(lastTr,"fontSz"))
.set($P.fnGetProto(prototypeList, otptNm, "fontSz"));
.set($P.fnGetProto(prototypeList, otptArtclNm, "fontSz"));
$($P.fnGetElement(lastTr,"fontColor"))
.set($P.fnGetProto(prototypeList, otptNm, "fontColor"));
.set($P.fnGetProto(prototypeList, otptArtclNm, "fontColor"));
$($P.fnGetElement(lastTr,"fontStyle"))
.set($P.fnGetProto(prototypeList, otptNm, "fontStyle"));
.set($P.fnGetProto(prototypeList, otptArtclNm, "fontStyle"));
}
if(tbodyId == "tbodyUnique--${pageName}"){
var el = $P.fnGetElement(lastTr,"otptNm");
var el = $P.fnGetElement(lastTr,"otptArtclNm");
$(el).attr("disabled","disabled");
$(el).addClass("no-bgi");
}
@ -485,32 +485,32 @@ $(document).ready(function(){
return;
}
var otptNm = $(selectElement).val();
var otptArtclNm = $(selectElement).val();
var tr = $(selectElement).parent().parent()[0];
var prototypeList = $P.otptStngMap.multiple.prototypeList;
$($P.fnGetElement(tr,"componentType"))
.val($P.fnGetProto(prototypeList, otptNm, "componentType"));
.val($P.fnGetProto(prototypeList, otptArtclNm, "componentType"));
$($P.fnGetElement(tr,"leftPstn"))
.val($P.fnGetProto(prototypeList, otptNm, "leftPstn"));
.val($P.fnGetProto(prototypeList, otptArtclNm, "leftPstn"));
$($P.fnGetElement(tr,"topPstn"))
.val($P.fnGetProto(prototypeList, otptNm, "topPstn"));
.val($P.fnGetProto(prototypeList, otptArtclNm, "topPstn"));
$($P.fnGetElement(tr,"widthSz"))
.val($P.fnGetProto(prototypeList, otptNm, "widthSz"));
.val($P.fnGetProto(prototypeList, otptArtclNm, "widthSz"));
$($P.fnGetElement(tr,"heightSz"))
.val($P.fnGetProto(prototypeList, otptNm, "heightSz"));
.val($P.fnGetProto(prototypeList, otptArtclNm, "heightSz"));
$($P.fnGetElement(tr,"textSort"))
.val($P.fnGetProto(prototypeList, otptNm, "textSort"));
.val($P.fnGetProto(prototypeList, otptArtclNm, "textSort"));
$($P.fnGetElement(tr,"fontNm"))
.val($P.fnGetProto(prototypeList, otptNm, "fontNm"));
.val($P.fnGetProto(prototypeList, otptArtclNm, "fontNm"));
$($P.fnGetElement(tr,"fontSz"))
.val($P.fnGetProto(prototypeList, otptNm, "fontSz"));
.val($P.fnGetProto(prototypeList, otptArtclNm, "fontSz"));
$($P.fnGetElement(tr,"fontColor"))
.val($P.fnGetProto(prototypeList, otptNm, "fontColor"));
.val($P.fnGetProto(prototypeList, otptArtclNm, "fontColor"));
$($P.fnGetElement(tr,"fontStyle"))
.val($P.fnGetProto(prototypeList, otptNm, "fontStyle"));
.val($P.fnGetProto(prototypeList, otptArtclNm, "fontStyle"));
}
@ -518,7 +518,7 @@ $(document).ready(function(){
var rowArr = [];
$("#"+tbodyId+" tr").each(function(){
var otptFormId = this.dataset.key;
var otptNm = $($P.fnGetElement(this,"otptNm")).val();
var otptArtclNm = $($P.fnGetElement(this,"otptArtclNm")).val();
var leftPstn = $($P.fnGetElement(this,"leftPstn")).val();
var topPstn = $($P.fnGetElement(this,"topPstn")).val();
var widthSz = $($P.fnGetElement(this,"widthSz")).val();
@ -531,7 +531,7 @@ $(document).ready(function(){
var row = {
otptFormId : otptFormId,
otptNm : otptNm,
otptArtclNm : otptArtclNm,
leftPstn : leftPstn,
topPstn : topPstn,
widthSz : widthSz,
@ -562,7 +562,7 @@ $(document).ready(function(){
var rowArr = [...rowArr1, ...rowArr2];
for(var i=0; i<rowArr.length; i++){
if(rowArr[i].otptNm == ""){
if(rowArr[i].otptArtclNm == ""){
alert("출력항목명을 선택하세요.");
return;
}
@ -636,7 +636,7 @@ $(document).ready(function(){
$("#btnLoad--${pageName}").on("click", () => $P.fnLoad() );
$("#btnUniqueAdd--${pageName}").on("click", () => $P.choiceOtptNm() );
$("#btnUniqueAdd--${pageName}").on("click", () => $P.choiceOtptArtclNm() );
$("#btnMultipleAdd--${pageName}").on("click", () => $P.addRow() );
$("#btnUniqueDel--${pageName}").on("click", () => $P.delRow('tbodyUnique--${pageName}') );

Loading…
Cancel
Save