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 b55c27b..91617da 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 @@ -251,7 +251,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe reqDto.setGc(apiInfInfo.get("deptCd")); // 관할관청코드 ApiUtil.validate(reqDto, null, validator); - List rtnList = findNimsDsuseRptsOfApi(reqDto); + List rtnList = findNimsDsuseRptsOfApi(reqDto, false); rtnList.sort((a, b) -> a.getUsrRptIdNo().compareTo(b.getUsrRptIdNo())); return rtnList; @@ -438,10 +438,17 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe .sdt(dsuseMgtDto.getHdrDe()) .edt(dsuseMgtDto.getHdrDe()) .bc(dsuseMgtDto.getBsshCd()) + .ur(dsuseMgtDto.getUsrRptIdNo()) .userId(reqDto.getUserId()) .build(); - List rtnList = saveFromfindDsuseRptDataByNimsApi(rptDto); + // 폐기보고 확인(NIMS 폐기 완료 - 상태가 "확인" 인 경우 데이타 조회 추가 + List rtnList = null; + if(!isEmpty(dsuseMgtDto.getUsrRptIdNo()) && Constants.PRGRS_STTS_CD.COMPLETE.getCode().equals(dsuseMgtDto.getPrgrsSttsCd())) { + rtnList = findNimsDsuseRptsOfApi(rptDto, true); + }else { + rtnList = saveFromfindDsuseRptDataByNimsApi(rptDto); + } for(NimsApiDto.DsuseRptInfo dto : rtnList){ // 7. FIXME : 폐기 관리 데이타와 매핑 @@ -615,7 +622,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe * */ private List saveFromfindDsuseRptDataByNimsApi(NimsApiRequest.DsuseRptInfoReq reqDto) { - List nimsList = findNimsDsuseRptsOfApi(reqDto); + List nimsList = findNimsDsuseRptsOfApi(reqDto, false); // 신규 작업대상 데이타 List List newList = new ArrayList<>(); @@ -684,9 +691,15 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe return new ArrayList<>(concurrentList); } - private List findNimsDsuseRptsOfApi(NimsApiRequest.DsuseRptInfoReq reqDto) { + /** + * + * @param reqDto + * @param isUsrRptIdNo "확인" 상태의 데이타 조회 여부 + * @return + */ + private List findNimsDsuseRptsOfApi(NimsApiRequest.DsuseRptInfoReq reqDto, boolean isUsrRptIdNo) { List nimsList = new ArrayList<>(); - boolean isUsrRptIdNo = !isEmpty(reqDto.getUr()); + //boolean isUsrRptIdNo = !isEmpty(reqDto.getUr()); while(true) { NimsApiResult.Response rslt = infNimsService.getDsuseRptInfo(reqDto);