이지우 - 마이페이지, 결제하기 수정 작업

This commit is contained in:
JIWOO 2025-07-25 18:25:36 +09:00
parent 846780c8c3
commit cca291675a
10 changed files with 84 additions and 33 deletions

View File

@ -1642,6 +1642,45 @@ public class MjonPayV2Controller {
return "web/cop/kgmV2/bankOkUrl";
}
/**
* 마지막 결제수단 SELECT
* @throws Exception
*/
@RequestMapping(value = "/web/member/pay/selectLastPayMethodAjax.do")
public ModelAndView selectLastPayMethodAjax(MjonPayVO mjonPayVO,
HttpServletRequest request ) throws Exception {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView");
boolean isSuccess = true;
String msg = "";
String nextPayMethod = "";
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
if(userId == null) {
isSuccess = false;
msg = "로그인이 필요합니다.";
}
try {
// 다음 결제시 결제수단 SELECT
nextPayMethod = userManageService.selectLastPayMethod(userId);
}
catch(Exception e) {
isSuccess = false;
msg = e.getMessage();
}
modelAndView.addObject("isSuccess", isSuccess);
modelAndView.addObject("msg", msg);
modelAndView.addObject("nextPayMethod", nextPayMethod);
return modelAndView;
}
// Get Server Path
public static String getKgServerPath(HttpServletRequest request) {
String kgmPath = request.getScheme() + "://" + request.getServerName() +":" + request.getServerPort();

View File

@ -220,4 +220,6 @@ public interface EgovUserManageService {
public Map<String, Object> selectFaxSendList(FaxGroupDataVO faxGroupDataVO);
// 마지막 결제수단 조회
public String selectLastPayMethod(String mberId) throws Exception;
}

View File

@ -883,4 +883,10 @@ public class EgovUserManageServiceImpl extends EgovAbstractServiceImpl implement
return resultMap;
}
// 마지막 결제수단 SELECT
@Override
public String selectLastPayMethod(String mberId) throws Exception {
return userManageDAO.selectLastPayMethod(mberId);
}
}

View File

@ -321,4 +321,8 @@ public class UserManageDAO extends EgovAbstractDAO{
return (int) select("userManageDAO.selectUserPrePaymentPGdataCount", userId);
}
// 마지막 결제수단 SELECT
public String selectLastPayMethod(String mberId) throws Exception{
return (String) select("userManageDAO.selectLastPayMethod", mberId);
}
}

View File

@ -1459,4 +1459,14 @@
</select>
<!-- 마지막 결제수단 SELECT -->
<select id="userManageDAO.selectLastPayMethod" parameterClass="String" resultClass="String">
SELECT
IFNULL(PAY_METHOD, '') AS nextPayMethod
FROM MJ_PG
WHERE
USER_ID = #userId#
ORDER BY REG_DATE DESC LIMIT 1
</select>
</sqlMap>

View File

@ -1639,7 +1639,7 @@ function actionLogin_end(){
</c:if>
<li><a href="<c:out value='/web/user/passwordChange.do'/>" >비밀번호 변경</a></li>
<li><a href="<c:out value='/web/user/sendNumberManage.do'/>" >발신번호 관리</a></li>
<li><a href="<c:out value='/web/user/notifyManage.do'/>" >알림설정</a></li>
<%-- <li><a href="<c:out value='/web/user/notifyManage.do'/>" >알림설정</a></li> --%>
<%-- <li><a href="<c:out value='/web/user/mberSecession.do'/>" >회원탈퇴</a></li> --%>
<%-- <li><a href="<c:out value='/web/user/kisaReport.do'/>" >KISA 신고</a></li> --%>
</ul>

View File

@ -41,7 +41,7 @@ function getNextPayMethod() {
var nextPayMethod = "";
$.ajax({
type: "POST",
url: "/web/member/pay/selectNextPayMethodAjax.do",
url: "/web/member/pay/selectLastPayMethodAjax.do",
data: {},
dataType:'json',
async: false,

View File

@ -247,20 +247,17 @@ function updateUserInfo(){
return false;
}
if($("#emailId").val() != ""|| $("#emailAdd").val() != ""){
if($("#emailAdd").val() != ""){
if($("#emailId").val().trim() == "" || $("#emailAdd").val().trim() == ""){
alert("이메일은 필수 입력 항목입니다.")
return false;
}else {
var email = $("#emailId").val() + "@" + $("#emailAdd").val();
var taxExptext = /^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*.[a-zA-Z]{2,3}$/i;
if(taxExptext.test(email)==false){
alert("이메일주소 형식이 올바르지 않습니다.");
return false;
}
$("#mberEmailAdres").val(email);
}else{
alert("이메일 주소를 확인해 주세요");
return false;
}
}
if("${cmpPhoneChangeManageVO.hstSttus}" == '03'){
@ -678,7 +675,7 @@ function changeValueWork(obj){
</c:if>
<div class="input_list_item emailWrap">
<div>
<div class="input_left"><span class="essential">*</span>이메일</div>
<div class="input_left">이메일</div>
<div class="input_right">
<div class="email">
<label for="" class="label">이메일 주소 앞자리</label>

View File

@ -149,21 +149,17 @@ function updateUserInfo(){
$("#receivemail").val("N");
}
if($("#emailId").val() != ""|| $("#emailAdd").val() != ""){
if($("#emailAdd").val() != ""){
if($("#emailId").val().trim() == "" || $("#emailAdd").val().trim() == ""){
alert("이메일은 필수 입력 항목입니다.")
return false;
}else {
var email = $("#emailId").val() + "@" + $("#emailAdd").val();
var taxExptext = /^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*.[a-zA-Z]{2,3}$/i;
if(taxExptext.test(email)==false){
alert("이메일주소 형식이 올바르지 않습니다.");
return false;
}
$("#mberEmailAdres").val(email);
}else{
alert("이메일 주소를 확인해 주세요");
return false;
}
}
if("${userInfo.moblphonNo}" != $("#moblphonNo").val()){

View File

@ -30,9 +30,6 @@ $(document).ready(function(){
<li class="tab" id="sendNumberManage">
<button type="button" onclick="TabType5(this,'4'); location.href='/web/user/sendNumberManage.do'">발신번호 관리</button>
</li>
<li class="tab" id="notifyManage">
<button type="button" onclick="TabType5(this,'5'); location.href='/web/user/notifyManage.do'">알림설정</button>
</li>
<li class="tab" id="mberSecession">
<button type="button" onclick="TabType5(this,'6'); location.href='/web/user/mberSecession.do'">회원탈퇴</button>
</li>