From ba5ea8bed199b0f64989f00ad3daef47a4141eba Mon Sep 17 00:00:00 2001 From: sjh88 Date: Thu, 2 Nov 2023 10:18:05 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20POST-PLUS=20master=20json=20=ED=83=AC?= =?UTF-8?q?=ED=94=8C=EB=A6=BF=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/cmm/service/CmmEnsFileService.java | 54 +++++++++++-------- .../mapper/biz/ens-cmm-file-mysql-mapper.xml | 2 + .../biz/ens/model/cmm/CmmEnsRequestDTO.java | 14 +++++ 3 files changed, 47 insertions(+), 23 deletions(-) diff --git a/mens-api/src/main/java/kr/xit/biz/cmm/service/CmmEnsFileService.java b/mens-api/src/main/java/kr/xit/biz/cmm/service/CmmEnsFileService.java index c663b1d..b1fb277 100644 --- a/mens-api/src/main/java/kr/xit/biz/cmm/service/CmmEnsFileService.java +++ b/mens-api/src/main/java/kr/xit/biz/cmm/service/CmmEnsFileService.java @@ -92,6 +92,8 @@ public class CmmEnsFileService extends EgovAbstractServiceImpl implements ICmmEn fileReq.setSignguCode(tmpDTO.getSignguCode()); fileReq.setFfnlgCode(tmpDTO.getFfnlgCode()); fileReq.setTry1(tmpDTO.getTry1()); + fileReq.setPost_dlvr_se(tmpDTO.getPost_dlvr_se()); + fileReq.setPost_tmplat_code(tmpDTO.getPost_tmplat_code()); List rslts = getConvertCis(fileReq, fmcExcels); // CNTC 테이블 insert @@ -290,6 +292,7 @@ public class CmmEnsFileService extends EgovAbstractServiceImpl implements ICmmEn final int excelCnt = fmcExcels.size(); final String register = StringUtils.defaultString(fileReq.getRegister(),""); String unitySndngMastrId = ""; + String[] ppMasterJson = new String[2]; for(FmcInfExcelRslt dto : rslts){ if(StringUtils.isEmpty(String.join("", dto.getCi1(), dto.getCi2()))){ @@ -318,17 +321,21 @@ public class CmmEnsFileService extends EgovAbstractServiceImpl implements ICmmEn // POST-PLUS(전자우편) 일 경우 tb_ens_post_plus_json 테이블 insert if("POST-PLUS".equals(fileReq.getTry1())){ - String ppJson[] = PPJson(Integer.toString(mst),dto, fileReq.getSignguCode()); + //최초 1회 POST-PLUS master json 생성 + if(mst == 1){ + ppMasterJson = PPMasterJson(dto, fileReq, excelCnt); + } + String ppDetailJson[] = PPDetailJson(Integer.toString(mst),dto, fileReq.getSignguCode()); mapper.insertPostPlusJson( CntcDTO.PostPlusJson.builder() .unitySndngDetailId(dto.getUnitySndngDetailId()) .serviceCd("PST") .conKey(unitySndngMastrId) .sn(Integer.toString(mst)) - .masterCols(ppJson[0]) - .masterRows(ppJson[1]) - .detailCols(ppJson[2]) - .detailRows(ppJson[3]) + .masterCols(ppMasterJson[0]) + .masterRows(ppMasterJson[1]) + .detailCols(ppDetailJson[0]) + .detailRows(ppDetailJson[1]) .register(register) .build() ); @@ -788,44 +795,45 @@ public class CmmEnsFileService extends EgovAbstractServiceImpl implements ICmmEn return jsonCn; } - private String[] PPJson(String no, FmcInfExcel dto, String signguCode){ - String[] returnJson = new String[4]; + private String[] PPMasterJson(FmcInfExcel dto, FmcExcelUpload fileReq, int excelCnt){ + String[] returnJson = new String[2]; returnJson[0] = "[" + "\"버전\",\"테스트여부\",\"서비스\",\"연계식별키\",\"봉투\"," + "\"봉투창\",\"흑백칼라\",\"단면양면\",\"배달\",\"템플릿코드\"," - + "\"템플릿출력여부\",\"페이지수\",\"동봉물페이지수\",\"수취인수\",\"주소페이지유무\"," - + "\"맞춤자제유무\",\"메일머지유무\",\"반송여부\",\"스테이플러유무\",\"발송인명\"," - + "\"발송인우편번호\",\"발송인주소\",\"발송인상세주소\",\"발송인전화번호\"" + + "\"템플릿출력여부\",\"수취인수\",\"주소페이지유무\",\"맞춤자제유무\",\"메일머지유무\"," + + "\"발송인명\",\"발송인우편번호\",\"발송인주소\",\"발송인상세주소\",\"발송인전화번호\"" + "]"; returnJson[1] = "[" + "\"v1.10\"," + "\"Y\"," + "\"PST\"," - + "\"TEST20230221_000001\"," + + "\""+ Checks.checkVal(dto.getUnitySndngMastrId(),"") +"\"," + "\"소봉투\"," + "\"이중창\"," + "\"칼라\"," - + "\"양면\"," - + "\"일반\"," - + "\"001\"," + + "\"단면\"," + + "\""+ Checks.checkVal(fileReq.getPost_dlvr_se(),"") +"\"," + + "\""+ Checks.checkVal(fileReq.getPost_tmplat_code(),"") +"\"," + "\"Y\"," - + "1," - + "0," - + "1," + + Checks.checkVal(String.valueOf(excelCnt),"") + "," + "\"N\"," + "\"Y\"," + "\"N\"," - + "\"N\"," - + "\"N\"," + + "\"Y\"," + "\""+ Checks.checkVal(dto.getSenderNm(),"") +"\"," + "\""+ Checks.checkVal(dto.getSenderZipNo(),"") +"\"," + "\""+ Checks.checkVal(dto.getSenderAddr(),"") +"\"," + "\""+ Checks.checkVal(dto.getSenderDetailAddr(),"") +"\"," + "\""+ Checks.checkVal(dto.getSenderTelno(),"") +"\"" + "]"; + return returnJson; + } + + private String[] PPDetailJson(String no, FmcInfExcel dto, String signguCode){ + String[] returnJson = new String[2]; switch (signguCode) { case "88328": //교통시설운영처 - returnJson[2] = "[" + returnJson[0] = "[" + "\"순번\",\"수취인 명\",\"수취인 우편번호\",\"수취인 주소\",\"수취인 상세주소\"," + "\"수취인 전화번호\",\"고지서 구분명\",\"고지서 명\",\"고지서 상세명\",\"QR 바코드\"," + "\"부과대상\",\"기관번호\",\"세목\",\"납세년월기\",\"과세번호\"," @@ -834,7 +842,7 @@ public class CmmEnsFileService extends EgovAbstractServiceImpl implements ICmmEn + "\"납기내금액2\",\"납기내금액3\",\"납기내금액4\",\"납기내합계액\",\"출력일자\"," + "\"담당자\",\"우리가상계좌\",\"신한가상계좌\",\"하나가상계좌\"" + "]"; - returnJson[3] = "[" + returnJson[1] = "[" + "\""+ no +"\"," + "\""+ Checks.checkVal(dto.getRecevNm(),"") +"\"," + "\""+ Checks.checkVal(dto.getRecevZipNo(),"") +"\"," @@ -872,7 +880,7 @@ public class CmmEnsFileService extends EgovAbstractServiceImpl implements ICmmEn + "]"; break; case "88316": //추모시설운영처 - returnJson[2] = "[" + returnJson[0] = "[" + "\"순번\",\"수취인 명\",\"수취인 우편번호\",\"수취인 주소\",\"수취인 상세주소\"," + "\"고지서 구분명\",\"고지서 명\",\"고지서 상세명\",\"자료관리번호\",\"관리비기간\"," + "\"기관번호\",\"세목\",\"납세년월기\",\"과세번호\",\"부과내역3\"," @@ -882,7 +890,7 @@ public class CmmEnsFileService extends EgovAbstractServiceImpl implements ICmmEn + "\"국민가상계좌\",\"우리가상계좌\",\"신한가상계좌\",\"하나가상계좌\",\"우체국가상계좌\"," + "\"가상계좌받는분\"" + "]"; - returnJson[3] = "[" + returnJson[1] = "[" + "\""+ no +"\"," + "\""+ Checks.checkVal(dto.getRecevNm(),"") +"\"," + "\""+ Checks.checkVal(dto.getRecevZipNo(),"") +"\"," diff --git a/mens-api/src/main/resources/egovframework/mapper/biz/ens-cmm-file-mysql-mapper.xml b/mens-api/src/main/resources/egovframework/mapper/biz/ens-cmm-file-mysql-mapper.xml index 83282d5..7f56ba6 100644 --- a/mens-api/src/main/resources/egovframework/mapper/biz/ens-cmm-file-mysql-mapper.xml +++ b/mens-api/src/main/resources/egovframework/mapper/biz/ens-cmm-file-mysql-mapper.xml @@ -7,6 +7,8 @@ SELECT tetm.signgu_code , tetm.ffnlg_code , tetm.try1 + , tetm.post_dlvr_se + , tetm.post_tmplat_code FROM tb_ens_tmplat_manage tetm WHERE tmplat_id = #{tmplatId} diff --git a/mens-core/src/main/java/kr/xit/biz/ens/model/cmm/CmmEnsRequestDTO.java b/mens-core/src/main/java/kr/xit/biz/ens/model/cmm/CmmEnsRequestDTO.java index b2fbf5a..2892755 100644 --- a/mens-core/src/main/java/kr/xit/biz/ens/model/cmm/CmmEnsRequestDTO.java +++ b/mens-core/src/main/java/kr/xit/biz/ens/model/cmm/CmmEnsRequestDTO.java @@ -62,4 +62,18 @@ public class CmmEnsRequestDTO { @Schema(requiredMode = RequiredMode.AUTO, title = "1차 발송", example = "KKO-MY-DOC") @JsonProperty("try1") private String try1; + + /** + * 우편 배달 구분 + */ + @Schema(requiredMode = RequiredMode.AUTO, title = "우편 배달 구분", example = "일반") + @JsonProperty("post_dlvr_se") + private String post_dlvr_se; + + /** + * 우편 템플릿 코드 + */ + @Schema(requiredMode = RequiredMode.AUTO, title = "우편 템플릿 코드", example = "SISUL_TRAFFIC") + @JsonProperty("post_tmplat_code") + private String post_tmplat_code; }