From 579fdc41141b793d30aac2a58cce64611a69d538 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Wed, 29 Nov 2023 15:04:21 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B6=9C=EB=A0=A5=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=ED=99=94=EB=A9=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cokr/xit/fims/base/UserController.java | 21 ++ .../xit/fims/cmmn/pdf/DefaultOtptStng.java | 67 ++-- .../cokr/xit/fims/cmmn/pdf/PDFFormat.java | 80 ++++- .../cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java | 52 ++- .../xit/fims/cmmn/pdf/format/Advntce.java | 118 ++++--- .../fims/sprt/service/bean/OtptStngBean.java | 62 ++++ .../sprt/service/bean/Sprt01ServiceBean.java | 38 +-- .../xit/fims/sprt/web/Sprt01Controller.java | 43 ++- .../cokr/xit/fims/task/web/CmnController.java | 13 + .../WEB-INF/jsp/fims/sprt/sprt01140-info.jsp | 43 +++ .../WEB-INF/jsp/fims/sprt/sprt01200-main.jsp | 322 ++++++++++++++++++ src/main/webapp/WEB-INF/jsp/index.jsp | 9 + 12 files changed, 748 insertions(+), 120 deletions(-) create mode 100644 src/main/java/cokr/xit/fims/sprt/service/bean/OtptStngBean.java create mode 100644 src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01200-main.jsp diff --git a/src/main/java/cokr/xit/fims/base/UserController.java b/src/main/java/cokr/xit/fims/base/UserController.java index 9e1d33f4..31005b13 100644 --- a/src/main/java/cokr/xit/fims/base/UserController.java +++ b/src/main/java/cokr/xit/fims/base/UserController.java @@ -19,17 +19,26 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; import cokr.xit.base.user.ManagedUser; +import cokr.xit.base.user.service.UserService; import cokr.xit.fims.cmmn.DirectoryStructureToJson; import cokr.xit.fims.cmmn.DirectoryStructureToJson.Node; import cokr.xit.fims.cmmn.dao.FactionMapper; +import cokr.xit.fims.cmmn.service.bean.FactionBean; import cokr.xit.fims.cmmn.service.bean.StngBean; import cokr.xit.fims.crdn.service.bean.ImportServiceBean; +import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.data.DataObject; import cokr.xit.interfaces.smg.service.bean.SmgServiceBean; @Controller public class UserController extends cokr.xit.base.user.web.UserController { + @Resource(name="userService") + private UserService userService; + + @Resource(name="factionBean") + FactionBean factionBean; + @Resource(name="factionMapper") FactionMapper factionMapper; @@ -61,6 +70,18 @@ public class UserController extends cokr.xit.base.user.web.UserController defaultOtptStng = new ArrayList(); + protected List prototypeStngs = new ArrayList(); - public List getDefaultOtptStng(){ - return this.defaultOtptStng; + /** + * 포맷원형을 반환한다. + */ + public List getPrototypeStngs(){ + return this.prototypeStngs; } - public DefaultOtptStng text(String otptNm, String otptBscVl){ - return new DefaultOtptStng("text", otptNm, otptBscVl); + /** + * 포맷원형을 반환한다. + */ + public List getPrototypeStngs(boolean unique){ + return this.prototypeStngs.stream().filter(item -> item.isUnique() == unique).toList(); } - public DefaultOtptStng image(String otptNm, String otptBscVl){ - return new DefaultOtptStng("image", otptNm, otptBscVl); + /** + * 텍스트 출력요소를 정의한다. + */ + public DefaultOtptStng text(String otptNm, String descrp, String otptBscVl){ + return new DefaultOtptStng("text", otptNm, descrp, otptBscVl); } - public void add(DefaultOtptStng... defaultOtptStngs){ - for(DefaultOtptStng defaultOtptStng : defaultOtptStngs) { - this.defaultOtptStng.add(defaultOtptStng); + /** + * 이미지 출력요소 정의한다. + */ + public DefaultOtptStng image(String otptNm, String descrp, String otptBscVl){ + return new DefaultOtptStng("image", otptNm, descrp, otptBscVl); + } + + /** + * 포맷원형에 출력요소를 추가한다. + */ + public void add(DefaultOtptStng... prototypeStngs){ + for(DefaultOtptStng prototypeStng : prototypeStngs) { + this.prototypeStngs.add(prototypeStng); } } - public void addForPost(DefaultOtptStng... defaultOtptStngs) { - for(DefaultOtptStng defaultOtptStng : defaultOtptStngs) { - this.defaultOtptStng.add(defaultOtptStng.post()); + /** + * 포맷원형에 우편물 출력요소를 추가한다. + */ + public void addForPost(DefaultOtptStng... prototypeStngs){ + for(DefaultOtptStng prototypeStng : prototypeStngs) { + this.prototypeStngs.add(prototypeStng.post()); } }; + /** + * 출력요소에 매핑될 값을 반환한다. + */ public abstract String getMappingValue(String otptNm, String defaultValue, boolean forPost, DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil); + /** + * 우편물 출력요소에 매핑될 값을 반환한다. + */ public abstract String getValueForPost(String otptNm, String defaultValue, DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil); + + /** + * 시군구별 출력설정요소에 속성(요소 유형, 출력설명, 출력물 내 유일 요소 여부, 우편물 관련 요소 여부, 기본값)을 추가한다. + */ + public void appendOtptAttribute(List otptStngList) { + + List prototypeStngs = this.getPrototypeStngs(); + + for(DataObject otptStng : otptStngList) { + String otptNm = (String) otptStng.get("OTPT_NM"); + DefaultOtptStng prototypeStng = prototypeStngs.stream() + .filter(item -> item.getOtptNm().equals(otptNm)).toList().get(0); + + otptStng.set("UNIQUE_YN", prototypeStng.isUnique() ? "Y" : "N"); + otptStng.set("DESCRP", prototypeStng.getDescrp()); + otptStng.set("COMPONENT_TYPE", prototypeStng.getComponentType()); + otptStng.set("POST_YN", prototypeStng.isForPost() ? "Y" : "N"); + } + } + + /** + * 출력용 샘플 데이터를 생성한다. + */ + public abstract DataObject createSampleData(); + + } 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 85a72c8e..ab52d1eb 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java @@ -12,6 +12,7 @@ import org.apache.pdfbox.pdmodel.font.PDType0Font; import org.apache.pdfbox.pdmodel.graphics.color.PDColor; import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject; import org.apache.pdfbox.pdmodel.graphics.state.RenderingMode; +import org.springframework.core.io.ClassPathResource; import cokr.xit.fims.cmmn.PrintUtil; import cokr.xit.foundation.data.DataObject; @@ -149,7 +150,7 @@ public class PDFPrintUtil extends PrintUtil { } } - public float[] getPstnStng(DefaultOtptStng defaultStng, DataObject sggStng, String otptPaperSeCd) { + public float[] getPstnStng(DefaultOtptStng prototypeStng, DataObject sggStng, String otptPaperSeCd) { if(!sggStng.string("LEFT_PSTN").equals("") && !sggStng.string("TOP_PSTN").equals("")) { return new float[] { sggStng.number("LEFT_PSTN").floatValue(), @@ -157,45 +158,45 @@ public class PDFPrintUtil extends PrintUtil { }; } else { return new float[] { - defaultStng.getLeftPstn(otptPaperSeCd), - defaultStng.getTopPstn(otptPaperSeCd) + prototypeStng.getLeftPstn(otptPaperSeCd), + prototypeStng.getTopPstn(otptPaperSeCd) }; } } - public PDType0Font getFontType(DefaultOtptStng defaultStng, DataObject sggStng, Map fontMap) { + public PDType0Font getFontType(DefaultOtptStng prototypeStng, DataObject sggStng, Map fontMap) { if(sggStng != null && !sggStng.isEmpty() && !sggStng.string("FONT_NM").equals("")) { return fontMap.get(sggStng.string("FONT_NM")); } else { - return fontMap.get(defaultStng.getFontNm()); + return fontMap.get(prototypeStng.getFontNm()); } } - public int getFontSize(DefaultOtptStng defaultStng, DataObject sggStng) { + public int getFontSize(DefaultOtptStng prototypeStng, DataObject sggStng) { if(!sggStng.string("FONT_SZ").equals("")) { return sggStng.number("FONT_SZ").intValue(); } else { - return defaultStng.getFontSize(); + return prototypeStng.getFontSize(); } } - public RenderingMode getFontStyle(DefaultOtptStng defaultStng, DataObject sggStng) { + public RenderingMode getFontStyle(DefaultOtptStng prototypeStng, DataObject sggStng) { if(!sggStng.string("FONT_STYLE").equals("")) { return RenderingMode.valueOf(sggStng.string("FONT_STYLE")); } else { - return RenderingMode.valueOf(defaultStng.getFontStyle()); + return RenderingMode.valueOf(prototypeStng.getFontStyle()); } } - public PDColor getFontColor(DefaultOtptStng defaultStng, DataObject sggStng) { + public PDColor getFontColor(DefaultOtptStng prototypeStng, DataObject sggStng) { if(!sggStng.string("FONT_COLOR").equals("")) { return PDFColors.getColor(sggStng.string("FONT_COLOR")); } else { - return PDFColors.getColor(defaultStng.getFontColor()); + return PDFColors.getColor(prototypeStng.getFontColor()); } } - public float[] getSize(DefaultOtptStng defaultStng, DataObject sggStng) { + public float[] getSize(DefaultOtptStng prototypeStng, DataObject sggStng) { if(!sggStng.string("WIDTH_SZ").equals("")) { return new float[] { sggStng.number("WIDTH_SZ").floatValue(), @@ -203,17 +204,36 @@ public class PDFPrintUtil extends PrintUtil { }; } else { return new float[] { - defaultStng.getWidthSz(), - defaultStng.getHeightSz() + prototypeStng.getWidthSz(), + prototypeStng.getHeightSz() }; } } - public String getAlign(DefaultOtptStng defaultStng, DataObject sggStng) { + public String getAlign(DefaultOtptStng prototypeStng, DataObject sggStng) { if(!sggStng.string("TEXT_SORT").equals("")) { return sggStng.string("TEXT_SORT"); } else { - return defaultStng.getAlign(); + return prototypeStng.getAlign(); + } + } + + public Map getFontMap(PDDocument doc) { + try { + Map fontMap = Map.of( + "notokrBold", PDType0Font.load(doc, new ClassPathResource("fonts/notokr-bold.ttf").getInputStream()), + "gulim", PDType0Font.load(doc, new ClassPathResource("fonts/gulim.ttf").getInputStream()), + "gulimche", PDType0Font.load(doc, new ClassPathResource("fonts/gulimche.ttf").getInputStream()), + "batang", PDType0Font.load(doc, new ClassPathResource("fonts/batang.ttf").getInputStream()), + "batangche", PDType0Font.load(doc, new ClassPathResource("fonts/batangche.ttf").getInputStream()), + "dotum", PDType0Font.load(doc, new ClassPathResource("fonts/dotum.ttf").getInputStream()), + "dotumche", PDType0Font.load(doc, new ClassPathResource("fonts/dotumche.ttf").getInputStream()), + "gungsuh", PDType0Font.load(doc, new ClassPathResource("fonts/gungsuh.ttf").getInputStream()), + "gungsuhche", PDType0Font.load(doc, new ClassPathResource("fonts/gungsuhche.ttf").getInputStream()) + ); + return fontMap; + } catch (IOException e) { + throw new RuntimeException("글꼴 로드 오류"); } } } diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/format/Advntce.java b/src/main/java/cokr/xit/fims/cmmn/pdf/format/Advntce.java index 39cc6464..3e6b1d82 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/format/Advntce.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/format/Advntce.java @@ -15,65 +15,73 @@ public class Advntce extends PDFFormat { public Advntce(){ addForPost( - image("postSenderLogo","").a4(10, 0).letter(0, 0).size(0, 0), - text("postSenderInst","").a4(10, 5).letter(0, 0), - text("postSenderDept","").a4(50, 5).letter(0, 0), - text("postSenderAddr","").a4(10, 15).letter(0, 0), - text("postSenderDtlAddr","").a4(10, 25).letter(0, 0), - text("postSenderZip","").a4(10, 35).letter(0, 0), - text("postSenderTel","").a4(10, 45).letter(0, 0), - text("postSenderFax","").a4(50, 45).letter(0, 0), + image("postSenderLogo","우편물송신자로고","").a4(10, 0).letter(0, 0).size(0, 0), + text("postSenderInst","우편물송신자기관","").a4(10, 5).letter(0, 0), + text("postSenderDept","우편물송신자부서","").a4(50, 5).letter(0, 0), + text("postSenderAddr","우편물송신자주소","").a4(10, 15).letter(0, 0), + text("postSenderDtlAddr","우편물송신자상세주소","").a4(10, 25).letter(0, 0), + text("postSenderZip","우편물송신자우편번호","").a4(10, 35).letter(0, 0), + text("postSenderTel","우편물송신자전화번호","").a4(10, 45).letter(0, 0), + text("postSenderFax","우편물송신자팩스번호","").a4(50, 45).letter(0, 0), - text("postReceiverAddr","").a4(100, 40).letter(0, 0).size(90, 0).align("right"), - text("postReceiverDtlAddr","").a4(100, 50).letter(0, 0).size(90, 0).align("right"), - text("postReceiver","").a4(100, 60).letter(0, 0).size(90, 0).align("right"), - text("postReceiverZip","").a4(100, 70).letter(0, 0).size(90, 0).align("right") + text("postReceiverAddr","우편물수신자주소","").a4(100, 40).letter(0, 0).size(90, 0).align("right"), + text("postReceiverDtlAddr","우편물수신자상세주소","").a4(100, 50).letter(0, 0).size(90, 0).align("right"), + text("postReceiver","우편물수신자명","").a4(100, 60).letter(0, 0).size(90, 0).align("right"), + text("postReceiverZip","우편물수신자우편번호","").a4(100, 70).letter(0, 0).size(90, 0).align("right") ); add( - image("background","").a4(0, 0).letter(0, 0).size(0, 0), - image("photo1","").a4(0, 0).letter(0, 0).size(0, 0), - image("photo2","").a4(0, 0).letter(0, 0).size(0, 0), - image("photo3","").a4(0, 0).letter(0, 0).size(0, 0), - image("photo4","").a4(0, 0).letter(0, 0).size(0, 0), + image("background","배경이미지","").a4(0, 0).letter(0, 0).size(0, 0), + image("photo1","단속사진1","").a4(0, 0).letter(0, 0).size(0, 0), + image("photo2","단속사진2","").a4(0, 0).letter(0, 0).size(0, 0), + image("photo3","단속사진3","").a4(0, 0).letter(0, 0).size(0, 0), + image("photo4","단속사진4","").a4(0, 0).letter(0, 0).size(0, 0), - text("rtpyrNm",""), - text("rtpyrNo",""), - text("rtpyrAddr",""), - text("rtpyrDtlAddr",""), - text("rtpyrFullAddr",""), + text("rtpyrNm","수신자명",""), + text("rtpyrNo","수신자번호",""), + text("rtpyrAddr","수신자주소",""), + text("rtpyrDtlAddr","수신자상세주소",""), + text("rtpyrFullAddr","수신자전체주소",""), - text("vhrno",""), - text("crdnYmd",""), - text("crdnYmdTm",""), - text("crdnPlc",""), - text("ffnlgCarmdlNm",""), - text("vltnArtcl",""), - text("vltnLawNm",""), - text("crdnSn",""), + text("vhrno","차량번호",""), + text("crdnYmd","단속일자",""), + text("crdnYmdTm","단속일시",""), + text("crdnPlc","단속장소",""), + text("ffnlgCarmdlNm","차종",""), + text("vltnArtcl","위반내용",""), + text("vltnLawNm","위반법령",""), + text("crdnSn","증거번호",""), - text("amt",""), - text("untilYmd",""), + text("amt","금액",""), + text("untilYmd","납부기한",""), - text("vrActno",""), - text("vrActno1",""), - text("vrActno2",""), - text("vrActno3",""), - text("vrActno4",""), - text("vrActno5",""), - text("vrActno6",""), - text("vrActno7",""), - text("vrActno8",""), - text("vrActno9",""), - text("vrActno10",""), - text("epayNo",""), + text("vrActno","대표가상계좌번호",""), + text("vrActno1","가상계좌번호1",""), + text("vrActno2","가상계좌번호2",""), + text("vrActno3","가상계좌번호3",""), + text("vrActno4","가상계좌번호4",""), + text("vrActno5","가상계좌번호5",""), + text("vrActno6","가상계좌번호6",""), + text("vrActno7","가상계좌번호7",""), + text("vrActno8","가상계좌번호8",""), + text("vrActno9","가상계좌번호9",""), + text("vrActno10","가상계좌번호10",""), + text("epayNo","전자납부번호",""), - text("otptYmd",""), - text("offcsText",""), - image("offcs","").size(20, 20) + text("otptYmd","출력일자",""), + text("otptDt","출력일시",""), + text("otptYYYY","출력년도",""), + text("otptMM","출력월",""), + text("otptDD","출력일",""), + + text("offcsText","관인명",""), + image("offcs","관인이미지","").size(20, 20) ); } + /** + * 출력요소에 매핑될 값을 반환한다. + */ @Override public String getMappingValue(String otptNm, String defaultValue, boolean forPost, DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil) { @@ -217,6 +225,9 @@ public class Advntce extends PDFFormat { return result; } + /** + * 우편물 출력요소에 매핑될 값을 반환한다. + */ @Override public String getValueForPost(String otptNm, String defaultValue, DataObject dataObject, PrintOption printOption, PDFPrintUtil pdfPrintUtil) { @@ -263,4 +274,17 @@ public class Advntce extends PDFFormat { return result; } + /** + * 출력용 샘플 데이터를 생성한다. + */ + @Override + public DataObject createSampleData() { + DataObject dataObject = new DataObject(); + dataObject.put("rtpyrNm", "홍길동"); + dataObject.put("rtpyrAddr", "무슨도 무슨시 무슨구"); + dataObject.put("rtpyrDtlAddr", "ㅇㅇ아파트 999호"); + dataObject.put("rtpyrZip", "12345"); + return dataObject; + } + } 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 new file mode 100644 index 00000000..020728f9 --- /dev/null +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/OtptStngBean.java @@ -0,0 +1,62 @@ +package cokr.xit.fims.sprt.service.bean; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Component; + +import cokr.xit.fims.cmmn.pdf.DefaultOtptStng; +import cokr.xit.fims.cmmn.pdf.PDFFormat; +import cokr.xit.fims.cmmn.pdf.format.Advntce; +import cokr.xit.fims.sprt.OtptStngQuery; +import cokr.xit.fims.sprt.dao.OtptStngMapper; +import cokr.xit.foundation.AbstractComponent; +import cokr.xit.foundation.data.DataObject; + +@Component("otptStngBean") +public class OtptStngBean extends AbstractComponent { + + @Resource(name = "otptStngMapper") + private OtptStngMapper otptStngMapper; + + public Map getOtptStngMap(OtptStngQuery query){ + Map otptStngMap = new HashMap(); + + PDFFormat pdfFormat = null; + switch(query.getSndngSeCd()) { + case "02" : + pdfFormat = new Advntce(); + break; + } + + List otptStngList = otptStngMapper.selectOtptStngList(query); + if(otptStngList == null) { + otptStngList = new ArrayList(); + } + + pdfFormat.appendOtptAttribute(otptStngList); + + 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(); + + Map unique = new HashMap(); + unique.put("prototypeList", uniquePrototypeList); + unique.put("dataList", uniqueDataList); + + Map multiple = new HashMap(); + multiple.put("prototypeList", multiplePrototypeList); + multiple.put("dataList", multipleDataList); + + + otptStngMap.put("unique", unique); + otptStngMap.put("multiple", multiple); + return otptStngMap; + } +} 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 9fd36d4d..485531e7 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 @@ -309,17 +309,7 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv PDDocument doc = new PDDocument();//pdf문서 생성 //폰트 로드 - Map fontMap = Map.of( - "notokrBold", PDType0Font.load(doc, new ClassPathResource("fonts/notokr-bold.ttf").getInputStream()), - "gulim", PDType0Font.load(doc, new ClassPathResource("fonts/gulim.ttf").getInputStream()), - "gulimche", PDType0Font.load(doc, new ClassPathResource("fonts/gulimche.ttf").getInputStream()), - "batang", PDType0Font.load(doc, new ClassPathResource("fonts/batang.ttf").getInputStream()), - "batangche", PDType0Font.load(doc, new ClassPathResource("fonts/batangche.ttf").getInputStream()), - "dotum", PDType0Font.load(doc, new ClassPathResource("fonts/dotum.ttf").getInputStream()), - "dotumche", PDType0Font.load(doc, new ClassPathResource("fonts/dotumche.ttf").getInputStream()), - "gungsuh", PDType0Font.load(doc, new ClassPathResource("fonts/gungsuh.ttf").getInputStream()), - "gungsuhche", PDType0Font.load(doc, new ClassPathResource("fonts/gungsuhche.ttf").getInputStream()) - ); + Map fontMap = pdfPrintUtil.getFontMap(doc); //용지 크기 설정 PDRectangle paper = null; @@ -345,7 +335,7 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv if(formatName.equals("advntce")) { pdfFormat = new Advntce(); } - List predefinedList = pdfFormat.getDefaultOtptStng(); + List prototypeStngList = pdfFormat.getPrototypeStngs(); otptStngQuery.setSndngSeCd(sndngSeCd); otptStngQuery.setOtptPaperSeCd(otptPaperSeCd); @@ -368,27 +358,27 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv for(DataObject otptItemStng : otptStng) { String otptNm = otptItemStng.string("OTPT_NM"); - DefaultOtptStng predefined = predefinedList.stream() + DefaultOtptStng prototypeStng = prototypeStngList.stream() .filter(item -> item.getOtptNm().equals(otptNm)).toList().get(0); - float[] pstn = pdfPrintUtil.getPstnStng(predefined, otptItemStng, otptPaperSeCd); - float[] size = pdfPrintUtil.getSize(predefined, otptItemStng); + float[] pstn = pdfPrintUtil.getPstnStng(prototypeStng, otptItemStng, otptPaperSeCd); + float[] size = pdfPrintUtil.getSize(prototypeStng, otptItemStng); - boolean forPost = predefined.isForPost(); - String defaultValue = predefined.getOtptBscVl(); + boolean forPost = prototypeStng.isForPost(); + String defaultValue = prototypeStng.getOtptBscVl(); - if(predefined.getContentType().equals("text")) { - String align = pdfPrintUtil.getAlign(predefined, otptItemStng); - PDType0Font font = pdfPrintUtil.getFontType(predefined, otptItemStng, fontMap); - int fontSz = pdfPrintUtil.getFontSize(predefined, otptItemStng); - RenderingMode fontStyle = pdfPrintUtil.getFontStyle(predefined, otptItemStng); - PDColor fontColor = pdfPrintUtil.getFontColor(predefined, otptItemStng); + 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 textValue = pdfFormat.getMappingValue(otptNm,defaultValue,forPost,dataObject,printOption,pdfPrintUtil); pdfPrintUtil.writeText(contentStream, textValue, pstn, size[0], align, font, fontSz, fontStyle, fontColor); - } else if(predefined.getContentType().equals("image")) { + } else if(prototypeStng.getComponentType().equals("image")) { String imagePath = pdfFormat.getMappingValue(otptNm,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 f197fe6e..5764493d 100644 --- a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java +++ b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java @@ -17,9 +17,11 @@ import cokr.xit.base.web.ApplicationController; import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.dao.GlobalStngMapper; import cokr.xit.fims.sprt.Keyword; +import cokr.xit.fims.sprt.OtptStngQuery; import cokr.xit.fims.sprt.PrintOption; import cokr.xit.fims.sprt.SprtQuery; import cokr.xit.fims.sprt.service.Sprt01Service; +import cokr.xit.fims.sprt.service.bean.OtptStngBean; import cokr.xit.foundation.data.DataObject; /**통합 조회 서비스의 웹 컨트롤러 @@ -53,7 +55,10 @@ public class Sprt01Controller extends ApplicationController { makeRcvmtConfirmFileFromHwpFormat = "/130/makeRcvmtConfirmFileFromHwpFormat.do", printAdvntceMain = "/140/info.do", makeAdvntcePdf = "/140/makeAdvntcePdf.do", - makeAdvntceOutsourcing = "/140/makeAdvntceOutsourcing.do" + makeAdvntceOutsourcing = "/140/makeAdvntceOutsourcing.do", + + otptStngMain = "/200/main.do", + getOtptStngInfo = "/200/info.do" ; } @@ -67,6 +72,9 @@ public class Sprt01Controller extends ApplicationController { @Resource(name="userMapper") protected UserMapper userMapper; + @Resource(name="otptStngBean") + protected OtptStngBean otptStngBean; + /**통합 조회 메인화면(fims/sprt/sprt01/010-main)을 연다. * * @return /fims/sprt/sprt01010 @@ -405,4 +413,37 @@ public class Sprt01Controller extends ApplicationController { return mav; } + + /** 출력물 설정 메인 화면을 연다. + * @return 출력물 설정 메인 화면 + */ + public ModelAndView otptStngMain() { + ModelAndView mav = new ModelAndView("fims/sprt/sprt01200-main"); + mav.addObject("pageName", "sprt01200-main"); + + Map> commonCodes = getCodesOf("FIM054","FIM047","FIM078"); + + mav.addObject("FIM047List", commonCodes.get("FIM047")); + mav.addObject("FIM054List", commonCodes.get("FIM054")); + mav.addObject("FIM078List", commonCodes.get("FIM078")); + + addCodes(commonCodes, mav, "FIM047", "FIM054", "FIM078"); + + return mav; + } + + /** 출력물 설정 정보를 불러온다. + * @return 출력물 설정 정보 + */ + public ModelAndView getOtptStngInfo(OtptStngQuery otptStngQuery) { + + ModelAndView mav = new ModelAndView("jsonView"); + + Map otptStngMap = otptStngBean.getOtptStngMap(otptStngQuery); + + mav.addObject("otptStngMap", otptStngMap); + + return mav; + } + } diff --git a/src/main/java/cokr/xit/fims/task/web/CmnController.java b/src/main/java/cokr/xit/fims/task/web/CmnController.java index 100a1ad1..46985282 100644 --- a/src/main/java/cokr/xit/fims/task/web/CmnController.java +++ b/src/main/java/cokr/xit/fims/task/web/CmnController.java @@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import cokr.xit.fims.crdn.Crdn; +import cokr.xit.fims.sprt.OtptStngQuery; import cokr.xit.fims.sprt.PrintOption; import cokr.xit.fims.sprt.SprtQuery; import cokr.xit.fims.stat.StatQuery; @@ -422,6 +423,18 @@ public class CmnController { return super.makeAdvntceOutsourcing(printOption, crdnIds); } + @Override + @RequestMapping(name="출력물 설정 메인 화면", value=METHOD_URL.otptStngMain) + public ModelAndView otptStngMain() { + return super.otptStngMain(); + } + + @Override + @RequestMapping(name="출력물 설정 정보 조회", value=METHOD_URL.getOtptStngInfo) + public ModelAndView getOtptStngInfo(OtptStngQuery otptStngQuery) { + return super.getOtptStngInfo(otptStngQuery); + } + } @Controller diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01140-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01140-info.jsp index 3985412a..51e3d68d 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01140-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01140-info.jsp @@ -10,6 +10,7 @@
+
@@ -152,9 +153,51 @@ $(document).ready(function(){ }); } + $P.fnOpenOtptStng = () => { + + var fix = ""; + if($P.provided.isAllSameTask($P.crdnIds)){ + var sample = $P.crdnIds[0]; //체크된것중첫번째 + fix = $P.provided.getInfo(sample).TASK_SE_CD; + } + + var url = wctx.url("/sprt/sprt01/200/main.do"); + var dialogId = "otptStngDialog"; + + ajax.post({ + url : url, + data : {}, + success : (resp) => { + + dialog.open({ + id : dialogId + , title : "출력설정" + , size : "xxl" + , content : resp + , init : () => { + + $("#"+dialogId).find("input[name='dialogId']").val(dialogId); + + $("#"+dialogId).find("form[name='frmSearch']").find("[name='sggCd']").val(MY_INFO.info.sggCd); + + if(fix != ""){ + var taskSeSelectbox = $("#"+dialogId).find("form[name='frmSearch']").find("[name='taskSeCd']"); + taskSeSelectbox.val(fix); + taskSeSelectbox.attr("disabled","disabled"); + } + + } + , onClose : () => { } + }); + } + }); + + } + //버튼이벤트 $("#btnPrintAdvntcePdf--${pageName}").on("click", () => $P.fnMakeFile('pdf') ); $("#btnPrintAdvntceOutsourcing--${pageName}").on("click", () => $P.fnMakeFile('outsourcing') ); + $("#btnOpenOtptStng--${pageName}").on("click", () => $P.fnOpenOtptStng() ); //첫번째 줄 클릭 $("#tbody--${pageName}").find("tr:eq(0)").click(); 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 new file mode 100644 index 00000000..8b134651 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01200-main.jsp @@ -0,0 +1,322 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> +<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> + +출력설정 + +
+
+
+
+
+
+ + 업무 + + 출력물 + + 용지 + + +
+
+
+ +
+
+
+ +

+

+ +
+
+
+ + +
+
+
+
+ +
+ +
+
+
+ + +
+
+
+
+ +
+ +
+ + + + + + +
+ + +
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/index.jsp b/src/main/webapp/WEB-INF/jsp/index.jsp index 906807bd..edd23c8c 100644 --- a/src/main/webapp/WEB-INF/jsp/index.jsp +++ b/src/main/webapp/WEB-INF/jsp/index.jsp @@ -98,6 +98,15 @@ break; } + var MY_INFO = {}; + ajax.get({ + url:wctx.url("/user/myInfo.do"), + data:{}, + success:resp => { + MY_INFO = resp.myInfo; + } + }); + ${functions} ${topScript}