feat: 폐기보고 - 보고정보 API 반영

dev
Jonguk. Lim 5 months ago
parent 9ec067cc2a
commit 7f1434990a

@ -6,6 +6,7 @@ import java.util.Optional;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper; import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.adds.biz.nims.model.BizNimsDto;
import cokr.xit.adds.biz.nims.model.BizNimsRequest; import cokr.xit.adds.biz.nims.model.BizNimsRequest;
import cokr.xit.adds.biz.nims.model.BizNimsResponse; import cokr.xit.adds.biz.nims.model.BizNimsResponse;
import cokr.xit.adds.inf.nims.model.NimsApiDto; import cokr.xit.adds.inf.nims.model.NimsApiDto;
@ -49,8 +50,8 @@ public interface BizNimsMapper extends AbstractMapper {
Optional<Map<String,String>> selectApiInfInfoByUserId(Map<String,String> map); Optional<Map<String,String>> selectApiInfInfoByUserId(Map<String,String> map);
int insertDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceipt dto); int insertDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceipt dto);
int updateDsuseMgtRslt(final BizNimsRequest.DsuseMgtRslt dto); int updateDsuseMgtRslt(final BizNimsRequest.DsuseMgtRslt dto);
int insertDsuseMgt(final BizNimsRequest.DsuseMgt dto); int insertDsuseMgt(final BizNimsDto.DsuseMgt dto);
int insertDsuseMgtDtl(final BizNimsRequest.DsuseMgtDtl dto); int insertDsuseMgtDtl(final BizNimsDto.DsuseMgtDtl dto);
List<BizNimsResponse.DsuseMgtRes> selectDsuseMgts(final BizNimsRequest.DsuseMgtInq dto); List<BizNimsResponse.DsuseMgtRes> selectDsuseMgts(final BizNimsRequest.DsuseMgtInq dto);
List<BizNimsResponse.DsuseMgtDtlRes> selectDsuseMgtDtls(final Map<String, String> map); List<BizNimsResponse.DsuseMgtDtlRes> selectDsuseMgtDtls(final Map<String, String> map);
int updateMappingDsuseMgt(final BizNimsResponse.DsuseMgtRes mgtDto); int updateMappingDsuseMgt(final BizNimsResponse.DsuseMgtRes mgtDto);
@ -59,7 +60,7 @@ public interface BizNimsMapper extends AbstractMapper {
int insertDsuseRptInfoDtl(final NimsApiDto.DsuseRptInfoDtl dto); int insertDsuseRptInfoDtl(final NimsApiDto.DsuseRptInfoDtl dto);
int updateCancelDsuseRptInfo(final NimsApiDto.DsuseRptInfo dto); int updateCancelDsuseRptInfo(final NimsApiDto.DsuseRptInfo dto);
int updateCancelDsuseRptInfoDtl(final NimsApiDto.DsuseRptInfo dto); int updateCancelDsuseRptInfoDtl(final NimsApiDto.DsuseRptInfo dto);
int updatePrgsSttsOfDsuseMgt(final BizNimsRequest.DsuseMgt dto); int updatePrgsSttsOfDsuseMgt(final BizNimsDto.DsuseMgt dto);
Map<String, String> recusiveRefUsrRptIdNo(final String refUsrRptIdNo); Map<String, String> recusiveRefUsrRptIdNo(final String refUsrRptIdNo);
/** /**
@ -76,7 +77,7 @@ public interface BizNimsMapper extends AbstractMapper {
//List<BizNimsResponse.DsuseRptInfoRes> selectSavedDsuseMgts(final List<String> dsuseMgtIds); //List<BizNimsResponse.DsuseRptInfoRes> selectSavedDsuseMgts(final List<String> dsuseMgtIds);
// int insertDsuseMgtDtl(BizNimsRequest.DsuseMgtDtl dto); // int insertDsuseMgtDtl(BizNimsDto.DsuseMgtDtl dto);
// int updateCancelDsuseMgtDtl(BizNimsRequest.DsuseMgt dto); // int updateCancelDsuseMgtDtl(BizNimsRequest.DsuseMgt dto);
// BizNimsAarDto.AarHeader selectTgtAarHeader(BizNimsRequest.DsuseMgt dto); // BizNimsAarDto.AarHeader selectTgtAarHeader(BizNimsRequest.DsuseMgt dto);

@ -0,0 +1,299 @@
package cokr.xit.adds.biz.nims.model;
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.*;
import java.util.ArrayList;
import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Positive;
import javax.validation.constraints.PositiveOrZero;
import com.fasterxml.jackson.annotation.JsonInclude;
import cokr.xit.adds.core.Constants;
import cokr.xit.adds.core.model.AuditDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
public class BizNimsDto {
/**
* request
*/
@Schema(name = "DsuseMgt", description = "마약류 폐기 관리 마스터 DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class DsuseMgt extends AuditDto {
/**
* ID
*/
@Schema(requiredMode = AUTO, title = "폐기 관리 ID", example = " ")
private String dscdmngId;
/**
* ID
*/
@Schema(requiredMode = REQUIRED, title = "사용자 ID", example = " ")
@NotEmpty(message = "사용자 ID는 필수 입니다")
private String userId;
/**
* <pre>
* - ADDS11
* 01-
* 06-
* 07-
* 11-
* 21-
* 99-
* </pre>
*/
@Schema(title = "폐기관리진행상태", example = " ")
@NotEmpty(message = "폐기관리진행상태는 필수 입니다")
private String prgrsSttsCd = Constants.PRGRS_STTS_CD.RECEIPT.getCode();
/**
*
*/
@Schema(title = "마약류취급자식별번호", example = " ")
@NotEmpty(message = "마약류취급자식별번호는 필수 입니다")
private String bsshCd;
/**
*
*/
@Schema(title = "수불상세보고수", example = " ")
private Integer rndDtlRptCnt;
/**
* - ()
*/
@Schema(title = "취급일자", example = " ")
@Pattern(regexp = Constants.DATE_REGX, message = "취급일자를 정확히 입력해 주세요(yyyyMMdd)")
private String hdrDe;
// /**
// * 보고일자
// */
// @Schema(title = "보고일자", example = " ")
// @Pattern(regexp = Constants.DATE_REGX, message = "보고일자를 정확히 입력해 주세요(yyyyMMdd)")
// private String rptDe;
/**
* <pre>
*
* 1-, 2-, 4-//
* </pre>
*/
@Schema(title = "폐기 구분 코드", example = " ")
@NotEmpty(message = "폐기 구분 코드는 필수 입니다")
private String dsuseSeCd;
/**
* <pre>
*
* 01-, 02-,, 03-
* 04- , 05- , 07-, 08-
* 09-, 12-
* </pre>
*/
@Schema(title = "폐기 사유 코드", example = " ")
@NotEmpty(message = "폐기 사유 코드는 필수 입니다")
private String dsusePrvCd;
/**
* <pre>
*
* 1-, 2-, 3- , 4-, 5-
* 6-, 7-, 8-(,), 9-
* </pre>
*/
@Schema(title = "폐기 방법 코드", example = " ")
@NotEmpty(message = "폐기 방법 코드는 필수 입니다")
private String dsuseMthCd;
/**
*
*/
@Schema(title = "폐기 장소", example = " ")
@NotEmpty(message = "폐기 장소는 필수 입니다")
private String dsuseLoc;
/**
*
*/
@Schema(title = "폐기일자", example = " ")
@Pattern(regexp = Constants.DATE_REGX, message = "폐기일자를 정확히 입력해 주세요(yyyyMMdd)")
private String dsuseDe;
/**
* <pre>
*
* update
* </pre>
*/
@Schema(title = "사용자보고식별번호", example = " ")
private String usrRptIdNo;
/**
* <pre>
*
*
* > > >
* =>
* YYYYMMDD
* </pre>
*/
@Schema(title = "원사용자보고식별번호", example = " ")
private String orgUsrRptIdNo;
/**
* <pre>
*
* 0-, 1-, 2-
* </pre>
*/
@Schema(title = "폐기보고유형코드", example = " ")
private String rptTyCd;
/**
* <pre>
*
* </pre>
*/
@Schema(title = "폐기보고처리상태", example = " ")
private String stts;
@Schema(requiredMode = REQUIRED, description = "폐기 관리 상세 목록", example = " ")
@Builder.Default
@Valid
List<DsuseMgtDtl> dsuseMgtDtls = new ArrayList<>();
}
/**
* request
*/
@Schema(name = "DsuseMgtDtl", description = "마약류 폐기 관리 상세 DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class DsuseMgtDtl extends AuditDto {
/**
* ID
*/
@Schema(title = "폐기관리ID-업무의필요에의해추가", example = " ")
private String dscdmngId;
/**
*
*/
@Schema(title = "폐기관리순번-업무의필요에의해추가", example = " ")
private String dscdmngSn;
/**
* _ - 13
*/
@Schema(requiredMode = REQUIRED, title = "제품코드", example = "8806718050823")
@Pattern(regexp = "[0-9a-zA-Z]{13}", message = "제품코드는 13자리 입니다")
private String prductCd;
/**
*
*/
@Schema(requiredMode = REQUIRED, title = "제품명", example = "아쿠아폴주20밀리리터(프로포폴) (20㎖)")
@NotEmpty(message = "제품명은 필수 입니다")
private String prductNm;
/**
* : 1 ~
*/
@Schema(requiredMode = REQUIRED, title = "최소유통단위수량", example = "1")
@Positive(message="최소유통단위 수량을 입력해 주세요(ex. 1)")
private Integer minDistbQy;
/**
*
*/
@Schema(title = "최소유통단위", example = "1")
private String minDistbUnit;
/**
* : 0 ~
*/
@Schema(requiredMode = REQUIRED, title = "낱개단위수량", example = "0")
@PositiveOrZero(message = "낱개단위 수량은 필수 입니다(ex. 0)")
private Integer pceQy;
/**
*
*/
@Schema(title = "낱개단위", example = "1")
private String pceUnit;
/**
* - 20
*/
@Schema(requiredMode = REQUIRED, title = "제품제조번호", example = "A1111")
@Pattern(regexp = "[0-9a-zA-Z]{1,20}", message = "제품제조번호는 필수 입니다")
private String mnfNo;
/**
* - yyyyMMdd
*/
@Schema(requiredMode = REQUIRED, title = "제품유효기간", example = "20300303")
@Pattern(regexp = Constants.DATE_REGX, message = "제품 유효 기간을 정확히 입력해 주세요(yyyyMMdd)")
private String prdValidDe;
/**
* - 20
*/
@Schema(requiredMode = REQUIRED, title = "제조일련번호", example = "A11111111")
@Pattern(regexp = "[0-9a-zA-Z]{1,20}", message = "제조 일련번호는 필수 입니다")
private String mnfSeq;
/**
*
*/
@Schema(requiredMode = REQUIRED, title = "폐기수량", example = "2")
@Positive(message = "폐기 수량은 0보다 커야 합니다")
private Integer dsuseQy;
@Schema(title = "폐기제품이미지파일ID", example = " ")
private String fileId;
/**
*
*/
@Schema(title = "사용자보고식별번호", example = " ")
private String usrRptIdNo;
/**
*
*/
@Schema(title = "사용자보고라인식별번호", example = " ")
private String usrRptLnIdNo;
/**
* <pre>
* ()
* -> "Y"
* </pre>
*/
@Schema(title = "폐기관리상세와 폐기보고정보 상세의 폐기 정보(상품) 일치 여부", example = " ")
private String matchYn;
}
}

@ -2,17 +2,13 @@ package cokr.xit.adds.biz.nims.model;
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.*; import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.*;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern; import javax.validation.constraints.Pattern;
import javax.validation.constraints.Positive; import javax.validation.constraints.Positive;
import javax.validation.constraints.PositiveOrZero;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import cokr.xit.adds.core.Constants; import cokr.xit.adds.core.Constants;
import cokr.xit.adds.core.model.AuditDto; import cokr.xit.adds.core.model.AuditDto;
@ -44,7 +40,6 @@ public class BizNimsRequest {
*/ */
@Schema(name = "DsuseMgtReceipt", description = "마약류 폐기 관리 신청서 접수 DTO") @Schema(name = "DsuseMgtReceipt", description = "마약류 폐기 관리 신청서 접수 DTO")
@Getter @Getter
//@Setter
@NoArgsConstructor @NoArgsConstructor
@SuperBuilder @SuperBuilder
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@ -198,349 +193,15 @@ public class BizNimsRequest {
private String dsuseDe; private String dsuseDe;
} }
/**
* request
*/
@Schema(name = "DsuseMgt", description = "마약류 폐기 관리 마스터 DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class DsuseMgt extends AuditDto {
/**
* ID
*/
@Schema(requiredMode = AUTO, title = "폐기 관리 ID", example = " ")
private String dscdmngId;
/**
* ID
*/
@Schema(requiredMode = REQUIRED, title = "사용자 ID", example = " ")
@NotEmpty(message = "사용자 ID는 필수 입니다")
private String userId;
/**
* <pre>
* - ADDS11
* 01-
* 06-
* 07-
* 11-
* 21-
* 99-
* </pre>
*/
@Schema(title = "폐기관리진행상태", example = " ")
@NotEmpty(message = "폐기관리진행상태는 필수 입니다")
private String prgrsSttsCd = Constants.PRGRS_STTS_CD.RECEIPT.getCode();
/**
*
*/
@Schema(title = "마약류취급자식별번호", example = " ")
@NotEmpty(message = "마약류취급자식별번호는 필수 입니다")
private String bsshCd;
/**
*
*/
@Schema(title = "수불상세보고수", example = " ")
private Integer rndDtlRptCnt;
/**
* - ()
*/
@Schema(title = "취급일자", example = " ")
@Pattern(regexp = Constants.DATE_REGX, message = "취급일자를 정확히 입력해 주세요(yyyyMMdd)")
private String hdrDe;
// /**
// * 보고일자
// */
// @Schema(title = "보고일자", example = " ")
// @Pattern(regexp = Constants.DATE_REGX, message = "보고일자를 정확히 입력해 주세요(yyyyMMdd)")
// private String rptDe;
/**
* <pre>
*
* 1-, 2-, 4-//
* </pre>
*/
@Schema(title = "폐기 구분 코드", example = " ")
@NotEmpty(message = "폐기 구분 코드는 필수 입니다")
private String dsuseSeCd;
/**
* <pre>
*
* 01-, 02-,, 03-
* 04- , 05- , 07-, 08-
* 09-, 12-
* </pre>
*/
@Schema(title = "폐기 사유 코드", example = " ")
@NotEmpty(message = "폐기 사유 코드는 필수 입니다")
private String dsusePrvCd;
/**
* <pre>
*
* 1-, 2-, 3- , 4-, 5-
* 6-, 7-, 8-(,), 9-
* </pre>
*/
@Schema(title = "폐기 방법 코드", example = " ")
@NotEmpty(message = "폐기 방법 코드는 필수 입니다")
private String dsuseMthCd;
/**
*
*/
@Schema(title = "폐기 장소", example = " ")
@NotEmpty(message = "폐기 장소는 필수 입니다")
private String dsuseLoc;
/**
*
*/
@Schema(title = "폐기일자", example = " ")
@Pattern(regexp = Constants.DATE_REGX, message = "폐기일자를 정확히 입력해 주세요(yyyyMMdd)")
private String dsuseDe;
/**
* <pre>
*
* update
* </pre>
*/
@Schema(title = "사용자보고식별번호", example = " ")
private String usrRptIdNo;
/**
* <pre>
*
*
* > > >
* =>
* YYYYMMDD
* </pre>
*/
@Schema(title = "원사용자보고식별번호", example = " ")
private String orgUsrRptIdNo;
/**
* <pre>
*
* 0-, 1-, 2-
* </pre>
*/
@Schema(title = "폐기보고유형코드", example = " ")
private String rptTyCd;
/**
* <pre>
*
* </pre>
*/
@Schema(title = "폐기보고처리상태", example = " ")
private String stts;
@Schema(requiredMode = REQUIRED, description = "폐기 관리 상세 목록", example = " ")
@Builder.Default
@Valid
List<DsuseMgtDtl> dsuseMgtDtls = new ArrayList<>();
}
/**
* request
*/
@Schema(name = "DsuseMgt", description = "마약류 폐기 관리 마스터 DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@EqualsAndHashCode(callSuper = false)
public static class DsuseMgt2 extends AuditDto {
@Schema(requiredMode = AUTO, title = "폐기 관리 ID", example = " ")
private String dscdmngId;
@Schema(requiredMode = REQUIRED, title = "사용자 ID", example = " ")
@NotEmpty(message = "사용자 ID는 필수 입니다")
private String userId;
/**
* <pre>
*
*
* > > >
* =>
* YYYYMMDD
* </pre>
*/
@Schema(requiredMode = REQUIRED, title = "원사용자보고식별번호", example = " ")
private String orgUsrRptIdNo;
/**
* <pre>
*
* update
* </pre>
*/
@Schema(requiredMode = REQUIRED, title = "사용자보고식별번호", example = " ")
private String usrRptIdNo;
/**
*
*/
@JsonProperty(value = "BSSH_CD", required = true)
private String bsshCd;
/**
* <pre>
* - ADDS11
* 01-
* 06-
* 07-
* 11-
* 21-
* 99-
* </pre>
*/
@Schema(requiredMode = REQUIRED, title = "진행 상태 코드", example = " ", allowableValues = {"01", "02", "11", "21", "22", "31", "41", "99"})
@Pattern(regexp = "01|02|11|22|31|41|99", message = "진행 상태 코드는 필수 입니다")
private String prgrsSttsCd = Constants.PRGRS_STTS_CD.RECEIPT.getCode();
}
/**
* request
*/
@Schema(name = "DsuseMgtDtl", description = "마약류 폐기 관리 상세 DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class DsuseMgtDtl extends AuditDto {
/**
* ID
*/
@Schema(title = "폐기관리ID-업무의필요에의해추가", example = " ")
private String dscdmngId;
/**
*
*/
@Schema(title = "폐기관리순번-업무의필요에의해추가", example = " ")
private String dscdmngSn;
/**
* _ - 13
*/
@Schema(requiredMode = REQUIRED, title = "제품코드", example = "8806718050823")
@Pattern(regexp = "[0-9a-zA-Z]{13}", message = "제품코드는 13자리 입니다")
private String prductCd;
/**
*
*/
@Schema(requiredMode = REQUIRED, title = "제품명", example = "아쿠아폴주20밀리리터(프로포폴) (20㎖)")
@NotEmpty(message = "제품명은 필수 입니다")
private String prductNm;
/**
* : 1 ~
*/
@Schema(requiredMode = REQUIRED, title = "최소유통단위수량", example = "1")
@Positive(message="최소유통단위 수량을 입력해 주세요(ex. 1)")
private Integer minDistbQy;
/**
*
*/
@Schema(title = "최소유통단위", example = "1")
private String minDistbUnit;
/**
* : 0 ~
*/
@Schema(requiredMode = REQUIRED, title = "낱개단위수량", example = "0")
@PositiveOrZero(message = "낱개단위 수량은 필수 입니다(ex. 0)")
private Integer pceQy;
/**
*
*/
@Schema(title = "낱개단위", example = "1")
private String pceUnit;
/**
* - 20
*/
@Schema(requiredMode = REQUIRED, title = "제품제조번호", example = "A1111")
@Pattern(regexp = "[0-9a-zA-Z]{1,20}", message = "제품제조번호는 필수 입니다")
private String mnfNo;
/**
* - yyyyMMdd
*/
@Schema(requiredMode = REQUIRED, title = "제품유효기간", example = "20300303")
@Pattern(regexp = Constants.DATE_REGX, message = "제품 유효 기간을 정확히 입력해 주세요(yyyyMMdd)")
private String prdValidDe;
/**
* - 20
*/
@Schema(requiredMode = REQUIRED, title = "제조일련번호", example = "A11111111")
@Pattern(regexp = "[0-9a-zA-Z]{1,20}", message = "제조 일련번호는 필수 입니다")
private String mnfSeq;
/**
*
*/
@Schema(requiredMode = REQUIRED, title = "폐기수량", example = "2")
@Positive(message = "폐기 수량은 0보다 커야 합니다")
private Integer dsuseQy;
@Schema(title = "폐기제품이미지파일ID", example = " ")
private String fileId;
/**
*
*/
@Schema(title = "사용자보고식별번호", example = " ")
private String usrRptIdNo;
/**
*
*/
@Schema(title = "사용자보고라인식별번호", example = " ")
private String usrRptLnIdNo;
/**
* <pre>
* ()
* -> "Y"
* </pre>
*/
@Schema(title = "데이타유효성체크-업무의필요에의해추가", example = " ")
private String validYn;
}
/** /**
* request * request
*/ */
@Schema(name = "DsuseMgtInq", description = "마약류 폐기 관리 조회 DTO") @Schema(name = "DsuseMgtInq", description = "마약류 폐기 관리 조회 DTO")
@Data @Getter
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@SuperBuilder
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
@Builder
public static class DsuseMgtInq { public static class DsuseMgtInq {
@Schema(requiredMode = AUTO, title = "폐기 관리 ID 목록", example = "[\"2024060001\", \"2024060002\"]") @Schema(requiredMode = AUTO, title = "폐기 관리 ID 목록", example = "[\"2024060001\", \"2024060002\"]")
private List<String> dscdmngIds; private List<String> dscdmngIds;
@ -576,35 +237,22 @@ public class BizNimsRequest {
@Schema(requiredMode = REQUIRED, title = "진행 상태 코드", example = " ", allowableValues = {"01", "02", "11", "21", "22", "31", "41", "99"}) @Schema(requiredMode = REQUIRED, title = "진행 상태 코드", example = " ", allowableValues = {"01", "02", "11", "21", "22", "31", "41", "99"})
private String prgrsSttsCd = Constants.PRGRS_STTS_CD.RECEIPT.getCode(); private String prgrsSttsCd = Constants.PRGRS_STTS_CD.RECEIPT.getCode();
} }
/** /**
* request * request
*/ */
// @Schema(name = "DsuseMgtDtl", description = "마약류 폐기 관리 상세 DTO") @Schema(name = "DsuseRptMappingInq", description = "폐기 보고 확인 request DTO")
// @Data @Getter
// @NoArgsConstructor @NoArgsConstructor
// @AllArgsConstructor @AllArgsConstructor
// @SuperBuilder @JsonInclude(JsonInclude.Include.NON_NULL)
// @EqualsAndHashCode(callSuper = false) public static class DsuseRptMappingInq {
// public static class DsuseMgtDtl extends NimsApiDto.DsuseRptInfoDtl { @Schema(requiredMode = REQUIRED, title = "폐기 관리 ID", example = "2024060002")
// @Schema(requiredMode = AUTO, title = "폐기 관리 ID", example = " ") @NotEmpty(message = "폐기관리 ID는 필수 입니다")
// private String dscdmngId; private String dscdmngId;
//
// @JsonIgnore @Schema(requiredMode = REQUIRED, title = "사용자 ID", example = "suji")
// @Builder.Default @NotEmpty(message = "사용자 ID는 필수 입니다")
// private String useYn = "Y"; private String userId;
// }
// @JsonIgnore
// private String regDt;
//
// @JsonIgnore
// @Setter
// private String rgtr;
//
// @JsonIgnore
// private String mdfcnDt;
//
// @JsonIgnore
// @Setter
// private String mdfr;
// }
} }

@ -37,7 +37,7 @@ public class BizNimsResponse {
@AllArgsConstructor @AllArgsConstructor
@SuperBuilder @SuperBuilder
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public static class DsuseMgtRes extends BizNimsRequest.DsuseMgt { public static class DsuseMgtRes extends BizNimsDto.DsuseMgt {
private String dsuseSeCdNm; private String dsuseSeCdNm;
private String dsusePrvCdNm; private String dsusePrvCdNm;
@ -66,7 +66,7 @@ public class BizNimsResponse {
@AllArgsConstructor @AllArgsConstructor
@SuperBuilder @SuperBuilder
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public static class DsuseMgtDtlRes extends BizNimsRequest.DsuseMgtDtl { public static class DsuseMgtDtlRes extends BizNimsDto.DsuseMgtDtl {
/** /**
* *

@ -4,6 +4,7 @@ import java.util.List;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import cokr.xit.adds.biz.nims.model.BizNimsDto;
import cokr.xit.adds.biz.nims.model.BizNimsRequest; import cokr.xit.adds.biz.nims.model.BizNimsRequest;
import cokr.xit.adds.biz.nims.model.BizNimsResponse; import cokr.xit.adds.biz.nims.model.BizNimsResponse;
import cokr.xit.adds.inf.nims.model.NimsApiDto; import cokr.xit.adds.inf.nims.model.NimsApiDto;
@ -56,15 +57,16 @@ public interface BizNimsService {
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
// NIMS BIZ // NIMS BIZ
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
BizNimsRequest.DsuseMgtReceipt saveDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceipt dto, final List<BizNimsRequest.DsuseMgtDtl> dtls, List<MultipartFile> files); BizNimsRequest.DsuseMgtReceipt saveDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceipt dto, final List<BizNimsDto.DsuseMgtDtl> dtls, List<MultipartFile> files);
BizNimsRequest.DsuseMgtRslt saveDsuseMgtRslt(final BizNimsRequest.DsuseMgtRslt dto, List<MultipartFile> files); BizNimsRequest.DsuseMgtRslt saveDsuseMgtRslt(final BizNimsRequest.DsuseMgtRslt dto, List<MultipartFile> files);
BizNimsRequest.DsuseMgt saveDsuseMgt(final BizNimsRequest.DsuseMgt dto);
List<BizNimsResponse.DsuseMgtRes> getDsuseMgts(final BizNimsRequest.DsuseMgtInq dto, final boolean isForDoc); List<BizNimsResponse.DsuseMgtRes> getDsuseMgts(final BizNimsRequest.DsuseMgtInq dto, final boolean isForDoc);
void modifyPrgsSttsOfDsuseMgt(final BizNimsRequest.DsuseMgt dto); void modifyPrgsSttsOfDsuseMgt(final BizNimsDto.DsuseMgt dto);
NimsApiDto.ProductInfoKd getPrdMnfSeqInfoOfBarcode(final String barcodeStr); NimsApiDto.ProductInfoKd getPrdMnfSeqInfoOfBarcode(final String barcodeStr);
List<NimsApiDto.DsuseRptInfo> getDsuseMgtMapping(final BizNimsRequest.DsuseMgt dto); List<NimsApiDto.DsuseRptInfo> getDsuseMgtMapping(final BizNimsRequest.DsuseRptMappingInq reqDto);
// @Deprecated
// BizNimsDto.DsuseMgt saveDsuseMgt(final BizNimsDto.DsuseMgt dto);
// @Deprecated // @Deprecated
// List<BizNimsResponse.DsuseRptInfoResponse> saveDsuseMgts(List<BizNimsRequest.DsuseMgt> dtos); // List<BizNimsResponse.DsuseRptInfoResponse> saveDsuseMgts(List<BizNimsRequest.DsuseMgt> dtos);

@ -15,6 +15,7 @@ import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import cokr.xit.adds.biz.nims.dao.BizNimsMapper; import cokr.xit.adds.biz.nims.dao.BizNimsMapper;
import cokr.xit.adds.biz.nims.model.BizNimsDto;
import cokr.xit.adds.biz.nims.model.BizNimsRequest; import cokr.xit.adds.biz.nims.model.BizNimsRequest;
import cokr.xit.adds.biz.nims.model.BizNimsResponse; import cokr.xit.adds.biz.nims.model.BizNimsResponse;
import cokr.xit.adds.biz.nims.service.BizNimsService; import cokr.xit.adds.biz.nims.service.BizNimsService;
@ -231,8 +232,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
@Override @Override
public List<NimsApiDto.DsuseRptInfo> saveDsuseRptInfo(NimsApiRequest.DsuseRptInfoReq reqDto) { public List<NimsApiDto.DsuseRptInfo> saveDsuseRptInfo(NimsApiRequest.DsuseRptInfoReq reqDto) {
List<NimsApiDto.DsuseRptInfo> nimsList = new ArrayList<>(); ApiUtil.validate(reqDto, null, validator);
Map<String, String> apiInfInfo = getApiInfInfo(reqDto.getUserId()); Map<String, String> apiInfInfo = getApiInfInfo(reqDto.getUserId());
reqDto.setK(apiInfInfo.get("apiKey")); reqDto.setK(apiInfInfo.get("apiKey"));
reqDto.setGc(apiInfInfo.get("deptCd")); // 관할관청코드 reqDto.setGc(apiInfInfo.get("deptCd")); // 관할관청코드
@ -251,10 +251,10 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
* <pre> * <pre>
* *
* @param reqDto BizNimsRequest.DsuseMgtReceipt * @param reqDto BizNimsRequest.DsuseMgtReceipt
* @return BizNimsRequest.DsuseMgt * @return BizNimsRequest.DsuseMgtReceipt
* </pre> * </pre>
*/ */
public BizNimsRequest.DsuseMgtReceipt saveDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceipt reqDto, final List<BizNimsRequest.DsuseMgtDtl> dtls, final List<MultipartFile> files) { public BizNimsRequest.DsuseMgtReceipt saveDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceipt reqDto, final List<BizNimsDto.DsuseMgtDtl> dtls, final List<MultipartFile> files) {
ApiUtil.validate(reqDto, null, validator); ApiUtil.validate(reqDto, null, validator);
if(reqDto.getRndDtlRptCnt() != dtls.size()) throw ApiCustomException.create("폐기물 보고수 오류[폐기물 갯수 확인]"); if(reqDto.getRndDtlRptCnt() != dtls.size()) throw ApiCustomException.create("폐기물 보고수 오류[폐기물 갯수 확인]");
ApiUtil.validate(dtls, null, validator); ApiUtil.validate(dtls, null, validator);
@ -264,7 +264,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
if(bizNimsMapper.insertDsuseMgtReceipt(reqDto) == 1){ if(bizNimsMapper.insertDsuseMgtReceipt(reqDto) == 1){
int dtlCnt = 0; int dtlCnt = 0;
for (BizNimsRequest.DsuseMgtDtl d : dtls) { for (BizNimsDto.DsuseMgtDtl d : dtls) {
String sn = StringUtils.leftPad(dtlCnt + 1 + "", 3, "0"); String sn = StringUtils.leftPad(dtlCnt + 1 + "", 3, "0");
d.setDscdmngId(reqDto.getDscdmngId()); d.setDscdmngId(reqDto.getDscdmngId());
d.setDscdmngSn(sn); d.setDscdmngSn(sn);
@ -283,8 +283,8 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
/** /**
* <pre> * <pre>
* [] * []
* @param reqDto BizNimsRequest.DsuseMgtReceipt * @param reqDto BizNimsRequest.DsuseMgtRslt
* @return BizNimsRequest.DsuseMgt * @return BizNimsRequest.DsuseMgtRslt
* </pre> * </pre>
*/ */
public BizNimsRequest.DsuseMgtRslt saveDsuseMgtRslt(final BizNimsRequest.DsuseMgtRslt reqDto, final List<MultipartFile> files) { public BizNimsRequest.DsuseMgtRslt saveDsuseMgtRslt(final BizNimsRequest.DsuseMgtRslt reqDto, final List<MultipartFile> files) {
@ -312,25 +312,25 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
* </pre> * </pre>
*/ */
// FIXME: 현재 미사용 // FIXME: 현재 미사용
public BizNimsRequest.DsuseMgt saveDsuseMgt(BizNimsRequest.DsuseMgt reqDto) { // public BizNimsDto.DsuseMgt saveDsuseMgt(BizNimsDto.DsuseMgt reqDto) {
ApiUtil.validate(reqDto, null, validator); // ApiUtil.validate(reqDto, null, validator);
if(reqDto.getRndDtlRptCnt() != reqDto.getDsuseMgtDtls().size()) throw ApiCustomException.create("폐기물 보고수 오류[폐기물 갯수 확인]"); // if(reqDto.getRndDtlRptCnt() != reqDto.getDsuseMgtDtls().size()) throw ApiCustomException.create("폐기물 보고수 오류[폐기물 갯수 확인]");
reqDto.setRgtr(reqDto.getUserId()); // reqDto.setRgtr(reqDto.getUserId());
//
if(bizNimsMapper.insertDsuseMgt(reqDto) == 1){ // if(bizNimsMapper.insertDsuseMgt(reqDto) == 1){
int dtlCnt = 0; // int dtlCnt = 0;
for (BizNimsRequest.DsuseMgtDtl d : reqDto.getDsuseMgtDtls()) { // for (BizNimsDto.DsuseMgtDtl d : reqDto.getDsuseMgtDtls()) {
d.setDscdmngId(reqDto.getDscdmngId()); // d.setDscdmngId(reqDto.getDscdmngId());
d.setDscdmngSn(StringUtils.leftPad(dtlCnt + 1 + "", 3, "0")); // d.setDscdmngSn(StringUtils.leftPad(dtlCnt + 1 + "", 3, "0"));
d.setRgtr(reqDto.getUserId()); // d.setRgtr(reqDto.getUserId());
dtlCnt = dtlCnt + bizNimsMapper.insertDsuseMgtDtl(d); // dtlCnt = dtlCnt + bizNimsMapper.insertDsuseMgtDtl(d);
} // }
if(reqDto.getDsuseMgtDtls().size() != dtlCnt) throw ApiCustomException.create("폐기 관리 상세 등록 실패"); // if(reqDto.getDsuseMgtDtls().size() != dtlCnt) throw ApiCustomException.create("폐기 관리 상세 등록 실패");
} else { // } else {
throw ApiCustomException.create("폐기 관리 마스터 등록 실패"); // throw ApiCustomException.create("폐기 관리 마스터 등록 실패");
} // }
return reqDto; // return reqDto;
} // }
/** /**
* <pre> * <pre>
@ -379,7 +379,8 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
// FIXME: API 적용 필요 - nims API 확정후 // FIXME: API 적용 필요 - nims API 확정후
// FIXME: saveDsuseRptInfo() 메소드를 활용할 수 있도록 구성 // FIXME: saveDsuseRptInfo() 메소드를 활용할 수 있도록 구성
@Override @Override
public List<NimsApiDto.DsuseRptInfo> getDsuseMgtMapping(BizNimsRequest.DsuseMgt reqDto) { public List<NimsApiDto.DsuseRptInfo> getDsuseMgtMapping(BizNimsRequest.DsuseRptMappingInq reqDto) {
ApiUtil.validate(reqDto, null, validator);
Map<String, String> apiInfInfo = getApiInfInfo(reqDto.getUserId()); Map<String, String> apiInfInfo = getApiInfInfo(reqDto.getUserId());
// 0. GET 폐기관리 데이타 정보 // 0. GET 폐기관리 데이타 정보
@ -424,10 +425,17 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
} }
@Override @Override
public void modifyPrgsSttsOfDsuseMgt(BizNimsRequest.DsuseMgt dto) { public void modifyPrgsSttsOfDsuseMgt(BizNimsDto.DsuseMgt reqDto) {
dto.setRgtr(dto.getUserId()); ApiUtil.validate(reqDto, null, validator);
if(bizNimsMapper.updatePrgsSttsOfDsuseMgt(dto) != 1){ reqDto.setRgtr(reqDto.getUserId());
throw ApiCustomException.create(String.format("폐기 관리 상태 변경[%s->%s] 실패",dto.getDscdmngId(), Constants.PRGRS_STTS_CD.getName(dto.getPrgrsSttsCd()))); if(bizNimsMapper.updatePrgsSttsOfDsuseMgt(reqDto) != 1){
throw ApiCustomException.create(
String.format(
"폐기 관리 상태 변경[%s->%s] 실패",
reqDto.getDscdmngId(),
Constants.PRGRS_STTS_CD.getName(reqDto.getPrgrsSttsCd())
)
);
} }
} }
@ -581,7 +589,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
* 6. return List - * 6. return List -
* @param reqDto NimsApiRequest.DsuseRptInfoReq * @param reqDto NimsApiRequest.DsuseRptInfoReq
* @param List<NimsApiDto.DsuseRptInfo> * @return List<NimsApiDto.DsuseRptInfo>
* </pre> * </pre>
*/ */
private List<NimsApiDto.DsuseRptInfo> saveFromfindDsuseRptDataByNimsApi(NimsApiRequest.DsuseRptInfoReq reqDto) { private List<NimsApiDto.DsuseRptInfo> saveFromfindDsuseRptDataByNimsApi(NimsApiRequest.DsuseRptInfoReq reqDto) {

@ -15,6 +15,7 @@ import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import cokr.xit.adds.biz.nims.model.BizNimsDto;
import cokr.xit.adds.biz.nims.model.BizNimsRequest; import cokr.xit.adds.biz.nims.model.BizNimsRequest;
import cokr.xit.adds.biz.nims.model.BizNimsResponse; import cokr.xit.adds.biz.nims.model.BizNimsResponse;
import cokr.xit.adds.biz.nims.service.BizNimsService; import cokr.xit.adds.biz.nims.service.BizNimsService;
@ -94,7 +95,7 @@ public class BizNimsController {
return ApiBaseResponse.of(bizNimsService.getJurisdictionGovInfo(dto)); return ApiBaseResponse.of(bizNimsService.getJurisdictionGovInfo(dto));
} }
@Operation(summary = "폐기 보고 정보 목록 조회(NIMS API)", description = "업체의 폐기 보고 정보 목록 조회<br><br>NIMS API 호출 결과를 DB에 저장후 Return") @Operation(summary = "폐기 보고 조회(NIMS API 폐기보고 조회)", description = "업체의 폐기 보고 정보 목록 조회<br><br>NIMS API 호출 결과를 DB에 저장후 Return")
@PostMapping("/getDsuseRptInfo") @PostMapping("/getDsuseRptInfo")
public ApiBaseResponse<List<NimsApiDto.DsuseRptInfo>> getDsuseRptInfo( public ApiBaseResponse<List<NimsApiDto.DsuseRptInfo>> getDsuseRptInfo(
@RequestBody NimsApiRequest.DsuseRptInfoReq dto @RequestBody NimsApiRequest.DsuseRptInfoReq dto
@ -122,7 +123,7 @@ public class BizNimsController {
) { ) {
JSON json = new JSON(); JSON json = new JSON();
BizNimsRequest.DsuseMgtReceipt receiptDto = json.parse(dsuseMgtJsonStr, new TypeReference<>() {}); BizNimsRequest.DsuseMgtReceipt receiptDto = json.parse(dsuseMgtJsonStr, new TypeReference<>() {});
List<BizNimsRequest.DsuseMgtDtl> dsuseMgtDtls = json.parse(dsuseMgtDtlsJsonStr, new TypeReference<>() {}); List<BizNimsDto.DsuseMgtDtl> dsuseMgtDtls = json.parse(dsuseMgtDtlsJsonStr, new TypeReference<>() {});
return ApiBaseResponse.of(bizNimsService.saveDsuseMgtReceipt(receiptDto, dsuseMgtDtls, dsusePrdImgFiles)); return ApiBaseResponse.of(bizNimsService.saveDsuseMgtReceipt(receiptDto, dsuseMgtDtls, dsusePrdImgFiles));
} }
@ -185,16 +186,16 @@ public class BizNimsController {
// }) // })
// }) // })
// @PostMapping("/saveDsuseMgt") // @PostMapping("/saveDsuseMgt")
// public ApiBaseResponse<BizNimsRequest.DsuseMgt> saveDsuseMgt( // public ApiBaseResponse<BizNimsDto.DsuseMgt> saveDsuseMgt(
// @RequestBody BizNimsRequest.DsuseMgt dto // @RequestBody BizNimsDto.DsuseMgt dto
// ) { // ) {
// return ApiBaseResponse.of(bizNimsService.saveDsuseMgt(dto)); // return ApiBaseResponse.of(bizNimsService.saveDsuseMgt(dto));
// } // }
@Operation(summary = "폐기 보고 확인(폐기관리 데이타에 대한 폐기보고 매핑)", description = "폐기 보고 확인(폐기관리 데이타에 대한 폐기보고 매핑)<br><br>폐기 관리 데이터에 대한 폐기보고 매핑 대상 데이타 조회 return") @Operation(summary = "폐기 보고 확인(폐기관리 데이타에 대한 폐기보고 매핑)", description = "폐기 보고 확인(폐기관리 데이타에 대한 폐기보고 매핑)<br><br>폐기 관리 데이터에 대한 폐기보고 매핑 대상 데이타 조회 return<br><br>NIMS API 호출 결과를 DB에 저장")
@PostMapping("/getDsuseMgtMapping") @PostMapping("/getDsuseMgtMapping")
public ApiBaseResponse<List<NimsApiDto.DsuseRptInfo>> getDsuseMgtMapping( public ApiBaseResponse<List<NimsApiDto.DsuseRptInfo>> getDsuseMgtMapping(
@RequestBody BizNimsRequest.DsuseMgt dto @RequestBody BizNimsRequest.DsuseRptMappingInq dto
) { ) {
return ApiBaseResponse.of(bizNimsService.getDsuseMgtMapping(dto)); return ApiBaseResponse.of(bizNimsService.getDsuseMgtMapping(dto));
} }
@ -223,7 +224,7 @@ public class BizNimsController {
}) })
}) })
@PutMapping(value = "/modifyPrgsSttsOfDsuseMgt") @PutMapping(value = "/modifyPrgsSttsOfDsuseMgt")
public ApiBaseResponse<Void> modifyPrgsSttsOfDsuseMgt(@RequestBody final BizNimsRequest.DsuseMgt dto) { public ApiBaseResponse<Void> modifyPrgsSttsOfDsuseMgt(@RequestBody final BizNimsDto.DsuseMgt dto) {
bizNimsService.modifyPrgsSttsOfDsuseMgt(dto); bizNimsService.modifyPrgsSttsOfDsuseMgt(dto);
return ApiBaseResponse.of(); return ApiBaseResponse.of();
} }

@ -6,9 +6,6 @@ import java.util.List;
import javax.validation.Valid; import javax.validation.Valid;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonGenerator;
@ -16,7 +13,7 @@ import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import cokr.xit.adds.biz.nims.model.BizNimsRequest; import cokr.xit.adds.biz.nims.model.BizNimsDto;
import cokr.xit.adds.biz.nims.model.BizNimsResponse; import cokr.xit.adds.biz.nims.model.BizNimsResponse;
import cokr.xit.adds.core.Constants; import cokr.xit.adds.core.Constants;
import cokr.xit.adds.core.model.AuditDto; import cokr.xit.adds.core.model.AuditDto;
@ -442,6 +439,7 @@ public class NimsApiDto {
* @return List<BizNimsResponse.DsuseMgtRes> * @return List<BizNimsResponse.DsuseMgtRes>
* </pre> * </pre>
*/ */
/*
@JsonIgnore @JsonIgnore
public List<BizNimsResponse.DsuseMgtRes> mappingNewDsuseRptInfos(List<BizNimsResponse.DsuseMgtRes> dsuseMgts){ public List<BizNimsResponse.DsuseMgtRes> mappingNewDsuseRptInfos(List<BizNimsResponse.DsuseMgtRes> dsuseMgts){
List<BizNimsResponse.DsuseMgtRes> newList = new ArrayList<>(); List<BizNimsResponse.DsuseMgtRes> newList = new ArrayList<>();
@ -454,6 +452,7 @@ public class NimsApiDto {
} }
return newList; return newList;
} }
*/
/** /**
* <pre> * <pre>
@ -500,13 +499,13 @@ public class NimsApiDto {
if (rptInfoStr.equals(mgtInfoStr)) { if (rptInfoStr.equals(mgtInfoStr)) {
if (this.listDtl.size() == mgtDto.getDsuseMgtDtls().size()) { if (this.listDtl.size() == mgtDto.getDsuseMgtDtls().size()) {
for (DsuseRptInfoDtl rptDtl : this.listDtl) { for (DsuseRptInfoDtl rptDtl : this.listDtl) {
for (BizNimsRequest.DsuseMgtDtl mgtDtl : mgtDto.getDsuseMgtDtls()) { for (BizNimsDto.DsuseMgtDtl mgtDtl : mgtDto.getDsuseMgtDtls()) {
if (rptDtl.getPrductCd().equals(mgtDtl.getPrductCd()) if (rptDtl.getPrductCd().equals(mgtDtl.getPrductCd())
&& rptDtl.getMnfNo().equals(mgtDtl.getMnfNo()) && rptDtl.getMnfNo().equals(mgtDtl.getMnfNo())
&& rptDtl.getPrdValidDe().equals(mgtDtl.getPrdValidDe()) && rptDtl.getPrdValidDe().equals(mgtDtl.getPrdValidDe())
&& rptDtl.getMnfSeq().equals(mgtDtl.getMnfSeq()) && rptDtl.getMnfSeq().equals(mgtDtl.getMnfSeq())
&& rptDtl.getDsuseQy().equals(mgtDtl.getDsuseQy())) { && rptDtl.getDsuseQy().equals(mgtDtl.getDsuseQy())) {
mgtDtl.setValidYn("Y"); rptDtl.setMatchYn("Y");
break; break;
} }
} }
@ -539,6 +538,7 @@ public class NimsApiDto {
* @return List<BizNimsResponse.DsuseMgtRes> * @return List<BizNimsResponse.DsuseMgtRes>
* </pre> * </pre>
*/ */
/*
@JsonIgnore @JsonIgnore
public List<BizNimsResponse.DsuseMgtRes> mappingDsuseRptInfo(List<BizNimsResponse.DsuseMgtRes> dsuseMgts){ public List<BizNimsResponse.DsuseMgtRes> mappingDsuseRptInfo(List<BizNimsResponse.DsuseMgtRes> dsuseMgts){
List<BizNimsResponse.DsuseMgtRes> newList = new ArrayList<>(); List<BizNimsResponse.DsuseMgtRes> newList = new ArrayList<>();
@ -563,13 +563,13 @@ public class NimsApiDto {
// FIXME: 상품정보 미일치 여부 set - 비교 필드 확정 필요 // FIXME: 상품정보 미일치 여부 set - 비교 필드 확정 필요
if (this.listDtl.size() == mgtDto.getDsuseMgtDtls().size()) { if (this.listDtl.size() == mgtDto.getDsuseMgtDtls().size()) {
for (DsuseRptInfoDtl rptDtl : this.listDtl) { for (DsuseRptInfoDtl rptDtl : this.listDtl) {
for (BizNimsRequest.DsuseMgtDtl mgtDtl : mgtDto.getDsuseMgtDtls()) { for (BizNimsDto.DsuseMgtDtl mgtDtl : mgtDto.getDsuseMgtDtls()) {
if (rptDtl.getPrductCd().equals(mgtDtl.getPrductCd()) if (rptDtl.getPrductCd().equals(mgtDtl.getPrductCd())
&& rptDtl.getMnfNo().equals(mgtDtl.getMnfNo()) && rptDtl.getMnfNo().equals(mgtDtl.getMnfNo())
&& rptDtl.getPrdValidDe().equals(mgtDtl.getPrdValidDe()) && rptDtl.getPrdValidDe().equals(mgtDtl.getPrdValidDe())
&& rptDtl.getMnfSeq().equals(mgtDtl.getMnfSeq()) && rptDtl.getMnfSeq().equals(mgtDtl.getMnfSeq())
&& rptDtl.getDsuseQy().equals(mgtDtl.getDsuseQy())) { && rptDtl.getDsuseQy().equals(mgtDtl.getDsuseQy())) {
mgtDtl.setValidYn("Y"); mgtDtl.setMatchYn("Y");
break; break;
} }
} }
@ -586,6 +586,7 @@ public class NimsApiDto {
} }
return newList; return newList;
} }
*/
} }
@Getter @Getter
@ -695,6 +696,14 @@ public class NimsApiDto {
* *
*/ */
private String bsshNm; private String bsshNm;
/**
* <pre>
* ()
* -> "Y"
* </pre>
*/
private String matchYn;
} }
/** /**

@ -1,6 +1,5 @@
package cokr.xit.adds.inf.nims.service.bean; package cokr.xit.adds.inf.nims.service.bean;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -205,81 +204,4 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe
NimsApiResult<NimsApiDto.DsuseRptInfo> result = json.parse(tmp, new TypeReference<>() {}); NimsApiResult<NimsApiDto.DsuseRptInfo> result = json.parse(tmp, new TypeReference<>() {});
return result.getResponse(); return result.getResponse();
} }
private NimsApiResult.Response<NimsApiDto.DsuseRptInfo> getDsuseRptResponse() {
//List<String> usrRptIdNoList = List.of("11111", "22222", "33333", "44444");
List<String> usrRptIdNoList = List.of("11111", "22222", "33333", "44444", "55555", "66666", "77777");
List<String> usrRptLnIdNoList = List.of("111111111", "222222222");
//List<String> rptTyCds = List.of("0", "0", "0", "0");
List<String> rptTyCds = List.of("0", "0", "1", "2", "0", "0", "2");
List<String> refUsrRptIdNos = List.of("11111", "22222", "44444");
List<NimsApiDto.DsuseRptInfo> dsuseRpts = new ArrayList<>();
int refIdx = 0;
for(int i = 0; i<usrRptIdNoList.size(); i++){
NimsApiDto.DsuseRptInfoDtl dtl1 = NimsApiDto.DsuseRptInfoDtl.builder()
.usrRptIdNo(usrRptIdNoList.get(i))
.usrRptLnIdNo(usrRptLnIdNoList.get(0)+i)
.prductCd("8806718050823")
.prductNm("아쿠아폴주20밀리리터(프로포폴) (20㎖)")
.minDistbQy(1)
.pceQy(5)
.mnfNo("123456")
.prdValidDe("99991231")
.mnfSeq("A0201K5391D57T")
.dsuseQy(30)
.build();
NimsApiDto.DsuseRptInfoDtl dtl2 = NimsApiDto.DsuseRptInfoDtl.builder()
.usrRptIdNo(usrRptIdNoList.get(i))
.usrRptLnIdNo(usrRptLnIdNoList.get(1)+i)
.prductCd("8806717024900")
.prductNm("베리콜시럽")
.minDistbQy(1)
.pceQy(1)
.mnfNo("A1111")
.prdValidDe("20300303")
.mnfSeq("A11111111")
.dsuseQy(10)
.build();
NimsApiDto.DsuseRptInfo dsuseRpt = NimsApiDto.DsuseRptInfo.builder()
.usrRptIdNo(usrRptIdNoList.get(i))
.refUsrRptIdNo("0".equals(rptTyCds.get(i))? null : refUsrRptIdNos.get(refIdx++))
.indutyNm("마약류취급의료업")
.rptTyCd(rptTyCds.get(i))
.rndDtlRptCnt("1".equals(rptTyCds.get(i))? 0 : 2)
.bsshCd("H00008333")
.bsshNm("수지미래산부인과의원")
.hdrDe("20240401")
.rptDe("20240401")
.dsuseSeCd("1")
.dsusePrvCd("01")
.dsuseMthCd("3")
.dsuseDe("20240306")
.dsuseLoc("보건소")
.status("0")
.listDtl("1".equals(rptTyCds.get(i))? null : List.of(dtl1, dtl2))
.build();
dsuseRpts.add(dsuseRpt);
}
return NimsApiResult.Response.<NimsApiDto.DsuseRptInfo>builder()
.header(
NimsApiResult.Header.builder()
.resultCd(0)
.resultMsg("성공")
.build()
)
.body(
NimsApiResult.Body.<NimsApiDto.DsuseRptInfo>builder()
.list(dsuseRpts)
.isEndYn("Y")
.nRecord(2)
.totalCount(2)
.build()
)
.build();
}
} }

@ -293,7 +293,7 @@
WHERE dscdmng_id = #{dscdmngId} WHERE dscdmng_id = #{dscdmngId}
</update> </update>
<insert id="insertDsuseMgt" parameterType="cokr.xit.adds.biz.nims.model.BizNimsRequest$DsuseMgt"> <insert id="insertDsuseMgt" parameterType="cokr.xit.adds.biz.nims.model.BizNimsDto$DsuseMgt">
/** nims-mysql-mapper|insertDsuseMgt-폐기관리 생성|julim */ /** nims-mysql-mapper|insertDsuseMgt-폐기관리 생성|julim */
<selectKey keyProperty="dscdmngId" resultType="string" order="BEFORE"> <selectKey keyProperty="dscdmngId" resultType="string" order="BEFORE">
SELECT NVL(MAX(dscdmng_id), CONCAT(DATE_FORMAT(now(), '%Y%m'),'0000')) + 1 SELECT NVL(MAX(dscdmng_id), CONCAT(DATE_FORMAT(now(), '%Y%m'),'0000')) + 1
@ -335,7 +335,7 @@
) )
</insert> </insert>
<insert id="insertDsuseMgtDtl" parameterType="cokr.xit.adds.biz.nims.model.BizNimsRequest$DsuseMgtDtl"> <insert id="insertDsuseMgtDtl" parameterType="cokr.xit.adds.biz.nims.model.BizNimsDto$DsuseMgtDtl">
/** nims-mysql-mapper|insertDsuseMgtDtl-폐기관리 상세 생성|julim */ /** nims-mysql-mapper|insertDsuseMgtDtl-폐기관리 상세 생성|julim */
INSERT INTO tb_dsuse_mgt_dtl ( INSERT INTO tb_dsuse_mgt_dtl (
dscdmng_id, /* 폐기관리ID */ dscdmng_id, /* 폐기관리ID */
@ -487,7 +487,7 @@
WHERE dscdmng_id = #{dscdmngId} WHERE dscdmng_id = #{dscdmngId}
</update> </update>
<update id="updatePrgsSttsOfDsuseMgt" parameterType="cokr.xit.adds.biz.nims.model.BizNimsRequest$DsuseMgt"> <update id="updatePrgsSttsOfDsuseMgt" parameterType="cokr.xit.adds.biz.nims.model.BizNimsDto$DsuseMgt">
/** nims-mysql-mapper|updatePrgsSttsOfDsuseMgt-폐기관리 상태 변경|julim */ /** nims-mysql-mapper|updatePrgsSttsOfDsuseMgt-폐기관리 상태 변경|julim */
UPDATE tb_dsuse_mgt UPDATE tb_dsuse_mgt
SET prgrs_stts_cd = #{prgrsSttsCd} SET prgrs_stts_cd = #{prgrsSttsCd}

Loading…
Cancel
Save