From c41c401efc249c57adbe884e7317be6e80107029 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Tue, 12 Mar 2024 13:08:13 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B3=A0=EC=A7=80=EC=84=9C=20=EC=99=B8?= =?UTF-8?q?=EC=A3=BC=ED=8C=8C=EC=9D=BC=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 --- .../base/file/etc/OutsourcingFileWriter.java | 28 +++++++++++++-- .../fims/cmmn/dao/OutsourcingStngMapper.java | 20 +++++++++++ .../service/bean/OutsourcingStngBean.java | 24 +++++++++++++ .../xit/fims/sndb/web/Sndb01Controller.java | 19 ++++++++++- .../xit/fims/sprt/web/Sprt01Controller.java | 34 +++++++++++++++++-- .../fims/cmmn/outsourcingStng-mapper.xml | 22 ++++++++++++ .../fims/sprt/integrationSearch-mapper.xml | 4 ++- 7 files changed, 144 insertions(+), 7 deletions(-) create mode 100644 src/main/java/cokr/xit/fims/cmmn/dao/OutsourcingStngMapper.java create mode 100644 src/main/java/cokr/xit/fims/cmmn/service/bean/OutsourcingStngBean.java create mode 100644 src/main/resources/sql/mapper/fims/cmmn/outsourcingStng-mapper.xml diff --git a/src/main/java/cokr/xit/base/file/etc/OutsourcingFileWriter.java b/src/main/java/cokr/xit/base/file/etc/OutsourcingFileWriter.java index 3006a0cc..7a327f6c 100644 --- a/src/main/java/cokr/xit/base/file/etc/OutsourcingFileWriter.java +++ b/src/main/java/cokr/xit/base/file/etc/OutsourcingFileWriter.java @@ -116,9 +116,31 @@ public class OutsourcingFileWriter { } String line = ""; for(DataObject printStngItem : printStngItems){ - String colNm = printStngItem.string("COL_NM"); - int byteCnt = printStngItem.number("BYTE_CNT").intValue(); - line += hangul.rpadByte(dataObject.string(colNm), byteCnt, " "); + String artclNm = printStngItem.string("ARTCL_NM"); + int byteCnt = printStngItem.number("ARTCL_SZ").intValue(); + String artclValue = ""; + + if(artclNm.equals("OTPT_YMD") || artclNm.equals("OTPT_YEAR") + || artclNm.equals("OTPT_MONTH") || artclNm.equals("OTPT_DAY")) { + switch(artclNm) { + case "OTPT_YMD" : + artclValue = yyyymmdd; + break; + case "OTPT_YEAR" : + artclValue = year; + break; + case "OTPT_MONTH" : + artclValue = month; + break; + case "OTPT_DAY" : + artclValue = day; + break; + } + + } else { + artclValue = dataObject.string(artclNm); + } + line += hangul.rpadByte(artclValue, byteCnt, " "); } writer.write(line); } diff --git a/src/main/java/cokr/xit/fims/cmmn/dao/OutsourcingStngMapper.java b/src/main/java/cokr/xit/fims/cmmn/dao/OutsourcingStngMapper.java new file mode 100644 index 00000000..a415a27f --- /dev/null +++ b/src/main/java/cokr/xit/fims/cmmn/dao/OutsourcingStngMapper.java @@ -0,0 +1,20 @@ +package cokr.xit.fims.cmmn.dao; + +import java.util.List; + +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; + +import cokr.xit.fims.cmmn.OtptStngQuery; +import cokr.xit.foundation.component.AbstractMapper; +import cokr.xit.foundation.data.DataObject; + +@Mapper("outsourcingStngMapper") +public interface OutsourcingStngMapper extends AbstractMapper { + + /**지정한 조건에 따라 외주파일 출력 항목 설정을 조회한다.
+ * @param query 출력물 설정 조회 조건 + * @return 출력물 설정 항목 + */ + List selectArtclStngList(OtptStngQuery 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 new file mode 100644 index 00000000..8fac445c --- /dev/null +++ b/src/main/java/cokr/xit/fims/cmmn/service/bean/OutsourcingStngBean.java @@ -0,0 +1,24 @@ +package cokr.xit.fims.cmmn.service.bean; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Component; + +import cokr.xit.fims.cmmn.OtptStngQuery; +import cokr.xit.fims.cmmn.dao.OutsourcingStngMapper; +import cokr.xit.foundation.AbstractComponent; +import cokr.xit.foundation.data.DataObject; + +@Component("outsourcingStngBean") +public class OutsourcingStngBean extends AbstractComponent { + + @Resource(name = "outsourcingStngMapper") + private OutsourcingStngMapper outsourcingStngMapper; + + + public List getArtclStngList(OtptStngQuery query){ + return outsourcingStngMapper.selectArtclStngList(query); + } +} 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 fe104be6..fd2dffa8 100644 --- a/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java +++ b/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java @@ -29,6 +29,7 @@ import cokr.xit.fims.cmmn.Print; import cokr.xit.fims.cmmn.PrintOption; import cokr.xit.fims.cmmn.dao.OtptStngMapper; import cokr.xit.fims.cmmn.pdf.print.format.Advntce; +import cokr.xit.fims.cmmn.service.bean.OutsourcingStngBean; import cokr.xit.fims.cmmn.service.bean.StngBean; import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.mngt.service.bean.FactionBean; @@ -150,6 +151,9 @@ public class Sndb01Controller extends ApplicationController { @Resource(name="otptStngMapper") private OtptStngMapper otptStngMapper; + @Resource(name="outsourcingStngBean") + protected OutsourcingStngBean outsourcingStngBean; + @Resource(name="integrationSearchMapper") private IntegrationSearchMapper integrationSearchMapper; @@ -1756,6 +1760,8 @@ public class Sndb01Controller extends ApplicationController { public ModelAndView makeAdvntceOutsourcing(PrintOption printOption, SndbQuery req) { ModelAndView mav = new ModelAndView("downloadView"); + String taskSeCd = ""; + List list = sndngDtlService.getSndngTrgtDtlIds(req); String[] crdnIds = new String[list.size()]; @@ -1769,6 +1775,10 @@ public class Sndb01Controller extends ApplicationController { for(int i=0; i < dataObjectList.size(); i++) { DataObject dataObject = dataObjectList.get(i); + if(taskSeCd.equals("")) { + taskSeCd = dataObject.string("TASK_SE_CD"); + } + FileQuery fileQuery = new FileQuery(); fileQuery.setInfoType(Crdn.INF_TYPE); fileQuery.setInfoKeys(dataObject.string("CRDN_ID")); @@ -1795,7 +1805,14 @@ public class Sndb01Controller extends ApplicationController { } - List printStngItems = new ArrayList(); + ManagedUser currentUser = (ManagedUser) currentUser().getUser(); + String sggCd = currentUser.getOrgID(); + + OtptStngQuery stngQuery = new OtptStngQuery(); + stngQuery.setSggCd(sggCd); + stngQuery.setTaskSeCd(taskSeCd); + stngQuery.setSndngSeCd("02"); + List printStngItems = outsourcingStngBean.getArtclStngList(stngQuery); OutsourcingFileWriter osWriter = new OutsourcingFileWriter(); 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 d305fdbe..8426edc7 100644 --- a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java +++ b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java @@ -39,6 +39,7 @@ import cokr.xit.fims.cmmn.hwp.format.RequestForDelivery; import cokr.xit.fims.cmmn.pdf.print.format.Advntce; import cokr.xit.fims.cmmn.pdf.print.format.Nht; 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.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; @@ -105,6 +106,9 @@ public class Sprt01Controller extends ApplicationController { @Resource(name="otptStngBean") protected OtptStngBean otptStngBean; + @Resource(name="outsourcingStngBean") + protected OutsourcingStngBean outsourcingStngBean; + @Resource(name = "fileBean") private FileBean fileBean; @@ -767,12 +771,18 @@ public class Sprt01Controller extends ApplicationController { public ModelAndView makeAdvntceOutsourcing(PrintOption printOption, String[] crdnIds) { ModelAndView mav = new ModelAndView("downloadView"); + String taskSeCd = ""; + SprtQuery sprtQuery = new SprtQuery(); sprtQuery.setCrdnIds(crdnIds); List dataObjectList = integrationSearchMapper.selectIntegrationDataList(sprtQuery); for(int i=0; i < dataObjectList.size(); i++) { DataObject dataObject = dataObjectList.get(i); + if(taskSeCd.equals("")) { + taskSeCd = dataObject.string("TASK_SE_CD"); + } + FileQuery fileQuery = new FileQuery(); fileQuery.setInfoType(Crdn.INF_TYPE); fileQuery.setInfoKeys(dataObject.string("CRDN_ID")); @@ -799,7 +809,14 @@ public class Sprt01Controller extends ApplicationController { } - List printStngItems = new ArrayList(); + ManagedUser currentUser = (ManagedUser) currentUser().getUser(); + String sggCd = currentUser.getOrgID(); + + OtptStngQuery stngQuery = new OtptStngQuery(); + stngQuery.setSggCd(sggCd); + stngQuery.setTaskSeCd(taskSeCd); + stngQuery.setSndngSeCd("02"); + List printStngItems = outsourcingStngBean.getArtclStngList(stngQuery); OutsourcingFileWriter osWriter = new OutsourcingFileWriter(); @@ -923,12 +940,18 @@ public class Sprt01Controller extends ApplicationController { public ModelAndView makeNhtOutsourcing(PrintOption printOption, String[] crdnIds) { ModelAndView mav = new ModelAndView("downloadView"); + String taskSeCd = ""; + SprtQuery sprtQuery = new SprtQuery(); sprtQuery.setCrdnIds(crdnIds); List dataObjectList = integrationSearchMapper.selectIntegrationDataList(sprtQuery); for(int i=0; i < dataObjectList.size(); i++) { DataObject dataObject = dataObjectList.get(i); + if(taskSeCd.equals("")) { + taskSeCd = dataObject.string("TASK_SE_CD"); + } + FileQuery fileQuery = new FileQuery(); fileQuery.setInfoType(Crdn.INF_TYPE); fileQuery.setInfoKeys(dataObject.string("CRDN_ID")); @@ -955,7 +978,14 @@ public class Sprt01Controller extends ApplicationController { } - List printStngItems = new ArrayList(); + ManagedUser currentUser = (ManagedUser) currentUser().getUser(); + String sggCd = currentUser.getOrgID(); + + OtptStngQuery stngQuery = new OtptStngQuery(); + stngQuery.setSggCd(sggCd); + stngQuery.setTaskSeCd(taskSeCd); + stngQuery.setSndngSeCd("03"); + List printStngItems = outsourcingStngBean.getArtclStngList(stngQuery); OutsourcingFileWriter osWriter = new OutsourcingFileWriter(); diff --git a/src/main/resources/sql/mapper/fims/cmmn/outsourcingStng-mapper.xml b/src/main/resources/sql/mapper/fims/cmmn/outsourcingStng-mapper.xml new file mode 100644 index 00000000..72485bb6 --- /dev/null +++ b/src/main/resources/sql/mapper/fims/cmmn/outsourcingStng-mapper.xml @@ -0,0 +1,22 @@ + + + + + + + \ No newline at end of file diff --git a/src/main/resources/sql/mapper/fims/sprt/integrationSearch-mapper.xml b/src/main/resources/sql/mapper/fims/sprt/integrationSearch-mapper.xml index 1ce457b4..88ff74f5 100644 --- a/src/main/resources/sql/mapper/fims/sprt/integrationSearch-mapper.xml +++ b/src/main/resources/sql/mapper/fims/sprt/integrationSearch-mapper.xml @@ -28,6 +28,7 @@ , EI.CEL_NO_V /* 민원인 휴대폰 번호 */ , C.VHRNO /* 차량번호 */ , L.RPM_SZR_VHRNO /* 대체차량번호 */ + , GET_CODE_NM('FIM009', C.FFNLG_CARMDL_CD) AS FFNLG_CARMDL_NM /* 차종 명 */ , C.ATCH_FILE_CNT /* 첨부 파일 수 */ , CA.PARKNG_PSBLTY_RSLT_CD /* 주차 가능 결과 코드 */ , (SELECT GET_CODE_NM('FIM034', CA.PARKNG_PSBLTY_RSLT_CD) FROM DUAL) AS PARKNG_PSBLTY_RSLT_NM/* 주차 가능 결과 명 */ @@ -89,7 +90,7 @@ , L.INSPY_INT /* 분납 이자 */ , (L.LEVY_PCPTAX + L.LEVY_ADAMT + L.INSPY_INT) AS LEVY_AMT /* 부과금액 */ , L.PAY_MTHD_SE_CD /* 납부 방법 구분 코드 */ - , (SELECT GET_CODE_NM('FIM045', L.PAY_MTHD_SE_CD) FROM DUAL) AS PAY_MTHD_SE_NM /* 납부 방법 구분 명 */ + , (SELECT GET_CODE_NM('FIM045', L.PAY_MTHD_SE_CD) FROM DUAL) AS PAY_MTHD_SE_NM /* 납부 방법 구분 명 */ , L.RCVMT_YMD /* 수납 일자 */ , L.RCVMT_PCPTAX /* 수납 본세 */ , L.RCVMT_ADAMT /* 수납 가산금 */ @@ -102,6 +103,7 @@ , L.DUDT_AFTR_YMD /* 납기후금액 */ , L.DUDT_AFTR_AMT /* 납기후일자 */ , L.EPAYNO /* 전자납부번호 */ + , L.BANK_NM /* 은행명 */ , L.VR_ACTNO /* 가상계좌번호 */ , L.SZR_YMD /* 압류 일자 */ , L.SZR_RMV_YMD /* 압류 해제 일자 */