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 9d003b4..5481ee4 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 @@ -234,20 +234,20 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe public List getDsuseMgts(BizNimsRequest.DsuseMgtInq dto) { List resList = bizNimsMapper.selectDsuseMgts(dto); - resList.forEach(r -> { - r.setRptTyCdNm(Constants.RPT_TY_CD.getName(r.getRptTyCd())); - r.setDsuseSeCdNm(Constants.DSUSE_SE_CD.getName(r.getDsuseSeCd())); - r.setDsusePrvCdNm(Constants.DSUSE_PRV_CD.getName(r.getDsusePrvCd())); - r.setDsuseMthCdNm(Constants.DSUSE_MTH_CD.getName(r.getDsuseMthCd())); - - Map map = new HashMap<>(); - map.put("usrRptIdNo", r.getUsrRptIdNo()); - List dsuseRptInfoDtls = bizNimsMapper.selectDsuseRptInfoDtls(map); - setAddProductInfo(dsuseRptInfoDtls); - r.getDsuseRptInfoDtls().addAll(bizNimsMapper.selectDsuseRptInfoDtls(map)); - }); - - return resList; + for (BizNimsResponse.DsuseMgtResponse r : resList) { + r.setRptTyCdNm(Constants.RPT_TY_CD.getName(r.getRptTyCd())); + r.setDsuseSeCdNm(Constants.DSUSE_SE_CD.getName(r.getDsuseSeCd())); + r.setDsusePrvCdNm(Constants.DSUSE_PRV_CD.getName(r.getDsusePrvCd())); + r.setDsuseMthCdNm(Constants.DSUSE_MTH_CD.getName(r.getDsuseMthCd())); + + Map map = new HashMap<>(); + map.put("usrRptIdNo", r.getUsrRptIdNo()); + List dsuseRptInfoDtls = bizNimsMapper.selectDsuseRptInfoDtls(map); + setAddProductInfo(dsuseRptInfoDtls); + r.getDsuseRptInfoDtls().addAll(dsuseRptInfoDtls); + } + + return resList; } //------------------------------------------------------------------------------------------------------ @@ -365,62 +365,79 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe * */ private void setAddBsshInfo(List resList) { - resList.forEach(r -> { - r.setRptTyCdNm(Constants.RPT_TY_CD.getName(r.getRptTyCd())); - r.setDsuseSeCdNm(Constants.DSUSE_SE_CD.getName(r.getDsuseSeCd())); - r.setDsusePrvCdNm(Constants.DSUSE_PRV_CD.getName(r.getDsusePrvCd())); - r.setDsuseMthCdNm(Constants.DSUSE_MTH_CD.getName(r.getDsuseMthCd())); - - if(isEmpty(r.getPrmisnNo())){ - List list = saveBsshInfoSt( - BsshInfoRequest.builder() - .fg("1") - .pg("1") - .bc(r.getBsshCd()) - .build() - ); - if(isEmpty(list)){ - // FIXME : 데이타 정상 흐름 확인후 comment 제거 - return; - //throw ApiCustomException.create(String.format("데이타 오류(마약류취급자식별번호[%s]에 해당하는 데이타가 없습니다)", r.getBsshCd())); - } - r.setPrmisnNo(list.get(0).getPrmisnNo()); - r.setRprsntvNm(list.get(0).getRprsntvNm()); - } - }); - } + for (BizNimsResponse.DsuseMgtResponse r : resList) { + r.setRptTyCdNm(Constants.RPT_TY_CD.getName(r.getRptTyCd())); + r.setDsuseSeCdNm(Constants.DSUSE_SE_CD.getName(r.getDsuseSeCd())); + r.setDsusePrvCdNm(Constants.DSUSE_PRV_CD.getName(r.getDsusePrvCd())); + r.setDsuseMthCdNm(Constants.DSUSE_MTH_CD.getName(r.getDsuseMthCd())); + + if (isEmpty(r.getPrmisnNo())) { + List list = saveBsshInfoSt( + BsshInfoRequest.builder() + .fg("1") + .pg("1") + .bc(r.getBsshCd()) + .build() + ); + if (isEmpty(list)) { + // FIXME : 데이타 정상 흐름 확인후 comment 제거 + continue; + //throw ApiCustomException.create(String.format("데이타 오류(마약류취급자식별번호[%s]에 해당하는 데이타가 없습니다)", r.getBsshCd())); + } + r.setPrmisnNo(list.get(0).getPrmisnNo()); + r.setRprsntvNm(list.get(0).getRprsntvNm()); + } + } + } /** *
 	 * 제품 추가 정보 set
-	 * 마약항정구분(nrcdSeNm), 중점일반구분(prtmSenm) set
+	 * 마약항정구분(nrcdSeNm), 중점일반구분(prtmSenm), 제조수입자명(bsshNm) set
 	 * @param dtlList 
 	 * 
*/ private void setAddProductInfo(List dtlList) { - dtlList.forEach(r -> { - //if() - if(isEmpty(r.getNrcdSeNm()) || isEmpty(r.getPrtmSeNm())){ - //NimsApiResult.Response result = infNimsService.getProductInfoKd( - - List list = saveProductInfoKd( - NimsApiRequest.ProductInfoRequest.builder() + for (NimsApiDto.DsuseRptInfoDtl r : dtlList) {//if() + // 마약항정구분(nrcdSeNm), 중점일반구분(prtmSenm) + // if (isEmpty(r.getNrcdSeNm()) || isEmpty(r.getPrtmSeNm())) { + // //NimsApiResult.Response result = infNimsService.getProductInfoKd( + // + // List list = saveProductInfoKd( + // NimsApiRequest.ProductInfoRequest.builder() + // .fg("1") + // .pg("1") + // .p(r.getPrductCd()) + // .build() + // ); + // if (isEmpty(list)) { + // // FIXME : 데이타 정상 흐름 확인후 comment 제거 + // continue; + // //throw ApiCustomException.create(String.format("데이타 오류(제품코드[%s]에 해당하는 데이타가 없습니다)", r.getPrductCd())); + // } + // r.setNrcdSeNm(list.get(0).getNrcdSeNm()); + // r.setPrtmSeNm(list.get(0).getPrtmSeNm()); + // } + + // 제조수입자명(bsshNm) + if (isEmpty(r.getBsshNm()) && !isEmpty(r.getBsshCd())) { + List list = saveBsshInfoSt( + BsshInfoRequest.builder() .fg("1") .pg("1") - .p(r.getPrductCd()) + .bc(r.getBsshCd()) .build() ); - if(isEmpty(list)){ + if (isEmpty(list)) { // FIXME : 데이타 정상 흐름 확인후 comment 제거 - return; - //throw ApiCustomException.create(String.format("데이타 오류(제품코드[%s]에 해당하는 데이타가 없습니다)", r.getPrductCd())); + continue; + //throw ApiCustomException.create(String.format("데이타 오류(마약류취급자식별번호[%s]에 해당하는 데이타가 없습니다)", r.getBsshCd())); } - r.setNrcdSeNm(list.get(0).getNrcdSeNm()); - r.setPrtmSeNm(list.get(0).getPrtmSeNm()); + r.setBsshNm(list.get(0).getBsshNm()); } - }); - } + } + } 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 ee4c524..cf6f3fc 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 @@ -127,7 +127,7 @@ public class BizNimsController { return ApiBaseResponse.of(bizNimsService.saveDsuseMgt(dtos)); } - @Operation(summary = "사고 마약류 폐기 관리 목록 조회", description = "사고 마약류 폐기 관리 목록 조회") + @Operation(summary = "사고 마약류 폐기 관리 목록 조회", description = "사고 마약류 폐기 관리 목록 조회

사고마약류 관리대장, 결과통보서, 폐기현황등에 필요한 내용 조회") @PostMapping(value = "/getDsuseMgts") public ApiBaseResponse> getDsuseMgts( @RequestBody BizNimsRequest.DsuseMgtInq dto 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 2a30d89..ab830c1 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 @@ -409,6 +409,16 @@ public class NimsApiDto { * 중점/일반 구분 */ private String prtmSeNm; + + /** + * 제조 수입자 + */ + private String bsshCd; + + /** + * 제조 수입자명 + */ + private String bsshNm; } // /** 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 67afe0e..0130b64 100644 --- a/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml +++ b/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml @@ -166,11 +166,15 @@ tdrid.reg_dt, tdrid.rgtr, tpi.nrcd_se_nm, /* 마약항정구분 */ - tpi.prtm_se_nm /* 중점일반구분 */ + tpi.prtm_se_nm, /* 중점일반구분 */ + tpi.bssh_cd, /* 제조수입자 */ + tbi.bssh_nm /* 제조수입자명 */ FROM tb_dsuse_rpt_info_dtl tdrid LEFT JOIN tb_prduct_info tpi ON (tdrid.prduct_cd = tpi.prduct_cd) -- AND tdrid.use_yn = 'Y') + LEFT JOIN tb_bssh_info tbi + ON (tpi.bssh_cd = tbi.bssh_cd) WHERE tdrid.usr_rpt_id_no = #{usrRptIdNo} AND tdrid.usr_rpt_ln_id_no = #{usrRptLnIdNo}