refactor: 스트링문자열 멀티라인 적용 """ """

dev
gitea-관리자 1 year ago
parent d98934da2f
commit d9b495688d

@ -1,5 +1,7 @@
package kr.xit.biz.cmm.service;
import static egovframework.com.cmm.util.EgovDateUtil.formatDate;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
@ -7,12 +9,12 @@ import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import javax.transaction.Transactional;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import kr.xit.biz.cmm.mapper.ICmmEnsFileMapper;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.ens.model.cmm.CmmEnsFileInfDTO.FmcExcelUpload;
@ -29,14 +31,15 @@ import kr.xit.ens.nice.service.INiceCiService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import static egovframework.com.cmm.util.EgovDateUtil.formatDate;
import static egovframework.com.cmm.util.EgovDateUtil.formatTime;
/**
* <pre>
* description :
@ -322,71 +325,87 @@ public class CmmEnsFileService extends EgovAbstractServiceImpl implements ICmmEn
}
private String jsonCn1(FmcInfExcel dto){
String jsonCn = "{"
+ "\"details\": ["
+ "{"
+ "\"title\": \"서울시설공단 고지서\","
+ "\"item_type\": \"SUBJECT_TEXT\","
+ "\"elements\": ["
+ "\"\""
+ "]"
+ "},"
+ "{"
+ "\"title\": \"내용\","
+ "\"item_type\": \"KEY_VALUE\","
+ "\"properties\": {"
+ "},"
+ "\"elements\": ["
+ "{"
+ "\"key\": \"수취인\","
+ "\"value\": \""+ Checks.checkVal(dto.getRecevNm(),"") +"\","
+ "\"level\": 1"
+ "},"
+ "{"
+ "\"key\": \"고지서\","
+ "\"value\": \""+ Checks.checkVal(dto.getGojiNm(),"") +"("+ Checks.checkVal(dto.getGojiGubun(),"") +")"+"\","
+ "\"level\": 1"
+ "},"
+ "{"
+ "\"key\": \"고지서 상세\","
+ "\"value\": \""+ Checks.checkVal(dto.getGojiDetailNm(),"") +"\","
+ "\"level\": 1"
+ "},"
+ "{"
+ "\"key\": \"납세번호\","
+ "\"value\": \""+ Checks.checkVal(dto.getTaxNum1(),"") + Checks.checkVal(dto.getTaxNum2(),"") + Checks.checkVal(dto.getTaxNum3(),"") + Checks.checkVal(dto.getTaxNum4(),"") +"\","
+ "\"level\": 1"
+ "},"
+ "{"
+ "\"key\": \""+ Checks.checkVal(dto.getNapAmountNm1(),"") +"\","
+ "\"value\": \""+ Checks.checkVal(dto.getNapAmount1(),"") +"\","
+ "\"level\": 1"
+ "},"
+ "{"
+ "\"key\": \""+ Checks.checkVal(dto.getNapGubun1(),"") +"\","
+ "\"value\": \""+ Checks.checkVal(formatDate(dto.getNapPd().substring(0,8), "-"),"") +"까지\","
+ "\"level\": 1"
+ "}"
+ "]"
+ "},"
+ "{"
+ "\"title\": \"세외수입 납부방법 안내\","
+ "\"item_type\": \"KEY_VALUE\","
+ "\"elements\": ["
+ "{"
+ "\"key\": \"가상계좌\\\\n납부\","
+ "\"value\": \"고지서에 기재된 가상계좌로 이체,납부\\\\n고지서 금액과 일치해야 이체 가능\","
+ "\"level\": 1"
+ "},"
+ "{"
+ "\"key\": \"모바일\\\\n어플\","
+ "\"value\": \"앱,PLAY스토어에서 (서울시 세금납부) 앱 설치\\\\n계좌이체(전 은행), 신용카드, 간편결제 납부\","
+ "\"level\": 1"
+ "}"
+ "]"
+ "}"
+ "]"
+"}";
return jsonCn;
AtomicReference<String> jsonCn = new AtomicReference<>("""
{
"details": [
{
"title": "서울시설공단 고지서",
"item_type": "SUBJECT_TEXT",
"elements": [ "" ]
},
{
"title": "내용",
"item_type": "KEY_VALUE",
"properties": {
},
"elements": [
{
"key": "수취인",
"value": \"""" + Checks.checkVal(dto.getRecevNm(), "") + """
",
"level": 1
},
{
"key": "고지서",
"value": \"""" + Checks.checkVal(dto.getGojiNm(), "") + "(" + Checks.checkVal(
dto.getGojiGubun(), "") + ")" + """
",
"level": 1
},
{
"key": "고지서 상세",
"value": \"""" + Checks.checkVal(dto.getGojiDetailNm(), "") + """
",
"level": 1
},
{
"key": "납세번호",
"value": \"""" + Checks.checkVal(dto.getTaxNum1(), "") + Checks.checkVal(
dto.getTaxNum2(), "") + Checks.checkVal(dto.getTaxNum3(), "") + Checks.checkVal(
dto.getTaxNum4(), "") + """
",
"level": 1
},
{
"key": \"""" + Checks.checkVal(dto.getNapAmountNm1(), "") + """
",
"value": \"""" + Checks.checkVal(dto.getNapAmountNm1(), "") + """
",
"level": 1
},
{
"key": \"""" + Checks.checkVal(dto.getNapGubun1(), "") + """
",
"value": \"""" + Checks.checkVal(
formatDate(dto.getNapPd().substring(0, 8), "-"), "") + """
",
"level": 1
}
]
},
{
"title": "세외수입 납부방법 안내",
"item_type": "KEY_VALUE",
"elements": [
{
"key": "
",
"value": " ,
",
"level": 1
},
{
"key": "
",
"value": ",PLAY ( )
( ), , ",
"level": 1
}
]
}
]
}
""");
return jsonCn.get();
}
}

@ -268,4 +268,5 @@ public class BizKtMmsController {
// KtAcmdInfoCfmResponse dto = service.cfmAcmd(reqDTO);
// return ApiResponseDTO.success(dto);
// }
}

Loading…
Cancel
Save