아이디/비밀번호 찾기 수정(1)
This commit is contained in:
@@ -337,6 +337,9 @@ public interface BOMbrMapper {
|
||||
public int insertBOPhoneAuth(BOMbrVO vo);
|
||||
public int selectBOPhoneAuth(BOMbrVO vo);
|
||||
|
||||
public int insertBOEmailAuth(BOMbrVO vo);
|
||||
public int selectBOEmailAuth(BOMbrVO vo);
|
||||
|
||||
public void insertBOMbrGradMapping(BOMbrVO mbrVO);
|
||||
|
||||
public void insertBOMemberSite(BOMbrVO mbrVO);
|
||||
|
||||
@@ -1026,6 +1026,65 @@ public class BOMbrService {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* 이메일 인증번호 생성
|
||||
*
|
||||
* @param mbrVO
|
||||
* @return
|
||||
* @author
|
||||
*/
|
||||
public DataMap insertBOEmailAuth(BOMbrVO vo) {
|
||||
|
||||
DataMap message = new DataMap();
|
||||
int result = 0;
|
||||
|
||||
try {
|
||||
|
||||
result = mapper.insertBOEmailAuth(vo);
|
||||
if (result > 0) {
|
||||
message.put("result", "success");
|
||||
message.put("sndngInnb", vo.getSndngInnb());
|
||||
} else {
|
||||
message.put("result", "fail");
|
||||
}
|
||||
} catch (WnbtRestException wre) {
|
||||
throw new WnbtRestException(wre.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* 이메일 인증
|
||||
*
|
||||
* @param mbrVO
|
||||
* @return
|
||||
* @author
|
||||
*/
|
||||
public DataMap selectBOEmailAuth(BOMbrVO vo) {
|
||||
|
||||
DataMap message = new DataMap();
|
||||
int result = 0;
|
||||
|
||||
try {
|
||||
|
||||
result = mapper.selectBOEmailAuth(vo);
|
||||
if (result > 0) {
|
||||
message.put("result", "success");
|
||||
} else {
|
||||
message.put("result", "fail");
|
||||
}
|
||||
} catch (WnbtRestException wre) {
|
||||
throw new WnbtRestException(wre.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* 회원구분코드 조회
|
||||
*
|
||||
|
||||
@@ -191,6 +191,7 @@ public class BOEmailService {
|
||||
List<BOEmailVO> voListNew = new ArrayList<BOEmailVO>();
|
||||
|
||||
BOEmailVO ListOne = voList.get(0);
|
||||
log.info("이메일 voList get(0) : {}", ListOne);
|
||||
List<Integer> trgetSndList = mapper.selectBOEmailSndngTrgetSnb(ListOne.getEmailSndngInnb());
|
||||
log.info("이메일 발송대상 순번 조회 => {}", trgetSndList);
|
||||
|
||||
|
||||
@@ -1372,10 +1372,15 @@ public class BOMssageService {
|
||||
String smsUseAt = StringUtil.isNullToString(sndngMap.get("smsUseAt"));
|
||||
String emailUseAt = StringUtil.isNullToString(sndngMap.get("emailUseAt"));
|
||||
|
||||
log.debug("카톡여부:문자여부:이메일여부 = {}",ntcntalkUseAt+":"+smsUseAt+":"+emailUseAt);
|
||||
|
||||
String ntcntalkSndngFormInnb = StringUtil.isNullToString(sndngMap.get("ntcntalkSndngFormInnb"));
|
||||
String smsSndngFormInnb = StringUtil.isNullToString(sndngMap.get("smsSndngFormInnb"));
|
||||
String emailSndngFormInnb = StringUtil.isNullToString(sndngMap.get("emailSndngFormInnb"));
|
||||
|
||||
log.debug("processTmpltMssage - paramMapList : {}",paramMapList);
|
||||
log.debug("processTmpltMssage - emailSndngFormInnb : {}",emailSndngFormInnb);
|
||||
|
||||
//전부 미사용 시
|
||||
boolean allNotY = !"Y".equals(ntcntalkUseAt) && !"Y".equals(smsUseAt) && !"Y".equals(emailUseAt);
|
||||
|
||||
@@ -1481,6 +1486,7 @@ public class BOMssageService {
|
||||
boEmailVO.setSecretKey(boCommonService.selectSecretkey());
|
||||
//이메일 발송내역 등록(치환코드 치환 x)
|
||||
|
||||
// 이메일 발송그룹(GC_EMAIL) 등록
|
||||
emailMapper.insertBOEmailSndngDtls(boEmailVO);
|
||||
|
||||
if (recptnRjctUrl != null) {
|
||||
@@ -1499,14 +1505,16 @@ public class BOMssageService {
|
||||
}
|
||||
|
||||
try {
|
||||
//이메일 발송대상 등록
|
||||
//이메일 발송대상(GC_EMAIL_TO) 등록
|
||||
emailMapper.insertBOEmailSndngTo(voList);
|
||||
|
||||
message.put("getEmailSndngInnb", boEmailVO.getEmailSndngInnb());
|
||||
message.put("result", "success");
|
||||
} catch (WnbtRestException wre){
|
||||
log.debug("이메일 발송 에러1");
|
||||
throw new WnbtRestException(wre.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.debug("이메일 발송 에러2");
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -358,6 +358,75 @@ public class MbrController {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 이메일 인증번호 생성
|
||||
* @return
|
||||
* @author
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/insertEmailAuth", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> insertEmailAuth(BOMbrVO vo, BindingResult bindingResult){
|
||||
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
|
||||
int random = (int) (Math.random() * 900000) + 100000;
|
||||
vo.setCrtnb(String.format("%06d", random));
|
||||
|
||||
DataMap content = new DataMap();
|
||||
content = service.insertBOEmailAuth(vo);
|
||||
|
||||
/** 자동발송 데이터 세팅 */
|
||||
Map<String, Object> sopmalInfoMap = new HashMap<>();
|
||||
BOMaSopmalVO sopmalVo = new BOMaSopmalVO();
|
||||
sopmalVo.setSopmalCd(user.getSopmalCd());
|
||||
sopmalInfoMap = maSopmalService.selectBOSopmalFooterInfo(sopmalVo);
|
||||
DataMap sopmalInfo = (DataMap) sopmalInfoMap.get("sopmalInfo");
|
||||
|
||||
/** 개인 인증 자동발송 */
|
||||
if (content.get("result").equals("success")) {
|
||||
DataMap paramMap = new DataMap();
|
||||
|
||||
// 공통 필수입력 항목
|
||||
paramMap.put("formDvCd", "FORM_DV_MBR");
|
||||
paramMap.put("formDtlDvCd", "05");
|
||||
paramMap.put("sopmalCd", user.getSopmalCd());
|
||||
paramMap.put("mbrInnb", vo.getMbrInnb());//비회원 = NULL
|
||||
paramMap.put("recpntNm", vo.getMbrNm());
|
||||
paramMap.put("recpntEmail", vo.getEmail());
|
||||
|
||||
// SMS
|
||||
paramMap.put("shopname", sopmalInfo.get("sopmalNm"));
|
||||
paramMap.put("authnum", vo.getCrtnb());
|
||||
|
||||
boMssageService.insertBOAtmcsndng(paramMap);
|
||||
}
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 이메일 인증
|
||||
* @return
|
||||
* @author
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectEmailAuth", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> selectEmailAuth(BOMbrVO vo, BindingResult bindingResult){
|
||||
|
||||
DataMap content = new DataMap();
|
||||
content = service.selectBOEmailAuth(vo);
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 회원가입
|
||||
* @return
|
||||
@@ -769,6 +838,137 @@ public class MbrController {
|
||||
paramMap.put("recpntNm", vo.getMbrNm());
|
||||
paramMap.put("recptnNb", vo.getMbtlnb());
|
||||
|
||||
// SMS
|
||||
paramMap.put("shopName", sopmalInfo.get("sopmalNm"));
|
||||
paramMap.put("userid", content.get("selectId"));
|
||||
|
||||
boMssageService.insertBOAtmcsndng(paramMap);
|
||||
}
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 이메일 인증 패스워드 조회
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectPasswordSearchEmail", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> selectIdPasswordSearchEmail(BOMbrVO vo){
|
||||
|
||||
List<Map<String, String>> errorList = new ArrayList<>();
|
||||
if (StringUtil.isEmpty(vo.getEmail())) {
|
||||
errorList.add(ValidateResultConverter.setErrorMap("email", "이메일 주소를 입력해 주세요."));
|
||||
}
|
||||
if (StringUtil.isEmpty(vo.getMbrId())) {
|
||||
errorList.add(ValidateResultConverter.setErrorMap("mbrId", "아이디를 입력해 주세요."));
|
||||
}
|
||||
if (StringUtil.isEmpty(vo.getMbrNm())) {
|
||||
errorList.add(ValidateResultConverter.setErrorMap("mbrNm", "이름을 입력해 주세요."));
|
||||
}
|
||||
if(errorList != null && !errorList.isEmpty()) {
|
||||
throw new WnbtRestException(ValidateResultConverter.convertCustomValidate(errorList));
|
||||
}
|
||||
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
vo.setMbrDvCd(service.selectBOMbrDvCd(vo));
|
||||
|
||||
String secretKey = commonService.selectSecretkey();
|
||||
vo.setSecretKey(secretKey);
|
||||
|
||||
log.debug("selectIdPasswordSearchEmail vo: {}", vo);
|
||||
DataMap content = service.selectBOPasswordSearch(vo);
|
||||
log.debug("selectIdPasswordSearchEmail content: {}", content);
|
||||
|
||||
/** 자동발송 데이터 세팅 */
|
||||
Map<String, Object> sopmalInfoMap = new HashMap<>();
|
||||
BOMaSopmalVO sopmalVo = new BOMaSopmalVO();
|
||||
sopmalVo.setSopmalCd(vo.getSopmalCd());
|
||||
sopmalInfoMap = maSopmalService.selectBOSopmalFooterInfo(sopmalVo);
|
||||
DataMap sopmalInfo = (DataMap) sopmalInfoMap.get("sopmalInfo");
|
||||
|
||||
/** 신규 패스워드 자동발송 */
|
||||
if (content.get("result").equals("success")) {
|
||||
DataMap paramMap = new DataMap();
|
||||
|
||||
// 공통 필수입력 항목
|
||||
paramMap.put("formDvCd", "FORM_DV_MBR");
|
||||
paramMap.put("formDtlDvCd", "04");
|
||||
paramMap.put("sopmalCd", user.getSopmalCd());
|
||||
paramMap.put("mbrInnb", vo.getMbrInnb());//비회원 = NULL
|
||||
paramMap.put("recpntNm", vo.getMbrNm());
|
||||
paramMap.put("recptnNb", vo.getMbtlnb());
|
||||
paramMap.put("recpntEmail", vo.getEmail());
|
||||
|
||||
// SMS
|
||||
paramMap.put("shopName", sopmalInfo.get("sopmalNm"));
|
||||
paramMap.put("password", content.get("newPassword"));
|
||||
|
||||
boMssageService.insertBOAtmcsndng(paramMap);
|
||||
}
|
||||
|
||||
return ResponseEntity.ok(
|
||||
WnbtResponse.builder()
|
||||
.resBody(new WnbtResponseBody(content))
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 이메일 인증 아이디 조회
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectIdSearchEmail", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<WnbtResponse> selectIdSearchEmail(BOMbrVO vo){
|
||||
|
||||
List<Map<String, String>> errorList = new ArrayList<>();
|
||||
if (StringUtil.isEmpty(vo.getEmail())) {
|
||||
errorList.add(ValidateResultConverter.setErrorMap("email", "이메일 주소를 입력해 주세요."));
|
||||
}
|
||||
if (StringUtil.isEmpty(vo.getMbrNm())) {
|
||||
errorList.add(ValidateResultConverter.setErrorMap("mbrNm", "이름을 입력해 주세요."));
|
||||
}
|
||||
if(errorList != null && !errorList.isEmpty()) {
|
||||
throw new WnbtRestException(ValidateResultConverter.convertCustomValidate(errorList));
|
||||
}
|
||||
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
vo.setMbrDvCd(service.selectBOMbrDvCd(vo));
|
||||
|
||||
String secretKey = commonService.selectSecretkey();
|
||||
vo.setSecretKey(secretKey);
|
||||
|
||||
log.debug("selectIdSearchEmail vo: {}", vo);
|
||||
DataMap content = service.selectBOIdSearch(vo);
|
||||
log.debug("selectIdSearchEmail content: {}", content);
|
||||
|
||||
/** 자동발송 데이터 세팅 */
|
||||
Map<String, Object> sopmalInfoMap = new HashMap<>();
|
||||
BOMaSopmalVO sopmalVo = new BOMaSopmalVO();
|
||||
sopmalVo.setSopmalCd(vo.getSopmalCd());
|
||||
sopmalInfoMap = maSopmalService.selectBOSopmalFooterInfo(sopmalVo);
|
||||
DataMap sopmalInfo = (DataMap) sopmalInfoMap.get("sopmalInfo");
|
||||
|
||||
/** 전체 아이디 자동발송 */
|
||||
if (content.get("result").equals("success")) {
|
||||
DataMap paramMap = new DataMap();
|
||||
|
||||
// 공통 필수입력 항목
|
||||
paramMap.put("formDvCd", "FORM_DV_MBR");
|
||||
paramMap.put("formDtlDvCd", "03");
|
||||
paramMap.put("sopmalCd", user.getSopmalCd());
|
||||
paramMap.put("mbrInnb", vo.getMbrInnb());//비회원 = NULL
|
||||
paramMap.put("recpntNm", vo.getMbrNm());
|
||||
paramMap.put("recptnNb", vo.getMbtlnb());
|
||||
paramMap.put("recpntEmail", vo.getEmail());
|
||||
|
||||
// SMS
|
||||
paramMap.put("shopName", sopmalInfo.get("sopmalNm"));
|
||||
paramMap.put("userid", content.get("selectId"));
|
||||
|
||||
Reference in New Issue
Block a user