feat: 폐기관리 상태 변경 반영

dev
Jonguk. Lim 6 months ago
parent 9f8d649b58
commit 8d9e79ace0

@ -31,38 +31,38 @@ public interface BizNimsMapper extends AbstractMapper {
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
// NIMS API CALL // NIMS API CALL
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
void mergeBsshInfoSt(NimsApiDto.BsshInfoSt dto); void mergeBsshInfoSt(final NimsApiDto.BsshInfoSt dto);
List<NimsApiDto.BsshInfoSt> selectBsshInfos(NimsApiRequest.BsshInfoReq dto); List<NimsApiDto.BsshInfoSt> selectBsshInfos(final NimsApiRequest.BsshInfoReq dto);
void mergeProductInfoKd(NimsApiDto.ProductInfoKd dto); void mergeProductInfoKd(final NimsApiDto.ProductInfoKd dto);
List<NimsApiDto.ProductInfoKd> selectProductInfos(NimsApiRequest.ProductInfoReq dto); List<NimsApiDto.ProductInfoKd> selectProductInfos(final NimsApiRequest.ProductInfoReq dto);
// int mergeStorgeInfo(NimsApiDto.StorageInfo dto); // int mergeStorgeInfo(NimsApiDto.StorageInfo dto);
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
// NIMS BIZ // NIMS BIZ
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
int insertDsuseMgt(BizNimsRequest.DsuseMgt dto); int insertDsuseMgt(final BizNimsRequest.DsuseMgt dto);
int insertDsuseMgtDtl(BizNimsRequest.DsuseMgtDtl dto); int insertDsuseMgtDtl(final BizNimsRequest.DsuseMgtDtl dto);
List<BizNimsResponse.DsuseMgtRes> selectDsuseMgts(BizNimsRequest.DsuseMgtInq dto); List<BizNimsResponse.DsuseMgtRes> selectDsuseMgts(final BizNimsRequest.DsuseMgtInq dto);
List<BizNimsResponse.DsuseMgtDtlRes> selectDsuseMgtDtls(Map<String, String> map); List<BizNimsResponse.DsuseMgtDtlRes> selectDsuseMgtDtls(final Map<String, String> map);
int updateMappingDsuseMgt(BizNimsResponse.DsuseMgtRes mgtDto); int updateMappingDsuseMgt(final BizNimsResponse.DsuseMgtRes mgtDto);
int insertDsuseRptInfo(NimsApiDto.DsuseRptInfo dto); int insertDsuseRptInfo(final NimsApiDto.DsuseRptInfo dto);
int insertDsuseRptInfoDtl(NimsApiDto.DsuseRptInfoDtl dto); int insertDsuseRptInfoDtl(final NimsApiDto.DsuseRptInfoDtl dto);
int updateCancelDsuseRptInfo(NimsApiDto.DsuseRptInfo dto); int updateCancelDsuseRptInfo(final NimsApiDto.DsuseRptInfo dto);
int updateCancelDsuseRptInfoDtl(NimsApiDto.DsuseRptInfo dto); int updateCancelDsuseRptInfoDtl(final NimsApiDto.DsuseRptInfo dto);
// int updateCancelDsuseMgt(NimsApiDto.DsuseRptInfo dto); int updatePrgsSttsOfDsuseMgt(final BizNimsRequest.DsuseMgt dto);
Map<String, String> recusiveRefUsrRptIdNo(String refUsrRptIdNo); Map<String, String> recusiveRefUsrRptIdNo(final String refUsrRptIdNo);
/** /**
* *
*/ */
int updateUsrRptIdNoOfDsuseMgt(NimsApiDto.DsuseRptInfo dto); //int updateUsrRptIdNoOfDsuseMgt(final NimsApiDto.DsuseRptInfo dto);
NimsApiDto.DsuseRptInfo selectDsuseRptInfoByUsrRptIdNo(Map<String, String> map); NimsApiDto.DsuseRptInfo selectDsuseRptInfoByUsrRptIdNo(final Map<String, String> map);
List<NimsApiDto.DsuseRptInfoDtl> selectDsuseRptInfoDtls(Map<String, String> map); //List<NimsApiDto.DsuseRptInfoDtl> selectDsuseRptInfoDtls(final Map<String, String> map);
List<BizNimsResponse.DsuseRptInfoRes> selectSavedDsuseMgts(List<String> dsuseMgtIds); //List<BizNimsResponse.DsuseRptInfoRes> selectSavedDsuseMgts(final List<String> dsuseMgtIds);
// int insertDsuseMgtDtl(BizNimsRequest.DsuseMgtDtl dto); // int insertDsuseMgtDtl(BizNimsRequest.DsuseMgtDtl dto);
// int updateCancelDsuseMgtDtl(BizNimsRequest.DsuseMgt dto); // int updateCancelDsuseMgtDtl(BizNimsRequest.DsuseMgt dto);

@ -26,9 +26,9 @@ public interface BizNimsService {
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
// NIMS API CALL // NIMS API CALL
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
List<NimsApiDto.BsshInfoSt> saveBsshInfoSt(NimsApiRequest.BsshInfoReq dto); List<NimsApiDto.BsshInfoSt> saveBsshInfoSt(final NimsApiRequest.BsshInfoReq dto);
List<NimsApiDto.ProductInfoKd> saveProductInfoKd(NimsApiRequest.ProductInfoReq dto, boolean isMnfSeqInfo); List<NimsApiDto.ProductInfoKd> saveProductInfoKd(final NimsApiRequest.ProductInfoReq dto, boolean isMnfSeqInfo);
List<NimsApiDto.MnfSeqInfo> getMnfSeqInfo(NimsApiRequest.MnfSeqInfoReq dto); List<NimsApiDto.MnfSeqInfo> getMnfSeqInfo(final NimsApiRequest.MnfSeqInfoReq dto);
// List<NimsApiDto.JurisdictionGovInfo> getJurisdictionGovInfo(NimsApiRequest.JurisdictionGovInfoRequest dto); // List<NimsApiDto.JurisdictionGovInfo> getJurisdictionGovInfo(NimsApiRequest.JurisdictionGovInfoRequest dto);
// List<NimsApiDto.StorageInfo> saveStorageInfo(NimsApiRequest.StorageInfoRequest dto); // List<NimsApiDto.StorageInfo> saveStorageInfo(NimsApiRequest.StorageInfoRequest dto);
@ -49,18 +49,14 @@ public interface BizNimsService {
* @return List<NimsApiDto.DsuseRptInfo> * @return List<NimsApiDto.DsuseRptInfo>
* </pre> * </pre>
*/ */
List<NimsApiDto.DsuseRptInfo> saveDsuseRptInfo(NimsApiRequest.DsuseRptInfoReq dto); List<NimsApiDto.DsuseRptInfo> saveDsuseRptInfo(final NimsApiRequest.DsuseRptInfoReq dto);
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
// NIMS BIZ // NIMS BIZ
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
// NimsAarResult createReportDsuse(); BizNimsRequest.DsuseMgt saveDsuseMgt(final BizNimsRequest.DsuseMgt dto);
// NimsAarResult updateReportDsuse(); List<BizNimsResponse.DsuseMgtRes> getDsuseMgts(final BizNimsRequest.DsuseMgtInq dto);
// NimsAarResult cancelReportDsuse(); void modifyPrgsSttsOfDsuseMgt(final BizNimsRequest.DsuseMgt dto);
BizNimsRequest.DsuseMgt saveDsuseMgt(BizNimsRequest.DsuseMgt dto);
List<BizNimsResponse.DsuseMgtRes> getDsuseMgts(BizNimsRequest.DsuseMgtInq dto);
NimsApiDto.ProductInfoKd getPrdMnfSeqInfoOfBarcode(final String barcodeStr); NimsApiDto.ProductInfoKd getPrdMnfSeqInfoOfBarcode(final String barcodeStr);
// @Deprecated // @Deprecated

@ -336,9 +336,6 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
}; };
} }
// return dtos; // return dtos;
return workList; return workList;
} }
@ -357,14 +354,14 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
public BizNimsRequest.DsuseMgt saveDsuseMgt(BizNimsRequest.DsuseMgt dto) { public BizNimsRequest.DsuseMgt saveDsuseMgt(BizNimsRequest.DsuseMgt dto) {
ApiUtil.validate(dto, null, validator); ApiUtil.validate(dto, null, validator);
if(dto.getRndDtlRptCnt() != dto.getDsuseMgtDtls().size()) throw ApiCustomException.create("폐기물 보고수 오류[폐기물 갯수 확인]"); 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){ if(bizNimsMapper.insertDsuseMgt(dto) == 1){
int dtlCnt = 0; int dtlCnt = 0;
for (BizNimsRequest.DsuseMgtDtl d : dto.getDsuseMgtDtls()) { for (BizNimsRequest.DsuseMgtDtl d : dto.getDsuseMgtDtls()) {
d.setDscdmngId(dto.getDscdmngId()); d.setDscdmngId(dto.getDscdmngId());
d.setDscdmngSn(StringUtils.leftPad(dtlCnt + 1 + "", 3, "0")); d.setDscdmngSn(StringUtils.leftPad(dtlCnt + 1 + "", 3, "0"));
d.setRgtr(Constants.NIMS_API_USER_ID); d.setRgtr(dto.getUserId());
dtlCnt = dtlCnt + bizNimsMapper.insertDsuseMgtDtl(d); dtlCnt = dtlCnt + bizNimsMapper.insertDsuseMgtDtl(d);
} }
if(dto.getDsuseMgtDtls().size() != dtlCnt) throw ApiCustomException.create("폐기 관리 상세 등록 실패"); if(dto.getDsuseMgtDtls().size() != dtlCnt) throw ApiCustomException.create("폐기 관리 상세 등록 실패");
@ -401,6 +398,14 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
return resList; 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 @Override
public NimsApiDto.ProductInfoKd getPrdMnfSeqInfoOfBarcode(final String barcodeStr) { public NimsApiDto.ProductInfoKd getPrdMnfSeqInfoOfBarcode(final String barcodeStr) {
NimsApiDto.MnfSeqInfo mnfSeqInfo = new BizNimsResponse.Barcode().parseBarcode(barcodeStr); NimsApiDto.MnfSeqInfo mnfSeqInfo = new BizNimsResponse.Barcode().parseBarcode(barcodeStr);

@ -5,6 +5,7 @@ import java.util.List;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; 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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@ -150,6 +151,25 @@ public class BizNimsController {
} }
@Operation(summary = "사고 마약류 폐기 관리 상태 변경", description = "사고 마약류 폐기 관리 상태변경<br><br>사고마약류 상태 변경 : 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<Void> modifyPrgsSttsOfDsuseMgt(@RequestBody final BizNimsRequest.DsuseMgt dto) {
bizNimsService.modifyPrgsSttsOfDsuseMgt(dto);
return ApiBaseResponse.of();
}
@Operation(summary = "barcode string 제품 제조 정보 조회", description = "barcode string 제품 제조 정보 조회<br><br>Barcode를 통한 제품 제조 정보 조회<br><br>ex) 01088065780457311717050110A1234210000000006") @Operation(summary = "barcode string 제품 제조 정보 조회", description = "barcode string 제품 제조 정보 조회<br><br>Barcode를 통한 제품 제조 정보 조회<br><br>ex) 01088065780457311717050110A1234210000000006")
@GetMapping(value = "/getPrdMnfSeqInfoOfBarcode") @GetMapping(value = "/getPrdMnfSeqInfoOfBarcode")
public ApiBaseResponse<NimsApiDto.ProductInfoKd> getPrdMnfSeqInfoOfBarcode( public ApiBaseResponse<NimsApiDto.ProductInfoKd> getPrdMnfSeqInfoOfBarcode(
@ -174,6 +194,11 @@ public class BizNimsController {
@Operation(deprecated = true, summary = "사고 마약류 폐기 관리 목록 조회", description = "사고 마약류 폐기 관리 목록 조회<br><br>사고마약류 관리대장, 결과통보서, 폐기현황등에 필요한 내용 조회") @Operation(deprecated = true, summary = "사고 마약류 폐기 관리 목록 조회", description = "사고 마약류 폐기 관리 목록 조회<br><br>사고마약류 관리대장, 결과통보서, 폐기현황등에 필요한 내용 조회")
@PostMapping(value = "/getDsuseMgts2") @PostMapping(value = "/getDsuseMgts2")
public ApiBaseResponse<List<BizNimsResponse.DsuseRptInfoRes>> getDsuseMgts2( public ApiBaseResponse<List<BizNimsResponse.DsuseRptInfoRes>> getDsuseMgts2(

@ -148,9 +148,7 @@
<!-- DB Connection Pool 관련 --> <!-- DB Connection Pool 관련 -->
<logger name="com.zaxxer.hikari.pool.PoolBase" level="ERROR" /> <logger name="com.zaxxer" level="ERROR" additivity="false"/>
<logger name="com.zaxxer.hikari.pool.HikariPool" level="ERROR" />
<logger name="com.zaxxer.hikari.HikariDataSource" level="ERROR" />
<!-- ************************************************************************* --> <!-- ************************************************************************* -->
<!-- SQL log --> <!-- SQL log -->
<!-- ************************************************************************* --> <!-- ************************************************************************* -->

@ -351,20 +351,15 @@
, mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s') , mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s')
, mdfr = #{rgtr} , mdfr = #{rgtr}
WHERE dscdmng_id = #{dscdmngId} WHERE dscdmng_id = #{dscdmngId}
AND use_yn = 'Y'
</update> </update>
<update id="updatePrgsSttsOfDsuseMgt" parameterType="cokr.xit.adds.biz.nims.model.BizNimsRequest$DsuseMgt">
<!-- FIXME:: 미사용 예정 :: 삭제 --> /** nims-mysql-mapper|updatePrgsSttsOfDsuseMgt-폐기관리 상태 변경|julim */
<update id="updateCancelDsuseMgt" parameterType="cokr.xit.adds.inf.nims.model.NimsApiDto$DsuseRptInfo">
/** nims-mysql-mapper|updateCancelDsuseMgt-폐기관리 취소(참조사용자식별번호로)|julim */
UPDATE tb_dsuse_mgt UPDATE tb_dsuse_mgt
SET usr_rpt_id_no = #{usrRptIdNo} SET prgrs_stts_cd = #{prgrsSttsCd}
, use_yn = IF(#{rptTyCd} = '1', 'N', use_yn)
, mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s') , mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s')
, mdfr = #{rgtr} , mdfr = #{rgtr}
WHERE usr_rpt_id_no = #{refUsrRptIdNo} WHERE dscdmng_id = #{dscdmngId}
AND use_yn = 'Y'
</update> </update>
<!-- ========================== --> <!-- ========================== -->

Loading…
Cancel
Save