From 307412847773a515e939b1c6235173e11ef00d51 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Fri, 5 Jul 2024 13:38:41 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=A0=9C=ED=92=88=20=EC=9D=BC=EB=A0=A8?= =?UTF-8?q?=EB=B2=88=ED=98=B8=20=EC=A1=B0=ED=9A=8C=EC=8B=9C=20=EC=A1=B0?= =?UTF-8?q?=EA=B1=B4=20=EC=B6=94=EA=B0=80=20=20=20=20=20->=20=EC=9C=A0?= =?UTF-8?q?=ED=9A=A8=EA=B8=B0=EA=B0=84,=20=EC=9D=BC=EB=A0=A8=EB=B2=88?= =?UTF-8?q?=ED=98=B8,=20=EC=A0=9C=EC=A1=B0=EB=B2=88=ED=98=B8=20=EC=A1=B0?= =?UTF-8?q?=EA=B1=B4=20=EC=B6=94=EA=B0=80=20=20=20=20=20->=20=EC=B5=9C?= =?UTF-8?q?=EC=86=8C=20200=EA=B1=B4=20=EA=B9=8C=EC=A7=80=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C(=EB=A7=88=EC=A7=80=EB=A7=89=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=EA=B0=80=20=EC=95=84=EB=8B=88=EA=B3=A0,=20200?= =?UTF-8?q?=EA=B1=B4=20=EC=9D=B4=ED=95=98=EB=A9=B4=20=EB=8B=A4=EC=9D=8C=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=A1=B0=ED=9A=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nims/service/bean/BizNimsServiceBean.java | 30 ++++++++++++++++--- .../adds/inf/nims/model/NimsApiRequest.java | 6 ++++ 2 files changed, 32 insertions(+), 4 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 d7b0043..0f3b585 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 @@ -199,11 +199,33 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe } //reqDto.setFg("1"); // 제조번호 또는 일련번호 구분(1-제조번호, 2-일련번호, 3-바코드/RFID) reqDto.setPg("1"); // 조회페이지 - NimsApiResult.Response response = infNimsService.getMnfSeqInfo(reqDto); - List results = response.getResult(); + List list = new ArrayList<>(); + boolean isPrdValidDe = !isEmpty(reqDto.getPrdValidDe()); + 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); + } + + // 데이타 조회 결과 마지막 페이지 이거나 100건 이상인 경우 종료 + if(rslt.isEndYn() || list.size() >= 100) break; + + reqDto.setPg(String.valueOf(Integer.parseInt(reqDto.getPg()) + 1)); + } // 올림 차순 정렬 - results.sort((a, b) -> { + list.sort((a, b) -> { if (isEmpty(a.getPrdValidDe()) && isEmpty(b.getPrdValidDe())) return 0; if (isEmpty(a.getPrdValidDe())) @@ -212,7 +234,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe return 1; return a.getPrdValidDe().compareTo(b.getPrdValidDe()); }); - return results; + return list; } @Override 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 0b16535..bd10753 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 @@ -384,6 +384,12 @@ public class NimsApiRequest { @Pattern(regexp = "^$|[A-Z0-9]{5,}", message = "번호를 5자이상 입력해주세요") private String t = StringUtils.EMPTY; + /** + * 유효기간 + */ + @Schema(title = "유효기간", description = "유효기간", example = " ") + private String prdValidDe; + /** *
          * 업무상 필요에 의해 추가