From e29fdaaa35e19ff0d1ad92b1f3ed99948111fb27 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Tue, 5 Dec 2023 15:00:01 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B0=B0=EA=B2=BD=EC=9D=B4=EB=AF=B8=EC=A7=80?= =?UTF-8?q?=20=EC=B6=9C=EB=A0=A5=EC=88=9C=EC=84=9C=20=EA=B3=A0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/fims/sprt/dao/OtptStngMapper.java | 12 +- .../fims/sprt/service/bean/OtptStngBean.java | 22 +++- .../sprt/service/bean/Sprt01ServiceBean.java | 38 ++++-- .../xit/fims/sprt/web/Sprt01Controller.java | 23 ++-- .../sql/mapper/fims/sprt/otptStng-mapper.xml | 20 ++++ .../WEB-INF/jsp/fims/sprt/sprt01200-main.jsp | 113 ++++++++++++++++-- .../js/fims/framework/cmm/componentization.js | 34 +++++- 7 files changed, 228 insertions(+), 34 deletions(-) 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 06d4084d..ab01da31 100644 --- a/src/main/java/cokr/xit/fims/sprt/dao/OtptStngMapper.java +++ b/src/main/java/cokr/xit/fims/sprt/dao/OtptStngMapper.java @@ -4,8 +4,8 @@ import java.util.List; import org.egovframe.rte.psl.dataaccess.mapper.Mapper; -import cokr.xit.fims.sprt.OtptForm; import cokr.xit.fims.sprt.OtptArtclStng; +import cokr.xit.fims.sprt.OtptForm; import cokr.xit.fims.sprt.OtptStngQuery; import cokr.xit.foundation.component.AbstractMapper; import cokr.xit.foundation.data.DataObject; @@ -13,7 +13,13 @@ import cokr.xit.foundation.data.DataObject; @Mapper("otptStngMapper") public interface OtptStngMapper extends AbstractMapper { - /**지정한 조건에 따라 출력 항목 설정을 조회한다..
+ /**지정한 조건에 따라 출력물 전역 설정을 조회한다.
+ * @param query 출력물 설정 조회 조건 + * @return 출력물 전역 설정 + */ + DataObject selectOtptBscStng(OtptStngQuery otptStngQuery); + + /**지정한 조건에 따라 출력 항목 설정을 조회한다.
* @param query 출력물 설정 조회 조건 * @return 출력물 설정 항목 */ @@ -25,4 +31,6 @@ public interface OtptStngMapper extends AbstractMapper { 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 866185cb..8b80aadd 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 @@ -12,8 +12,8 @@ import org.springframework.stereotype.Component; 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.OtptArtclStng; +import cokr.xit.fims.sprt.OtptForm; import cokr.xit.fims.sprt.OtptStngQuery; import cokr.xit.fims.sprt.dao.OtptStngMapper; import cokr.xit.foundation.AbstractComponent; @@ -25,6 +25,18 @@ public class OtptStngBean extends AbstractComponent { @Resource(name = "otptStngMapper") private OtptStngMapper otptStngMapper; + /**지정한 조건에 따라 출력물 전역 설정을 조회한다. + * @param query 조회 조건 + * @return 출력물 전역 설정 + */ + public DataObject getOtptBscStng(OtptStngQuery otptStngQuery) { + return otptStngMapper.selectOtptBscStng(otptStngQuery); + } + + /**지정한 조건에 따라 출력요소별 설정을 조회한다. + * @param query 조회 조건 + * @return 출력 요소 설정 + */ public Map getOtptArtclStngMap(OtptStngQuery query){ Map otptStngMap = new HashMap(); @@ -62,7 +74,11 @@ public class OtptStngBean extends AbstractComponent { return otptStngMap; } - public boolean saveOtptStng(OtptForm otptForm) { + /** 출력 요소 설정을 저장 및 삭제 처리한다. + * @param otptForm 출력 설정 + * @return 저장여부 + */ + public boolean saveOtptArtclStng(OtptForm otptForm) { try { String userId = currentUser().getId(); @@ -102,4 +118,6 @@ public class OtptStngBean extends AbstractComponent { return true; } + + } 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 f8d6623d..93093b89 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 @@ -2,9 +2,11 @@ package cokr.xit.fims.sprt.service.bean; import java.io.InputStream; import java.util.ArrayList; +import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; import javax.annotation.Resource; @@ -348,7 +350,23 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv otptStngQuery.setSndngSeCd(sndngSeCd); otptStngQuery.setPaperSeCd(paperSeCd); - List otptStng = otptStngMapper.selectOtptArtclStngList(otptStngQuery); + List otptArtclStngList = otptStngMapper.selectOtptArtclStngList(otptStngQuery); + pdfFormat.appendOtptAttribute(otptArtclStngList); + + Comparator comparator1 = (item1, item2) -> { + int int1 = item1.string("UNIQUE_YN").equals("Y") ? 0 : 1; + int int2 = item2.string("UNIQUE_YN").equals("Y") ? 0 : 1; + return Integer.compare(int1, int2); + }; + + Comparator comparator2 = (item1, item2) -> { + int int1 = item1.number("OTPT_ARTCL_ORDR").intValue(); + int int2 = item2.number("OTPT_ARTCL_ORDR").intValue(); + return Integer.compare(int1, int2); + };; + + otptArtclStngList = otptArtclStngList.stream() + .sorted(comparator1.thenComparing(comparator2)).collect(Collectors.toList()); for(DataObject dataObject : dataObjectList) { //페이지생성(건별) @@ -364,23 +382,23 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv pdfPrintUtil.renderFoldLine(contentStream, paperWidth, paperHeight); - for(DataObject otptItemStng : otptStng) { - String otptArtclNm = otptItemStng.string("OTPT_ARTCL_NM"); + for(DataObject otptArtclStng : otptArtclStngList) { + String otptArtclNm = otptArtclStng.string("OTPT_ARTCL_NM"); DefaultOtptArtclStng prototypeStng = prototypeStngList.stream() .filter(item -> item.getOtptArtclNm().equals(otptArtclNm)).toList().get(0); - float[] pstn = pdfPrintUtil.getPstnStng(prototypeStng, otptItemStng, paperSeCd); - float[] size = pdfPrintUtil.getSize(prototypeStng, otptItemStng); + float[] pstn = pdfPrintUtil.getPstnStng(prototypeStng, otptArtclStng, paperSeCd); + float[] size = pdfPrintUtil.getSize(prototypeStng, otptArtclStng); boolean forPost = prototypeStng.isForPost(); String defaultValue = prototypeStng.getOtptBscVl(); if(prototypeStng.getComponentType().equals("text")) { - String align = pdfPrintUtil.getAlign(prototypeStng, otptItemStng); - PDType0Font font = pdfPrintUtil.getFontType(prototypeStng, otptItemStng, fontMap); - int fontSz = pdfPrintUtil.getFontSize(prototypeStng, otptItemStng); - RenderingMode fontStyle = pdfPrintUtil.getFontStyle(prototypeStng, otptItemStng); - PDColor fontColor = pdfPrintUtil.getFontColor(prototypeStng, otptItemStng); + String align = pdfPrintUtil.getAlign(prototypeStng, otptArtclStng); + PDType0Font font = pdfPrintUtil.getFontType(prototypeStng, otptArtclStng, fontMap); + int fontSz = pdfPrintUtil.getFontSize(prototypeStng, otptArtclStng); + RenderingMode fontStyle = pdfPrintUtil.getFontStyle(prototypeStng, otptArtclStng); + PDColor fontColor = pdfPrintUtil.getFontColor(prototypeStng, otptArtclStng); String textValue = pdfFormat.getMappingValue(otptArtclNm,defaultValue,forPost,dataObject,printOption,pdfPrintUtil); diff --git a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java index e4efd17a..3a2ebccc 100644 --- a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java +++ b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java @@ -427,13 +427,13 @@ public class Sprt01Controller extends ApplicationController { ModelAndView mav = new ModelAndView("fims/sprt/sprt01200-main"); mav.addObject("pageName", "sprt01200-main"); - Map> commonCodes = getCodesOf("FIM054","FIM047","FIM078"); + Map> commonCodes = getCodesOf("FIM054","FIM047","FIM078","FIM080"); mav.addObject("FIM047List", commonCodes.get("FIM047")); mav.addObject("FIM054List", commonCodes.get("FIM054")); mav.addObject("FIM078List", commonCodes.get("FIM078")); - - addCodes(commonCodes, mav, "FIM047", "FIM054", "FIM078"); + mav.addObject("FIM080List", commonCodes.get("FIM080")); + addCodes(commonCodes, mav, "FIM047", "FIM054", "FIM078","FIM080"); return mav; } @@ -445,10 +445,7 @@ public class Sprt01Controller extends ApplicationController { ModelAndView mav = new ModelAndView("jsonView"); - Map otptArtclStngMap = otptStngBean.getOtptArtclStngMap(otptStngQuery); - - mav.addObject("otptArtclStngMap", otptArtclStngMap); - + //출력 설정 제목 String institute = currentUser().getInstitute(); String account = currentUser().getAccount(); ManagedUser currentUser = userMapper.getUser(account, institute); @@ -474,6 +471,16 @@ public class Sprt01Controller extends ApplicationController { String otptStngTitle = "["+sggNm+", "+taskSeNm+"]"+" "+sndngSeNm+" "+"("+otptPaperSeNm+")"; mav.addObject("otptStngTitle", otptStngTitle); + //출력물 기본 설정 + DataObject otptBscStng = new DataObject(); + otptBscStng = otptStngBean.getOtptBscStng(otptStngQuery); + mav.addObject("otptGlobalStng", otptBscStng); + + //출력 요소별 설정 + Map otptArtclStngMap = otptStngBean.getOtptArtclStngMap(otptStngQuery); + + mav.addObject("otptArtclStngMap", otptArtclStngMap); + return mav; } @@ -484,7 +491,7 @@ public class Sprt01Controller extends ApplicationController { ModelAndView mav = new ModelAndView("jsonView"); boolean saved = false; - saved = otptStngBean.saveOtptStng(otptForm); + saved = otptStngBean.saveOtptArtclStng(otptForm); mav.addObject("saved", saved); return mav; 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 0eb9cf00..77d08536 100644 --- a/src/main/resources/sql/mapper/fims/sprt/otptStng-mapper.xml +++ b/src/main/resources/sql/mapper/fims/sprt/otptStng-mapper.xml @@ -2,6 +2,25 @@ + +