feat: POST-PLUS master json 탬플릿 수정

dev
sjh88 1 year ago
parent 8a452a420d
commit ba5ea8bed1

@ -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<FmcInfExcelRslt> 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(),"") +"\","

@ -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}
</select>

@ -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;
}

Loading…
Cancel
Save