From 4b00bc7c58188f90a7d10b78774610d98816df93 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Mon, 21 Oct 2024 09:34:32 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=97=85=EC=B2=B4=EC=A1=B0=ED=9A=8C(?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=95=20=EC=B2=98=EB=A6=AC)=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 --- .../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)