|
|
|
|
@ -0,0 +1,268 @@
|
|
|
|
|
/**
|
|
|
|
|
* Class Name : BrsMemberCiMobileController.java
|
|
|
|
|
* Description : 사전등록 회원 휴대전화번호 요청 수신
|
|
|
|
|
* Version : 1.0
|
|
|
|
|
* Since : 2025. 04.03
|
|
|
|
|
* Author : 서울시 녹색교통 사전등록결제 개발팀
|
|
|
|
|
*
|
|
|
|
|
<pre>
|
|
|
|
|
수정일 수정자 수정내용
|
|
|
|
|
</pre>
|
|
|
|
|
*/
|
|
|
|
|
package gtpa.brs.openapi.web;
|
|
|
|
|
|
|
|
|
|
import java.sql.SQLException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
|
|
import egovframework.rte.fdl.property.EgovPropertyService;
|
|
|
|
|
//import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
|
|
|
|
|
|
|
|
|
import gtpa.brs.openapi.service.GtpaBrsOpenapiService;
|
|
|
|
|
import gtpa.brs.openapi.common.BrsCommonMessage;
|
|
|
|
|
import gtpa.brs.openapi.dao.MemberCiReqVO;
|
|
|
|
|
import gtpa.brs.openapi.dao.MemberCiResVO;
|
|
|
|
|
import gtpa.brs.openapi.dao.MemberOneResVO;
|
|
|
|
|
import gtpa.brs.openapi.dao.ResponseJsonArrayVO;
|
|
|
|
|
import gtpa.brs.openapi.dao.ResponseJsonVO;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import org.springmodules.validation.commons.DefaultBeanValidator;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class Name : BrsMemberCiMobileController Class
|
|
|
|
|
* Description : 사전등록 회원 휴대전화번호 요청 수신
|
|
|
|
|
* Version : 1.0
|
|
|
|
|
* Since : 2019. 04.16
|
|
|
|
|
* Author : 서울시 녹색교통 사전등록결제 개발팀
|
|
|
|
|
*
|
|
|
|
|
<pre>
|
|
|
|
|
수정일 수정자 수정내용
|
|
|
|
|
</pre>
|
|
|
|
|
*/
|
|
|
|
|
@RestController
|
|
|
|
|
public class BrsMemberCiMobileController {
|
|
|
|
|
|
|
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(BrsMemberCiMobileController.class);
|
|
|
|
|
|
|
|
|
|
/** GtpaBrsOpenapiService */
|
|
|
|
|
@Resource(name = "openapiService")
|
|
|
|
|
private GtpaBrsOpenapiService openapiService;
|
|
|
|
|
|
|
|
|
|
/** EgovPropertyService */
|
|
|
|
|
@Resource(name = "propertiesService")
|
|
|
|
|
protected EgovPropertyService propertiesService;
|
|
|
|
|
|
|
|
|
|
/** Validator */
|
|
|
|
|
@Resource(name = "beanValidator")
|
|
|
|
|
protected DefaultBeanValidator beanValidator;
|
|
|
|
|
|
|
|
|
|
private final static int SEQ_START = 0;
|
|
|
|
|
private final static int SEQ_END = 99999999;
|
|
|
|
|
protected static int iSequence = 0;
|
|
|
|
|
protected static Object objSequence = new Object();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ITF_BRS_I 사전등록 회원 휴대전화번호 요청 수신
|
|
|
|
|
*/
|
|
|
|
|
//ITF_BRS_I 사전등록 회원 휴대전화번호 요청 수신
|
|
|
|
|
@PostMapping("/member/ciMobile")
|
|
|
|
|
public ResponseJsonVO jsonMemberManychild(@ModelAttribute MemberCiReqVO param) { //클라이언트에서 JSON반식으로 데이터 요청
|
|
|
|
|
|
|
|
|
|
//SimpleDateFormat debugFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS ");
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
|
|
//String appr_dtm = debugFormat.format(new Date());
|
|
|
|
|
|
|
|
|
|
BrsCommonMessage cmmMsg = new BrsCommonMessage();
|
|
|
|
|
MemberCiResVO resData = new MemberCiResVO();
|
|
|
|
|
ResponseJsonVO resJson = new ResponseJsonVO();
|
|
|
|
|
|
|
|
|
|
final String sIFNo = "026"; //인터페이스 번호 eq.연계구분
|
|
|
|
|
LOGGER.info("[IF_BRS_"+sIFNo+"] /member/ciMobile > Param "+param.toString());
|
|
|
|
|
|
|
|
|
|
//TODO 변수 선언
|
|
|
|
|
final String sInsttNo = param.getInsttNo(); //기관 번호
|
|
|
|
|
final String sInsttCntcJobSe = param.getInsttCntcJobSe(); //기관 업무 구분
|
|
|
|
|
String sLogMno = sIFNo+"_"+dateFormat.format(new Date()).substring(0, 8); //세션 로그 관리번호
|
|
|
|
|
iSequence = 0; //초기값
|
|
|
|
|
|
|
|
|
|
//String resInsert = "";
|
|
|
|
|
String resUpdate = "";
|
|
|
|
|
String sqlException = "";
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
//TODO 로그 기록 IN
|
|
|
|
|
sLogMno = sLogMno+String.format("%08d", Integer.parseInt(openapiService.seqBrsBrsLog())); //세션 로그 관리번호
|
|
|
|
|
serviceBrsLogInsert(sLogMno,sInsttCntcJobSe,sInsttNo,"RequestJson : /member/ciMobile?"+param.toString());
|
|
|
|
|
|
|
|
|
|
//TODO 기본 파라미터 검증
|
|
|
|
|
if(param.getInsttNo() == null || "".equals(param.getInsttNo()) || "null".equals(param.getInsttNo()) || param.getInsttNo().length() > 12 ||
|
|
|
|
|
param.getInsttCntcJobSe() == null || "".equals(param.getInsttCntcJobSe()) || "null".equals(param.getInsttCntcJobSe()) || param.getInsttCntcJobSe().length() > 3 ||
|
|
|
|
|
param.getMberCi() == null || "".equals(param.getMberCi()) || "null".equals(param.getMberCi()) || param.getMberCi().length() > 90 ||
|
|
|
|
|
param.getVhcleNo() == null || "".equals(param.getVhcleNo()) || "null".equals(param.getVhcleNo()) || param.getVhcleNo().length() > 9 ){
|
|
|
|
|
|
|
|
|
|
//응답 오류메세지 전달
|
|
|
|
|
resJson.setResult("FAIL");
|
|
|
|
|
resJson.setResultCode("EC0001");
|
|
|
|
|
resJson.setResultMessage(cmmMsg.resultMessage(resJson.getResultCode()));
|
|
|
|
|
resJson.setData(null);
|
|
|
|
|
serviceBrsLogInsert(sLogMno,sInsttCntcJobSe,sInsttNo,"ResponseJson:"+resJson.toErrString());
|
|
|
|
|
LOGGER.info("[IF_BRS_"+sIFNo+"] "+resJson.getResult()+" > "+resJson.getResultCode()+"/"+resJson.getResultMessage());
|
|
|
|
|
return resJson;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//TODO 등록요청에 필요한 DB Select
|
|
|
|
|
//TODO DB Select 기관검증
|
|
|
|
|
HashMap<String, String> mInsttInfo = new HashMap<String, String>();
|
|
|
|
|
mInsttInfo.put("instt_no",sInsttNo); //기관번호
|
|
|
|
|
mInsttInfo = openapiService.selectTbBrsInsttInfo(mInsttInfo);
|
|
|
|
|
if(mInsttInfo == null || mInsttInfo.get("INSTT_NO").equals(sInsttNo) != true)
|
|
|
|
|
{
|
|
|
|
|
///응답 오류메세지 전달
|
|
|
|
|
resJson.setResult("FAIL");
|
|
|
|
|
resJson.setResultCode("ES0001");
|
|
|
|
|
resJson.setResultMessage(cmmMsg.resultMessage(resJson.getResultCode()));
|
|
|
|
|
resJson.setData(null);
|
|
|
|
|
serviceBrsLogInsert(sLogMno,sInsttCntcJobSe,sInsttNo,"ResponseJson:"+resJson.toErrString());
|
|
|
|
|
LOGGER.info("[IF_BRS_"+sIFNo+"] "+resJson.getResult()+" > "+resJson.getResultCode()+"/"+resJson.getResultMessage());
|
|
|
|
|
return resJson;
|
|
|
|
|
}
|
|
|
|
|
LOGGER.debug("[IF_BRS_"+sIFNo+"] openapiService.selectTbBrsInsttInfo : "+mInsttInfo.get("INSTT_NO")+"/"+
|
|
|
|
|
mInsttInfo.get("INSTT_NM")+"/"+
|
|
|
|
|
mInsttInfo.get("INSTT_CHRGE_SE")+"/"+
|
|
|
|
|
mInsttInfo.get("INSTT_CHRGE_DETAIL")+"/"+
|
|
|
|
|
mInsttInfo.get("HMPG")+"/"+
|
|
|
|
|
mInsttInfo.get("MNGR_NM")+"/"+
|
|
|
|
|
mInsttInfo.get("MNGR_CTTPC")+"/"+
|
|
|
|
|
mInsttInfo.get("REGIST_DT")+"/"+
|
|
|
|
|
mInsttInfo.get("REGISTER_ID")+"/"+
|
|
|
|
|
mInsttInfo.get("UPDT_DT")+"/"+
|
|
|
|
|
mInsttInfo.get("UPDUSR_ID") );
|
|
|
|
|
|
|
|
|
|
//TODO DB Select 기관운영검증
|
|
|
|
|
HashMap<String, String> mInsttOper = new HashMap<String, String>();
|
|
|
|
|
mInsttOper.put("instt_no",sInsttNo); //기관번호
|
|
|
|
|
mInsttOper.put("instt_cntc_job_se",sInsttCntcJobSe); //기관 연계 업무구분
|
|
|
|
|
mInsttOper.put("use_at","Y");
|
|
|
|
|
mInsttOper = openapiService.selectTbBrsInsttOperInfo(mInsttOper);
|
|
|
|
|
if(mInsttOper == null || sIFNo.equals(sInsttCntcJobSe) != true)
|
|
|
|
|
{
|
|
|
|
|
///응답 오류메세지 전달
|
|
|
|
|
resJson.setResult("FAIL");
|
|
|
|
|
resJson.setResultCode("ES0002");
|
|
|
|
|
resJson.setResultMessage(cmmMsg.resultMessage(resJson.getResultCode()));
|
|
|
|
|
resJson.setData(null);
|
|
|
|
|
serviceBrsLogInsert(sLogMno,sInsttCntcJobSe,sInsttNo,"ResponseJson:"+resJson.toErrString());
|
|
|
|
|
LOGGER.info("[IF_BRS_"+sIFNo+"] "+resJson.getResult()+" > "+resJson.getResultCode()+"/"+resJson.getResultMessage());
|
|
|
|
|
return resJson;
|
|
|
|
|
}
|
|
|
|
|
LOGGER.debug("[IF_BRS_"+sIFNo+"] openapiService.selectTbBrsInsttOperInfo : "+mInsttOper.get("INSTT_NO")+"/"+
|
|
|
|
|
mInsttOper.get("INSTT_CNTC_JOB_SE")+"/"+
|
|
|
|
|
mInsttOper.get("USE_AT")+"/"+
|
|
|
|
|
mInsttOper.get("REQUST_URL")+"/"+
|
|
|
|
|
mInsttOper.get("RSPNS_URL") );
|
|
|
|
|
|
|
|
|
|
//TODO 회원 전화번호 가져오기
|
|
|
|
|
HashMap<String, String> mMberCi = new HashMap<String, String>();
|
|
|
|
|
mMberCi.put("mber_ci",param.getMberCi()); //회원 필터 조건
|
|
|
|
|
mMberCi.put("vhcle_no",param.getVhcleNo()); //회원 필터 조건
|
|
|
|
|
|
|
|
|
|
Map mMberMobileInfo = openapiService.selectMemberMobileInfo(mMberCi);
|
|
|
|
|
if(mMberMobileInfo == null)
|
|
|
|
|
{
|
|
|
|
|
///응답 오류메세지 전달
|
|
|
|
|
resJson.setResult("FAIL");
|
|
|
|
|
resJson.setResultCode("ES9999");
|
|
|
|
|
resJson.setResultMessage("휴대전화번호가 없는 회원입니다.");
|
|
|
|
|
resJson.setData(null);
|
|
|
|
|
serviceBrsLogInsert(sLogMno,sInsttCntcJobSe,sInsttNo,"ResponseJson:"+resJson.toErrString());
|
|
|
|
|
LOGGER.info("[IF_BRS_"+sIFNo+"] "+resJson.getResult()+" > "+resJson.getResultCode()+"/"+resJson.getResultMessage());
|
|
|
|
|
return resJson;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resData.setMobileNo((String) mMberMobileInfo.get("MOBILE_NO"));
|
|
|
|
|
|
|
|
|
|
resJson.setResult("SUCCESS");
|
|
|
|
|
resJson.setResultCode("E0000");
|
|
|
|
|
resJson.setResultMessage("정상");
|
|
|
|
|
resJson.setData((Object)resData);
|
|
|
|
|
|
|
|
|
|
//TODO 로그 기록 OUT
|
|
|
|
|
serviceBrsLogInsert(sLogMno,sInsttCntcJobSe,sInsttNo,"ResponseJson:"+resJson.toString());
|
|
|
|
|
|
|
|
|
|
} catch(RuntimeException e) {
|
|
|
|
|
resJson.setResult("EXCEPTION");
|
|
|
|
|
resJson.setResultCode("EE9000");
|
|
|
|
|
resJson.setResultMessage(cmmMsg.resultMessage(resJson.getResultCode()));
|
|
|
|
|
resJson.setData(null);
|
|
|
|
|
serviceBrsLogInsert(sLogMno,sInsttCntcJobSe,sInsttNo,"RuntimeException:"+resJson.getResultCode()+"/"+resJson.getResultMessage()+"/"+e.getClass().getName());
|
|
|
|
|
|
|
|
|
|
LOGGER.error("[IF_BRS_"+sIFNo+"] "+resJson.getResult()+" > "+resJson.getResultCode()+"/"+resJson.getResultMessage()+"/"+e.getClass().getName());
|
|
|
|
|
LOGGER.error("[IF_BRS_"+sIFNo+"] /member/ciMobile RuntimeException : " + e);
|
|
|
|
|
return resJson;
|
|
|
|
|
|
|
|
|
|
} catch(Exception e) {
|
|
|
|
|
resJson.setResult("EXCEPTION");
|
|
|
|
|
resJson.setResultCode("EE9000");
|
|
|
|
|
resJson.setResultMessage(cmmMsg.resultMessage(resJson.getResultCode()));
|
|
|
|
|
resJson.setData(null);
|
|
|
|
|
serviceBrsLogInsert(sLogMno,sInsttCntcJobSe,sInsttNo,"Exception:"+resJson.getResultCode()+"/"+resJson.getResultMessage()+"/"+e.getClass().getName());
|
|
|
|
|
|
|
|
|
|
LOGGER.error("[IF_BRS_"+sIFNo+"] "+resJson.getResult()+" > "+resJson.getResultCode()+"/"+resJson.getResultMessage()+"/"+e.getClass().getName());
|
|
|
|
|
LOGGER.error("[IF_BRS_"+sIFNo+"] /member/ciMobile Exception : " + e);
|
|
|
|
|
return resJson;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LOGGER.info("[IF_BRS_"+sIFNo+"] /member/ciMobile > Response "+resJson);
|
|
|
|
|
return resJson;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 로그정보를 저장한다.
|
|
|
|
|
*/
|
|
|
|
|
public String serviceBrsLogInsert(String sLogMno, String sInsttCntcJobSe, String sInsttNo, String requstMsssage)
|
|
|
|
|
{
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
|
|
HashMap<String, String> mLog = new HashMap<String, String>(); //리턴 응답값
|
|
|
|
|
mLog.put("brs_log_mno", sLogMno); //발행번호 채번
|
|
|
|
|
mLog.put("seq_no",getSeqNumber());
|
|
|
|
|
mLog.put("instt_cntc_job_se", sInsttCntcJobSe);
|
|
|
|
|
mLog.put("instt_no", sInsttNo);
|
|
|
|
|
mLog.put("request_dt", dateFormat.format(new Date()));
|
|
|
|
|
mLog.put("requst_msssage",requstMsssage);
|
|
|
|
|
//DB insert
|
|
|
|
|
String res = openapiService.insertTbBrsLog(mLog);
|
|
|
|
|
mLog.clear();
|
|
|
|
|
if("1".equals(res) != true)
|
|
|
|
|
{
|
|
|
|
|
LOGGER.debug("[IF_BRS_"+sInsttCntcJobSe+"] openapiService.insertTbBrsLog("+res+") >"+sLogMno+"/"+sInsttNo+"/"+sInsttCntcJobSe+"/"+requstMsssage);
|
|
|
|
|
}
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 로그 시퀀스번호를 생성한다. (로그번호+1)
|
|
|
|
|
*/
|
|
|
|
|
public static String getSeqNumber() {
|
|
|
|
|
|
|
|
|
|
synchronized (objSequence) {
|
|
|
|
|
if (iSequence == SEQ_END)
|
|
|
|
|
iSequence = SEQ_START;
|
|
|
|
|
|
|
|
|
|
iSequence++;
|
|
|
|
|
return Integer.toString(iSequence);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|