폐기보고정보조회 API 코드명 매핑 추가

dev
Jonguk. Lim 7 months ago
parent 489c04c4f5
commit 63b16ff2dd

@ -285,6 +285,11 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
* </pre>
*/
private void createDsuseRpt(NimsApiDto.DsuseRptInfo dto, boolean isNew) {
dto.setRptTyCdNm(Constants.RPT_TY_CD.getName(dto.getRptTyCd()));
dto.setDsuseSeCdNm(Constants.DSUSE_SE_CD.getName(dto.getDsuseSeCd()));
dto.setDsusePrvCdNm(Constants.DSUSE_PRV_CD.getName(dto.getDsusePrvCd()));
dto.setDsuseMthCdNm(Constants.DSUSE_MTH_CD.getName(dto.getDsuseMthCd()));
if(!isNew){
String refUsrRptIdNo = dto.getRefUsrRptIdNo();

@ -2,9 +2,13 @@ package cokr.xit.adds.core;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import org.springframework.http.HttpHeaders;
import cokr.xit.adds.core.spring.exception.ApiCustomException;
import lombok.Getter;
/**
* <pre>
* description :
@ -20,12 +24,6 @@ import org.springframework.http.HttpHeaders;
public class Constants {
public static final String API_URL_PATTERNS = "/*";
public static final Charset CHARSET_UTF8 = StandardCharsets.UTF_8;
public static final String DEFAULT_VIEW = "mappingJackson2JsonView";
public static final String PRIMARY_DATA_SOURCE = "primaryDataSource";
public static final String SECONDARY_DATA_SOURCE = "secondaryDataSource";
public static final String PRIMARY_SQL_SESSION = "primarySqlSession";
public static final String SECONDARY_SQL_SESSION = "secondarySqlSession";
public static final String DATE_REGX = "^[12]\\d{3}((0[1-9])|(1[0-2]))(0[1-9]|[12]\\d|3[01])$";
public static final String CUR_DATE_REGX = "^20([2-9][0-9])((0[1-9])|(1[0-2]))(0[1-9]|[12][0-9]|3[01])$";
@ -35,6 +33,173 @@ public class Constants {
public static final String EMAIL_REGX = "^[a-zA-Z0-9]([._%+-]?[a-zA-Z0-9])*@([._%+-]?[a-zA-Z0-9])*\\.[a-zA-Z]{2,6}$";
public static final String NIMS_API_USER_ID = "nims-api";
/**
* <pre>
* - ADDS02
* 0:, 1:, 2:
* </pre>
*/
@Getter
public enum RPT_TY_CD {
NEW("0", "신규"), //신규
CANCEL("1", "취소"), //취소
MODIFY("2", "변경") //변경
;
private final String code;
private final String nm;
RPT_TY_CD(String code, String nm) {
this.code = code;
this.nm = nm;
}
public static String getName(final String code){
return Arrays.stream(RPT_TY_CD.values())
.filter(ssc -> ssc.getCode().equals(code))
.findFirst()
.map(RPT_TY_CD::getNm)
.orElseThrow(() -> ApiCustomException.create(String.format("미 정의된 보고 유형 코드[%s]", code)));
//return eNum.getNm();
}
}
/**
* <pre>
* - ADDS03
* 1:, 2:, 4:
* </pre>
*/
@Getter
public enum DSUSE_SE_CD {
PHC("1", "보건소폐기"),
GOV("2", "공무원입회"),
ACDT("4", "사고마약류")
;
private final String code;
private final String nm;
DSUSE_SE_CD(String code, String nm) {
this.code = code;
this.nm = nm;
}
public static String getName(final String code){
return Arrays.stream(DSUSE_SE_CD.values())
.filter(ssc -> ssc.getCode().equals(code))
.findFirst()
.map(DSUSE_SE_CD::getNm)
.orElseThrow(() -> ApiCustomException.create(String.format("미 정의된 폐기 보고 코드[%s]", code)));
//return eNum.getNm();
}
}
/**
* <pre>
* - ADDS04
* 01:(), 02:(,), 03:, 04:,
* 05:, 07:, 08:, 09:, 12:
* </pre>
*/
@Getter
public enum DSUSE_PRV_CD {
DMG("01", "사고마약류(파손)"),
SPOIL("02", "사고마약류(변질,부패)"),
EXPIRED("03", "유효기한경과"),
EXPIRED_IMMINENT("04", "유효기한임박"),
STOP("05", "사용중단"),
CLOSURE("07", "폐업"),
REFUND("08", "환자반납"),
ETC("09", "기타"),
DISUSE("12", "제조공정중폐기물")
;
private final String code;
private final String nm;
DSUSE_PRV_CD(String code, String nm) {
this.code = code;
this.nm = nm;
}
public static String getName(final String code){
return Arrays.stream(DSUSE_PRV_CD.values())
.filter(ssc -> ssc.getCode().equals(code))
.findFirst()
.map(DSUSE_PRV_CD::getNm)
.orElseThrow(() -> ApiCustomException.create(String.format("미 정의된 폐기 사유 코드[%s]", code)));
//return eNum.getNm();
}
}
/**
* <pre>
* - ADDS05
* 1:, 2:, 3:, 4:, 5:, 6:, 7:, 8:, 9:
* </pre>
*/
@Getter
public enum DSUSE_MTH_CD {
INCINERATION("1", "소각"),
NEUTRALIZATION("2", "중화"),
HYDROLYSIS("3", "가수분해"),
OXIDATION("4", "산화"),
RETURN("5", "환원"),
DILUTION("6", "희석"),
BURIAL("7", "매몰"),
ETC("8", "기타"),
ACCIDENT("9", "사고")
;
private final String code;
private final String nm;
DSUSE_MTH_CD(String code, String nm) {
this.code = code;
this.nm = nm;
}
public static String getName(final String code){
return Arrays.stream(DSUSE_MTH_CD.values())
.filter(ssc -> ssc.getCode().equals(code))
.findFirst()
.map(DSUSE_MTH_CD::getNm)
.orElseThrow(() -> ApiCustomException.create(String.format("미 정의된 폐기 방법 코드[%s]", code)));
//return eNum.getNm();
}
}
/**
* <pre>
* - ADDS06
* 1102:, 1170:
* </pre>
*/
@Getter
public enum MVMN_TY_CD {
DSUSE_OUT("1102", "폐기출고"),
NOT_DSUSE_OUT("1170", "폐기재고미차감")
;
private final String code;
private final String nm;
MVMN_TY_CD(String code, String nm) {
this.code = code;
this.nm = nm;
}
public static String getName(final String code){
return Arrays.stream(MVMN_TY_CD.values())
.filter(ssc -> ssc.getCode().equals(code))
.findFirst()
.map(MVMN_TY_CD::getNm)
.orElseThrow(() -> ApiCustomException.create(String.format("미 정의된 이동 유형 코드[%s]", code)));
//return eNum.getNm();
}
}
/**
* ()
*/

@ -242,6 +242,8 @@ public class NimsApiDto {
@JsonAlias("RPT_TY_CD")
private String rptTyCd;
private String rptTyCdNm;
/**
*
*/
@ -267,6 +269,8 @@ public class NimsApiDto {
@JsonAlias("DSUSE_SE_CD")
private String dsuseSeCd;
private String dsuseSeCdNm;
/**
*
* 01~05, 07~09, 12
@ -274,6 +278,8 @@ public class NimsApiDto {
@JsonAlias("DSUSE_PRV_CD")
private String dsusePrvCd;
private String dsusePrvCdNm;
/**
*
* 1 ~ 9
@ -281,6 +287,8 @@ public class NimsApiDto {
@JsonAlias("DSUSE_MTH_CD")
private String dsuseMthCd;
private String dsuseMthCdNm;
/**
*
*/

Loading…
Cancel
Save