From d9b495688d5ef6e7af1632dfec28e5362348baed Mon Sep 17 00:00:00 2001 From: limju Date: Fri, 20 Oct 2023 16:29:51 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=8A=A4=ED=8A=B8=EB=A7=81?= =?UTF-8?q?=EB=AC=B8=EC=9E=90=EC=97=B4=20=EB=A9=80=ED=8B=B0=EB=9D=BC?= =?UTF-8?q?=EC=9D=B8=20=EC=A0=81=EC=9A=A9=20"""=20"""?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/cmm/service/CmmEnsFileService.java | 161 ++++++++++-------- .../kr/xit/biz/kt/web/BizKtMmsController.java | 1 + 2 files changed, 91 insertions(+), 71 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 3af9108..4dff767 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 @@ -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; - /** *
  * 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 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();
     }
 }
diff --git a/mens-api/src/main/java/kr/xit/biz/kt/web/BizKtMmsController.java b/mens-api/src/main/java/kr/xit/biz/kt/web/BizKtMmsController.java
index 805f343..48c04a9 100644
--- a/mens-api/src/main/java/kr/xit/biz/kt/web/BizKtMmsController.java
+++ b/mens-api/src/main/java/kr/xit/biz/kt/web/BizKtMmsController.java
@@ -268,4 +268,5 @@ public class BizKtMmsController {
 //        KtAcmdInfoCfmResponse dto = service.cfmAcmd(reqDTO);
 //        return ApiResponseDTO.success(dto);
 //    }
+
 }