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

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

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

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

Loading…
Cancel
Save