diff --git a/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java b/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java index 1c7cb7d..4bef651 100644 --- a/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java +++ b/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java @@ -31,38 +31,38 @@ public interface BizNimsMapper extends AbstractMapper { //------------------------------------------------------------------------------------------------------ // NIMS API CALL //------------------------------------------------------------------------------------------------------ - void mergeBsshInfoSt(NimsApiDto.BsshInfoSt dto); - List selectBsshInfos(NimsApiRequest.BsshInfoReq dto); - void mergeProductInfoKd(NimsApiDto.ProductInfoKd dto); - List selectProductInfos(NimsApiRequest.ProductInfoReq dto); + void mergeBsshInfoSt(final NimsApiDto.BsshInfoSt dto); + List selectBsshInfos(final NimsApiRequest.BsshInfoReq dto); + void mergeProductInfoKd(final NimsApiDto.ProductInfoKd dto); + List selectProductInfos(final NimsApiRequest.ProductInfoReq dto); // int mergeStorgeInfo(NimsApiDto.StorageInfo dto); //------------------------------------------------------------------------------------------------------ // NIMS BIZ //------------------------------------------------------------------------------------------------------ - int insertDsuseMgt(BizNimsRequest.DsuseMgt dto); - int insertDsuseMgtDtl(BizNimsRequest.DsuseMgtDtl dto); - List selectDsuseMgts(BizNimsRequest.DsuseMgtInq dto); - List selectDsuseMgtDtls(Map map); - int updateMappingDsuseMgt(BizNimsResponse.DsuseMgtRes mgtDto); + int insertDsuseMgt(final BizNimsRequest.DsuseMgt dto); + int insertDsuseMgtDtl(final BizNimsRequest.DsuseMgtDtl dto); + List selectDsuseMgts(final BizNimsRequest.DsuseMgtInq dto); + List selectDsuseMgtDtls(final Map map); + int updateMappingDsuseMgt(final BizNimsResponse.DsuseMgtRes mgtDto); - int insertDsuseRptInfo(NimsApiDto.DsuseRptInfo dto); - int insertDsuseRptInfoDtl(NimsApiDto.DsuseRptInfoDtl dto); - int updateCancelDsuseRptInfo(NimsApiDto.DsuseRptInfo dto); - int updateCancelDsuseRptInfoDtl(NimsApiDto.DsuseRptInfo dto); -// int updateCancelDsuseMgt(NimsApiDto.DsuseRptInfo dto); - Map recusiveRefUsrRptIdNo(String refUsrRptIdNo); + int insertDsuseRptInfo(final NimsApiDto.DsuseRptInfo dto); + int insertDsuseRptInfoDtl(final NimsApiDto.DsuseRptInfoDtl dto); + int updateCancelDsuseRptInfo(final NimsApiDto.DsuseRptInfo dto); + int updateCancelDsuseRptInfoDtl(final NimsApiDto.DsuseRptInfo dto); + int updatePrgsSttsOfDsuseMgt(final BizNimsRequest.DsuseMgt dto); + Map recusiveRefUsrRptIdNo(final String refUsrRptIdNo); /** * 폐기관리 테이블 사용자보고식별번호 반영 */ - int updateUsrRptIdNoOfDsuseMgt(NimsApiDto.DsuseRptInfo dto); + //int updateUsrRptIdNoOfDsuseMgt(final NimsApiDto.DsuseRptInfo dto); - NimsApiDto.DsuseRptInfo selectDsuseRptInfoByUsrRptIdNo(Map map); - List selectDsuseRptInfoDtls(Map map); + NimsApiDto.DsuseRptInfo selectDsuseRptInfoByUsrRptIdNo(final Map map); + //List selectDsuseRptInfoDtls(final Map map); - List selectSavedDsuseMgts(List dsuseMgtIds); + //List selectSavedDsuseMgts(final List dsuseMgtIds); // int insertDsuseMgtDtl(BizNimsRequest.DsuseMgtDtl dto); // int updateCancelDsuseMgtDtl(BizNimsRequest.DsuseMgt dto); diff --git a/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java b/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java index 7ce4876..18b6ed0 100644 --- a/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java +++ b/src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java @@ -26,9 +26,9 @@ public interface BizNimsService { //------------------------------------------------------------------------------------------------------ // NIMS API CALL //------------------------------------------------------------------------------------------------------ - List saveBsshInfoSt(NimsApiRequest.BsshInfoReq dto); - List saveProductInfoKd(NimsApiRequest.ProductInfoReq dto, boolean isMnfSeqInfo); - List getMnfSeqInfo(NimsApiRequest.MnfSeqInfoReq dto); + List saveBsshInfoSt(final NimsApiRequest.BsshInfoReq dto); + List saveProductInfoKd(final NimsApiRequest.ProductInfoReq dto, boolean isMnfSeqInfo); + List getMnfSeqInfo(final NimsApiRequest.MnfSeqInfoReq dto); // List getJurisdictionGovInfo(NimsApiRequest.JurisdictionGovInfoRequest dto); // List saveStorageInfo(NimsApiRequest.StorageInfoRequest dto); @@ -49,18 +49,14 @@ public interface BizNimsService { * @return List * */ - List saveDsuseRptInfo(NimsApiRequest.DsuseRptInfoReq dto); + List saveDsuseRptInfo(final NimsApiRequest.DsuseRptInfoReq dto); //------------------------------------------------------------------------------------------------------ // NIMS BIZ //------------------------------------------------------------------------------------------------------ - // NimsAarResult createReportDsuse(); - // NimsAarResult updateReportDsuse(); - // NimsAarResult cancelReportDsuse(); - - BizNimsRequest.DsuseMgt saveDsuseMgt(BizNimsRequest.DsuseMgt dto); - List getDsuseMgts(BizNimsRequest.DsuseMgtInq dto); - + BizNimsRequest.DsuseMgt saveDsuseMgt(final BizNimsRequest.DsuseMgt dto); + List getDsuseMgts(final BizNimsRequest.DsuseMgtInq dto); + void modifyPrgsSttsOfDsuseMgt(final BizNimsRequest.DsuseMgt dto); NimsApiDto.ProductInfoKd getPrdMnfSeqInfoOfBarcode(final String barcodeStr); // @Deprecated 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 91ee983..d2a36ab 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 @@ -336,9 +336,6 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe }; } - - - // return dtos; return workList; } @@ -357,14 +354,14 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe public BizNimsRequest.DsuseMgt saveDsuseMgt(BizNimsRequest.DsuseMgt dto) { ApiUtil.validate(dto, null, validator); if(dto.getRndDtlRptCnt() != dto.getDsuseMgtDtls().size()) throw ApiCustomException.create("폐기물 보고수 오류[폐기물 갯수 확인]"); - dto.setRgtr(Constants.NIMS_API_USER_ID); + dto.setRgtr(dto.getUserId()); if(bizNimsMapper.insertDsuseMgt(dto) == 1){ int dtlCnt = 0; for (BizNimsRequest.DsuseMgtDtl d : dto.getDsuseMgtDtls()) { d.setDscdmngId(dto.getDscdmngId()); d.setDscdmngSn(StringUtils.leftPad(dtlCnt + 1 + "", 3, "0")); - d.setRgtr(Constants.NIMS_API_USER_ID); + d.setRgtr(dto.getUserId()); dtlCnt = dtlCnt + bizNimsMapper.insertDsuseMgtDtl(d); } if(dto.getDsuseMgtDtls().size() != dtlCnt) throw ApiCustomException.create("폐기 관리 상세 등록 실패"); @@ -401,6 +398,14 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe return resList; } + @Override + public void modifyPrgsSttsOfDsuseMgt(BizNimsRequest.DsuseMgt dto) { + dto.setRgtr(dto.getUserId()); + if(bizNimsMapper.updatePrgsSttsOfDsuseMgt(dto) != 1){ + throw ApiCustomException.create(String.format("폐기 관리 상태 변경[%s->%s] 실패",dto.getDscdmngId(), Constants.PRGRS_STTS_CD.getName(dto.getPrgrsSttsCd()))); + } + } + @Override public NimsApiDto.ProductInfoKd getPrdMnfSeqInfoOfBarcode(final String barcodeStr) { NimsApiDto.MnfSeqInfo mnfSeqInfo = new BizNimsResponse.Barcode().parseBarcode(barcodeStr); 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 8fb4607..20d7977 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 @@ -5,6 +5,7 @@ import java.util.List; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -150,6 +151,25 @@ public class BizNimsController { } + @Operation(summary = "사고 마약류 폐기 관리 상태 변경", description = "사고 마약류 폐기 관리 상태변경

사고마약류 상태 변경 : Constants.PRGRS_STTS_CD의 코드값 사용") + @io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = { + @Content(mediaType = "application/json", examples = { + @ExampleObject(value = """ + { + "dscdmngId": "2024050001", + "userId": "api-user", + "prgrsSttsCd": "02" + } + """) + }) + }) + @PutMapping(value = "/modifyPrgsSttsOfDsuseMgt") + public ApiBaseResponse modifyPrgsSttsOfDsuseMgt(@RequestBody final BizNimsRequest.DsuseMgt dto) { + bizNimsService.modifyPrgsSttsOfDsuseMgt(dto); + return ApiBaseResponse.of(); + } + + @Operation(summary = "barcode string 제품 제조 정보 조회", description = "barcode string 제품 제조 정보 조회

Barcode를 통한 제품 제조 정보 조회

ex) 01088065780457311717050110A1234210000000006") @GetMapping(value = "/getPrdMnfSeqInfoOfBarcode") public ApiBaseResponse getPrdMnfSeqInfoOfBarcode( @@ -174,6 +194,11 @@ public class BizNimsController { + + + + + @Operation(deprecated = true, summary = "사고 마약류 폐기 관리 목록 조회", description = "사고 마약류 폐기 관리 목록 조회

사고마약류 관리대장, 결과통보서, 폐기현황등에 필요한 내용 조회") @PostMapping(value = "/getDsuseMgts2") public ApiBaseResponse> getDsuseMgts2( diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index 3962b28..df6bf5f 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -148,9 +148,7 @@ - - - + 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 97fd9f9..2729a15 100644 --- a/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml +++ b/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml @@ -351,20 +351,15 @@ , mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s') , mdfr = #{rgtr} WHERE dscdmng_id = #{dscdmngId} - AND use_yn = 'Y' - - - - /** nims-mysql-mapper|updateCancelDsuseMgt-폐기관리 취소(참조사용자식별번호로)|julim */ + + /** nims-mysql-mapper|updatePrgsSttsOfDsuseMgt-폐기관리 상태 변경|julim */ UPDATE tb_dsuse_mgt - SET usr_rpt_id_no = #{usrRptIdNo} - , use_yn = IF(#{rptTyCd} = '1', 'N', use_yn) - , mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s') - , mdfr = #{rgtr} - WHERE usr_rpt_id_no = #{refUsrRptIdNo} - AND use_yn = 'Y' + SET prgrs_stts_cd = #{prgrsSttsCd} + , mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s') + , mdfr = #{rgtr} + WHERE dscdmng_id = #{dscdmngId}