보고서 데이타 조회를 위한 필드 반영

dev
Jonguk. Lim 7 months ago
parent b4daeec93f
commit e9c12b7c8c

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

@ -127,7 +127,7 @@ public class BizNimsController {
return ApiBaseResponse.of(bizNimsService.saveDsuseMgt(dtos)); return ApiBaseResponse.of(bizNimsService.saveDsuseMgt(dtos));
} }
@Operation(summary = "사고 마약류 폐기 관리 목록 조회", description = "사고 마약류 폐기 관리 목록 조회") @Operation(summary = "사고 마약류 폐기 관리 목록 조회", description = "사고 마약류 폐기 관리 목록 조회<br><br>사고마약류 관리대장, 결과통보서, 폐기현황등에 필요한 내용 조회")
@PostMapping(value = "/getDsuseMgts") @PostMapping(value = "/getDsuseMgts")
public ApiBaseResponse<List<BizNimsResponse.DsuseMgtResponse>> getDsuseMgts( public ApiBaseResponse<List<BizNimsResponse.DsuseMgtResponse>> getDsuseMgts(
@RequestBody BizNimsRequest.DsuseMgtInq dto @RequestBody BizNimsRequest.DsuseMgtInq dto

@ -409,6 +409,16 @@ public class NimsApiDto {
* / * /
*/ */
private String prtmSeNm; private String prtmSeNm;
/**
*
*/
private String bsshCd;
/**
*
*/
private String bsshNm;
} }
// /** // /**

@ -166,11 +166,15 @@
tdrid.reg_dt, tdrid.reg_dt,
tdrid.rgtr, tdrid.rgtr,
tpi.nrcd_se_nm, /* 마약항정구분 */ 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 FROM tb_dsuse_rpt_info_dtl tdrid
LEFT JOIN tb_prduct_info tpi LEFT JOIN tb_prduct_info tpi
ON (tdrid.prduct_cd = tpi.prduct_cd) ON (tdrid.prduct_cd = tpi.prduct_cd)
-- AND tdrid.use_yn = 'Y') -- 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} WHERE tdrid.usr_rpt_id_no = #{usrRptIdNo}
<if test="usrRptLnIdNo != null"> <if test="usrRptLnIdNo != null">
AND tdrid.usr_rpt_ln_id_no = #{usrRptLnIdNo} AND tdrid.usr_rpt_ln_id_no = #{usrRptLnIdNo}

Loading…
Cancel
Save