From ea9cd66eaa50f7320ac275cea4dd22df420ce9a1 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 28 Mar 2024 13:45:06 +0900 Subject: [PATCH] =?UTF-8?q?=EC=99=B8=EC=A3=BC=EC=9A=94=EC=B2=AD=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=84=9C=EC=8B=9D=20=EC=84=A4=EC=A0=95=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/fims/cmmn/OutsourcingStngQuery.java | 19 +++++ .../fims/cmmn/dao/OutsourcingStngMapper.java | 4 +- .../service/bean/OutsourcingStngBean.java | 70 ++++++++++++++++++- .../xit/fims/cmmn/web/StngController.java | 49 ++++++++++++- .../xit/fims/sndb/web/Sndb01Controller.java | 3 +- .../xit/fims/sprt/web/Sprt01Controller.java | 5 +- .../cokr/xit/fims/task/web/CmnController.java | 7 ++ .../fims/cmmn/outsourcingStng-mapper.xml | 4 +- .../WEB-INF/jsp/fims/stng01010-main.jsp | 2 +- .../WEB-INF/jsp/fims/stng01030-main.jsp | 30 ++++---- 10 files changed, 170 insertions(+), 23 deletions(-) create mode 100644 src/main/java/cokr/xit/fims/cmmn/OutsourcingStngQuery.java diff --git a/src/main/java/cokr/xit/fims/cmmn/OutsourcingStngQuery.java b/src/main/java/cokr/xit/fims/cmmn/OutsourcingStngQuery.java new file mode 100644 index 00000000..eb22b896 --- /dev/null +++ b/src/main/java/cokr/xit/fims/cmmn/OutsourcingStngQuery.java @@ -0,0 +1,19 @@ +package cokr.xit.fims.cmmn; + +public class OutsourcingStngQuery extends CmmnQuery { + + private static final long serialVersionUID = 1L; + + //발송구분코드 + private String sndngSeCd; + + public String getSndngSeCd() { + return ifEmpty(sndngSeCd, () -> null); + } + + public T setSndngSeCd(String sndngSeCd) { + this.sndngSeCd = sndngSeCd; + return self(); + } + +} diff --git a/src/main/java/cokr/xit/fims/cmmn/dao/OutsourcingStngMapper.java b/src/main/java/cokr/xit/fims/cmmn/dao/OutsourcingStngMapper.java index a415a27f..316ee541 100644 --- a/src/main/java/cokr/xit/fims/cmmn/dao/OutsourcingStngMapper.java +++ b/src/main/java/cokr/xit/fims/cmmn/dao/OutsourcingStngMapper.java @@ -4,7 +4,7 @@ import java.util.List; import org.egovframe.rte.psl.dataaccess.mapper.Mapper; -import cokr.xit.fims.cmmn.OtptStngQuery; +import cokr.xit.fims.cmmn.OutsourcingStngQuery; import cokr.xit.foundation.component.AbstractMapper; import cokr.xit.foundation.data.DataObject; @@ -15,6 +15,6 @@ public interface OutsourcingStngMapper extends AbstractMapper { * @param query 출력물 설정 조회 조건 * @return 출력물 설정 항목 */ - List selectArtclStngList(OtptStngQuery query); + List selectArtclStngList(OutsourcingStngQuery query); } diff --git a/src/main/java/cokr/xit/fims/cmmn/service/bean/OutsourcingStngBean.java b/src/main/java/cokr/xit/fims/cmmn/service/bean/OutsourcingStngBean.java index 8fac445c..17e32cb7 100644 --- a/src/main/java/cokr/xit/fims/cmmn/service/bean/OutsourcingStngBean.java +++ b/src/main/java/cokr/xit/fims/cmmn/service/bean/OutsourcingStngBean.java @@ -1,13 +1,18 @@ package cokr.xit.fims.cmmn.service.bean; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Optional; import javax.annotation.Resource; import org.springframework.stereotype.Component; -import cokr.xit.fims.cmmn.OtptStngQuery; +import cokr.xit.fims.cmmn.OutsourcingStngQuery; import cokr.xit.fims.cmmn.dao.OutsourcingStngMapper; +import cokr.xit.fims.cmmn.pdf.extraction.PredefinedSet; import cokr.xit.foundation.AbstractComponent; import cokr.xit.foundation.data.DataObject; @@ -18,7 +23,68 @@ public class OutsourcingStngBean extends AbstractComponent { private OutsourcingStngMapper outsourcingStngMapper; - public List getArtclStngList(OtptStngQuery query){ + public List getArtclStngList(OutsourcingStngQuery query){ return outsourcingStngMapper.selectArtclStngList(query); } + + + public Map getArtclStngMap(OutsourcingStngQuery query) { + Map outsourcingStngMap = new HashMap(); + + List predefinedSetList = new ArrayList<>(); + predefinedSetList.add(new PredefinedSet("SNDNG_DTL_ID", "발송상세아이디")); + predefinedSetList.add(new PredefinedSet("VLTN_LAW_NM", "위반법명")); + predefinedSetList.add(new PredefinedSet("BARCODE", "바코드")); + predefinedSetList.add(new PredefinedSet("CRDN_DT", "단속일시")); + predefinedSetList.add(new PredefinedSet("DUDT_YMD", "납부기한")); + predefinedSetList.add(new PredefinedSet("VHRNO", "차량번호")); + predefinedSetList.add(new PredefinedSet("FFNLG_CARMDL_NM", "과태료차종명")); + predefinedSetList.add(new PredefinedSet("VHCL_NM", "차량명")); + predefinedSetList.add(new PredefinedSet("CRDN_PLC", "단속장소")); + predefinedSetList.add(new PredefinedSet("RTPYR_ADDR", "납부자기본주소")); + predefinedSetList.add(new PredefinedSet("RTPYR_DTL_ADDR", "납부자상세주소")); + predefinedSetList.add(new PredefinedSet("RTPYR_ZIP", "납부자우편번호")); + predefinedSetList.add(new PredefinedSet("RTPYR_NM", "납부자명")); + predefinedSetList.add(new PredefinedSet("CRDN_SE_NM", "단속구분명")); + predefinedSetList.add(new PredefinedSet("ATCH_FILE_CNT", "첨부파일갯수")); + predefinedSetList.add(new PredefinedSet("FFNLG_CRDN_AMT", "과태료단속금액")); + predefinedSetList.add(new PredefinedSet("SUM_AMT", "합계금액")); + predefinedSetList.add(new PredefinedSet("RG_NO", "등기번호")); + predefinedSetList.add(new PredefinedSet("OCR0", "OCR0")); + predefinedSetList.add(new PredefinedSet("OCR0_1", "OCR0_1")); + predefinedSetList.add(new PredefinedSet("OCR0_2", "OCR0_2")); + predefinedSetList.add(new PredefinedSet("OCR_BAND1", "OCR_BAND1")); + predefinedSetList.add(new PredefinedSet("OCR_BAND2", "OCR_BAND2")); + predefinedSetList.add(new PredefinedSet("BANK_NM", "가상계좌은행명")); + predefinedSetList.add(new PredefinedSet("VR_ACTNO", "가상계좌")); + predefinedSetList.add(new PredefinedSet("EPAYNO", "전자납부번호")); + predefinedSetList.add(new PredefinedSet("EMPTY", "공백")); + outsourcingStngMap.put("predefinedSetList", predefinedSetList); + + // + List outsourcingArtclStngList = outsourcingStngMapper.selectArtclStngList(query); + if(outsourcingArtclStngList == null) { + outsourcingArtclStngList = new ArrayList(); + } + + for(DataObject outsourcingArtclStng : outsourcingArtclStngList) { + String outsourcingArtclNm = (String) outsourcingArtclStng.get("ARTCL_NM"); + + Optional optional = predefinedSetList.stream() + .filter(item -> item.getExtrArtclNm().equals(outsourcingArtclNm)).findFirst(); + + if(optional.isEmpty()) { + outsourcingArtclStng.set("DSCRP", outsourcingArtclStng.get("ARTCL_NM")); + } else { + PredefinedSet predefinedSet = optional.get(); + outsourcingArtclStng.set("DSCRP", predefinedSet.getExtrArtclDscrp()); + } + + } + outsourcingStngMap.put("dataList", outsourcingArtclStngList); + + + + return outsourcingStngMap; + } } diff --git a/src/main/java/cokr/xit/fims/cmmn/web/StngController.java b/src/main/java/cokr/xit/fims/cmmn/web/StngController.java index e3483482..bd68c6f0 100644 --- a/src/main/java/cokr/xit/fims/cmmn/web/StngController.java +++ b/src/main/java/cokr/xit/fims/cmmn/web/StngController.java @@ -18,9 +18,11 @@ import cokr.xit.fims.cmmn.ExtrForm; import cokr.xit.fims.cmmn.ExtrStngQuery; import cokr.xit.fims.cmmn.OtptForm; import cokr.xit.fims.cmmn.OtptStngQuery; +import cokr.xit.fims.cmmn.OutsourcingStngQuery; import cokr.xit.fims.cmmn.service.StngService; import cokr.xit.fims.cmmn.service.bean.ExtrStngBean; import cokr.xit.fims.cmmn.service.bean.OtptStngBean; +import cokr.xit.fims.cmmn.service.bean.OutsourcingStngBean; import cokr.xit.fims.cmmn.service.bean.StngBean; import cokr.xit.fims.stat.dao.StatMapper; import cokr.xit.foundation.data.DataObject; @@ -46,7 +48,8 @@ public class StngController extends ApplicationController { extrStngMain = "/020/main.do", getExtrStngInfo = "/020/info.do", saveExtrStngInfo = "/020/save.do", - outsourcingStngMain = "/030/main.do" + outsourcingStngMain = "/030/main.do", + getOutsourcingStngInfo = "/030/info.do" ; } @@ -59,6 +62,9 @@ public class StngController extends ApplicationController { @Resource(name = "otptStngBean") private OtptStngBean otptStngBean; + @Resource(name = "outsourcingStngBean") + private OutsourcingStngBean outsourcingStngBean; + @Resource(name = "extrStngBean") private ExtrStngBean extrStngBean; @@ -275,4 +281,45 @@ public class StngController extends ApplicationController { return mav; } + + + /** 외주요청파일 서식 설정 정보를 불러온다. + * @return 외주요청파일 서식 설정 정보 + */ + public ModelAndView getOutsourcingStngInfo(OutsourcingStngQuery outsourcingStngQuery) { + + ModelAndView mav = new ModelAndView("jsonView"); + + //설정 제목 + ManagedUser currentUser = (ManagedUser) currentUser().getUser(); + String sggCd = currentUser.getOrgID(); + DataObject sgg = statMapper.selectSggByCode(sggCd); + String sggNm = sgg.string("NAME"); + + Map> commonCodes = getCodesOf("FIM054","FIM047","FIM078"); + List FIM047 = commonCodes.get("FIM047"); + List FIM054 = commonCodes.get("FIM054"); + + String taskSeNm = FIM054.stream(). + filter(item -> item.getCode().equals(outsourcingStngQuery.getTaskSeCd())).findFirst().get().getValue(); + + String sndngSeNm = FIM047.stream(). + filter(item -> item.getCode().equals(outsourcingStngQuery.getSndngSeCd())).findFirst().get().getValue(); + + String outsourcingStngTitle = "["+sggNm+", "+taskSeNm+"]"+" "+sndngSeNm; + mav.addObject("outsourcingStngTitle", outsourcingStngTitle); + + //기본 설정 + DataObject zipGlobalStng = new DataObject(); + //zipGlobalStng = outsourcingStngBean.getBscStng(); + zipGlobalStng.put("OUTSOURCING_BSC_ID",""); + mav.addObject("zipGlobalStng", zipGlobalStng); + + //요소별 설정 + Map zipArtclStngMap = outsourcingStngBean.getArtclStngMap(outsourcingStngQuery); + + mav.addObject("zipArtclStngMap", zipArtclStngMap); + + return mav; + } } diff --git a/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java b/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java index fd2dffa8..dc2e575f 100644 --- a/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java +++ b/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java @@ -25,6 +25,7 @@ import cokr.xit.base.web.ApplicationController; import cokr.xit.fims.cmmn.CmmnQuery; import cokr.xit.fims.cmmn.CmmnUtil; import cokr.xit.fims.cmmn.OtptStngQuery; +import cokr.xit.fims.cmmn.OutsourcingStngQuery; import cokr.xit.fims.cmmn.Print; import cokr.xit.fims.cmmn.PrintOption; import cokr.xit.fims.cmmn.dao.OtptStngMapper; @@ -1808,7 +1809,7 @@ public class Sndb01Controller extends ApplicationController { ManagedUser currentUser = (ManagedUser) currentUser().getUser(); String sggCd = currentUser.getOrgID(); - OtptStngQuery stngQuery = new OtptStngQuery(); + OutsourcingStngQuery stngQuery = new OutsourcingStngQuery(); stngQuery.setSggCd(sggCd); stngQuery.setTaskSeCd(taskSeCd); stngQuery.setSndngSeCd("02"); 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 6902a7ee..64612bb3 100644 --- a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java +++ b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java @@ -30,6 +30,7 @@ import cokr.xit.base.user.dao.UserMapper; import cokr.xit.base.web.ApplicationController; import cokr.xit.fims.cmmn.CmmnUtil; import cokr.xit.fims.cmmn.OtptStngQuery; +import cokr.xit.fims.cmmn.OutsourcingStngQuery; import cokr.xit.fims.cmmn.Print; import cokr.xit.fims.cmmn.PrintOption; import cokr.xit.fims.cmmn.dao.OtptStngMapper; @@ -871,7 +872,7 @@ public class Sprt01Controller extends ApplicationController { ManagedUser currentUser = (ManagedUser) currentUser().getUser(); String sggCd = currentUser.getOrgID(); - OtptStngQuery stngQuery = new OtptStngQuery(); + OutsourcingStngQuery stngQuery = new OutsourcingStngQuery(); stngQuery.setSggCd(sggCd); stngQuery.setTaskSeCd(taskSeCd); stngQuery.setSndngSeCd("02"); @@ -1102,7 +1103,7 @@ public class Sprt01Controller extends ApplicationController { ManagedUser currentUser = (ManagedUser) currentUser().getUser(); String sggCd = currentUser.getOrgID(); - OtptStngQuery stngQuery = new OtptStngQuery(); + OutsourcingStngQuery stngQuery = new OutsourcingStngQuery(); stngQuery.setSggCd(sggCd); stngQuery.setTaskSeCd(taskSeCd); stngQuery.setSndngSeCd("03"); 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 a941d39e..39fbfa3d 100644 --- a/src/main/java/cokr/xit/fims/task/web/CmnController.java +++ b/src/main/java/cokr/xit/fims/task/web/CmnController.java @@ -12,6 +12,7 @@ import cokr.xit.fims.cmmn.ExtrForm; import cokr.xit.fims.cmmn.ExtrStngQuery; import cokr.xit.fims.cmmn.OtptForm; import cokr.xit.fims.cmmn.OtptStngQuery; +import cokr.xit.fims.cmmn.OutsourcingStngQuery; import cokr.xit.fims.cmmn.PrintOption; import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.mngt.FimsDepartment; @@ -826,5 +827,11 @@ public class CmnController { public ModelAndView outsourcingStngMain() { return super.outsourcingStngMain(); } + + @Override + @RequestMapping(name="외주요청파일 서식 설정 정보 조회", value=METHOD_URL.getOutsourcingStngInfo) + public ModelAndView getOutsourcingStngInfo(OutsourcingStngQuery outsourcingStngQuery) { + return super.getOutsourcingStngInfo(outsourcingStngQuery); + } } } diff --git a/src/main/resources/sql/mapper/fims/cmmn/outsourcingStng-mapper.xml b/src/main/resources/sql/mapper/fims/cmmn/outsourcingStng-mapper.xml index 72485bb6..37e6ad93 100644 --- a/src/main/resources/sql/mapper/fims/cmmn/outsourcingStng-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cmmn/outsourcingStng-mapper.xml @@ -2,7 +2,7 @@ - /* 외주파일 항목 설정 조회(outsourcingStngMapper.selectArtclStngList) */ SELECT OUTSOURCING_FORM_ID , SGG_CD @@ -11,6 +11,8 @@ SELECT OUTSOURCING_FORM_ID , ARTCL_NM , ARTCL_SZ , ARTCL_ORDR + , PADDING_DIRECTION + , FORMATTING FROM TB_OUTSOURCING_FORM_STNG WHERE USE_YN = 'Y' AND SGG_CD = #{sggCd} diff --git a/src/main/webapp/WEB-INF/jsp/fims/stng01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/stng01010-main.jsp index fe953aa5..063e592f 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/stng01010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/stng01010-main.jsp @@ -113,7 +113,7 @@ @@ -171,7 +175,7 @@ $(document).ready(function(){ $P.zipArtclStngMap = resp.zipArtclStngMap; $P.renderZipArtclStngGrid( - $P.zipArtclStngMap.prototypeList, + $P.zipArtclStngMap.predefinedSetList, $P.zipArtclStngMap.dataList); } }); @@ -190,13 +194,13 @@ $(document).ready(function(){ } //요소 그리드 렌더링 - $P.renderZipArtclStngGrid = (prototypeList, dataList) => { + $P.renderZipArtclStngGrid = (predefinedSetList, dataList) => { - var components = ""; + var components = ""; - for(var i=0; i < prototypeList.length; i++){ - var p = prototypeList[i]; - components += ""; + for(var i=0; i < predefinedSetList.length; i++){ + var p = predefinedSetList[i]; + components += ""; } for(var i=0; i < dataList.length; i++){ @@ -216,7 +220,7 @@ $(document).ready(function(){ .set(!isEmpty(data.ARTCL_SZ) ? data.ARTCL_SZ : 0); $($P.fnGetElement(lastTr,"paddingDirection")) - .set(!isEmpty(data.TEXT_SORT) ? data.TEXT_SORT : "left"); + .set(!isEmpty(data.PADDING_DIRECTION) ? data.PADDING_DIRECTION : "left"); } @@ -243,12 +247,12 @@ $(document).ready(function(){ //행 추가 $P.addRow = () => { - var prototypeList = $P.zipArtclStngMap.prototypeList; + var predefinedSetList = $P.zipArtclStngMap.predefinedSetList; var components = ""; - for(var i=0; i < prototypeList.length; i++){ - var p = prototypeList[i]; - components += ""; + for(var i=0; i < predefinedSetList.length; i++){ + var p = predefinedSetList[i]; + components += ""; } var template = document.getElementById("found--${pageName}").innerHTML; template = template.replace(/{OUTSOURCING_FORM_ID}/gi, "");