From 37052ea41c3173ad237dbc6c948578911750ee5c Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Thu, 22 Aug 2024 17:52:26 +0900 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20=EC=9D=BC=EB=A0=A8=EB=B2=88?= =?UTF-8?q?=ED=98=B8=20=EC=A1=B0=ED=9A=8C(seqinfo=5Fpub)=20API=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9=20=20=20=20=20=20=20=EC=A0=9C=ED=92=88=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EB=B0=98=EC=98=81(=EC=97=85=EC=B2=B4=EC=9D=98=20?= =?UTF-8?q?=EC=A0=9C=ED=92=88=20=EC=A1=B0=ED=9A=8C=20=EB=90=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adds/biz/nims/service/BizNimsService.java | 2 +- .../nims/service/bean/BizNimsServiceBean.java | 166 ++++++++---------- .../adds/biz/nims/web/BizNimsController.java | 14 +- .../adds/inf/nims/model/NimsApiRequest.java | 18 +- .../nims/service/bean/InfNimsServiceBean.java | 20 ++- .../adds/inf/nims/web/InfNimsController.java | 2 +- .../resources/config/application-nims.yml | 2 +- 7 files changed, 114 insertions(+), 110 deletions(-) diff --git a/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java b/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java index 471ff99..f7860ab 100644 --- a/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java +++ b/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java @@ -33,7 +33,7 @@ public interface BizNimsService { List saveBsshInfoSt(final NimsApiRequest.BsshInfoReq dto); List saveProductInfoKd(final NimsApiRequest.ProductInfoReq dto, boolean isMnfSeqInfo); ApiBaseResponse> getMnfSeqInfo(final NimsApiRequest.MnfSeqInfoReq dto); - List getMnfSeqInfo2(final NimsApiRequest.MnfSeqInfoReq dto); +// List getMnfSeqInfo2(final NimsApiRequest.MnfSeqInfoReq dto); List getJurisdictionGovInfo(final NimsApiRequest.JurisdictionGovInfoReq dto); List getNimsDsuseRptInfo(final NimsApiRequest.DsuseRptInfoReq dto); 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 5c0b6ae..6ef6d6b 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 @@ -149,20 +149,22 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe List list = new ArrayList<>(); - // DB 조회 - if("N".equals(reqDto.getDbSkipYn())) { - list = bizNimsMapper.selectProductInfos(reqDto); - if (!isEmpty(list)){ - if(isMnfSeqInfo){ - if(isEmpty(reqDto.getK())){ - productInfoaddMnfSeqs(list, getApiInfInfo(reqDto.getUserId()).get("apiKey")); - }else { - productInfoaddMnfSeqs(list, reqDto.getK()); - } - } - return list; - } - } + //////////////////////////////////////////////////////////////////////////////////////// + // TODO: API 적용후 DB 조회 skip 처리 + // if("N".equals(reqDto.getDbSkipYn())) { + // list = bizNimsMapper.selectProductInfos(reqDto); + // if (!isEmpty(list)){ + // if(isMnfSeqInfo){ + // if(isEmpty(reqDto.getK())){ + // productInfoaddMnfSeqs(list, reqDto.getBc(), getApiInfInfo(reqDto.getUserId()).get("apiKey")); + // }else { + // productInfoaddMnfSeqs(list, reqDto.getBc(), reqDto.getK()); + // } + // } + // return list; + // } + // } + /////////////////////////////////////////////////////////////// if(isEmpty(reqDto.getK())){ reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey")); @@ -184,7 +186,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe } // 제조 번호, 일련번호, 유효기간 정보 목록 추가 - if(isMnfSeqInfo) productInfoaddMnfSeqs(curList, reqDto.getK()); + if(isMnfSeqInfo) productInfoaddMnfSeqs(curList, reqDto.getBc(), reqDto.getK()); list.addAll(curList); if(rslt.isEndYn()) break; @@ -201,84 +203,28 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe //reqDto.setFg("1"); // 제조번호 또는 일련번호 구분(1-제조번호, 2-일련번호, 3-바코드/RFID) //reqDto.setPg("1"); // 조회페이지 - // 시리얼번호 및 제조번호 기준 검색후, 결과내에서 유효기간으로 필터링 하도록 처리 - boolean isPrdValidDe = !isEmpty(reqDto.getT()) && !isEmpty(reqDto.getPrdValidDe()); - List list = new ArrayList<>(); - //while (true) { - NimsApiResult.Response rslt = infNimsService.getMnfSeqInfo(reqDto); - List curList = rslt.getResult(); + NimsApiResult.Response rslt = infNimsService.getMnfSeqInfo(reqDto); + List list = rslt.getResult(); - if(isPrdValidDe) { - for (NimsApiDto.MnfSeqInfo d : curList) { - if(!isEmpty(d.getPrdValidDe()) && d.getPrdValidDe().contains(reqDto.getPrdValidDe())){ - list.add(d); - } - } - }else { - list.addAll(curList); + // 시리얼번호 및 제조번호 기준 검색후, 결과내에서 유효기간으로 필터링 하도록 처리 + if(!isEmpty(list) && (!isEmpty(reqDto.getT()) && !isEmpty(reqDto.getVd()))) { + list.sort((a, b) -> { + if (isEmpty(a.getPrdValidDe()) && isEmpty(b.getPrdValidDe())) + return 0; + if (isEmpty(a.getPrdValidDe())) + return -1; + if (isEmpty(b.getPrdValidDe())) + return 1; + return a.getPrdValidDe().compareTo(b.getPrdValidDe()); + }); } - list.sort((a, b) -> { - if (isEmpty(a.getPrdValidDe()) && isEmpty(b.getPrdValidDe())) - return 0; - if (isEmpty(a.getPrdValidDe())) - return -1; - if (isEmpty(b.getPrdValidDe())) - return 1; - return a.getPrdValidDe().compareTo(b.getPrdValidDe()); - }); - ApiBaseResponse> res = ApiBaseResponse.of(list); res.setTotalCount(rslt.getBody().getTotalCount()); return res; } - @Override - public List getMnfSeqInfo2(NimsApiRequest.MnfSeqInfoReq reqDto) { - if(isEmpty(reqDto.getK())){ - reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey")); - } - //reqDto.setFg("1"); // 제조번호 또는 일련번호 구분(1-제조번호, 2-일련번호, 3-바코드/RFID) - reqDto.setPg("1"); // 조회페이지 - - // 시리얼번호 및 제조번호 기준 검색후, 결과내에서 유효기간으로 필터링 하도록 처리 - boolean isPrdValidDe = !isEmpty(reqDto.getT()) && !isEmpty(reqDto.getPrdValidDe()); - List list = new ArrayList<>(); - while (true) { - NimsApiResult.Response rslt = infNimsService.getMnfSeqInfo(reqDto); - - List curList = rslt.getResult(); - - if (isEmpty(curList)) break; - - if(isPrdValidDe) { - for (NimsApiDto.MnfSeqInfo d : curList) { - if(!isEmpty(d.getPrdValidDe()) && d.getPrdValidDe().contains(reqDto.getPrdValidDe())){ - list.add(d); - } - } - }else { - list.addAll(curList); - // 올림 차순 정렬 - list.sort((a, b) -> { - if (isEmpty(a.getPrdValidDe()) && isEmpty(b.getPrdValidDe())) - return 0; - if (isEmpty(a.getPrdValidDe())) - return -1; - if (isEmpty(b.getPrdValidDe())) - return 1; - return a.getPrdValidDe().compareTo(b.getPrdValidDe()); - }); - } - // 데이타 조회 결과 마지막 페이지 이거나 100건 이상인 경우 종료 - if(rslt.isEndYn() || list.size() > 100 || isPrdValidDe) break; - - reqDto.setPg(String.valueOf(Integer.parseInt(reqDto.getPg()) + 1)); - } - return list; - } - @Override public List getJurisdictionGovInfo(final NimsApiRequest.JurisdictionGovInfoReq reqDto) { List list = new ArrayList<>(); @@ -443,7 +389,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe Map map = new HashMap<>(); map.put("dscdmngId", dto.getDscdmngId()); List dsuseRptInfoDtls = bizNimsMapper.selectDsuseMgtDtls(map); - if(isForDoc) setDsuseMgtDtlAddProductInfo(dsuseRptInfoDtls, reqDto.getUserId(), apiKey); + if(isForDoc) setDsuseMgtDtlAddProductInfo(dsuseRptInfoDtls, dto.getBsshCd(), reqDto.getUserId(), apiKey); dto.getDsuseMgtDtls().addAll(dsuseRptInfoDtls); } @@ -565,7 +511,6 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe .fg("1") .pg("1") .p(mnfSeqInfo.getPrductCd()) - .dbSkipYn("N") .userId(userId) .build(); List productInfoKds = saveProductInfoKd(prdReq, false); @@ -610,7 +555,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe * @param dtlList * */ - private void setDsuseMgtDtlAddProductInfo(List dtlList, String userId, String apiKey) { + private void setDsuseMgtDtlAddProductInfo(List dtlList, String bsshCd, String userId, String apiKey) { for (BizNimsResponse.DsuseMgtDtlRes r : dtlList) { // 마약항정구분(nrcdSeNm), 중점일반구분(prtmSenm) if (isEmpty(r.getNrcdSeNm()) || isEmpty(r.getPrtmSeNm())) { @@ -899,7 +844,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe * @param apiKey Api Key * */ - private void productInfoaddMnfSeqs(final List list, final String apiKey) { + private void productInfoaddMnfSeqs(final List list, final String bsshCd, final String apiKey) { String productCd = ""; try { @@ -913,6 +858,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe .fg("1") .pg("1") .p(d.getPrductCd()) + .bc(bsshCd) .userId("") .build() ); @@ -997,4 +943,48 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe return files.get(0).getId(); } + + private List getMnfSeqInfo2(NimsApiRequest.MnfSeqInfoReq reqDto) { + if(isEmpty(reqDto.getK())){ + reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey")); + } + //reqDto.setFg("1"); // 제조번호 또는 일련번호 구분(1-제조번호, 2-일련번호, 3-바코드/RFID) + reqDto.setPg("1"); // 조회페이지 + + // 시리얼번호 및 제조번호 기준 검색후, 결과내에서 유효기간으로 필터링 하도록 처리 + boolean isPrdValidDe = !isEmpty(reqDto.getT()) && !isEmpty(reqDto.getVd()); + List list = new ArrayList<>(); + while (true) { + NimsApiResult.Response rslt = infNimsService.getMnfSeqInfo(reqDto); + + List curList = rslt.getResult(); + + if (isEmpty(curList)) break; + + if(isPrdValidDe) { + for (NimsApiDto.MnfSeqInfo d : curList) { + if(!isEmpty(d.getPrdValidDe()) && d.getPrdValidDe().contains(reqDto.getVd())){ + list.add(d); + } + } + }else { + list.addAll(curList); + // 올림 차순 정렬 + list.sort((a, b) -> { + if (isEmpty(a.getPrdValidDe()) && isEmpty(b.getPrdValidDe())) + return 0; + if (isEmpty(a.getPrdValidDe())) + return -1; + if (isEmpty(b.getPrdValidDe())) + return 1; + return a.getPrdValidDe().compareTo(b.getPrdValidDe()); + }); + } + // 데이타 조회 결과 마지막 페이지 이거나 100건 이상인 경우 종료 + if(rslt.isEndYn() || list.size() > 100 || isPrdValidDe) break; + + reqDto.setPg(String.valueOf(Integer.parseInt(reqDto.getPg()) + 1)); + } + return list; + } } diff --git a/src/main/java/cokr/xit/adds/biz/nims/web/BizNimsController.java b/src/main/java/cokr/xit/adds/biz/nims/web/BizNimsController.java index 343cec9..ce29cad 100644 --- a/src/main/java/cokr/xit/adds/biz/nims/web/BizNimsController.java +++ b/src/main/java/cokr/xit/adds/biz/nims/web/BizNimsController.java @@ -85,13 +85,13 @@ public class BizNimsController { return bizNimsService.getMnfSeqInfo(dto); } - @Operation(summary = "NIMS 제조 일련 번호 정보 조회", description = "제보 일련 번호 정보 조회
NIMS API 호출 결과 Return

아래 항목만 set
p - 제품번호
userId - 사용자ID", tags = { "NIMS API" }) - @RequestMapping(value = "/getNimsMnfSeqInfo2", method = { RequestMethod.POST, RequestMethod.GET }) - public ApiBaseResponse> getNimsMnfSeqInfo2( - @ModelAttribute NimsApiRequest.MnfSeqInfoReq dto - ) { - return ApiBaseResponse.of(bizNimsService.getMnfSeqInfo2(dto)); - } + // @Operation(summary = "NIMS 제조 일련 번호 정보 조회", description = "제보 일련 번호 정보 조회
NIMS API 호출 결과 Return

아래 항목만 set
p - 제품번호
userId - 사용자ID", tags = { "NIMS API" }) + // @RequestMapping(value = "/getNimsMnfSeqInfo2", method = { RequestMethod.POST, RequestMethod.GET }) + // public ApiBaseResponse> getNimsMnfSeqInfo2( + // @ModelAttribute NimsApiRequest.MnfSeqInfoReq dto + // ) { + // return ApiBaseResponse.of(bizNimsService.getMnfSeqInfo2(dto)); + // } @Operation(summary = "NIMS 관할 허가 관청 정보 조회", description = "관할 허가 관청 정보 조회

NIMS API 호출 결과를 DB에 저장후 결과 Return

아래 항목만 set
onm - 기관명
ocd - 기관코드
adr - 주소
dbSkipYn - N : db조회후 결과 없는경우만 API호출, Y : API 호출
userId - 사용자ID
onm, ocd, adr중 하나는 필수", tags = { "NIMS API" }) @RequestMapping(value = "/getNimsJurisdictionGovInfo", method = { RequestMethod.POST, RequestMethod.GET }) 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 4386160..a00effc 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 @@ -198,15 +198,11 @@ public class NimsApiRequest { /** *
-         * DB 조회 skip 여부
-         * DB먼저 조회 하고 없는 경우 NIMS API 조회 호출
-         * true 인 경우 DB 조회 skip
-         * 업무상 필요에 의해 추가
+         * 마약류취급자번호
          * 
*/ - @Schema(title = "DB 조회 skip 여부", description = "DB 조회 skip 여부(DB 조회 없이 NIMS API호출 하려면 Y)", example = "N") - @Builder.Default - private String dbSkipYn = "N"; + @Schema(title = "마약류취급자번호", description = "마약류취급자번호", example = " ") + private String bc; /** *
@@ -384,11 +380,17 @@ public class NimsApiRequest {
         @Pattern(regexp = "^$|[A-Z0-9]{1,}", message = "번호는 영숫자(A~Z, 0~9)만 입력가능합니다")
         private String t = StringUtils.EMPTY;
 
+        /**
+         * 마약류 취급자 식별 번호
+         */
+        @Schema(title = "마약류 취급자 식별 번호", description = "마약류 취급자 식별 번호", example = " ")
+        private String bc;
+
         /**
          * 유효기간
          */
         @Schema(title = "유효기간", description = "유효기간", example = " ")
-        private String prdValidDe;
+        private String vd;
 
         /**
          * 
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 7b6cad6..4794b4e 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
@@ -57,7 +57,7 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe
 	private String productinfoKd;
 
 	/**
-	 * 마약류 제품 제조번호 정보 조회 API URL
+	 * 업체별 마약류 제품 제조번호 정보 조회 API URL
 	 */
 	@Value("${app.inf.nims.api.seqinfo}")
 	private String seqinfo;
@@ -95,18 +95,30 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe
 		ApiUtil.validate(dto, null, validator);
 		if(!isEmpty(dto.getYmd())) ApiUtil.checkYmdError(dto.getYmd(), null);
 
-		String rslt = ApiUtil.callNimsApi(nimsUrl + productinfoKd, dto);
+		//FIXME: 운영기 반영 이후 주석 제거
+		//String rslt = ApiUtil.callNimsApi(nimsUrl + productinfoKd, dto);
+		dto.setK("998003699950fa950b798c9edea1b38f3cfbcf3b77e03e419");
+		String rslt = ApiUtil.callNimsApi("https://test.nims.or.kr" + productinfoKd, dto);
 		NimsApiResult result = json.parse(rslt, new TypeReference<>() {});
 		return result.getResponse();
 	}
 
+	/**
+	 * 업체별 상품일련번호 정보 조회 API URL
+	 * @param dto NimsApiRequest.MnfSeqInfoReq
+	 * @return NimsApiResult.Response
+	 */
 	@Override
-	//@TraceLogging
 	public NimsApiResult.Response getMnfSeqInfo(NimsApiRequest.MnfSeqInfoReq dto) {
 		ApiUtil.validate(dto, null, validator);
 		if(!isEmpty(dto.getYmd())) ApiUtil.checkYmdError(dto.getYmd(), null);
 
-		String rslt = ApiUtil.callNimsApi(nimsUrl + seqinfo, dto);
+		//FIXME: 운영기 반영 이후 주석 제거
+		//String rslt = ApiUtil.callNimsApi(nimsUrl + seqinfo, dto);
+		//dto.setK("1d6646562470902a61fc334c83a249cdcc5dc753426942138ee04342e66c8128");
+		dto.setK("998003699950fa950b798c9edea1b38f3cfbcf3b77e03e419");
+		dto.setBc("");
+		String rslt = ApiUtil.callNimsApi("https://test.nims.or.kr" + seqinfo, dto);
 		NimsApiResult result = json.parse(rslt, new TypeReference<>() {});
 		return result.getResponse();
 	}
diff --git a/src/main/java/cokr/xit/adds/inf/nims/web/InfNimsController.java b/src/main/java/cokr/xit/adds/inf/nims/web/InfNimsController.java
index 345c4c7..c2dab5c 100644
--- a/src/main/java/cokr/xit/adds/inf/nims/web/InfNimsController.java
+++ b/src/main/java/cokr/xit/adds/inf/nims/web/InfNimsController.java
@@ -52,7 +52,7 @@ public class InfNimsController {
 		return ApiBaseResponse.of(infNimsService.getProductInfoKd(dto));
 	}
 
-	@Operation(summary = "제조 일련 번호 정보 조회", description = "제조 일련 번호 정보 조회")
+	@Operation(summary = "제조 일련 번호 정보 조회(업체별)", description = "제조 일련 번호 정보 조회(업체별)")
 	@PostMapping("/getMnfSeqInfo")
 	public ApiBaseResponse> getMnfSeqInfo(
 		@RequestBody NimsApiRequest.MnfSeqInfoReq dto
diff --git a/src/main/resources/config/application-nims.yml b/src/main/resources/config/application-nims.yml
index f4540b9..263320c 100644
--- a/src/main/resources/config/application-nims.yml
+++ b/src/main/resources/config/application-nims.yml
@@ -4,7 +4,7 @@ app:
       api:
         bsshinfoStV1: /api/bsshinfo_st_v1.do
         productinfoKd: /api/productinfo_kd.do
-        seqinfo: /api/seqinfo.do
+        seqinfo: /api/seqinfo_pub.do
         officeinfo: /api/officeinfo.do
         placeinfoV1: /api/placeinfo_v1.do
         dsuseresult: /api/dsuseresult.do

From 5d751cab852559929590f73255844c7d53f11cf5 Mon Sep 17 00:00:00 2001
From: "Jonguk. Lim" 
Date: Tue, 15 Oct 2024 15:37:36 +0900
Subject: [PATCH 2/6] =?UTF-8?q?feat:=20=EC=9D=BC=EB=A0=A8=EB=B2=88?=
 =?UTF-8?q?=ED=98=B8=20=EC=A1=B0=ED=9A=8C(seqinfo=5Fpub)=20API=20=EC=A0=81?=
 =?UTF-8?q?=EC=9A=A9=20=20=20=20=20=20=20=EC=A0=9C=ED=92=88=EC=A1=B0?=
 =?UTF-8?q?=ED=9A=8C=20=EB=B0=98=EC=98=81(=EC=97=85=EC=B2=B4=EC=9D=98=20?=
 =?UTF-8?q?=EC=A0=9C=ED=92=88=20=EC=A1=B0=ED=9A=8C=20=EB=90=98=EB=8F=84?=
 =?UTF-8?q?=EB=A1=9D)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../xit/adds/biz/nims/dao/BizNimsMapper.java  |  19 +--
 .../adds/biz/nims/service/BizNimsService.java |  17 +--
 .../nims/service/bean/BizNimsServiceBean.java | 121 +++++++++--------
 .../adds/biz/nims/web/BizNimsController.java  |  44 +++----
 .../xit/adds/inf/nims/model/NimsApiDto.java   | 124 ++++++++++++++----
 .../adds/inf/nims/model/NimsApiRequest.java   |  20 ++-
 .../sql/mapper/biz/nims-mysql-mapper.xml      |  38 +++---
 7 files changed, 223 insertions(+), 160 deletions(-)

diff --git a/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java b/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java
index da7b0ba..f460612 100644
--- a/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java
+++ b/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java
@@ -1,21 +1,16 @@
 package cokr.xit.adds.biz.nims.dao;
 
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
+import java.util.*;
 
-import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
+import org.egovframe.rte.psl.dataaccess.mapper.*;
 
-import cokr.xit.adds.biz.nims.model.BizNimsDto;
-import cokr.xit.adds.biz.nims.model.BizNimsRequest;
-import cokr.xit.adds.biz.nims.model.BizNimsResponse;
-import cokr.xit.adds.inf.nims.model.NimsApiDto;
-import cokr.xit.adds.inf.nims.model.NimsApiRequest;
-import cokr.xit.foundation.component.AbstractMapper;
+import cokr.xit.adds.biz.nims.model.*;
+import cokr.xit.adds.inf.nims.model.*;
+import cokr.xit.foundation.component.*;
 
 /**
  * 
- * description : 
+ * description :
  *
  * packageName : cokr.xit.adds.inf.nims.dao
  * fileName    : InfNimsMapper
@@ -36,7 +31,7 @@ public interface BizNimsMapper extends AbstractMapper {
 	void mergeBsshInfoSt(final NimsApiDto.BsshInfoSt dto);
 	List selectBsshInfos(final NimsApiRequest.BsshInfoReq dto);
 
-	void mergeProductInfoKd(final NimsApiDto.ProductInfoKd dto);
+	void mergeProductInfoKd(final NimsApiDto.ProductInfoKdSaveDTO dto);
 	List selectProductInfos(final NimsApiRequest.ProductInfoReq dto);
 
 	void mergeJurisdictionGovInfo(NimsApiDto.JurisdictionGovInfo dto);
diff --git a/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java b/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java
index f7860ab..54c8101 100644
--- a/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java
+++ b/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java
@@ -1,19 +1,16 @@
 package cokr.xit.adds.biz.nims.service;
 
-import java.util.List;
+import java.util.*;
 
-import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.*;
 
-import cokr.xit.adds.biz.nims.model.BizNimsDto;
-import cokr.xit.adds.biz.nims.model.BizNimsRequest;
-import cokr.xit.adds.biz.nims.model.BizNimsResponse;
-import cokr.xit.adds.core.model.ApiBaseResponse;
-import cokr.xit.adds.inf.nims.model.NimsApiDto;
-import cokr.xit.adds.inf.nims.model.NimsApiRequest;
+import cokr.xit.adds.biz.nims.model.*;
+import cokr.xit.adds.core.model.*;
+import cokr.xit.adds.inf.nims.model.*;
 
 /**
  * 
- * description : 
+ * description :
  *
  * packageName : cokr.xit.adds.inf.nims.service
  * fileName    : InfNimsService
@@ -41,7 +38,7 @@ public interface BizNimsService {
 	//------------------------------------------------------------------------------------------------------
 	// NIMS BIZ
 	//------------------------------------------------------------------------------------------------------
-	BizNimsRequest.DsuseMgtReceiptReq saveDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceiptReq dto, final List dtls, List files);
+	BizNimsRequest.DsuseMgtReceiptReq saveDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceiptReq reqDto, final List dtls, final List files, final NimsApiDto.BsshInfoSt bsshInfoSt, final List prdList);
 
 	BizNimsRequest.DsuseMgtReceiptReq modifyDsuseMgtReceiptMstInfo(final BizNimsRequest.DsuseMgtReceiptReq reqDto);
 
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 6ef6d6b..9600cae 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
@@ -1,45 +1,36 @@
 package cokr.xit.adds.biz.nims.service.bean;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import javax.validation.Validation;
-import javax.validation.Validator;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.MultipartFile;
-
-import cokr.xit.adds.biz.nims.dao.BizNimsMapper;
-import cokr.xit.adds.biz.nims.model.BizNimsDto;
-import cokr.xit.adds.biz.nims.model.BizNimsRequest;
-import cokr.xit.adds.biz.nims.model.BizNimsResponse;
-import cokr.xit.adds.biz.nims.service.BizNimsService;
-import cokr.xit.adds.core.Constants;
-import cokr.xit.adds.core.Constants.RPT_TY_CD;
-import cokr.xit.adds.core.model.ApiBaseResponse;
-import cokr.xit.adds.core.spring.exception.ApiCustomException;
-import cokr.xit.adds.core.util.ApiUtil;
-import cokr.xit.adds.inf.nims.model.NimsApiDto;
-import cokr.xit.adds.inf.nims.model.NimsApiDto.BsshInfoSt;
-import cokr.xit.adds.inf.nims.model.NimsApiRequest;
-import cokr.xit.adds.inf.nims.model.NimsApiRequest.BsshInfoReq;
-import cokr.xit.adds.inf.nims.model.NimsApiResult;
-import cokr.xit.adds.inf.nims.service.InfNimsService;
-import cokr.xit.base.file.FileInfo;
-import cokr.xit.base.file.service.FileService;
-import cokr.xit.base.file.web.FileInfoFactory;
-import cokr.xit.foundation.component.AbstractServiceBean;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
+import java.util.*;
+import java.util.concurrent.*;
+
+import javax.validation.*;
+
+import org.apache.commons.lang3.*;
+import org.springframework.stereotype.*;
+import org.springframework.web.multipart.*;
+
+import cokr.xit.adds.biz.nims.dao.*;
+import cokr.xit.adds.biz.nims.model.*;
+import cokr.xit.adds.biz.nims.service.*;
+import cokr.xit.adds.core.*;
+import cokr.xit.adds.core.Constants.*;
+import cokr.xit.adds.core.model.*;
+import cokr.xit.adds.core.spring.exception.*;
+import cokr.xit.adds.core.util.*;
+import cokr.xit.adds.inf.nims.model.*;
+import cokr.xit.adds.inf.nims.model.NimsApiDto.*;
+import cokr.xit.adds.inf.nims.model.NimsApiRequest.*;
+import cokr.xit.adds.inf.nims.service.*;
+import cokr.xit.base.file.*;
+import cokr.xit.base.file.service.*;
+import cokr.xit.base.file.web.*;
+import cokr.xit.foundation.component.*;
+import lombok.*;
+import lombok.extern.slf4j.*;
 
 /**
  * 
- * description : 
+ * description :
  *
  * packageName : cokr.xit.adds.inf.nims.service.bean
  * fileName    : InfNimsServiceBean
@@ -86,10 +77,12 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
 
 		// DB 조회
 		List list = new ArrayList<>();
-		if("N".equals(reqDto.getDbSkipYn())) {
-			list = bizNimsMapper.selectBsshInfos(reqDto);
-			if (!isEmpty(list)) 	return list;
-		}
+
+		// FIXME: API 적용 - db 조회 skip
+		// if("N".equals(reqDto.getDbSkipYn())) {
+		// 	list = bizNimsMapper.selectBsshInfos(reqDto);
+		// 	if (!isEmpty(list)) 	return list;
+		// }
 
 		if(isEmpty(reqDto.getK())){
 			reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey"));
@@ -107,16 +100,23 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
 			if (isEmpty(curList))
 				break;
 
-			for (BsshInfoSt d : curList) {
-				d.setRgtr(reqDto.getUserId());
-				bizNimsMapper.mergeBsshInfoSt(d);
-				// 대표자 검색조건이 있는 경우
-				if (isRprsntvNm && !isEmpty(d.getRprsntvNm()) && d.getRprsntvNm().contains(reqDto.getRprsntvNm())) {
-					list.add(d);
-				}
-			}
+			// FIXME: API 적용 - db 저장 skip
+			// for (BsshInfoSt d : curList) {
+			// 	d.setRgtr(reqDto.getUserId());
+			// 	bizNimsMapper.mergeBsshInfoSt(d);
+			// 	// 대표자 검색조건이 있는 경우
+			// 	if (isRprsntvNm && !isEmpty(d.getRprsntvNm()) && d.getRprsntvNm().contains(reqDto.getRprsntvNm())) {
+			// 		list.add(d);
+			// 	}
+			// }
+
 			if (!isRprsntvNm){
 				list.addAll(curList);
+			}else{
+				list.addAll(
+					curList.stream()
+						.filter(d -> !isEmpty(d.getRprsntvNm()) && d.getRprsntvNm().contains(reqDto.getRprsntvNm()))
+						.toList());
 			}
 
 			if(rslt.isEndYn()) break;
@@ -150,7 +150,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
 		List list = new ArrayList<>();
 
 		////////////////////////////////////////////////////////////////////////////////////////
-		// TODO: API 적용후 DB 조회 skip 처리
+		// FIXME: 신규 API 적용 - DB 조회 skip 처리
 		// if("N".equals(reqDto.getDbSkipYn())) {
 		// 	list = bizNimsMapper.selectProductInfos(reqDto);
 		// 	if (!isEmpty(list)){
@@ -180,10 +180,11 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
 
 			if(isEmpty(curList))	break;
 
-			for (NimsApiDto.ProductInfoKd d : curList) {
-				d.setRgtr(reqDto.getUserId());
-				bizNimsMapper.mergeProductInfoKd(d);
-			}
+			// FIXME: 신규 API 적용 - 조회 결과 저장 skip
+			// for (NimsApiDto.ProductInfoKd d : curList) {
+			// 	d.setRgtr(reqDto.getUserId());
+			// 	bizNimsMapper.mergeProductInfoKd(d);
+			// }
 
 			// 제조 번호, 일련번호, 유효기간  정보 목록 추가
 			if(isMnfSeqInfo)	productInfoaddMnfSeqs(curList, reqDto.getBc(), reqDto.getK());
@@ -283,7 +284,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
 	 * 
*/ @Override - public BizNimsRequest.DsuseMgtReceiptReq saveDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceiptReq reqDto, final List dtls, final List files) { + public BizNimsRequest.DsuseMgtReceiptReq saveDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceiptReq reqDto, final List dtls, final List files, final NimsApiDto.BsshInfoSt bsshInfoSt, final List prdList) { ApiUtil.validate(reqDto, null, validator); if(reqDto.getRndDtlRptCnt() != dtls.size()) throw ApiCustomException.create("폐기물 보고수 오류[폐기물 갯수 확인]"); ApiUtil.validate(dtls, null, validator); @@ -291,6 +292,16 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe if(files.size() != dtls.size()) throw ApiCustomException.create("폐기물 파일 갯수 오류[파일 갯수 확인]"); + // FIXME: 신규 API 적용 - 취급자 및 제품 정보 저장 + bsshInfoSt.setRgtr(reqDto.getUserId()); + bizNimsMapper.mergeBsshInfoSt(bsshInfoSt); + prdList.forEach( + d -> { + d.setRgtr(reqDto.getUserId()); + bizNimsMapper.mergeProductInfoKd(d); + } + ); + if(isEmpty(reqDto.getDscdmngId())) { if (bizNimsMapper.insertDsuseMgtReceipt(reqDto) == 1) { diff --git a/src/main/java/cokr/xit/adds/biz/nims/web/BizNimsController.java b/src/main/java/cokr/xit/adds/biz/nims/web/BizNimsController.java index ce29cad..a429476 100644 --- a/src/main/java/cokr/xit/adds/biz/nims/web/BizNimsController.java +++ b/src/main/java/cokr/xit/adds/biz/nims/web/BizNimsController.java @@ -1,36 +1,26 @@ package cokr.xit.adds.biz.nims.web; -import java.util.List; +import java.util.*; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; +import org.springframework.http.*; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.*; -import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.core.type.*; -import cokr.xit.adds.biz.nims.model.BizNimsDto; -import cokr.xit.adds.biz.nims.model.BizNimsRequest; -import cokr.xit.adds.biz.nims.model.BizNimsResponse; -import cokr.xit.adds.biz.nims.service.BizNimsService; -import cokr.xit.adds.core.model.ApiBaseResponse; -import cokr.xit.adds.core.util.XingUtils; -import cokr.xit.adds.inf.nims.model.NimsApiDto; -import cokr.xit.adds.inf.nims.model.NimsApiRequest; -import cokr.xit.foundation.data.JSON; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.ExampleObject; -import lombok.RequiredArgsConstructor; +import cokr.xit.adds.biz.nims.model.*; +import cokr.xit.adds.biz.nims.service.*; +import cokr.xit.adds.core.model.*; +import cokr.xit.adds.core.util.*; +import cokr.xit.adds.inf.nims.model.*; +import cokr.xit.foundation.data.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.media.*; +import lombok.*; /** *
- * description : 
+ * description :
  *
  * packageName : cokr.xit.adds.inf.nims.web
  * fileName    : InfNimsController
@@ -128,9 +118,11 @@ public class BizNimsController {
         @RequestParam(value = "dsusePrdImgFiles", required = false) List dsusePrdImgFiles
     ) {
         JSON json = new JSON();
+        NimsApiDto.BsshInfoSt bsshInfoSt = json.parse(dsuseMgtJsonStr, new TypeReference<>() {});
         BizNimsRequest.DsuseMgtReceiptReq receiptDto = json.parse(dsuseMgtJsonStr, new TypeReference<>() {});
+        List productInfoKds = json.parse(dsuseMgtDtlsJsonStr, new TypeReference<>() {});
         List dsuseMgtDtls = json.parse(dsuseMgtDtlsJsonStr, new TypeReference<>() {});
-        return ApiBaseResponse.of(bizNimsService.saveDsuseMgtReceipt(receiptDto, dsuseMgtDtls, dsusePrdImgFiles));
+        return ApiBaseResponse.of(bizNimsService.saveDsuseMgtReceipt(receiptDto, dsuseMgtDtls, dsusePrdImgFiles, bsshInfoSt, productInfoKds));
     }
 
     @Operation(summary = "사고 마약류 폐기 관리 폐기 신청서 마스터 정보 변경", description = "사고 마약류 폐기 관리 폐기 신청서 접수 마스터 정보 변경", tags = { "BIZ API" })
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 4c3274d..37eb842 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
@@ -1,30 +1,21 @@
 package cokr.xit.adds.inf.nims.model;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-
-import javax.validation.Valid;
-
-import com.fasterxml.jackson.annotation.JsonAlias;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.JsonSerializer;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-
-import cokr.xit.adds.biz.nims.model.BizNimsDto;
-import cokr.xit.adds.biz.nims.model.BizNimsResponse;
-import cokr.xit.adds.core.Constants;
-import cokr.xit.adds.core.model.AuditDto;
-import cokr.xit.adds.core.spring.exception.ApiCustomException;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-import lombok.experimental.SuperBuilder;
+import java.io.*;
+import java.util.*;
+
+import javax.validation.*;
+
+import com.fasterxml.jackson.annotation.*;
+import com.fasterxml.jackson.core.*;
+import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.annotation.*;
+
+import cokr.xit.adds.biz.nims.model.*;
+import cokr.xit.adds.core.*;
+import cokr.xit.adds.core.model.*;
+import cokr.xit.adds.core.spring.exception.*;
+import lombok.*;
+import lombok.experimental.*;
 
 /**
  * 
@@ -210,6 +201,88 @@ public class NimsApiDto {
         private List mnfSeqInfos = new ArrayList<>();
     }
 
+    /**
+     * 상품 정보 저장을 위한 DTO
+     */
+    @Getter
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @SuperBuilder
+    public static class ProductInfoKdSaveDTO extends AuditDto {
+        /**
+         * 품목코드
+         */
+        @JsonAlias("PRDUCT_CD")
+        private String prductCd;
+
+        /**
+         * 제품대표코드
+         */
+        @JsonAlias("PRDLST_MST_CD")
+        private String prdlstMstCd;
+
+        /**
+         * 제품명
+         */
+        @JsonAlias("PRDUCT_NM")
+        private String prductNm;
+
+        /**
+         * 마약/항정 구분명
+         */
+        @JsonAlias("NRCD_SE_NM")
+        private String nrcdSeNm;
+
+        /**
+         * 중점/일반 구분
+         */
+        @JsonAlias("PRTM_SE_NM")
+        private String prtmSeNm;
+
+        /**
+         * 제품최소유통단위수량
+         * 제품규격정보(고정값 = 1)
+         */
+        @JsonAlias("minDistbQy")
+        private Integer prdMinDistbQy;
+
+        /**
+         * 제품최소유통단위
+         */
+        @JsonAlias("minDistbUnit")
+        private String stdPackngStleNm;
+
+        /**
+         * 제품총낱개단위수량
+         */
+        @JsonAlias("pceQy")
+        private Integer prdTotPceQy;
+
+        /**
+         * 제품낱개단위
+         */
+        @JsonAlias("pceUnit")
+        private String pceCoUnitNm;
+
+        /**
+         * 마약류취급자식별번호
+         */
+        @JsonAlias("BSSH_CD")
+        private String bsshCd;
+
+        /**
+         * 등록일
+         */
+        @JsonAlias("RGS_DT")
+        private String rgsDt;
+
+        /**
+         * 변경일
+         */
+        @JsonAlias("UPD_DT")
+        private String updDt;;
+    }
+
     /**
      * 제품 제조 일련 번호 정보 조회 response
      */
@@ -678,4 +751,3 @@ public class NimsApiDto {
         private String bassDtlAdres;
     }
 }
-
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 a00effc..c52c558 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
@@ -2,17 +2,13 @@ package cokr.xit.adds.inf.nims.model;
 
 import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.*;
 
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.Pattern;
+import javax.validation.constraints.*;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.*;
 
-import cokr.xit.adds.core.Constants;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
+import cokr.xit.adds.core.*;
+import io.swagger.v3.oas.annotations.media.*;
+import lombok.*;
 
 /**
  * 
@@ -114,9 +110,9 @@ public class NimsApiRequest {
          * true 인 경우 DB 조회 skip
          * 
*/ - @Schema(title = "DB 조회 skip 여부", description = "DB 조회 skip 여부(DB 조회 없이 NIMS API호출 하려면 Y)", example = "N") - @Builder.Default - private String dbSkipYn = "N"; + // @Schema(title = "DB 조회 skip 여부", description = "DB 조회 skip 여부(DB 조회 없이 NIMS API호출 하려면 Y)", example = "N") + // @Builder.Default + // private String dbSkipYn = "N"; /** *
diff --git a/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml b/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml
index bc95265..c8866e4 100644
--- a/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml
+++ b/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml
@@ -44,21 +44,21 @@
         )
         ON DUPLICATE KEY UPDATE
             bssh_nm = #{bsshNm},            /* 마약류취급자명 */
-            induty_nm = #{indutyNm},        /* 업종명 */
-            hdnt_cd = #{hdntCd},            /* 의료업자구분 */
-            hdnt_nm = #{hdntNm},            /* 의료업자구분명 */
-            bizrno = #{bizrno},             /* 사업자등록번호 */
-            rprsntv_nm = #{rprsntvNm},      /* 대표자명 */
-            chrg_nm = #{chrgNm},            /* 담당자명 */
-            hptl_no = #{hptlNo},            /* 요약기관번호 */
-            join_yn = #{joinYn},            /* 가입여부 */
-            bssh_stts_nm = #{bsshSttusNm},  /* 마약류취급자상태명 */
-            prmisn_no = #{prmisnNo},        /* 허가번호 */
+            bizrno =  #{bizrno},            /* 사업자등록번호 */
+            rprsntv_nm =  #{rprsntvNm},     /* 대표자명 */
+            prmisn_no =  #{prmisnNo},       /* 허가번호 */
+            induty_nm = CASE WHEN induty_nm != IFNULL(#{indutyNm}, '') AND IFNULL(#{indutyNm}, '') != '' THEN #{indutyNm} ELSE induty_nm END,           /* 업종명 */
+            hdnt_cd =  CASE WHEN hdnt_cd != IFNULL(#{hdntCd}, '') AND IFNULL(#{hdntCd}, '') != '' THEN #{hdntCd} ELSE hdnt_cd END,                      /* 의료업자구분 */
+            hdnt_nm =  CASE WHEN hdnt_nm != IFNULL(#{hdntNm}, '') AND IFNULL(#{hdntNm}, '') != '' THEN #{hdntNm} ELSE hdnt_nm END,                      /* 의료업자구분명 */
+            chrg_nm =  CASE WHEN chrg_nm != IFNULL(#{chrgNm}, '') AND IFNULL(#{chrgNm}, '') != '' THEN #{chrgNm} ELSE chrg_nm END,                      /* 담당자명 */
+            hptl_no =  CASE WHEN hptl_no != IFNULL(#{hptlNo}, '') AND IFNULL(#{hptlNo}, '') != '' THEN #{hptlNo} ELSE hptl_no END,                      /* 요약기관번호 */
+            join_yn =  CASE WHEN join_yn != IFNULL(#{joinYn}, '') AND IFNULL(#{joinYn}, '') != '' THEN #{joinYn} ELSE join_yn END,                      /* 가입여부 */
+            bssh_stts_nm =  CASE WHEN bssh_stts_nm != IFNULL(#{bsshSttusNm}, '') AND IFNULL(#{bsshSttusNm}, '') != '' THEN #{bsshSttusNm} ELSE bssh_stts_nm END,  /* 마약류취급자상태명 */
             mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s'),
             mdfr = #{rgtr}
     
 
-    
+    
         /** nims-mysql-mapper|mergeProductInfoKd-상품정보 생성|julim  */
         INSERT INTO tb_prduct_info(
             prduct_cd,              /* 제품코드 */
@@ -87,24 +87,24 @@
             #{prdTotPceQy},
             #{pceCoUnitNm},
             #{bsshCd},
-            #{rgsDt},
-            #{updDt},
+            NULLIF(#{rgsDt}, ''),
+            NULLIF(#{updDt}, ''),
             'Y',
             DATE_FORMAT(now(), '%Y%m%d%H%i%s'),
             #{rgtr}
         )
         ON DUPLICATE KEY UPDATE
-            prdlst_mst_cd = #{prdlstMstCd},             /* 제품대표코드 */
             prduct_nm = #{prductNm},                    /* 제품명 */
-            nrcd_se_nm = #{nrcdSeNm},                   /* 마약항정구분 */
-            prtm_se_nm = #{prtmSeNm},                   /* 중점일반구분 */
             prd_min_distb_qy = #{prdMinDistbQy},        /* 최소유통단위수량 - 제품규격정보(고정값=1) */
             std_packng_stle_nm = #{stdPackngStleNm},    /* 제품최소유통단위 */
             prd_tot_pce_qy = #{prdTotPceQy},            /* 제품총낱개단위수량 */
             pce_co_unit_nm = #{pceCoUnitNm},            /* 제품낱개단위 */
-            bssh_cd = #{bsshCd},                        /* 마약류취급자식별번호 */
-            rgs_dt = #{rgsDt},                          /* 등록일 */
-            upd_dt = #{updDt},                          /* 변경일 */
+            prdlst_mst_cd = CASE WHEN prdlst_mst_cd != IFNULL(#{prdlstMstCd}, '') AND IFNULL(#{prdlstMstCd}, '') != '' THEN #{prdlstMstCd} ELSE prdlst_mst_cd END,  /* 제품대표코드 */
+            nrcd_se_nm = CASE WHEN nrcd_se_nm != IFNULL(#{nrcdSeNm}, '') AND IFNULL(#{nrcdSeNm}, '') != '' THEN #{nrcdSeNm} ELSE nrcd_se_nm END,                    /* 마약항정구분 */
+            prtm_se_nm = CASE WHEN prtm_se_nm != IFNULL(#{prtmSeNm}, '') AND IFNULL(#{prtmSeNm}, '') != '' THEN #{prtmSeNm} ELSE prtm_se_nm END,                    /* 중점일반구분 */
+            bssh_cd = CASE WHEN bssh_cd != IFNULL(#{bsshCd}, '') AND IFNULL(#{bsshCd}, '') != '' THEN #{bsshCd} ELSE bssh_cd END,                                   /* 마약류취급자식별번호 */
+            rgs_dt = CASE WHEN rgs_dt != NULLIF(#{rgsDt}, '') AND IFNULL(#{rgsDt}, '') != '' THEN NULLIF(#{rgsDt}, '') ELSE rgs_dt END,                             /* 등록일 */
+            upd_dt = CASE WHEN upd_dt != NULLIF(#{updDt}, '') AND IFNULL(#{updDt}, '') != '' THEN NULLIF(#{updDt}, '') ELSE upd_dt END,                             /* 변경일 */
             mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s'),
             mdfr = #{rgtr}
     

From 4b00bc7c58188f90a7d10b78774610d98816df93 Mon Sep 17 00:00:00 2001
From: "Jonguk. Lim" 
Date: Mon, 21 Oct 2024 09:34:32 +0900
Subject: [PATCH 3/6] =?UTF-8?q?feat:=20=EC=97=85=EC=B2=B4=EC=A1=B0?=
 =?UTF-8?q?=ED=9A=8C(=ED=8E=98=EC=9D=B4=EC=A7=95=20=EC=B2=98=EB=A6=AC)=20?=
 =?UTF-8?q?=EB=B0=98=EC=98=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../adds/biz/nims/service/BizNimsService.java |  1 +
 .../nims/service/bean/BizNimsServiceBean.java | 53 +++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java b/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java
index 54c8101..dc95415 100644
--- a/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java
+++ b/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java
@@ -27,6 +27,7 @@ public interface BizNimsService {
 	//------------------------------------------------------------------------------------------------------
 	// NIMS API CALL
 	//------------------------------------------------------------------------------------------------------
+	ApiBaseResponse> getBsshInfoSt(final NimsApiRequest.BsshInfoReq reqDto);
 	List saveBsshInfoSt(final NimsApiRequest.BsshInfoReq dto);
 	List saveProductInfoKd(final NimsApiRequest.ProductInfoReq dto, boolean isMnfSeqInfo);
 	ApiBaseResponse> getMnfSeqInfo(final NimsApiRequest.MnfSeqInfoReq dto);
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 9600cae..09a0fe4 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
@@ -56,6 +56,59 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
 	//------------------------------------------------------------------------------------------------------
 	// NIMS API CALL
 	//------------------------------------------------------------------------------------------------------
+	@Override
+	public ApiBaseResponse> getBsshInfoSt(BsshInfoReq reqDto) {
+		if(isEmpty(reqDto.getBc()) && isEmpty(reqDto.getBi()) && isEmpty(reqDto.getBn())){
+			throw ApiCustomException.create("업체[사업자] 번호 또는 명, 사업자등록번호 중 하나는 필수 입니다");
+		}
+		if(!isEmpty(reqDto.getBn()) && reqDto.getBn().length() < 3) {
+			throw ApiCustomException.create("업체[사업자]명은 3자 이상 으로 조회해 주세요");
+		}
+
+		// DB 조회
+		List list = new ArrayList<>();
+		// if("N".equals(reqDto.getDbSkipYn())) {
+		// 	list = bizNimsMapper.selectBsshInfos(reqDto);
+		// 	if (!isEmpty(list)){
+		// 		//return list;
+		// 		ApiBaseResponse> res = ApiBaseResponse.of(list);
+		// 		res.setTotalCount(list.size());
+		// 		return res;
+		// 	}
+		// }
+
+		if(isEmpty(reqDto.getK())){
+			reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey"));
+		}
+		reqDto.setFg("1");	// 조회범위(1-전체,2-내거래처)
+		//reqDto.setPg("1");  // 조회페이지
+		reqDto.setFg2("1"); // 조회범위2(1:NK(취급승인)포함 - default, 2:NK(취급승인)제외)
+
+		boolean isRprsntvNm = !isEmpty(reqDto.getRprsntvNm());//while(true) {
+
+		// 마약류취급자식별번호로 마약류취급자정보 조회
+		NimsApiResult.Response rslt = infNimsService.getBsshInfoSt(reqDto);
+		List curList = rslt.getResult();
+
+		for (BsshInfoSt d : curList) {
+			if(isEmpty(d.getBsshCd()))	continue;
+			d.setRgtr(reqDto.getUserId());
+			bizNimsMapper.mergeBsshInfoSt(d);
+			// 대표자 검색조건이 있는 경우
+			if (isRprsntvNm && !isEmpty(d.getRprsntvNm()) && d.getRprsntvNm().contains(reqDto.getRprsntvNm())) {
+				list.add(d);
+			}
+		}
+		if (!isRprsntvNm){
+			list.addAll(curList);
+		}
+
+		ApiBaseResponse> res = ApiBaseResponse.of(list);
+		res.setTotalCount(list.size());
+		return res;
+	}
+
+
 	/**
 	 * 
 	 *     DB에서 먼저 조회(dbSkipYn = 'Y' 인 경우는 DB 조회 skip)

From ebbf803a1eda900c3a2d767d7186c4c870f2a36b Mon Sep 17 00:00:00 2001
From: "Jonguk. Lim" 
Date: Mon, 21 Oct 2024 17:13:17 +0900
Subject: [PATCH 4/6] =?UTF-8?q?feat:=20=EC=97=85=EC=B2=B4=EC=A1=B0?=
 =?UTF-8?q?=ED=9A=8C(=ED=8E=98=EC=9D=B4=EC=A7=95=20=EC=B2=98=EB=A6=AC)=20?=
 =?UTF-8?q?=EB=B0=98=EC=98=81=20=20=20=20=20=20=20=EC=A0=9C=ED=92=88?=
 =?UTF-8?q?=EC=A1=B0=ED=9A=8C(=ED=8E=98=EC=9D=B4=EC=A7=95=20=EC=B2=98?=
 =?UTF-8?q?=EB=A6=AC)=20=EB=B0=98=EC=98=81=20=20=20=20=20=20=20=EC=97=85?=
 =?UTF-8?q?=EC=B2=B4=20=EB=B0=8F=20=EC=A0=9C=ED=92=88=20=EC=A1=B0=ED=9A=8C?=
 =?UTF-8?q?=EC=8B=9C=20DB=20=EC=A0=80=EC=9E=A5=20=EC=A0=9C=EA=B1=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../xit/adds/biz/nims/dao/BizNimsMapper.java  |   2 +-
 .../adds/biz/nims/service/BizNimsService.java |   5 +-
 .../nims/service/bean/BizNimsServiceBean.java | 197 +++++++-----------
 .../adds/biz/nims/web/BizNimsController.java  |  14 +-
 .../mois/service/bean/InfMoisServiceBean.java |  83 +++-----
 .../nims/service/bean/InfNimsServiceBean.java |  38 ++--
 .../sql/mapper/biz/nims-mysql-mapper.xml      |   2 +-
 7 files changed, 137 insertions(+), 204 deletions(-)

diff --git a/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java b/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java
index f460612..c145b33 100644
--- a/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java
+++ b/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java
@@ -31,7 +31,7 @@ public interface BizNimsMapper extends AbstractMapper {
 	void mergeBsshInfoSt(final NimsApiDto.BsshInfoSt dto);
 	List selectBsshInfos(final NimsApiRequest.BsshInfoReq dto);
 
-	void mergeProductInfoKd(final NimsApiDto.ProductInfoKdSaveDTO dto);
+	 void mergeProductInfoKd(final T t);
 	List selectProductInfos(final NimsApiRequest.ProductInfoReq dto);
 
 	void mergeJurisdictionGovInfo(NimsApiDto.JurisdictionGovInfo dto);
diff --git a/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java b/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java
index dc95415..16be1ad 100644
--- a/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java
+++ b/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java
@@ -28,8 +28,9 @@ public interface BizNimsService {
 	// NIMS API CALL
 	//------------------------------------------------------------------------------------------------------
 	ApiBaseResponse> getBsshInfoSt(final NimsApiRequest.BsshInfoReq reqDto);
-	List saveBsshInfoSt(final NimsApiRequest.BsshInfoReq dto);
-	List saveProductInfoKd(final NimsApiRequest.ProductInfoReq dto, boolean isMnfSeqInfo);
+	List saveBsshInfoStQueryBsshInfoByBsshCd(final NimsApiRequest.BsshInfoReq dto);
+	ApiBaseResponse> getProductInfoKd(final NimsApiRequest.ProductInfoReq dto, boolean isMnfSeqInfo);
+	List saveProductInfoKdQueryProductByProductId(final NimsApiRequest.ProductInfoReq dto, boolean isMnfSeqInfo);
 	ApiBaseResponse> getMnfSeqInfo(final NimsApiRequest.MnfSeqInfoReq dto);
 //	List getMnfSeqInfo2(final NimsApiRequest.MnfSeqInfoReq dto);
 	List getJurisdictionGovInfo(final NimsApiRequest.JurisdictionGovInfoReq dto);
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 09a0fe4..5bad15e 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
@@ -67,75 +67,56 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
 
 		// DB 조회
 		List list = new ArrayList<>();
-		// if("N".equals(reqDto.getDbSkipYn())) {
-		// 	list = bizNimsMapper.selectBsshInfos(reqDto);
-		// 	if (!isEmpty(list)){
-		// 		//return list;
-		// 		ApiBaseResponse> res = ApiBaseResponse.of(list);
-		// 		res.setTotalCount(list.size());
-		// 		return res;
-		// 	}
-		// }
 
 		if(isEmpty(reqDto.getK())){
 			reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey"));
 		}
 		reqDto.setFg("1");	// 조회범위(1-전체,2-내거래처)
-		//reqDto.setPg("1");  // 조회페이지
 		reqDto.setFg2("1"); // 조회범위2(1:NK(취급승인)포함 - default, 2:NK(취급승인)제외)
 
 		boolean isRprsntvNm = !isEmpty(reqDto.getRprsntvNm());//while(true) {
+		int totalCount = 0;
+		do {
+			// 마약류취급자식별번호로 마약류취급자정보 조회
+			NimsApiResult.Response rslt = infNimsService.getBsshInfoSt(reqDto);
+			List curList = rslt.getResult();
 
-		// 마약류취급자식별번호로 마약류취급자정보 조회
-		NimsApiResult.Response rslt = infNimsService.getBsshInfoSt(reqDto);
-		List curList = rslt.getResult();
-
-		for (BsshInfoSt d : curList) {
-			if(isEmpty(d.getBsshCd()))	continue;
-			d.setRgtr(reqDto.getUserId());
-			bizNimsMapper.mergeBsshInfoSt(d);
-			// 대표자 검색조건이 있는 경우
-			if (isRprsntvNm && !isEmpty(d.getRprsntvNm()) && d.getRprsntvNm().contains(reqDto.getRprsntvNm())) {
-				list.add(d);
+			if (!isRprsntvNm) {
+				totalCount = rslt.getBody().getTotalCount();
+				list.addAll(curList);
+				break;
 			}
-		}
-		if (!isRprsntvNm){
-			list.addAll(curList);
-		}
+
+			// 대표자 검색이 있는 경우 NIMS 데이타 전체 조회
+			list.addAll(
+				curList.stream()
+					.filter(d -> !isEmpty(d.getRprsntvNm()) && d.getRprsntvNm().contains(reqDto.getRprsntvNm()))
+					.toList());
+			totalCount = list.size();
+			if(rslt.isEndYn()) break;
+			reqDto.setPg(String.valueOf(Integer.parseInt(reqDto.getPg()) + 1));
+
+		} while(true);
 
 		ApiBaseResponse> res = ApiBaseResponse.of(list);
-		res.setTotalCount(list.size());
+		res.setTotalCount(totalCount);
 		return res;
 	}
 
 
 	/**
 	 * 
-	 *     DB에서 먼저 조회(dbSkipYn = 'Y' 인 경우는 DB 조회 skip)
-	 *     -> 조회 결과가 없는 경우 API 조회
-	 *     업체정보 조회후 DB 저장
-	 *     조회 건수를 제한하기 위해 조회 조건 강제 - 업체명(3자 이상) 필수
+	 *     업체정보를 업체코드로 조회후 DB 저장
+	 *     제품의 제조업체 조회시 사용 - 결과는 단건
 	 * @param reqDto NimsApiRequest.BsshInfoRequest
 	 * @return List
 	 * 
*/ @Override - public List saveBsshInfoSt(BsshInfoReq reqDto) { + public List saveBsshInfoStQueryBsshInfoByBsshCd(BsshInfoReq reqDto) { if(isEmpty(reqDto.getBc()) && isEmpty(reqDto.getBi()) && isEmpty(reqDto.getBn())){ throw ApiCustomException.create("업체[사업자] 번호 또는 명, 사업자등록번호 중 하나는 필수 입니다"); } - if(!isEmpty(reqDto.getBn()) && reqDto.getBn().length() < 3) { - throw ApiCustomException.create("업체[사업자]명은 3자 이상 으로 조회해 주세요"); - } - - // DB 조회 - List list = new ArrayList<>(); - - // FIXME: API 적용 - db 조회 skip - // if("N".equals(reqDto.getDbSkipYn())) { - // list = bizNimsMapper.selectBsshInfos(reqDto); - // if (!isEmpty(list)) return list; - // } if(isEmpty(reqDto.getK())){ reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey")); @@ -144,38 +125,44 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe reqDto.setPg("1"); // 조회페이지 reqDto.setFg2("1"); // 조회범위2(1:NK(취급승인)포함 - default, 2:NK(취급승인)제외) - boolean isRprsntvNm = !isEmpty(reqDto.getRprsntvNm()); - while(true) { - // 마약류취급자식별번호로 마약류취급자정보 조회 - NimsApiResult.Response rslt = infNimsService.getBsshInfoSt(reqDto); - List curList = rslt.getResult(); + // 마약류취급자식별번호로 마약류취급자정보 조회 + NimsApiResult.Response rslt = infNimsService.getBsshInfoSt(reqDto); + List curList = rslt.getResult(); - if (isEmpty(curList)) - break; + for (BsshInfoSt d : curList) { + d.setRgtr(reqDto.getUserId()); + bizNimsMapper.mergeBsshInfoSt(d); + } + return curList; + } - // FIXME: API 적용 - db 저장 skip - // for (BsshInfoSt d : curList) { - // d.setRgtr(reqDto.getUserId()); - // bizNimsMapper.mergeBsshInfoSt(d); - // // 대표자 검색조건이 있는 경우 - // if (isRprsntvNm && !isEmpty(d.getRprsntvNm()) && d.getRprsntvNm().contains(reqDto.getRprsntvNm())) { - // list.add(d); - // } - // } - - if (!isRprsntvNm){ - list.addAll(curList); - }else{ - list.addAll( - curList.stream() - .filter(d -> !isEmpty(d.getRprsntvNm()) && d.getRprsntvNm().contains(reqDto.getRprsntvNm())) - .toList()); - } + @Override + public ApiBaseResponse> getProductInfoKd(NimsApiRequest.ProductInfoReq reqDto, boolean isMnfSeqInfo) { + if(isEmpty(reqDto.getP()) && isEmpty(reqDto.getPn())){ + throw ApiCustomException.create("상품번호 또는 상품명중 하나는 필수 입니다"); + } - if(rslt.isEndYn()) break; - reqDto.setPg(String.valueOf(Integer.parseInt(reqDto.getPg()) + 1)); + if(!isEmpty(reqDto.getPn()) && reqDto.getPn().length() < 2){ + throw ApiCustomException.create("상품명은 2자 이상 으로 조회해 주세요"); } - return list; + + if(isEmpty(reqDto.getK())){ + reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey")); + } + reqDto.setFg("1"); // 조회범위(1-전체,2-내거래처품목,3-청구코드매핑) + reqDto.setFg2(""); // 중점일반구분(all, 1:중점, 2:일반) + + // 제품코드로 제품정보 조회 + NimsApiResult.Response rslt = infNimsService.getProductInfoKd(reqDto); + List curList = rslt.getResult(); + + if(isEmpty(curList)) return ApiBaseResponse.of(curList); + + // 제조 번호, 일련번호, 유효기간 정보 목록 추가 + if(isMnfSeqInfo) productInfoaddMnfSeqs(curList, reqDto.getBc(), reqDto.getK()); + ApiBaseResponse> res = ApiBaseResponse.of(curList); + res.setTotalCount(rslt.getBody().getTotalCount()); + return res; } /** @@ -191,7 +178,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe *
*/ @Override - public List saveProductInfoKd(NimsApiRequest.ProductInfoReq reqDto, boolean isMnfSeqInfo) { + public List saveProductInfoKdQueryProductByProductId(NimsApiRequest.ProductInfoReq reqDto, boolean isMnfSeqInfo) { if(isEmpty(reqDto.getP()) && isEmpty(reqDto.getPn())){ throw ApiCustomException.create("상품번호 또는 상품명중 하나는 필수 입니다"); } @@ -200,25 +187,6 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe throw ApiCustomException.create("상품명은 2자 이상 으로 조회해 주세요"); } - List list = new ArrayList<>(); - - //////////////////////////////////////////////////////////////////////////////////////// - // FIXME: 신규 API 적용 - DB 조회 skip 처리 - // if("N".equals(reqDto.getDbSkipYn())) { - // list = bizNimsMapper.selectProductInfos(reqDto); - // if (!isEmpty(list)){ - // if(isMnfSeqInfo){ - // if(isEmpty(reqDto.getK())){ - // productInfoaddMnfSeqs(list, reqDto.getBc(), getApiInfInfo(reqDto.getUserId()).get("apiKey")); - // }else { - // productInfoaddMnfSeqs(list, reqDto.getBc(), reqDto.getK()); - // } - // } - // return list; - // } - // } - /////////////////////////////////////////////////////////////// - if(isEmpty(reqDto.getK())){ reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey")); } @@ -226,27 +194,21 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe reqDto.setPg("1"); // 조회페이지 reqDto.setFg2(""); // 중점일반구분(all, 1:중점, 2:일반) - while(true) { - // 제품코드로 제품정보 조회 - NimsApiResult.Response rslt = infNimsService.getProductInfoKd(reqDto); - List curList = rslt.getResult(); - - if(isEmpty(curList)) break; + // 제품코드로 제품정보 조회 + NimsApiResult.Response rslt = infNimsService.getProductInfoKd(reqDto); + List curList = rslt.getResult(); - // FIXME: 신규 API 적용 - 조회 결과 저장 skip - // for (NimsApiDto.ProductInfoKd d : curList) { - // d.setRgtr(reqDto.getUserId()); - // bizNimsMapper.mergeProductInfoKd(d); - // } + if(isEmpty(curList)) return curList; - // 제조 번호, 일련번호, 유효기간 정보 목록 추가 - if(isMnfSeqInfo) productInfoaddMnfSeqs(curList, reqDto.getBc(), reqDto.getK()); - list.addAll(curList); - - if(rslt.isEndYn()) break; - reqDto.setPg(String.valueOf(Integer.parseInt(reqDto.getPg()) + 1)); + //FIXME: 신규 API 적용 - 조회 결과 저장 skip + for (NimsApiDto.ProductInfoKd d : curList) { + d.setRgtr(reqDto.getUserId()); + bizNimsMapper.mergeProductInfoKd(d); } - return list; + + // 제조 번호, 일련번호, 유효기간 정보 목록 추가 + if(isMnfSeqInfo) productInfoaddMnfSeqs(curList, reqDto.getBc(), reqDto.getK()); + return curList; } @Override @@ -453,7 +415,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe Map map = new HashMap<>(); map.put("dscdmngId", dto.getDscdmngId()); List dsuseRptInfoDtls = bizNimsMapper.selectDsuseMgtDtls(map); - if(isForDoc) setDsuseMgtDtlAddProductInfo(dsuseRptInfoDtls, dto.getBsshCd(), reqDto.getUserId(), apiKey); + if(isForDoc) setDsuseMgtDtlAddProductInfo(dsuseRptInfoDtls, reqDto.getUserId(), apiKey); dto.getDsuseMgtDtls().addAll(dsuseRptInfoDtls); } @@ -577,7 +539,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe .p(mnfSeqInfo.getPrductCd()) .userId(userId) .build(); - List productInfoKds = saveProductInfoKd(prdReq, false); + List productInfoKds = saveProductInfoKdQueryProductByProductId(prdReq, false); if(productInfoKds.size() != 1) { throw ApiCustomException.create(String.format("제품정보 오류
[Barcode 제품[%s]의 정보가 NIMS에 등록되지 않은 데이타 입니다]", mnfSeqInfo.getPrductCd())); } @@ -619,13 +581,12 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe * @param dtlList *
*/ - private void setDsuseMgtDtlAddProductInfo(List dtlList, String bsshCd, String userId, String apiKey) { + private void setDsuseMgtDtlAddProductInfo(List dtlList, String userId, String apiKey) { for (BizNimsResponse.DsuseMgtDtlRes r : dtlList) { + // 마약항정구분(nrcdSeNm), 중점일반구분(prtmSenm) if (isEmpty(r.getNrcdSeNm()) || isEmpty(r.getPrtmSeNm())) { - //NimsApiResult.Response result = infNimsService.getProductInfoKd( - - List list = saveProductInfoKd( + List list = saveProductInfoKdQueryProductByProductId( NimsApiRequest.ProductInfoReq.builder() .k(apiKey) .fg("1") @@ -646,7 +607,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe // 제조수입자명(bsshNm) if (isEmpty(r.getBsshNm()) && !isEmpty(r.getBsshCd())) { - List list = saveBsshInfoSt( + List list = saveBsshInfoStQueryBsshInfoByBsshCd( BsshInfoReq.builder() .k(apiKey) .fg("1") @@ -916,7 +877,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe for (NimsApiDto.ProductInfoKd d : list) { productCd = d.getPrductCd(); - List mnfList = getMnfSeqInfo2( + List mnfList = getMnfSeqInfoAll( NimsApiRequest.MnfSeqInfoReq.builder() .k(apiKey) .fg("1") @@ -1008,7 +969,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe return files.get(0).getId(); } - private List getMnfSeqInfo2(NimsApiRequest.MnfSeqInfoReq reqDto) { + private List getMnfSeqInfoAll(NimsApiRequest.MnfSeqInfoReq reqDto) { if(isEmpty(reqDto.getK())){ reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey")); } diff --git a/src/main/java/cokr/xit/adds/biz/nims/web/BizNimsController.java b/src/main/java/cokr/xit/adds/biz/nims/web/BizNimsController.java index a429476..b694a60 100644 --- a/src/main/java/cokr/xit/adds/biz/nims/web/BizNimsController.java +++ b/src/main/java/cokr/xit/adds/biz/nims/web/BizNimsController.java @@ -48,7 +48,15 @@ public class BizNimsController { public ApiBaseResponse> getNimsBsshInfoSt( @ModelAttribute NimsApiRequest.BsshInfoReq dto ) { - return ApiBaseResponse.of(bizNimsService.saveBsshInfoSt(dto)); + return bizNimsService.getBsshInfoSt(dto); + } + + @Operation(summary = "NIMS 마약류 취급자 정보 조회(취급자코드로)", description = "마약류 취급자 정보 조회(취급자코드로)
NIMS API 호출 결과를 DB에 저장후 결과 Return

아래 항목만 set
bc - 취급자식별번호
userId - 사용자ID
bc 필수", tags = { "NIMS API" }) + @RequestMapping(value = "/saveBsshInfoStQueryBsshInfoByBsshCd", method = { RequestMethod.POST, RequestMethod.GET }) + public ApiBaseResponse> saveBsshInfoStQueryBsshInfoByBsshCd( + @ModelAttribute NimsApiRequest.BsshInfoReq dto + ) { + return ApiBaseResponse.of(bizNimsService.saveBsshInfoStQueryBsshInfoByBsshCd(dto)); } @Operation(summary = "NIMS 마약류 제품 조회", description = "마약류 제품 조회
NIMS API 호출 결과를 DB에 저장후 결과 Return

아래 항목만 set
p - 제품번호
pn - 제품명
dbSkipYn - N:db조회후 결과 없는경우만 API호출, Y:API 호출
userId - 사용자ID
p, pn중 하나는 필수", tags = { "NIMS API" }) @@ -56,7 +64,7 @@ public class BizNimsController { public ApiBaseResponse> getNimsMnfSeqInfo( @ModelAttribute NimsApiRequest.ProductInfoReq dto ) { - return ApiBaseResponse.of(bizNimsService.saveProductInfoKd(dto, false)); + return bizNimsService.getProductInfoKd(dto, false); } @Operation(summary = "NIMS 마약류 상품 정보 & 제조번호 조회", description = "마약류 상품정보 & 제조번호 조회
NIMS API 호출 결과를 DB에 저장후 결과 Return

아래 항목만 set
p - 제품번호
pn - 제품명
dbSkipYn - N:db조회후 결과 없는경우만 API호출, Y:API 호출
userId - 사용자ID
p, pn중 하나는 필수", tags = { "NIMS API" }) @@ -64,7 +72,7 @@ public class BizNimsController { public ApiBaseResponse> getNimsProductInfoKdAndMnfSeqInfo( @ModelAttribute NimsApiRequest.ProductInfoReq dto ) { - return ApiBaseResponse.of(bizNimsService.saveProductInfoKd(dto, true)); + return bizNimsService.getProductInfoKd(dto, true); } @Operation(summary = "NIMS 제조 일련 번호 정보 조회", description = "제보 일련 번호 정보 조회
NIMS API 호출 결과 Return

아래 항목만 set
p - 제품번호
userId - 사용자ID", tags = { "NIMS API" }) diff --git a/src/main/java/cokr/xit/adds/inf/mois/service/bean/InfMoisServiceBean.java b/src/main/java/cokr/xit/adds/inf/mois/service/bean/InfMoisServiceBean.java index f6cd290..3f42547 100644 --- a/src/main/java/cokr/xit/adds/inf/mois/service/bean/InfMoisServiceBean.java +++ b/src/main/java/cokr/xit/adds/inf/mois/service/bean/InfMoisServiceBean.java @@ -1,63 +1,36 @@ package cokr.xit.adds.inf.mois.service.bean; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringReader; -import java.io.UnsupportedEncodingException; -import java.nio.file.FileVisitResult; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.StandardCopyOption; -import java.nio.file.attribute.BasicFileAttributes; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Random; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.apache.commons.lang3.StringUtils; +import java.io.*; +import java.nio.file.*; +import java.nio.file.attribute.*; +import java.util.*; + +import javax.xml.parsers.*; +import javax.xml.transform.*; +import javax.xml.transform.dom.*; +import javax.xml.transform.stream.*; + +import org.apache.commons.lang3.*; import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.multipart.MultipartFile; -import org.w3c.dom.Attr; -import org.w3c.dom.DOMException; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -import cokr.xit.adds.biz.nims.service.BizNimsService; -import cokr.xit.adds.core.Constants; -import cokr.xit.adds.core.spring.exception.ApiCustomException; -import cokr.xit.adds.core.util.DateUtils; -import cokr.xit.adds.inf.mois.model.MoisExchangeRequest; -import cokr.xit.adds.inf.mois.model.PackDto; -import cokr.xit.adds.inf.mois.service.InfMoisService; -import cokr.xit.adds.inf.nims.model.NimsApiDto; -import cokr.xit.adds.inf.nims.model.NimsApiRequest; -import cokr.xit.foundation.component.AbstractServiceBean; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.*; +import org.springframework.web.multipart.*; +import org.w3c.dom.*; +import org.xml.sax.*; + +import cokr.xit.adds.biz.nims.service.*; +import cokr.xit.adds.core.*; +import cokr.xit.adds.core.spring.exception.*; +import cokr.xit.adds.core.util.*; +import cokr.xit.adds.inf.mois.model.*; +import cokr.xit.adds.inf.mois.service.*; +import cokr.xit.adds.inf.nims.model.*; +import cokr.xit.foundation.component.*; +import lombok.*; +import lombok.extern.slf4j.*; /** *
- * description : 
+ * description :
  * packageName : cokr.xit.adds.inf.mois.service.bean
  * fileName    : InfMoisServiceBean
  * author      : limju
@@ -343,7 +316,7 @@ public class InfMoisServiceBean extends AbstractServiceBean implements InfMoisSe
     }
 
     private NimsApiDto.BsshInfoSt getBsshInfo(MoisExchangeRequest reqDto) {
-        List list = bizNimsService.saveBsshInfoSt(
+        List list = bizNimsService.saveBsshInfoStQueryBsshInfoByBsshCd(
             NimsApiRequest.BsshInfoReq.builder()
                 .fg("1")
                 .pg("1")
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 4794b4e..2778c7f 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
@@ -1,27 +1,24 @@
 package cokr.xit.adds.inf.nims.service.bean;
 
-import javax.validation.Validation;
-import javax.validation.Validator;
+import javax.validation.*;
 
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
+import org.springframework.stereotype.*;
 
-import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.core.type.*;
 
-import cokr.xit.adds.core.spring.exception.ApiCustomException;
-import cokr.xit.adds.core.util.ApiUtil;
-import cokr.xit.adds.inf.nims.model.NimsApiDto;
-import cokr.xit.adds.inf.nims.model.NimsApiRequest;
-import cokr.xit.adds.inf.nims.model.NimsApiResult;
-import cokr.xit.adds.inf.nims.service.InfNimsService;
-import cokr.xit.foundation.component.AbstractServiceBean;
-import cokr.xit.foundation.data.JSON;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
+import cokr.xit.adds.core.spring.exception.*;
+import cokr.xit.adds.core.util.*;
+import cokr.xit.adds.inf.nims.model.*;
+import cokr.xit.adds.inf.nims.service.*;
+import cokr.xit.foundation.component.*;
+import cokr.xit.foundation.data.*;
+import lombok.*;
+import lombok.extern.slf4j.*;
 
 /**
  * 
- * description : 
+ * description :
  *
  * packageName : cokr.xit.adds.inf.nims.service.bean
  * fileName    : InfNimsServiceBean
@@ -96,9 +93,7 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe
 		if(!isEmpty(dto.getYmd())) ApiUtil.checkYmdError(dto.getYmd(), null);
 
 		//FIXME: 운영기 반영 이후 주석 제거
-		//String rslt = ApiUtil.callNimsApi(nimsUrl + productinfoKd, dto);
-		dto.setK("998003699950fa950b798c9edea1b38f3cfbcf3b77e03e419");
-		String rslt = ApiUtil.callNimsApi("https://test.nims.or.kr" + productinfoKd, dto);
+		String rslt = ApiUtil.callNimsApi(nimsUrl + productinfoKd, dto);
 		NimsApiResult result = json.parse(rslt, new TypeReference<>() {});
 		return result.getResponse();
 	}
@@ -113,12 +108,7 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe
 		ApiUtil.validate(dto, null, validator);
 		if(!isEmpty(dto.getYmd())) ApiUtil.checkYmdError(dto.getYmd(), null);
 
-		//FIXME: 운영기 반영 이후 주석 제거
-		//String rslt = ApiUtil.callNimsApi(nimsUrl + seqinfo, dto);
-		//dto.setK("1d6646562470902a61fc334c83a249cdcc5dc753426942138ee04342e66c8128");
-		dto.setK("998003699950fa950b798c9edea1b38f3cfbcf3b77e03e419");
-		dto.setBc("");
-		String rslt = ApiUtil.callNimsApi("https://test.nims.or.kr" + seqinfo, dto);
+		String rslt = ApiUtil.callNimsApi(nimsUrl + seqinfo, dto);
 		NimsApiResult result = json.parse(rslt, new TypeReference<>() {});
 		return result.getResponse();
 	}
diff --git a/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml b/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml
index c8866e4..09f5199 100644
--- a/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml
+++ b/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml
@@ -58,7 +58,7 @@
             mdfr = #{rgtr}
     
 
-    
+    
         /** nims-mysql-mapper|mergeProductInfoKd-상품정보 생성|julim  */
         INSERT INTO tb_prduct_info(
             prduct_cd,              /* 제품코드 */

From c96cfd8defcc794c63e055eb2a3cc95a3a54be5d Mon Sep 17 00:00:00 2001
From: "Jonguk. Lim" 
Date: Tue, 22 Oct 2024 12:14:57 +0900
Subject: [PATCH 5/6] =?UTF-8?q?feat:=20=ED=8F=90=EA=B8=B0=EA=B2=B0?=
 =?UTF-8?q?=EA=B3=BC=EC=9D=98=20=ED=8F=90=EA=B8=B0=EC=9E=A5=EC=86=8C=20?=
 =?UTF-8?q?=EC=9D=BC=EA=B4=84=20=EB=B3=80=EA=B2=BD=20=EC=A0=81=EC=9A=A9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../xit/adds/biz/nims/dao/BizNimsMapper.java  |  3 +++
 .../nims/service/bean/BizNimsServiceBean.java | 25 ++++++++++++++-----
 .../sql/mapper/biz/nims-mysql-mapper.xml      | 22 ++++++++++++++++
 3 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java b/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java
index c145b33..c135721 100644
--- a/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java
+++ b/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java
@@ -44,6 +44,9 @@ public interface BizNimsMapper extends AbstractMapper {
 
 	int insertDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceiptReq dto);
 	int updateDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceiptReq dto);
+
+	Optional selectCheckDsuseLocBydscdmngId(final String dscdmngId);
+	void updateDsuseLocOfDsuseMgt(final BizNimsRequest.DsuseMgtRsltReq dto);
 	int updateDsuseMgtRslt(final BizNimsRequest.DsuseMgtRsltReq dto);
 
 	int insertDsuseMgtDtl(final BizNimsDto.DsuseMgtDtl dto);
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 5bad15e..c3c783f 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
@@ -190,8 +190,6 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
 		if(isEmpty(reqDto.getK())){
 			reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey"));
 		}
-		reqDto.setFg("1");	// 조회범위(1-전체,2-내거래처품목,3-청구코드매핑)
-		reqDto.setPg("1");  // 조회페이지
 		reqDto.setFg2(""); 	// 중점일반구분(all, 1:중점, 2:일반)
 
 		// 제품코드로 제품정보 조회
@@ -201,10 +199,10 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
 		if(isEmpty(curList))	return curList;
 
 		//FIXME: 신규 API 적용 - 조회 결과 저장 skip
-		for (NimsApiDto.ProductInfoKd d : curList) {
-			d.setRgtr(reqDto.getUserId());
-			bizNimsMapper.mergeProductInfoKd(d);
-		}
+		// for (NimsApiDto.ProductInfoKd d : curList) {
+		// 	d.setRgtr(reqDto.getUserId());
+		// 	bizNimsMapper.mergeProductInfoKd(d);
+		// }
 
 		// 제조 번호, 일련번호, 유효기간  정보 목록 추가
 		if(isMnfSeqInfo)	productInfoaddMnfSeqs(curList, reqDto.getBc(), reqDto.getK());
@@ -362,6 +360,21 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
 		ApiUtil.validate(reqDto, null, validator);
 		reqDto.setRgtr(reqDto.getUserId());
 
+		// ------------------------------------------------------------------------------------------------
+		// 폐기장소 변경 여부 체크 - 폐기 결과를 공유하는 데이타
+		// 폐기구분, 폐기일자, 폐기방법이 동일한 건에 대하여 폐기장소 일괄 변경
+		// ------------------------------------------------------------------------------------------------
+		// 폐기장소가 null인 경우 - request 데이타로 set
+		final String dsuseLoc = bizNimsMapper.selectCheckDsuseLocBydscdmngId(reqDto.getDscdmngId())
+			.orElse(reqDto.getDsuseLoc());
+
+		// 1. 폐기장소가 null(또는 "")인 경우 - 신규 저장 -> 폐기장소 저장으로 이동
+		// 2. 1이 아니고, 저장된 폐기장소와 request 폐기장소가 다르면 해당 데이타를 공유하는 모든건 변경
+		if(!isEmpty(dsuseLoc) && !reqDto.getDsuseLoc().equals(dsuseLoc)){
+			bizNimsMapper.updateDsuseLocOfDsuseMgt(reqDto);
+		}
+		// ------------------------------------------------------------------------------------------------
+
 		if(bizNimsMapper.updateDsuseMgtRslt(reqDto) == 1){
 			if("Y".equals(fileChangeYn)) {
 				Map map = Map.of("infType", Constants.FILE_INF_TYPE.DSUSE_IMG.getCode(), "infKey", reqDto.getDscdmngId());
diff --git a/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml b/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml
index 09f5199..4405ef6 100644
--- a/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml
+++ b/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml
@@ -295,6 +295,28 @@
         WHERE dscdmng_id = #{dscdmngId}
     
 
+    
+
+    
+        /** nims-mysql-mapper|updateDsuseLocOfDsuseMgt-폐기관리 결과의 폐기장소 변경|julim  */
+        UPDATE tb_dsuse_mgt
+           SET dsuse_loc = #{dsuseLoc}
+             , mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s')
+             , mdfr = #{rgtr}
+         WHERE use_yn = 'Y'
+           AND dept_cd = (SELECT dept_cd FROM tb_user WHERE user_acnt = #{userId})
+           AND dsuse_mth_cd = #{dsuseMthCd}
+           AND dsuse_se_cd = #{dsuseSeCd}
+           AND dsuse_de = #{dsuseDe}
+           AND tb_dsuse_mgt.dscdmng_id != #{dscdmngId}
+    
+
+
     
         /** nims-mysql-mapper|updateDsuseMgtRslt-폐기관리 정보 변경|julim  */
         UPDATE tb_dsuse_mgt

From b081d12dfcd0446f2a7b4f648ee57a099c900773 Mon Sep 17 00:00:00 2001
From: "Jonguk. Lim" 
Date: Tue, 22 Oct 2024 12:26:42 +0900
Subject: [PATCH 6/6] =?UTF-8?q?feat:=20=ED=8F=90=EA=B8=B0=EB=B3=B4?=
 =?UTF-8?q?=EA=B3=A0=20=ED=99=95=EC=9D=B8=EC=8B=9C=20=EC=A0=9C=ED=92=88=20?=
 =?UTF-8?q?=EC=8B=9C=EB=A6=AC=EC=96=BC=20=EC=9D=BC=EC=B9=98=20=EC=97=AC?=
 =?UTF-8?q?=EB=B6=80=20=EB=B9=84=EA=B5=90=20=EC=A0=9C=EC=99=B8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/main/java/cokr/xit/adds/inf/nims/model/NimsApiDto.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

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 37eb842..5c0b10b 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
@@ -570,9 +570,10 @@ public class NimsApiDto {
                             && Objects.equals(
                                 Objects.toString(rptDtl.getPrdValidDe(), "").replaceAll("-", ""),
                                 Objects.toString(mgtDtl.getPrdValidDe(), "").replaceAll("-", ""))
-                            && Objects.equals(
-                                Objects.toString(rptDtl.getMnfSeq(), "").replaceAll("-", ""),
-                                Objects.toString(mgtDtl.getMnfSeq(), "").replaceAll("-", ""))
+                            // FIXME:: NIMS 데이타 일치여부 체크 - 제조번호 제외
+                            // && Objects.equals(
+                            //     Objects.toString(rptDtl.getMnfSeq(), "").replaceAll("-", ""),
+                            //     Objects.toString(mgtDtl.getMnfSeq(), "").replaceAll("-", ""))
                             && Objects.equals(rptDtl.getDsuseQy(), mgtDtl.getDsuseQy())) {
                             rptDtl.setMatchYn("Y");
                             break;