From 74e8082ebaa9f318a2a6d7cac21a6d81b6c8d9f6 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Tue, 5 Dec 2023 10:16:21 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B6=9C=EB=A0=A5=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=EB=A9=94=EC=86=8C=EB=93=9C=EB=AA=85,?= =?UTF-8?q?=EB=B3=80=EC=88=98=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tptStng.java => DefaultOtptArtclStng.java} | 16 ++++---- .../cokr/xit/fims/cmmn/pdf/PDFFormat.java | 40 +++++++++---------- .../cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java | 14 +++---- .../{OtptStng.java => OtptArtclStng.java} | 2 +- .../java/cokr/xit/fims/sprt/OtptForm.java | 6 ++- .../xit/fims/sprt/dao/OtptStngMapper.java | 6 +-- .../fims/sprt/service/bean/OtptStngBean.java | 34 ++++++++-------- .../sprt/service/bean/Sprt01ServiceBean.java | 6 +-- .../sql/mapper/fims/sprt/otptStng-mapper.xml | 4 +- .../WEB-INF/jsp/fims/sprt/sprt01200-main.jsp | 4 +- 10 files changed, 68 insertions(+), 64 deletions(-) rename src/main/java/cokr/xit/fims/cmmn/pdf/{DefaultOtptStng.java => DefaultOtptArtclStng.java} (83%) rename src/main/java/cokr/xit/fims/sprt/{OtptStng.java => OtptArtclStng.java} (93%) diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/DefaultOtptStng.java b/src/main/java/cokr/xit/fims/cmmn/pdf/DefaultOtptArtclStng.java similarity index 83% rename from src/main/java/cokr/xit/fims/cmmn/pdf/DefaultOtptStng.java rename to src/main/java/cokr/xit/fims/cmmn/pdf/DefaultOtptArtclStng.java index 5a23f672..1b256dc7 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/DefaultOtptStng.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/DefaultOtptArtclStng.java @@ -5,11 +5,11 @@ import lombok.Setter; @Getter @Setter -public class DefaultOtptStng { +public class DefaultOtptArtclStng { /** * 기본 출력 요소 생성 */ - public DefaultOtptStng(String componentType, String otptArtclNm, String dscrp, String otptBscVl){ + public DefaultOtptArtclStng(String componentType, String otptArtclNm, String dscrp, String otptBscVl){ this.componentType = componentType; this.otptArtclNm=otptArtclNm; this.dscrp=dscrp; @@ -31,7 +31,7 @@ public class DefaultOtptStng { /** * 용지가 A4일 때의 기본위치를 설정한다. 해당 출력요소는 1장의 출력물에서 1개만 존재한다. */ - public DefaultOtptStng a4(float leftPstn, float topPstn) { + public DefaultOtptArtclStng a4(float leftPstn, float topPstn) { this.a4 = new Pstn(leftPstn, topPstn); this.unique = true; return this; @@ -40,7 +40,7 @@ public class DefaultOtptStng { /** * 용지가 레터일 때의 기본위치를 설정한다. 해당 출력요소는 1장의 출력물에서 1개만 존재한다. */ - public DefaultOtptStng letter(float leftPstn, float topPstn) { + public DefaultOtptArtclStng letter(float leftPstn, float topPstn) { this.letter = new Pstn(leftPstn, topPstn); this.unique = true; return this; @@ -49,7 +49,7 @@ public class DefaultOtptStng { /** * 해당 출력요소를 우편물과 관련된 출력요소로 설정한다. */ - public DefaultOtptStng post() { + public DefaultOtptArtclStng post() { this.forPost = true; return this; } @@ -57,7 +57,7 @@ public class DefaultOtptStng { /** * 출력요소의 기본 텍스트정렬을 설정한다. */ - public DefaultOtptStng align(String alignValue) { + public DefaultOtptArtclStng align(String alignValue) { this.textSort = alignValue; return this; } @@ -65,7 +65,7 @@ public class DefaultOtptStng { /** * 출력요소의 기본 영역크기를 설정한다. */ - public DefaultOtptStng size(float width, float height) { + public DefaultOtptArtclStng size(float width, float height) { this.widthSz = width; this.heightSz = height; return this; @@ -74,7 +74,7 @@ public class DefaultOtptStng { /** * 출력요소의 기본 글꼴을 설정한다. */ - public DefaultOtptStng font(String fontNm, int fontSz, String fontColor, String fontStyle) { + public DefaultOtptArtclStng font(String fontNm, int fontSz, String fontColor, String fontStyle) { this.fontNm = fontNm; this.fontSz = fontSz; this.fontColor = fontColor; diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/PDFFormat.java b/src/main/java/cokr/xit/fims/cmmn/pdf/PDFFormat.java index 942d6a3a..c8098280 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/PDFFormat.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/PDFFormat.java @@ -8,41 +8,41 @@ import cokr.xit.foundation.data.DataObject; public abstract class PDFFormat { - protected List prototypeStngs = new ArrayList(); + protected List prototypeStngs = new ArrayList(); /** * 포맷원형을 반환한다. */ - public List getPrototypeStngs(){ + public List getPrototypeStngs(){ return this.prototypeStngs; } /** * 포맷원형을 반환한다. */ - public List getPrototypeStngs(boolean unique){ + public List getPrototypeStngs(boolean unique){ return this.prototypeStngs.stream().filter(item -> item.isUnique() == unique).toList(); } /** * 텍스트 출력요소를 정의한다. */ - public DefaultOtptStng text(String otptArtclNm, String dscrp, String otptBscVl){ - return new DefaultOtptStng("text", otptArtclNm, dscrp, otptBscVl); + public DefaultOtptArtclStng text(String otptArtclNm, String dscrp, String otptBscVl){ + return new DefaultOtptArtclStng("text", otptArtclNm, dscrp, otptBscVl); } /** * 이미지 출력요소 정의한다. */ - public DefaultOtptStng image(String otptArtclNm, String dscrp, String otptBscVl){ - return new DefaultOtptStng("image", otptArtclNm, dscrp, otptBscVl); + public DefaultOtptArtclStng image(String otptArtclNm, String dscrp, String otptBscVl){ + return new DefaultOtptArtclStng("image", otptArtclNm, dscrp, otptBscVl); } /** * 포맷원형에 출력요소를 추가한다. */ - public void add(DefaultOtptStng... prototypeStngs){ - for(DefaultOtptStng prototypeStng : prototypeStngs) { + public void add(DefaultOtptArtclStng... prototypeStngs){ + for(DefaultOtptArtclStng prototypeStng : prototypeStngs) { this.prototypeStngs.add(prototypeStng); } } @@ -50,8 +50,8 @@ public abstract class PDFFormat { /** * 포맷원형에 우편물 출력요소를 추가한다. */ - public void addForPost(DefaultOtptStng... prototypeStngs){ - for(DefaultOtptStng prototypeStng : prototypeStngs) { + public void addForPost(DefaultOtptArtclStng... prototypeStngs){ + for(DefaultOtptArtclStng prototypeStng : prototypeStngs) { this.prototypeStngs.add(prototypeStng.post()); } }; @@ -71,19 +71,19 @@ public abstract class PDFFormat { /** * 시군구별 출력설정요소에 속성(요소 유형, 출력설명, 출력물 내 유일 요소 여부, 우편물 관련 요소 여부, 기본값)을 추가한다. */ - public void appendOtptAttribute(List otptStngList) { + public void appendOtptAttribute(List otptArtclStngList) { - List prototypeStngs = this.getPrototypeStngs(); + List prototypeStngs = this.getPrototypeStngs(); - for(DataObject otptStng : otptStngList) { - String otptArtclNm = (String) otptStng.get("OTPT_ARTCL_NM"); - DefaultOtptStng prototypeStng = prototypeStngs.stream() + for(DataObject otptArtclStng : otptArtclStngList) { + String otptArtclNm = (String) otptArtclStng.get("OTPT_ARTCL_NM"); + DefaultOtptArtclStng prototypeStng = prototypeStngs.stream() .filter(item -> item.getOtptArtclNm().equals(otptArtclNm)).toList().get(0); - otptStng.set("UNIQUE_YN", prototypeStng.isUnique() ? "Y" : "N"); - otptStng.set("DSCRP", prototypeStng.getDscrp()); - otptStng.set("COMPONENT_TYPE", prototypeStng.getComponentType()); - otptStng.set("POST_YN", prototypeStng.isForPost() ? "Y" : "N"); + otptArtclStng.set("UNIQUE_YN", prototypeStng.isUnique() ? "Y" : "N"); + otptArtclStng.set("DSCRP", prototypeStng.getDscrp()); + otptArtclStng.set("COMPONENT_TYPE", prototypeStng.getComponentType()); + otptArtclStng.set("POST_YN", prototypeStng.isForPost() ? "Y" : "N"); } } diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java b/src/main/java/cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java index 88247344..80859f1e 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java @@ -153,7 +153,7 @@ public class PDFPrintUtil extends PrintUtil { } } - public float[] getPstnStng(DefaultOtptStng prototypeStng, DataObject sggStng, String paperSeCd) { + public float[] getPstnStng(DefaultOtptArtclStng prototypeStng, DataObject sggStng, String paperSeCd) { if(!sggStng.string("LEFT_PSTN").equals("") && !sggStng.string("TOP_PSTN").equals("")) { return new float[] { sggStng.number("LEFT_PSTN").floatValue(), @@ -167,7 +167,7 @@ public class PDFPrintUtil extends PrintUtil { } } - public PDType0Font getFontType(DefaultOtptStng prototypeStng, DataObject sggStng, Map fontMap) { + public PDType0Font getFontType(DefaultOtptArtclStng prototypeStng, DataObject sggStng, Map fontMap) { if(sggStng != null && !sggStng.isEmpty() && !sggStng.string("FONT_NM").equals("")) { return fontMap.get(sggStng.string("FONT_NM")); } else { @@ -175,7 +175,7 @@ public class PDFPrintUtil extends PrintUtil { } } - public int getFontSize(DefaultOtptStng prototypeStng, DataObject sggStng) { + public int getFontSize(DefaultOtptArtclStng prototypeStng, DataObject sggStng) { if(!sggStng.string("FONT_SZ").equals("")) { return sggStng.number("FONT_SZ").intValue(); } else { @@ -183,7 +183,7 @@ public class PDFPrintUtil extends PrintUtil { } } - public RenderingMode getFontStyle(DefaultOtptStng prototypeStng, DataObject sggStng) { + public RenderingMode getFontStyle(DefaultOtptArtclStng prototypeStng, DataObject sggStng) { if(!sggStng.string("FONT_STYLE").equals("")) { return RenderingMode.valueOf(sggStng.string("FONT_STYLE")); } else { @@ -191,7 +191,7 @@ public class PDFPrintUtil extends PrintUtil { } } - public PDColor getFontColor(DefaultOtptStng prototypeStng, DataObject sggStng) { + public PDColor getFontColor(DefaultOtptArtclStng prototypeStng, DataObject sggStng) { if(!sggStng.string("FONT_COLOR").equals("")) { return PDFColors.getColor(sggStng.string("FONT_COLOR")); } else { @@ -199,7 +199,7 @@ public class PDFPrintUtil extends PrintUtil { } } - public float[] getSize(DefaultOtptStng prototypeStng, DataObject sggStng) { + public float[] getSize(DefaultOtptArtclStng prototypeStng, DataObject sggStng) { if(!sggStng.string("WIDTH_SZ").equals("")) { return new float[] { sggStng.number("WIDTH_SZ").floatValue(), @@ -213,7 +213,7 @@ public class PDFPrintUtil extends PrintUtil { } } - public String getAlign(DefaultOtptStng prototypeStng, DataObject sggStng) { + public String getAlign(DefaultOtptArtclStng prototypeStng, DataObject sggStng) { if(!sggStng.string("TEXT_SORT").equals("")) { return sggStng.string("TEXT_SORT"); } else { diff --git a/src/main/java/cokr/xit/fims/sprt/OtptStng.java b/src/main/java/cokr/xit/fims/sprt/OtptArtclStng.java similarity index 93% rename from src/main/java/cokr/xit/fims/sprt/OtptStng.java rename to src/main/java/cokr/xit/fims/sprt/OtptArtclStng.java index 2e2e8c39..90a89f76 100644 --- a/src/main/java/cokr/xit/fims/sprt/OtptStng.java +++ b/src/main/java/cokr/xit/fims/sprt/OtptArtclStng.java @@ -6,7 +6,7 @@ import lombok.Setter; @Getter @Setter -public class OtptStng extends AbstractEntity { +public class OtptArtclStng extends AbstractEntity { private String otptFormId; //출력항목ID private String otptArtclNm; //출력항목명 private String leftPstn; //좌측 위치 diff --git a/src/main/java/cokr/xit/fims/sprt/OtptForm.java b/src/main/java/cokr/xit/fims/sprt/OtptForm.java index 856f4ebb..5e538d09 100644 --- a/src/main/java/cokr/xit/fims/sprt/OtptForm.java +++ b/src/main/java/cokr/xit/fims/sprt/OtptForm.java @@ -13,6 +13,10 @@ public class OtptForm extends AbstractEntity { private String taskSeCd; private String sndngSeCd; private String paperSeCd; - private List otptStngList; + private String foldLinePstnSeCd;//접는선 위치 구분코드 + private String bcrnImgPath; //배경이미지경로 + private String bcrnImgFileNm; //배경이미지파일 + private String otptPhotoCnt; //출력사진수 + private List otptArtclStngList; private String[] otptFormIDs; } diff --git a/src/main/java/cokr/xit/fims/sprt/dao/OtptStngMapper.java b/src/main/java/cokr/xit/fims/sprt/dao/OtptStngMapper.java index 9c6de632..06d4084d 100644 --- a/src/main/java/cokr/xit/fims/sprt/dao/OtptStngMapper.java +++ b/src/main/java/cokr/xit/fims/sprt/dao/OtptStngMapper.java @@ -5,7 +5,7 @@ import java.util.List; import org.egovframe.rte.psl.dataaccess.mapper.Mapper; import cokr.xit.fims.sprt.OtptForm; -import cokr.xit.fims.sprt.OtptStng; +import cokr.xit.fims.sprt.OtptArtclStng; import cokr.xit.fims.sprt.OtptStngQuery; import cokr.xit.foundation.component.AbstractMapper; import cokr.xit.foundation.data.DataObject; @@ -19,10 +19,10 @@ public interface OtptStngMapper extends AbstractMapper { */ List selectOtptArtclStngList(OtptStngQuery query); - int updateArtclStng(OtptStng update); + int updateArtclStng(OtptArtclStng update); int deleteArtclStng(OtptForm otptForm); - int insertArtclStng(OtptStng insert); + int insertArtclStng(OtptArtclStng insert); } diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/OtptStngBean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/OtptStngBean.java index d0fa5fb0..866185cb 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/OtptStngBean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/OtptStngBean.java @@ -9,11 +9,11 @@ import javax.annotation.Resource; import org.springframework.stereotype.Component; -import cokr.xit.fims.cmmn.pdf.DefaultOtptStng; +import cokr.xit.fims.cmmn.pdf.DefaultOtptArtclStng; import cokr.xit.fims.cmmn.pdf.PDFFormat; import cokr.xit.fims.cmmn.pdf.format.Advntce; import cokr.xit.fims.sprt.OtptForm; -import cokr.xit.fims.sprt.OtptStng; +import cokr.xit.fims.sprt.OtptArtclStng; import cokr.xit.fims.sprt.OtptStngQuery; import cokr.xit.fims.sprt.dao.OtptStngMapper; import cokr.xit.foundation.AbstractComponent; @@ -35,18 +35,18 @@ public class OtptStngBean extends AbstractComponent { break; } - List otptStngList = otptStngMapper.selectOtptArtclStngList(query); - if(otptStngList == null) { - otptStngList = new ArrayList(); + List otptArtclStngList = otptStngMapper.selectOtptArtclStngList(query); + if(otptArtclStngList == null) { + otptArtclStngList = new ArrayList(); } - pdfFormat.appendOtptAttribute(otptStngList); + pdfFormat.appendOtptAttribute(otptArtclStngList); - List uniquePrototypeList = pdfFormat.getPrototypeStngs(true); - List multiplePrototypeList = pdfFormat.getPrototypeStngs(false); + List uniquePrototypeList = pdfFormat.getPrototypeStngs(true); + List multiplePrototypeList = pdfFormat.getPrototypeStngs(false); - List uniqueDataList = otptStngList.stream().filter(item -> item.string("UNIQUE_YN").equals("Y")).toList(); - List multipleDataList = otptStngList.stream().filter(item -> item.string("UNIQUE_YN").equals("N")).toList(); + List uniqueDataList = otptArtclStngList.stream().filter(item -> item.string("UNIQUE_YN").equals("Y")).toList(); + List multipleDataList = otptArtclStngList.stream().filter(item -> item.string("UNIQUE_YN").equals("N")).toList(); Map unique = new HashMap(); unique.put("prototypeList", uniquePrototypeList); @@ -66,22 +66,22 @@ public class OtptStngBean extends AbstractComponent { try { String userId = currentUser().getId(); - List otptStngList = otptForm.getOtptStngList(); + List otptArtclStngList = otptForm.getOtptArtclStngList(); List updateKeyList = new ArrayList(); - List insertList = new ArrayList(); + List insertList = new ArrayList(); - if(otptStngList != null && !otptStngList.isEmpty()) { + if(otptArtclStngList != null && !otptArtclStngList.isEmpty()) { - List updateList = otptStngList.stream().filter(item -> !ifEmpty(item.getOtptFormId(), () -> "").equals("")).toList(); + List updateList = otptArtclStngList.stream().filter(item -> !ifEmpty(item.getOtptFormId(), () -> "").equals("")).toList(); if(!updateList.isEmpty()) { - for(OtptStng update : updateList) { + for(OtptArtclStng update : updateList) { update.setModifiedBy(userId); int u = otptStngMapper.updateArtclStng(update); updateKeyList.add(update.getOtptFormId()); } } - insertList = otptStngList.stream().filter(item -> ifEmpty(item.getOtptFormId(), () -> "").equals("")).toList(); + insertList = otptArtclStngList.stream().filter(item -> ifEmpty(item.getOtptFormId(), () -> "").equals("")).toList(); } if(!updateKeyList.isEmpty()) { @@ -91,7 +91,7 @@ public class OtptStngBean extends AbstractComponent { int d = otptStngMapper.deleteArtclStng(otptForm); if(!insertList.isEmpty()) { - for(OtptStng insert : insertList) { + for(OtptArtclStng insert : insertList) { insert.setCreatedBy(userId); int i = otptStngMapper.insertArtclStng(insert); } diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01ServiceBean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01ServiceBean.java index 86e5b209..f8d6623d 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01ServiceBean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01ServiceBean.java @@ -28,7 +28,7 @@ import cokr.xit.fims.cmmn.hwp.format.CrdnList; import cokr.xit.fims.cmmn.hwp.format.RcvmtConfirm; import cokr.xit.fims.cmmn.hwp.format.ReportOnClaims; import cokr.xit.fims.cmmn.hwp.format.RequestForDelivery; -import cokr.xit.fims.cmmn.pdf.DefaultOtptStng; +import cokr.xit.fims.cmmn.pdf.DefaultOtptArtclStng; import cokr.xit.fims.cmmn.pdf.PDFFormat; import cokr.xit.fims.cmmn.pdf.PDFPrintUtil; import cokr.xit.fims.cmmn.pdf.format.Advntce; @@ -343,7 +343,7 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv sndngSeCd = "02"; } - List prototypeStngList = pdfFormat.getPrototypeStngs(); + List prototypeStngList = pdfFormat.getPrototypeStngs(); otptStngQuery.setSndngSeCd(sndngSeCd); otptStngQuery.setPaperSeCd(paperSeCd); @@ -366,7 +366,7 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv for(DataObject otptItemStng : otptStng) { String otptArtclNm = otptItemStng.string("OTPT_ARTCL_NM"); - DefaultOtptStng prototypeStng = prototypeStngList.stream() + DefaultOtptArtclStng prototypeStng = prototypeStngList.stream() .filter(item -> item.getOtptArtclNm().equals(otptArtclNm)).toList().get(0); float[] pstn = pdfPrintUtil.getPstnStng(prototypeStng, otptItemStng, paperSeCd); diff --git a/src/main/resources/sql/mapper/fims/sprt/otptStng-mapper.xml b/src/main/resources/sql/mapper/fims/sprt/otptStng-mapper.xml index 22431517..0eb9cf00 100644 --- a/src/main/resources/sql/mapper/fims/sprt/otptStng-mapper.xml +++ b/src/main/resources/sql/mapper/fims/sprt/otptStng-mapper.xml @@ -28,7 +28,7 @@ SELECT OTPT_FORM_ID ORDER BY OTPT_ARTCL_ORDR - + /* 출력 설정 등록(otptStngMapper.insertArtclStng) */ SELECT @@ -80,7 +80,7 @@ INSERT ) - + /* 출력 설정 수정(otptStngMapper.updateArtclStng) */ UPDATE TB_OTPT_FORM_STNG SET OTPT_ARTCL_NM = #{otptArtclNm} diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01200-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01200-main.jsp index 39912a84..5ae52cc7 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01200-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01200-main.jsp @@ -595,9 +595,9 @@ $(document).ready(function(){ } } - query.otptStngList = rowArr; + query.otptArtclStngList = rowArr; - query = fnJsonToFormData(query,"otptStngList"); + query = fnJsonToFormData(query,"otptArtclStngList"); ajax.post({ url : wctx.url("/sprt/sprt01/200/save.do"),