From 1a84ae9e6bf7b53844f23c4381a492b43e2ba2c4 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Tue, 2 Jul 2024 17:57:37 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=8F=90=EA=B8=B0=EB=B3=B4=EA=B3=A0?= =?UTF-8?q?=ED=99=95=EC=9D=B8=EC=8B=9C=20=EB=A7=A4=ED=95=91=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EB=B3=B4=EB=8B=A4=20=EA=B5=AC=EC=B2=B4=EC=A0=81?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20set=20=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nims/service/bean/BizNimsServiceBean.java | 6 +- .../xit/adds/inf/nims/model/NimsApiDto.java | 80 +++++++------------ 2 files changed, 30 insertions(+), 56 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 68a4e0e..7375058 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 @@ -10,7 +10,6 @@ import java.util.concurrent.CopyOnWriteArrayList; import javax.validation.Validation; import javax.validation.Validator; -import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; @@ -452,12 +451,9 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe rtnList = saveFromfindDsuseRptDataByNimsApi(rptDto); } + // NIMS폐기보고와 일치하는 경우 - 폐기관리ID 매핑 for(NimsApiDto.DsuseRptInfo dto : rtnList){ BizNimsResponse.DsuseMgtRes dsuseMgtRes = dto.mappingNewDsuseRptInfo(dsuseMgtDto); - // NIMS폐기보고와 일치하는 경우 - 폐기관리ID 매핑 - if(ObjectUtils.isNotEmpty(dsuseMgtRes)) { - dto.setDscdmngId(dsuseMgtRes.getDscdmngId()); - } } rtnList.sort((a, b) -> a.getUsrRptIdNo().compareTo(b.getUsrRptIdNo())); 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 ba69e25..921a856 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 @@ -428,35 +428,6 @@ public class NimsApiDto { @Valid private List listDtl = new ArrayList<>(); - /** - *
-         * 폐기 관리 정보에 폐기 보고 정보 매핑 처리
-         * -> 사용자보고라인식별번호가 매핑되지 않은 경우 - 신규인 경우
-         * -> 폐기관리진행상태가 폐기신청서 접수인 상태의 데이타 대상
-         *
-         * 1. 폐기 관리 정보와 폐기 보고 정보가 동일한 데이타 매핑
-         * 2. 폐기관리 데이타 set
-         *    -> 폐기보고진생상태 - 폐기보고매핑(02)으로 set
-         *    -> 사용자보고식별번호, 원사용자보고식별번호, 보고유형코드, 처리상태 set
-         * @param dsuseMgts List 진행중인 폐기관리목록
-         * @return List 매핑 목록
-         * 
- */ - /* - @JsonIgnore - public List mappingNewDsuseRptInfos(List dsuseMgts){ - List newList = new ArrayList<>(); - - for(BizNimsResponse.DsuseMgtRes mgtDto: dsuseMgts) { - BizNimsResponse.DsuseMgtRes dsuseMgtRes = mappingNewDsuseRptInfo(mgtDto); - if(ObjectUtils.isNotEmpty(dsuseMgtRes)) { - newList.add(dsuseMgtRes); - } - } - return newList; - } - */ - /** *
          * 폐기 관리 정보에 폐기 보고 정보 매핑 처리
@@ -495,27 +466,7 @@ public class NimsApiDto {
 
             // FIXME: 폐기관리와 폐기보고의 상품정보 일치 여부 set - 비교 필드 확정 필요
             if (rptInfoStr.equals(mgtInfoStr)) {
-                mgtDto.setPrdMatch(true);
-                if (this.listDtl.size() == mgtDto.getDsuseMgtDtls().size()) {
-                    for (DsuseRptInfoDtl rptDtl : this.listDtl) {
-                        for (BizNimsDto.DsuseMgtDtl mgtDtl : mgtDto.getDsuseMgtDtls()) {
-                            if (rptDtl.getPrductCd().equals(mgtDtl.getPrductCd())
-                                && rptDtl.getMnfNo().equals(mgtDtl.getMnfNo())
-                                && rptDtl.getPrdValidDe().equals(mgtDtl.getPrdValidDe())
-                                && rptDtl.getMnfSeq().equals(mgtDtl.getMnfSeq())
-                                && rptDtl.getDsuseQy().equals(mgtDtl.getDsuseQy())) {
-                                rptDtl.setMatchYn("Y");
-                                break;
-                            }
-                        }
-                    }
-                }
-                for (DsuseRptInfoDtl rptDtl : this.listDtl){
-                    if(!"Y".equals(rptDtl.getMatchYn())){
-                        mgtDto.setPrdMatch(false);
-                        break;
-                    }
-                }
+                prdMatch(mgtDto);
                 if(mgtDto.isPrdMatch()){
                     mgtDto.setUsrRptIdNo(this.usrRptIdNo);
                     mgtDto.setOrgUsrRptIdNo(this.usrRptIdNo);
@@ -523,11 +474,38 @@ public class NimsApiDto {
                     mgtDto.setStts(this.status);
                     mgtDto.setPrgrsSttsCd(Constants.PRGRS_STTS_CD.MAPPING.getCode());
                     mgtDto.setRgtr(this.getRgtr());
+                    this.dscdmngId = mgtDto.getDscdmngId();
                     return mgtDto;
                 }
+            }else{
+                prdMatch(mgtDto);
             }
 
-            return null;
+            return mgtDto;
+        }
+
+        private void prdMatch(BizNimsResponse.DsuseMgtRes mgtDto) {
+            mgtDto.setPrdMatch(true);
+            if (this.listDtl.size() == mgtDto.getDsuseMgtDtls().size()) {
+                for (DsuseRptInfoDtl rptDtl : this.listDtl) {
+                    for (BizNimsDto.DsuseMgtDtl mgtDtl : mgtDto.getDsuseMgtDtls()) {
+                        if (rptDtl.getPrductCd().equals(mgtDtl.getPrductCd())
+                            && rptDtl.getMnfNo().equals(mgtDtl.getMnfNo())
+                            && rptDtl.getPrdValidDe().equals(mgtDtl.getPrdValidDe())
+                            && rptDtl.getMnfSeq().equals(mgtDtl.getMnfSeq())
+                            && rptDtl.getDsuseQy().equals(mgtDtl.getDsuseQy())) {
+                            rptDtl.setMatchYn("Y");
+                            break;
+                        }
+                    }
+                }
+            }
+            for (DsuseRptInfoDtl rptDtl : this.listDtl){
+                if(!"Y".equals(rptDtl.getMatchYn())){
+                    mgtDto.setPrdMatch(false);
+                    break;
+                }
+            }
         }
     }