From d2325eebed3b226777d5fe0dd49cac9b21a3ce34 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Mon, 3 Jun 2024 11:54:56 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=8F=90=EA=B8=B0=EB=B3=B4=EA=B3=A0=20?= =?UTF-8?q?=EB=AA=A9=EB=A1=9D(NIMS=20API)=20=EC=A1=B0=ED=9A=8C=20=EB=B0=98?= =?UTF-8?q?=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/nims/service/bean/BizNimsServiceBean.java | 2 +- .../cokr/xit/adds/inf/nims/model/NimsApiDto.java | 10 +++++----- .../xit/adds/inf/nims/model/NimsApiRequest.java | 8 ++++---- .../inf/nims/service/bean/InfNimsServiceBean.java | 15 +++++++++++---- src/main/resources/config/application-nims.yml | 4 ++-- 5 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/main/java/cokr/xit/adds/biz/nims/service/bean/BizNimsServiceBean.java b/src/main/java/cokr/xit/adds/biz/nims/service/bean/BizNimsServiceBean.java index 4f20044..e93d6cd 100644 --- a/src/main/java/cokr/xit/adds/biz/nims/service/bean/BizNimsServiceBean.java +++ b/src/main/java/cokr/xit/adds/biz/nims/service/bean/BizNimsServiceBean.java @@ -848,7 +848,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe if("1".equals(dto.getRptTyCd())) return; int dtlCnt = 0; - for (NimsApiDto.DsuseRptInfoDtl d : dto.getDsuseRptInfoDtls()) { + for (NimsApiDto.DsuseRptInfoDtl d : dto.getListDtl()) { d.setRgtr(Constants.NIMS_API_USER_ID); dtlCnt = dtlCnt + bizNimsMapper.insertDsuseRptInfoDtl(d); } diff --git a/src/main/java/cokr/xit/adds/inf/nims/model/NimsApiDto.java b/src/main/java/cokr/xit/adds/inf/nims/model/NimsApiDto.java index ea7b764..5162bc7 100644 --- a/src/main/java/cokr/xit/adds/inf/nims/model/NimsApiDto.java +++ b/src/main/java/cokr/xit/adds/inf/nims/model/NimsApiDto.java @@ -426,7 +426,7 @@ public class NimsApiDto { */ @Builder.Default @Valid - private List dsuseRptInfoDtls = new ArrayList<>(); + private List listDtl = new ArrayList<>(); /** *
@@ -494,8 +494,8 @@ public class NimsApiDto {
 
                 // FIXME: 폐기관리와 폐기보고의 상품정보 일치 여부 set - 비교 필드 확정 필요
                 if (rptInfo.equals(mgtInfo)) {
-                    if (this.dsuseRptInfoDtls.size() == mgtDto.getDsuseMgtDtls().size()) {
-                        for (DsuseRptInfoDtl rptDtl : this.dsuseRptInfoDtls) {
+                    if (this.listDtl.size() == mgtDto.getDsuseMgtDtls().size()) {
+                        for (DsuseRptInfoDtl rptDtl : this.listDtl) {
                             for (BizNimsRequest.DsuseMgtDtl mgtDtl : mgtDto.getDsuseMgtDtls()) {
                                 if (rptDtl.getPrductCd().equals(mgtDtl.getPrductCd())
                                     && rptDtl.getMnfNo().equals(mgtDtl.getMnfNo())
@@ -557,8 +557,8 @@ public class NimsApiDto {
                     }
 
                     // FIXME: 상품정보 미일치 여부 set - 비교 필드 확정 필요
-                    if (this.dsuseRptInfoDtls.size() == mgtDto.getDsuseMgtDtls().size()) {
-                        for (DsuseRptInfoDtl rptDtl : this.dsuseRptInfoDtls) {
+                    if (this.listDtl.size() == mgtDto.getDsuseMgtDtls().size()) {
+                        for (DsuseRptInfoDtl rptDtl : this.listDtl) {
                             for (BizNimsRequest.DsuseMgtDtl mgtDtl : mgtDto.getDsuseMgtDtls()) {
                                 if (rptDtl.getPrductCd().equals(mgtDtl.getPrductCd())
                                     && rptDtl.getMnfNo().equals(mgtDtl.getMnfNo())
diff --git a/src/main/java/cokr/xit/adds/inf/nims/model/NimsApiRequest.java b/src/main/java/cokr/xit/adds/inf/nims/model/NimsApiRequest.java
index dec4995..ad693e8 100644
--- a/src/main/java/cokr/xit/adds/inf/nims/model/NimsApiRequest.java
+++ b/src/main/java/cokr/xit/adds/inf/nims/model/NimsApiRequest.java
@@ -257,7 +257,7 @@ public class NimsApiRequest {
          * 빈값 : 전체
          * 0: 신규, 1: 취소, 2: 변경
          */
-        @Schema(title = "보고유형('': 전체, 0:신규, 1:취소, 2:변경)", description = "보고유형('': 전체, 0:신규, 1:취소, 2:변경)", example = " ", allowableValues = {"", "0", "1", "2"})
+        @Schema(title = "보고유형('': 전체, 0:신규, 1:취소, 2:변경)", description = "보고유형('': 전체, 0:신규, 1:취소, 2:변경)", example = "0", allowableValues = {"", "0", "1", "2"})
         @Pattern(regexp = "^$|[012]", message = "보고유형 값을 확인해 주세요('': 전체, 0:신규, 1:취소, 2:변경)")
         String fg2;
 
@@ -274,7 +274,7 @@ public class NimsApiRequest {
          * 조회 시작일(yyyyMMdd)
          * 최대 1개월
          */
-        @Schema(title = "조회 시작일(yyyyMMdd)", description = "조회 시작일(yyyyMMdd)", example = "20240101")
+        @Schema(title = "조회 시작일(yyyyMMdd)", description = "조회 시작일(yyyyMMdd)", example = "20240105")
         @Pattern(regexp = Constants.DATE_REGX, message = "조회 시작일은 필수 입니다(yyyyMMdd)")
         String sdt;
 
@@ -282,7 +282,7 @@ public class NimsApiRequest {
          * 조회 종료일(yyyyMMdd)
          * 최대 1개월
          */
-        @Schema(title = "조회 종료일(yyyyMMdd)", description = "조회 종료일(yyyyMMdd)", example = "20240131")
+        @Schema(title = "조회 종료일(yyyyMMdd)", description = "조회 종료일(yyyyMMdd)", example = "20240105")
         @Pattern(regexp = Constants.DATE_REGX, message = "조회 종료일은 필수 입니다(yyyyMMdd)")
         String edt;
 
@@ -308,7 +308,7 @@ public class NimsApiRequest {
          * 폐기 보고 상태
          * 01: 확인, 02: 보류, 03: 정정, 04: 미처리
          */
-        @Schema(title = "상태", description = "상태", example = " ", allowableValues = {"01", "02", "03", "04"})
+        @Schema(title = "상태", description = "상태", example = "01", allowableValues = {"01", "02", "03", "04"})
         @Pattern(regexp = "^$|0[1-4]", message = "상태[폐기보고] 값을 확인해 주세요('': 전체, 01:확인, 02:보류, 03:정정, 04:미처리)")
         String ps;
 
diff --git a/src/main/java/cokr/xit/adds/inf/nims/service/bean/InfNimsServiceBean.java b/src/main/java/cokr/xit/adds/inf/nims/service/bean/InfNimsServiceBean.java
index 7f96c95..406113c 100644
--- a/src/main/java/cokr/xit/adds/inf/nims/service/bean/InfNimsServiceBean.java
+++ b/src/main/java/cokr/xit/adds/inf/nims/service/bean/InfNimsServiceBean.java
@@ -72,6 +72,13 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe
 	@Value("${app.inf.nims.api.officeinfo}")
 	private String officeinfo;
 
+	/**
+	 * 폐기보고 정보 조회 API URL
+	 */
+	@Value("${app.inf.nims.api.dsuseresult}")
+	private String dsuseresult;
+
+
 	@Override
 	@TraceLogging
 	public NimsApiResult.Response getBsshInfoSt(NimsApiRequest.BsshInfoReq dto) {
@@ -146,9 +153,9 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe
 		ApiUtil.checkYmdError(dto.getEdt(), "edt");
 
 		// FIXME: API 호출 시 주석 해제
-		//String rslt = ApiUtil.callNimsApi(nimsUrl + reportinfo, dto);
-		//NimsApiResult result = json.parse(rslt, new TypeReference<>() {});
-		//return result.getResponse();
+		// String rslt = ApiUtil.callNimsApi(nimsUrl + dsuseresult, dto);
+		// NimsApiResult result = json.parse(rslt, new TypeReference<>() {});
+		// return result.getResponse();
 
 		return getDsuseRptResponse();
 	}
@@ -206,7 +213,7 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe
 				.dsuseDe("20240306")
 				.dsuseLoc("보건소")
 				.status("0")
-				.dsuseRptInfoDtls("1".equals(rptTyCds.get(i))? null : List.of(dtl1, dtl2))
+				.listDtl("1".equals(rptTyCds.get(i))? null : List.of(dtl1, dtl2))
 				.build();
 			dsuseRpts.add(dsuseRpt);
 		}
diff --git a/src/main/resources/config/application-nims.yml b/src/main/resources/config/application-nims.yml
index d1ae4d2..8493a56 100644
--- a/src/main/resources/config/application-nims.yml
+++ b/src/main/resources/config/application-nims.yml
@@ -7,7 +7,7 @@ app:
         seqinfo: /api/seqinfo.do
         officeinfo: /api/officeinfo.do
         placeinfoV1: /api/placeinfo_v1.do
-        reportinfo: /api/reportinfo_ggg.do
+        dsuseresult: /api/dsuseresult.do
     iros:
       url: https://apis.data.go.kr
       api-key: 0fTkYnZU6XjaAPAp6GzKW9Q6fYq8iaoSH9wKUZwz2PBjRXGM04aUgtO3a61xYGjL8nFZn4fjLGS9XErhMSXq%2Bw%3D%3D
@@ -23,7 +23,7 @@ spring:
 app:
   inf:
     nims:
-      url: https://test.nims.or.kr
+      url: https://www.nims.or.kr
 
 ---
 spring: