You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

414 lines
7.6 KiB
Java

package cokr.xit.fims.mngt;
import org.assertj.core.util.Arrays;
import cokr.xit.foundation.AbstractEntity;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class MsgEntity extends AbstractEntity {
/**
* 고유번호
*/
private String msgKey;
/**
* G/W에 전송할 아이디
*/
private String msgSubId;
/**
* 사용자 고유 번호
*/
private String userKey;
/**
* 사용자 그룹
*/
private String userGroup;
/**
* 사용자 고유 아이디
*/
private String userId;
/**
* 사용자 JOB 아이디
*/
private String userJobid;
/**
* 전송라인(추후 요구 시 사용)
*/
private String centerKey;
/**
* 메시지 전송 우선 순위(추후 요구 시 사용)
*/
private String msgPriority;
/**
* 메시지 상태 값
*/
private String msgState;
/**
* 메시지 입력시간(DB 서버 시간 기준)
*/
private String inputDate;
/**
* 메시지 예약일시
*/
private String resDate;
/**
* 메시지를 수집한 시간
*/
private String queDate;
/**
* 메시지를 전송한 시간
*/
private String sentDate;
/**
* 핸드폰에 전달된 시간
*/
private String rsltDate;
/**
* G/W에서 결과를 수신한 시간
*/
private String reportDate;
/**
* 결과처리 상세코드
*/
private String rsltCode;
/**
* 결과처리 통신사
*/
private String rsltNet;
/**
* 결과처리된 메시지 유형
*/
private String rsltType;
/**
* 결과처리 히스토리 재전송 횟수
*/
private String sentCount;
/**
* 결과처리 히스토리 전송 타입
*/
private String historyMsgType;
/**
* 결과처리 히스토리 결과처리 상세코드
*/
private String historyRsltCode;
/**
* 메시지 식별자코드
*/
private String identifier;
/**
* 수신 번호
*/
private String phone;
/**
* 발신 번호
*/
private String callback;
/**
* 전송 타입 1번째
*/
private String msgType1;
/**
* 메시지 내용에 대한 타입 1번째
*/
private String contentsType1;
/**
* 1번째 메시지 수집한 시간
*/
private String queDate1;
/**
* 1번째 메시지 전송한 시간
*/
private String sentDate1;
/**
* 전송 타입 2번째
*/
private String msgType2;
/**
* 메시지 내용에 대한 타입 2번째
*/
private String contentsType2;
/**
* 2번째 메시지 수집한 시간
*/
private String queDate2;
/**
* 2번째 메시지 전송한 시간
*/
private String sentDate2;
/**
* 전송 타입 3번째
*/
private String msgType3;
/**
* 메시지 내용에 대한 타입 3번째
*/
private String contentsType3;
/**
* 3번째 메시지 수집한 시간
*/
private String queDate3;
/**
* 3번째 메시지 전송한 시간
*/
private String sentDate3;
/**
* XMS 결과처리 상세코드
*/
private String xmsRsltCode;
/**
* XMS 결과처리 통신사
*/
private String xmsRsltNet;
/**
* XMS 핸드폰에 전달된 시간
*/
private String xmsRsltDate;
/**
* XMS G/W에서 결과를 수신한 시간
*/
private String xmsReportDate;
/**
* ALT 결과처리 상세코드
*/
private String altRsltCode;
/**
* ALT 결과처리 통신사
*/
private String altRsltNet;
/**
* ALT 핸드폰에 전달된 시간
*/
private String altRsltDate;
/**
* ALT G/W에서 결과를 수신한 시간
*/
private String altReportDate;
/**
* RCS 결과처리 상세코드
*/
private String rcsRsltCode;
/**
* RCS 결과처리 통신사
*/
private String rcsRsltNet;
/**
* RCS 핸드폰에 전달된 시간
*/
private String rcsRsltDate;
/**
* RCS G/W에서 결과를 수신한 시간
*/
private String rcsReportDate;
/**
* 메시지 타이틀(LMS/MMS)
*/
private String xmsSubject;
/**
* 메시지 본문(SMS/LMS/MMS)
*/
private String xmsText;
/**
* 파일경로를 포함한 파일명1(MMS)
*/
private String xmsFileName1;
/**
* 파일경로를 포함한 파일명2(MMS)
*/
private String xmsFileName2;
/**
* 파일경로를 포함한 파일명3(MMS)
*/
private String xmsFileName3;
/**
* ALT 국가코드(ALT,ALI)
*/
private String altCountryCode;
/**
* ALT 사용자 아이디(ALT,ALI)
*/
private String altSenderKey;
/**
* ALT 등록된 템플릿 고유키(ALT,ALI)
*/
private String altTemplateCode;
/**
* 메시지 본문(ALT,ALI)
*/
private String altJson;
/**
* RCS 브랜드 키
*/
private String rcsBrandKey;
/**
* RCS 메시지 베이스 아이디
*/
private String rcsMassageBaseId;
/**
* 메시지 본문(RCS)
*/
private String rcsJson;
/**
* 실패 사유
*/
private String failRsn;
/**
* 1차,2차,3차 메시지 유형 설정
*/
public void setMsgTypes(String[] types) {
if(types != null) {
if(types.length == 1) {
this.setMsgType1(types[0]);
this.setMsgType2(null);
this.setMsgType3(null);
} else if(types.length == 2) {
this.setMsgType1(types[0]);
this.setMsgType2(types[1]);
this.setMsgType3(null);
} else if(types.length == 3) {
this.setMsgType1(types[0]);
this.setMsgType2(types[1]);
this.setMsgType3(types[2]);
}
}
}
/**
* 메시지 유형별 콘텐츠 유형
*/
public static String[] SMS = {"SMS"};
public static String[] MMS = {"LMS","MMS"};
public static String[] ALT = {"ALT","ALI","FRT","FRI","FRW"};
public static String[] RCS = {"RCS","RCL","RCM","RCT","RCD","RCF","RIT"};
/**
* (1차,2차,3차 메시지 유형 설정 후)콘텐츠 유형 설정
*/
public void setContentsTypeN(String contentsType) {
String msgType = "";
if(Arrays.asList(SMS).contains(contentsType)) {
msgType = "SMS";
} else if(Arrays.asList(MMS).contains(contentsType)){
msgType = "MMS";
} else if(Arrays.asList(ALT).contains(contentsType)) {
msgType = "ALT";
} else if(Arrays.asList(RCS).contains(contentsType)) {
msgType = "RCS";
}
if(msgType.equals(this.msgType1)) {
this.contentsType1 = contentsType;
} else if(msgType.equals(this.msgType2)) {
this.contentsType2 = contentsType;
} else if(msgType.equals(this.msgType3)) {
this.contentsType3 = contentsType;
}
}
/**
* 현재 메시지 엔티티의 RCS의 콘텐츠 유형 반환
*/
public String getContentsTypeOfRCS() {
if("RCS".equals(this.msgType1)) {
return this.contentsType1;
} else if("RCS".equals(this.msgType2)){
return this.contentsType2;
} else if("RCS".equals(this.msgType3)){
return this.contentsType3;
}
return null;
}
/**
* 현재 메시지 엔티티의 알림톡의 콘텐츠 유형 반환
*/
public String getContentsTypeOfALT() {
if("ALT".equals(this.msgType1)) {
return this.contentsType1;
} else if("ALT".equals(this.msgType2)){
return this.contentsType2;
} else if("ALT".equals(this.msgType3)){
return this.contentsType3;
}
return null;
}
/**
* 현재 메시지 엔티티의 XMS의 콘텐츠 유형 반환
*/
public String getContentsTypeOfXMS() {
if("SMS".equals(this.msgType1) || "MMS".equals(this.msgType1)) {
return this.contentsType1;
} else if("SMS".equals(this.msgType2) || "MMS".equals(this.msgType2)) {
return this.contentsType2;
} else if("SMS".equals(this.msgType3) || "MMS".equals(this.msgType3)) {
return this.contentsType3;
}
return null;
}
}