결제하기 화면 다음 결제시 결제수단 UPDATE 기능추가
@4e0024044f8e228e510019ac71f5789944032005
--- src/main/java/itn/let/mjo/pay/web/MjonPayV2Controller.java
+++ src/main/java/itn/let/mjo/pay/web/MjonPayV2Controller.java
... | ... | @@ -192,6 +192,82 @@ |
| 192 | 192 |
return "/web/pay/PayViewV2"; |
| 193 | 193 |
} |
| 194 | 194 |
|
| 195 |
+ /** |
|
| 196 |
+ * 다음 결제시 결제수단 SELECT |
|
| 197 |
+ * @throws Exception |
|
| 198 |
+ */ |
|
| 199 |
+ @RequestMapping(value = "/web/member/pay/selectNextPayMethodAjax.do") |
|
| 200 |
+ public ModelAndView selectNextPayMethodAjax(MjonPayVO mjonPayVO, |
|
| 201 |
+ HttpServletRequest request ) throws Exception {
|
|
| 202 |
+ |
|
| 203 |
+ ModelAndView modelAndView = new ModelAndView(); |
|
| 204 |
+ modelAndView.setViewName("jsonView");
|
|
| 205 |
+ |
|
| 206 |
+ boolean isSuccess = true; |
|
| 207 |
+ String msg = ""; |
|
| 208 |
+ String nextPayMethod = ""; |
|
| 209 |
+ |
|
| 210 |
+ LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); |
|
| 211 |
+ String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId()); |
|
| 212 |
+ |
|
| 213 |
+ if(userId == null) {
|
|
| 214 |
+ isSuccess = false; |
|
| 215 |
+ msg = "로그인이 필요합니다."; |
|
| 216 |
+ } |
|
| 217 |
+ |
|
| 218 |
+ try {
|
|
| 219 |
+ // 다음 결제시 결제수단 SELECT |
|
| 220 |
+ nextPayMethod = userManageService.selectNextPayMethod(userId); |
|
| 221 |
+ } |
|
| 222 |
+ catch(Exception e) {
|
|
| 223 |
+ isSuccess = false; |
|
| 224 |
+ msg = e.getMessage(); |
|
| 225 |
+ } |
|
| 226 |
+ |
|
| 227 |
+ modelAndView.addObject("isSuccess", isSuccess);
|
|
| 228 |
+ modelAndView.addObject("msg", msg);
|
|
| 229 |
+ modelAndView.addObject("nextPayMethod", nextPayMethod);
|
|
| 230 |
+ |
|
| 231 |
+ return modelAndView; |
|
| 232 |
+ } |
|
| 233 |
+ |
|
| 234 |
+ /** |
|
| 235 |
+ * 다음 결제시 결제수단 UPDATE |
|
| 236 |
+ * @throws Exception |
|
| 237 |
+ */ |
|
| 238 |
+ @RequestMapping(value = "/web/member/pay/updateNextPayMethodAjax.do") |
|
| 239 |
+ public ModelAndView updateNextPayMethodAjax(UserManageVO userManageVO, |
|
| 240 |
+ HttpServletRequest request ) throws Exception {
|
|
| 241 |
+ |
|
| 242 |
+ ModelAndView modelAndView = new ModelAndView(); |
|
| 243 |
+ modelAndView.setViewName("jsonView");
|
|
| 244 |
+ |
|
| 245 |
+ boolean isSuccess = true; |
|
| 246 |
+ String msg = ""; |
|
| 247 |
+ |
|
| 248 |
+ LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); |
|
| 249 |
+ String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId()); |
|
| 250 |
+ |
|
| 251 |
+ if(userId == null) {
|
|
| 252 |
+ isSuccess = false; |
|
| 253 |
+ msg = "로그인이 필요합니다."; |
|
| 254 |
+ } |
|
| 255 |
+ |
|
| 256 |
+ try {
|
|
| 257 |
+ // 다음 결제시 결제수단 SELECT |
|
| 258 |
+ userManageVO.setMberId(userId); |
|
| 259 |
+ userManageService.updateNextPayMethod(userManageVO); |
|
| 260 |
+ } |
|
| 261 |
+ catch(Exception e) {
|
|
| 262 |
+ isSuccess = false; |
|
| 263 |
+ msg = e.getMessage(); |
|
| 264 |
+ } |
|
| 265 |
+ |
|
| 266 |
+ modelAndView.addObject("isSuccess", isSuccess);
|
|
| 267 |
+ modelAndView.addObject("msg", msg);
|
|
| 268 |
+ |
|
| 269 |
+ return modelAndView; |
|
| 270 |
+ } |
|
| 195 | 271 |
|
| 196 | 272 |
///////////////////////////////////////////////////////////////////////////////////////// |
| 197 | 273 |
// |
--- src/main/java/itn/let/uss/umt/service/EgovUserManageService.java
+++ src/main/java/itn/let/uss/umt/service/EgovUserManageService.java
... | ... | @@ -159,6 +159,12 @@ |
| 159 | 159 |
|
| 160 | 160 |
void updateCrtfcDnValue(UserManageVO userManageVO) throws Exception; |
| 161 | 161 |
|
| 162 |
+ // 다음 결제시 결제수단 SELECT |
|
| 163 |
+ public String selectNextPayMethod(String mberId) throws Exception; |
|
| 164 |
+ |
|
| 165 |
+ // 다음 결제시 결제수단 UPDATE |
|
| 166 |
+ void updateNextPayMethod(UserManageVO userManageVO) throws Exception; |
|
| 167 |
+ |
|
| 162 | 168 |
public int selectAdminDiChk(UserManageVO userManageVO); |
| 163 | 169 |
|
| 164 | 170 |
public boolean selectUserStatusInfo(String userId) throws Exception; |
--- src/main/java/itn/let/uss/umt/service/UserManageVO.java
+++ src/main/java/itn/let/uss/umt/service/UserManageVO.java
... | ... | @@ -206,7 +206,14 @@ |
| 206 | 206 |
private String recommendId; // 추천아이디 |
| 207 | 207 |
private String atSmishingYn; // 알림톡 스미싱 의심여부 |
| 208 | 208 |
private String spamYn; |
| 209 |
+ private String nextPayMethod; |
|
| 209 | 210 |
|
| 211 |
+ public String getNextPayMethod() {
|
|
| 212 |
+ return nextPayMethod; |
|
| 213 |
+ } |
|
| 214 |
+ public void setNextPayMethod(String nextPayMethod) {
|
|
| 215 |
+ this.nextPayMethod = nextPayMethod; |
|
| 216 |
+ } |
|
| 210 | 217 |
public String getSpamYn() {
|
| 211 | 218 |
return spamYn; |
| 212 | 219 |
} |
--- src/main/java/itn/let/uss/umt/service/impl/EgovUserManageServiceImpl.java
+++ src/main/java/itn/let/uss/umt/service/impl/EgovUserManageServiceImpl.java
... | ... | @@ -439,6 +439,18 @@ |
| 439 | 439 |
userManageDAO.updateCrtfcDnValue(userManageVO); |
| 440 | 440 |
} |
| 441 | 441 |
|
| 442 |
+ // 다음 결제시 결제수단 SELECT |
|
| 443 |
+ @Override |
|
| 444 |
+ public String selectNextPayMethod(String mberId) throws Exception{
|
|
| 445 |
+ return userManageDAO.selectNextPayMethod(mberId); |
|
| 446 |
+ } |
|
| 447 |
+ |
|
| 448 |
+ // 다음 결제시 결제수단 UPDATE |
|
| 449 |
+ @Override |
|
| 450 |
+ public void updateNextPayMethod(UserManageVO userManageVO) throws Exception{
|
|
| 451 |
+ userManageDAO.updateNextPayMethod(userManageVO); |
|
| 452 |
+ } |
|
| 453 |
+ |
|
| 442 | 454 |
@Override |
| 443 | 455 |
public int selectAdminDiChk(UserManageVO userManageVO) {
|
| 444 | 456 |
return userManageDAO.selectAdminDiChk(userManageVO); |
--- src/main/java/itn/let/uss/umt/service/impl/UserManageDAO.java
+++ src/main/java/itn/let/uss/umt/service/impl/UserManageDAO.java
... | ... | @@ -228,6 +228,16 @@ |
| 228 | 228 |
update("userManageDAO.updateCrtfcDnValue",userManageVO);
|
| 229 | 229 |
} |
| 230 | 230 |
|
| 231 |
+ // 다음 결제시 결제수단 SELECT |
|
| 232 |
+ public String selectNextPayMethod(String mberId) throws Exception{
|
|
| 233 |
+ return (String) select("userManageDAO.selectNextPayMethod", mberId);
|
|
| 234 |
+ } |
|
| 235 |
+ |
|
| 236 |
+ // 다음 결제시 결제수단 UPDATE |
|
| 237 |
+ public void updateNextPayMethod(UserManageVO userManageVO){
|
|
| 238 |
+ update("userManageDAO.updateNextPayMethod",userManageVO);
|
|
| 239 |
+ } |
|
| 240 |
+ |
|
| 231 | 241 |
/** |
| 232 | 242 |
* Admin DI Chk |
| 233 | 243 |
* @param userManageVO 본인 인증 값 :: KMS DI 값 -> CRTFC_DN_VALUE |
--- src/main/resources/egovframework/sqlmap/let/uss/umt/EgovUserManage_SQL_Mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/uss/umt/EgovUserManage_SQL_Mysql.xml
... | ... | @@ -412,6 +412,21 @@ |
| 412 | 412 |
|
| 413 | 413 |
</update> |
| 414 | 414 |
|
| 415 |
+ <!-- 다음 결제시 결제수단 SELECT --> |
|
| 416 |
+ <select id="userManageDAO.selectNextPayMethod" parameterClass="String" resultClass="String"> |
|
| 417 |
+ SELECT |
|
| 418 |
+ IFNULL(NEXT_PAY_METHOD, '') AS nextPayMethod |
|
| 419 |
+ FROM LETTNGNRLMBER |
|
| 420 |
+ WHERE MBER_ID = #mberId# |
|
| 421 |
+ </select> |
|
| 422 |
+ |
|
| 423 |
+ <!-- 다음 결제시 결제수단 UPDATE --> |
|
| 424 |
+ <update id="userManageDAO.updateNextPayMethod"> |
|
| 425 |
+ UPDATE LETTNGNRLMBER |
|
| 426 |
+ SET NEXT_PAY_METHOD = #nextPayMethod# |
|
| 427 |
+ WHERE MBER_ID = #mberId# |
|
| 428 |
+ </update> |
|
| 429 |
+ |
|
| 415 | 430 |
<select id="userManageDAO.selectAdminDiChk" resultClass="int"> |
| 416 | 431 |
SELECT |
| 417 | 432 |
count(*) |
--- src/main/webapp/WEB-INF/jsp/web/pay/PayViewV2.jsp
+++ src/main/webapp/WEB-INF/jsp/web/pay/PayViewV2.jsp
... | ... | @@ -28,10 +28,123 @@ |
| 28 | 28 |
if (tabType == "2") {
|
| 29 | 29 |
$("#btnDdedicatedAccount").trigger("click");
|
| 30 | 30 |
} |
| 31 |
+ |
|
| 32 |
+ //다음 결제시 결제수단 SELECT |
|
| 33 |
+ getNextPayMethod(); |
|
| 31 | 34 |
|
| 32 | 35 |
// 등급제 대상 여부 |
| 33 | 36 |
getMberGrdChk(); |
| 34 | 37 |
}); |
| 38 |
+ |
|
| 39 |
+//다음 결제시 결제수단 SELECT |
|
| 40 |
+function getNextPayMethod() {
|
|
| 41 |
+ var nextPayMethod = ""; |
|
| 42 |
+ $.ajax({
|
|
| 43 |
+ type: "POST", |
|
| 44 |
+ url: "/web/member/pay/selectNextPayMethodAjax.do", |
|
| 45 |
+ data: {},
|
|
| 46 |
+ dataType:'json', |
|
| 47 |
+ async: false, |
|
| 48 |
+ success: function (data) {
|
|
| 49 |
+ if (data.isSuccess) {
|
|
| 50 |
+ if (data.nextPayMethod != '') {
|
|
| 51 |
+ nextPayMethod = data.nextPayMethod; |
|
| 52 |
+ |
|
| 53 |
+ // 버튼 영역 |
|
| 54 |
+ $(".btn_tab").removeClass("active");
|
|
| 55 |
+ // 금액 영역 |
|
| 56 |
+ $(".area_tabcont").removeClass("on");
|
|
| 57 |
+ |
|
| 58 |
+ if (nextPayMethod == "CARD") {
|
|
| 59 |
+ $(".btn_charge1").addClass("active");
|
|
| 60 |
+ $("#tab2_1").addClass("area_tabcont on");
|
|
| 61 |
+ } |
|
| 62 |
+ else if (nextPayMethod == "VBANK") {
|
|
| 63 |
+ $(".btn_charge2").addClass("active");
|
|
| 64 |
+ $("#tab2_2").addClass("area_tabcont on");
|
|
| 65 |
+ } |
|
| 66 |
+ else if (nextPayMethod == "CELLPHONE") {
|
|
| 67 |
+ $(".btn_charge3").addClass("active");
|
|
| 68 |
+ $("#tab2_3").addClass("area_tabcont on");
|
|
| 69 |
+ } |
|
| 70 |
+ else if (nextPayMethod == "BANK") {
|
|
| 71 |
+ $(".btn_charge4").addClass("active");
|
|
| 72 |
+ $("#tab2_4").addClass("area_tabcont on");
|
|
| 73 |
+ } |
|
| 74 |
+ else if (nextPayMethod == "NAV") {
|
|
| 75 |
+ $(".btn_charge5").addClass("active");
|
|
| 76 |
+ $("#tab2_5").addClass("area_tabcont on");
|
|
| 77 |
+ } |
|
| 78 |
+ else if (nextPayMethod == "KKO") {
|
|
| 79 |
+ $(".btn_charge6").addClass("active");
|
|
| 80 |
+ $("#tab2_6").addClass("area_tabcont on");
|
|
| 81 |
+ } |
|
| 82 |
+ else if (nextPayMethod == "TOS") {
|
|
| 83 |
+ $(".btn_charge7").addClass("active");
|
|
| 84 |
+ $("#tab2_7").addClass("area_tabcont on");
|
|
| 85 |
+ } |
|
| 86 |
+ else if (nextPayMethod == "PYC") {
|
|
| 87 |
+ $(".btn_charge8").addClass("active");
|
|
| 88 |
+ $("#tab2_8").addClass("area_tabcont on");
|
|
| 89 |
+ } |
|
| 90 |
+ |
|
| 91 |
+ // 체크박스 |
|
| 92 |
+ $("input:checkbox[id='agree']").prop("checked", true);
|
|
| 93 |
+ } |
|
| 94 |
+ } |
|
| 95 |
+ }, |
|
| 96 |
+ error: function (e) {
|
|
| 97 |
+ |
|
| 98 |
+ } |
|
| 99 |
+ }); |
|
| 100 |
+} |
|
| 101 |
+ |
|
| 102 |
+// 다음 결제시 결제수단 UPDATE |
|
| 103 |
+function setNextPayMethod() {
|
|
| 104 |
+ var nextPayMethod = ""; |
|
| 105 |
+ if ($("input:checkbox[id='agree']").is(":checked") == true) {
|
|
| 106 |
+ var $currentTab = $('.area_tab').children('.active').index();
|
|
| 107 |
+ if ($currentTab == 0) {
|
|
| 108 |
+ nextPayMethod = "CARD"; |
|
| 109 |
+ } else if ($currentTab == 1) {
|
|
| 110 |
+ nextPayMethod = "VBANK"; |
|
| 111 |
+ } else if ($currentTab==2) {
|
|
| 112 |
+ nextPayMethod = "CELLPHONE"; |
|
| 113 |
+ } else if ($currentTab==3) {
|
|
| 114 |
+ nextPayMethod = "BANK"; |
|
| 115 |
+ } else {
|
|
| 116 |
+ if ($currentTab == 4) {
|
|
| 117 |
+ nextPayMethod = "NAV"; // 네이버페이 |
|
| 118 |
+ } else if ($currentTab==5) {
|
|
| 119 |
+ nextPayMethod = "KKO"; // 카카오페이 |
|
| 120 |
+ } else if ($currentTab==6) {
|
|
| 121 |
+ nextPayMethod = "TOS"; // 토스페이 |
|
| 122 |
+ } else if ($currentTab==7) {
|
|
| 123 |
+ nextPayMethod = "PYC"; // 페이코 |
|
| 124 |
+ } |
|
| 125 |
+ } |
|
| 126 |
+ } |
|
| 127 |
+ else {
|
|
| 128 |
+ nextPayMethod = ""; |
|
| 129 |
+ } |
|
| 130 |
+ |
|
| 131 |
+ // 업데이트 |
|
| 132 |
+ $.ajax({
|
|
| 133 |
+ type: "POST", |
|
| 134 |
+ url: "/web/member/pay/updateNextPayMethodAjax.do", |
|
| 135 |
+ data: {"nextPayMethod" : nextPayMethod},
|
|
| 136 |
+ dataType:'json', |
|
| 137 |
+ async: false, |
|
| 138 |
+ success: function (data) {
|
|
| 139 |
+ if (data.isSuccess) {
|
|
| 140 |
+ |
|
| 141 |
+ } |
|
| 142 |
+ }, |
|
| 143 |
+ error: function (e) {
|
|
| 144 |
+ |
|
| 145 |
+ } |
|
| 146 |
+ }); |
|
| 147 |
+} |
|
| 35 | 148 |
|
| 36 | 149 |
|
| 37 | 150 |
//결제수단 상태 체크 |
... | ... | @@ -120,6 +233,9 @@ |
| 120 | 233 |
alert("충전금액을 선택해주세요.");
|
| 121 | 234 |
return false; |
| 122 | 235 |
} |
| 236 |
+ |
|
| 237 |
+ // 다음 결제시 결제수단 UPDATE |
|
| 238 |
+ setNextPayMethod(); |
|
| 123 | 239 |
|
| 124 | 240 |
var payMethod = ""; |
| 125 | 241 |
document.pgForm.action = "/web/member/pay/PayActionAjax.do"; |
... | ... | @@ -414,6 +530,9 @@ |
| 414 | 530 |
|
| 415 | 531 |
} |
| 416 | 532 |
|
| 533 |
+ // 다음 결제시 결제수단 UPDATE |
|
| 534 |
+ setNextPayMethod(); |
|
| 535 |
+ |
|
| 417 | 536 |
var data = new FormData(document.pgForm); |
| 418 | 537 |
url = "/web/member/pay/updateVacsAccountUsrIdAjax.do"; |
| 419 | 538 |
|
... | ... | @@ -693,10 +812,10 @@ |
| 693 | 812 |
<li class="btn_charge3 btn_tab"><button type="button" onclick="TabTypePay(this,'3');"><i></i>휴대폰결제</button></li> |
| 694 | 813 |
<li class="btn_charge4 btn_tab"><button type="button" onclick="TabTypePay(this,'4');"><i></i>즉시이체</button></li> |
| 695 | 814 |
|
| 696 |
- <li class="btn_charge5 btn_tab simple_pay"><button type="button" onclick="TabTypePay(this,'6');"><i></i></button></li> |
|
| 697 |
- <li class="btn_charge6 btn_tab simple_pay"><button type="button" onclick="TabTypePay(this,'7');"><i></i></button></li> |
|
| 698 |
- <li class="btn_charge7 btn_tab simple_pay"><button type="button" onclick="TabTypePay(this,'8');"><i></i></button></li> |
|
| 699 |
- <li class="btn_charge8 btn_tab simple_pay"><button type="button" onclick="TabTypePay(this,'9');"><i></i></button></li> |
|
| 815 |
+ <li class="btn_charge5 btn_tab simple_pay"><button type="button" onclick="TabTypePay(this,'5');"><i></i></button></li> |
|
| 816 |
+ <li class="btn_charge6 btn_tab simple_pay"><button type="button" onclick="TabTypePay(this,'6');"><i></i></button></li> |
|
| 817 |
+ <li class="btn_charge7 btn_tab simple_pay"><button type="button" onclick="TabTypePay(this,'7');"><i></i></button></li> |
|
| 818 |
+ <li class="btn_charge8 btn_tab simple_pay"><button type="button" onclick="TabTypePay(this,'8');"><i></i></button></li> |
|
| 700 | 819 |
</ul> |
| 701 | 820 |
<div class="checkbox_wrap"><input type="checkbox" id="agree"><label for="agree">선택한 수단을 다음 충전 시에도 이용합니다.</label></div> |
| 702 | 821 |
|
... | ... | @@ -1013,7 +1132,7 @@ |
| 1013 | 1132 |
<!-- //즉시이체 --> |
| 1014 | 1133 |
|
| 1015 | 1134 |
<!-- 네이버페이 --> |
| 1016 |
- <div class="area_tabcont" id="tab2_6"> |
|
| 1135 |
+ <div class="area_tabcont" id="tab2_5"> |
|
| 1017 | 1136 |
<p class="tType1_title"><img src="/publish/images/simple_small.png" alt="간편결제"> 네이버페이</p> |
| 1018 | 1137 |
<table class="tType1"> |
| 1019 | 1138 |
<colgroup> |
... | ... | @@ -1082,7 +1201,7 @@ |
| 1082 | 1201 |
<!-- //네이버페이 --> |
| 1083 | 1202 |
|
| 1084 | 1203 |
<!-- 카카오페이 --> |
| 1085 |
- <div class="area_tabcont current" id="tab2_7"> |
|
| 1204 |
+ <div class="area_tabcont current" id="tab2_6"> |
|
| 1086 | 1205 |
<!-- 신규계좌발급 시 --> |
| 1087 | 1206 |
<p class="tType1_title"><img src="/publish/images/simple_small.png" alt="간편결제"> 카카오페이</p> |
| 1088 | 1207 |
<table class="tType1"> |
... | ... | @@ -1151,7 +1270,7 @@ |
| 1151 | 1270 |
<!-- //카카오페이 --> |
| 1152 | 1271 |
|
| 1153 | 1272 |
<!-- 토스페이 --> |
| 1154 |
- <div class="area_tabcont current" id="tab2_8"> |
|
| 1273 |
+ <div class="area_tabcont current" id="tab2_7"> |
|
| 1155 | 1274 |
<p class="tType1_title"><img src="/publish/images/simple_small.png" alt="간편결제"> 토스페이</p> |
| 1156 | 1275 |
<table class="tType1"> |
| 1157 | 1276 |
<caption></caption> |
... | ... | @@ -1210,7 +1329,7 @@ |
| 1210 | 1329 |
<!-- //토스페이 --> |
| 1211 | 1330 |
|
| 1212 | 1331 |
<!-- 페이코 --> |
| 1213 |
- <div class="area_tabcont current" id="tab2_9"> |
|
| 1332 |
+ <div class="area_tabcont current" id="tab2_8"> |
|
| 1214 | 1333 |
<p class="tType1_title"><img src="/publish/images/simple_small.png" alt="간편결제"> PAYCO</p> |
| 1215 | 1334 |
<table class="tType1"> |
| 1216 | 1335 |
<caption></caption> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?