|
|
|
|
@ -137,6 +137,8 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
|
|
|
|
|
String sndngDt = null;
|
|
|
|
|
|
|
|
|
|
for (EnsDTO.SndngMssageParam dto : list) {
|
|
|
|
|
dto.setSignguCode(reqDTO.getSignguCode());
|
|
|
|
|
dto.setFfnlgCode(reqDTO.getFfnlgCode());
|
|
|
|
|
final List<String> mstIdList = new ArrayList<>();
|
|
|
|
|
String mstId = "";
|
|
|
|
|
if (!Objects.equals(mstId, dto.getUnitySndngMastrId())) {
|
|
|
|
|
@ -147,21 +149,22 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
|
|
|
|
|
|
|
|
|
|
// validation check
|
|
|
|
|
final List<EnsDTO.sndngVali> valiList = mapper.selectAcceptVali(dto);
|
|
|
|
|
final String err = validatedAccept(valiList);
|
|
|
|
|
if(StringUtils.isNotEmpty(err)){
|
|
|
|
|
try {
|
|
|
|
|
validatedAccept(valiList);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
updateAcceptCntcSndngMstFailStatus(mstIdList,
|
|
|
|
|
"accept 생성 요청 실패(파라메터 오류) : " + EgovStringUtil.cutString(err, 300));
|
|
|
|
|
"accept 생성 요청 실패(파라메터 오류) : " + EgovStringUtil.cutString(e.getMessage(), 300));
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 초기 1회 셋팅 (발송 일시2, 발송 일시3 : 템플릿 관리 try2_minute, try3_minute 값에 따라 처리)
|
|
|
|
|
if (sndngDt == null) {
|
|
|
|
|
if (StringUtils.isEmpty(sndngDt)) {
|
|
|
|
|
sndngDt = StringUtils.defaultString(dto.getSndngDt());
|
|
|
|
|
if (dto.getTry2() != null && !"".equals(sndngDt)) {
|
|
|
|
|
if (StringUtils.isNotEmpty(dto.getTry2()) && StringUtils.isNotEmpty(sndngDt)) {
|
|
|
|
|
dto.setSndngDt2(
|
|
|
|
|
EgovDateUtil.addMinute(sndngDt, Integer.parseInt(dto.getTry2Minute())));
|
|
|
|
|
}
|
|
|
|
|
if (dto.getTry3() != null && !"".equals(sndngDt)) {
|
|
|
|
|
if (StringUtils.isNotEmpty(dto.getTry3()) && StringUtils.isNotEmpty(sndngDt)) {
|
|
|
|
|
dto.setSndngDt3(
|
|
|
|
|
EgovDateUtil.addMinute(sndngDt, Integer.parseInt(dto.getTry3Minute())));
|
|
|
|
|
}
|
|
|
|
|
@ -462,10 +465,9 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
|
|
|
|
|
* accept 파라메터 유효성 체크
|
|
|
|
|
*
|
|
|
|
|
* @param valiList List<EnsDTO.sndngVali>
|
|
|
|
|
* @return String 에러 내용
|
|
|
|
|
* </pre>
|
|
|
|
|
*/
|
|
|
|
|
private String validatedAccept(List<EnsDTO.sndngVali> valiList) {
|
|
|
|
|
private void validatedAccept(List<EnsDTO.sndngVali> valiList) {
|
|
|
|
|
List<String> errors = new ArrayList<>();
|
|
|
|
|
int idx = 0;
|
|
|
|
|
|
|
|
|
|
@ -506,17 +508,22 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
|
|
|
|
|
|
|
|
|
|
switch (SndngSeCode.compare(tryVal[dto.getTrySeq() - 1])) {
|
|
|
|
|
case KAKAO:
|
|
|
|
|
if (Checks.isEmpty(dto.getIhidnum())) {
|
|
|
|
|
errors.add(
|
|
|
|
|
String.format("주민등록번호는 필수입니다(dto.getIhidnum[%d] 번째 오류)", idx + 1));
|
|
|
|
|
}
|
|
|
|
|
if (Checks.isEmpty(dto.getMoblphonNo())) {
|
|
|
|
|
errors.add(String.format("핸드폰 번호는 필수입니다(dto.getMoblphonNo[%d] 번째 오류)",
|
|
|
|
|
idx + 1));
|
|
|
|
|
}
|
|
|
|
|
if (Checks.isEmpty(dto.getIhidnum())) {
|
|
|
|
|
errors.add(
|
|
|
|
|
String.format("받는이 이름은 필수입니다(dto.getIhidnum[%d] 번째 오류)", idx + 1));
|
|
|
|
|
if (Checks.isEmpty(dto.getCi())) {
|
|
|
|
|
if(Checks.isEmpty(dto.getIhidnum())) {
|
|
|
|
|
errors.add(
|
|
|
|
|
String.format("주민등록번호는 필수입니다(dto.getIhidnum[%d] 번째 오류)",
|
|
|
|
|
idx + 1));
|
|
|
|
|
}
|
|
|
|
|
if(Checks.isEmpty(dto.getMoblphonNo())) {
|
|
|
|
|
errors.add(
|
|
|
|
|
String.format("핸드폰 번호는 필수입니다(dto.getMoblphonNo[%d] 번째 오류)",
|
|
|
|
|
idx + 1));
|
|
|
|
|
}
|
|
|
|
|
if(Checks.isEmpty(dto.getIhidnum())) {
|
|
|
|
|
errors.add(
|
|
|
|
|
String.format("받는이 이름은 필수입니다(dto.getIhidnum[%d] 번째 오류)",
|
|
|
|
|
idx + 1));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
@ -554,8 +561,9 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
|
|
|
|
|
idx++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return errors.size() > 0 ? errors.toString() : StringUtils.EMPTY;
|
|
|
|
|
if (errors.size() > 0) {
|
|
|
|
|
throw BizRuntimeException.create(errors.toString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|