Просмотр исходного кода

js 위치 변경및 전체적으로 수정

jsshin 5 лет назад
Родитель
Сommit
1857142a7e

+ 11 - 0
src/main/java/com/style24/front/biz/service/TsfCustomerService.java

@@ -182,4 +182,15 @@ public class TsfCustomerService {
 		return result;
 		return result;
 	}
 	}
 
 
+	/**
+	 * 회원가입
+	 * @param customer - 일반가입, SNS 가입
+	 * @author jsshin
+	 * @since 2021. 02. 19
+	 */
+	@Transactional("shopTxnManager")
+	public void saveJoinCustomer(Customer customer) {
+		//
+	}
+
 }
 }

+ 66 - 0
src/main/java/com/style24/front/biz/service/TsfKakaoService.java

@@ -0,0 +1,66 @@
+package com.style24.front.biz.service;
+
+import com.gagaframework.web.parameter.GagaMap;
+import com.style24.core.biz.service.TscCustomerService;
+import com.style24.core.biz.thirdparty.SsgKakaoSender;
+import com.style24.core.support.env.TscConstants;
+import com.style24.persistence.domain.CustContactHst;
+import com.style24.persistence.domain.Customer;
+import com.style24.persistence.domain.SsgDirectMessage;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+
+/**
+ * 카카오알림톡 Service. 모든 카카오알림톡 발송은 여기에서 처리한다.
+ *
+ * @author gagamel
+ * @since 2021. 02. 19
+ */
+@Service
+@Slf4j
+public class TsfKakaoService {
+
+	@Autowired
+	private SsgKakaoSender kakaoSender;
+
+	@Autowired
+	private TscCustomerService coreCustomerService;
+
+
+	/**
+	 * 가입축하 알림톡
+	 *
+	 * @param customer - 고객 정보
+	 * @author jsshin
+	 * @since 2021. 02. 19
+	 */
+	@Transactional("shopTxnManager")
+	public void sendJoinCongrat(Customer customer) {
+		SsgDirectMessage dm = new SsgDirectMessage();
+		dm.setFdestine(customer.getCellPhnno());
+		dm.setFkkoresendtype("LMS");
+
+		GagaMap replaceInfo = new GagaMap();
+		replaceInfo.setString("siteNm", TscConstants.Style24Infomation.SITE_NAME.value());
+		replaceInfo.setString("custNm", customer.getCustNm());
+		kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.JoinCongrat.value(), dm, replaceInfo);
+
+		try {
+			// 고객접촉이력 정보
+			CustContactHst custContactHst = new CustContactHst();
+			custContactHst.setContactType(TscConstants.ContactType.CONGRATULATIONS.value());
+			custContactHst.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법:알림톡+문자(공통코드G055)
+			custContactHst.setReceiverNo(customer.getCustNo());
+			custContactHst.setContactContents("회원가입축하");
+			coreCustomerService.createCustomerContactHistory(custContactHst);
+		} catch (Exception e) {
+			log.error("error", e);
+			// Do nothing
+		}
+	}
+
+
+}

+ 22 - 17
src/main/java/com/style24/front/biz/web/TsfCustomerController.java

@@ -2,8 +2,10 @@ package com.style24.front.biz.web;
 
 
 import com.gagaframework.web.parameter.GagaMap;
 import com.gagaframework.web.parameter.GagaMap;
 import com.gagaframework.web.security.GagaPasswordEncoder;
 import com.gagaframework.web.security.GagaPasswordEncoder;
+import com.style24.core.biz.service.TscClauseService;
 import com.style24.core.support.env.TscConstants;
 import com.style24.core.support.env.TscConstants;
 import com.style24.core.support.session.TscSession;
 import com.style24.core.support.session.TscSession;
+import com.style24.front.biz.service.TsfKakaoService;
 import com.style24.front.biz.thirdparty.NiceCertify;
 import com.style24.front.biz.thirdparty.NiceCertify;
 import com.style24.front.support.security.session.TsfSession;
 import com.style24.front.support.security.session.TsfSession;
 import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.Customer;
@@ -41,6 +43,12 @@ public class TsfCustomerController extends TsfBaseController {
 	@Autowired
 	@Autowired
 	private TsfCustomerService customerService;
 	private TsfCustomerService customerService;
 
 
+	@Autowired
+	TscClauseService clauseService;
+
+	@Autowired
+	TsfKakaoService kakaoService;
+
 	@Autowired
 	@Autowired
 	private NiceCertify niceCertify;
 	private NiceCertify niceCertify;
 
 
@@ -323,10 +331,6 @@ public class TsfCustomerController extends TsfBaseController {
 	@GetMapping("/licensing/layer/form")
 	@GetMapping("/licensing/layer/form")
 	public ModelAndView getLicensingLayerForm() {
 	public ModelAndView getLicensingLayerForm() {
 		ModelAndView mav = new ModelAndView();
 		ModelAndView mav = new ModelAndView();
-		// 이용약관
-//		mav.addObject("clause10", customerService.getClauseOne("10"));
-
-//		mav.setViewName(super.getDeviceViewName("customer/LicensingLayerForm"));
 
 
 		return mav;
 		return mav;
 	}
 	}
@@ -342,9 +346,6 @@ public class TsfCustomerController extends TsfBaseController {
 	public ModelAndView getPrivacyLayerForm() {
 	public ModelAndView getPrivacyLayerForm() {
 		ModelAndView mav = new ModelAndView();
 		ModelAndView mav = new ModelAndView();
 
 
-		// 개인정보취급방침
-//		mav.addObject("clause11", customerService.getClauseOne("11"));
-//		mav.setViewName(super.getDeviceViewName("customer/PrivacyLayerForm"));
 		return mav;
 		return mav;
 	}
 	}
 
 
@@ -358,10 +359,7 @@ public class TsfCustomerController extends TsfBaseController {
 	@GetMapping("/marketing/layer/form")
 	@GetMapping("/marketing/layer/form")
 	public ModelAndView getMarketingLayerForm() {
 	public ModelAndView getMarketingLayerForm() {
 		ModelAndView mav = new ModelAndView();
 		ModelAndView mav = new ModelAndView();
-
-		// 마케팅 동의
-//		mav.addObject("clause18", customerService.getClauseOne("18"));
-//		mav.setViewName(super.getDeviceViewName("customer/MarketingLayerForm"));
+		
 
 
 		return mav;
 		return mav;
 	}
 	}
@@ -511,9 +509,9 @@ public class TsfCustomerController extends TsfBaseController {
 	}
 	}
 
 
 	/**
 	/**
-	 * 가입화면 - 휴대포 확인
+	 * 가입화면 - 휴대폰 확인(임시)
 	 *
 	 *
-	 * @param customer - email
+	 * @param customer - cellphnno
 	 * @return GagaMap - 결과정보
 	 * @return GagaMap - 결과정보
 	 * @author jsshin
 	 * @author jsshin
 	 * @since 2021. 02. 18
 	 * @since 2021. 02. 18
@@ -540,9 +538,9 @@ public class TsfCustomerController extends TsfBaseController {
 
 
 
 
 	/**
 	/**
-	 * 가입화면 - 휴대폰 인증
+	 * 가입화면 - 나이스 휴대폰인증
 	 *
 	 *
-	 * @param customer - cellPhnno
+	 * @param customer - 인증정보
 	 * @return GagaMap - 결과정보
 	 * @return GagaMap - 결과정보
 	 * @author jsshin
 	 * @author jsshin
 	 * @since 2021. 02. 18
 	 * @since 2021. 02. 18
@@ -575,15 +573,22 @@ public class TsfCustomerController extends TsfBaseController {
 
 
 	@PostMapping("/join/save")
 	@PostMapping("/join/save")
 	@ResponseBody
 	@ResponseBody
-	public GagaMap saveCustomerJoin(@RequestBody Customer customer) {
+	public GagaMap saveJoinCustomer(@RequestBody Customer customer) {
 		String encData = TscSession.getAttribute("encData");
 		String encData = TscSession.getAttribute("encData");
 		customer.setEncData(encData);
 		customer.setEncData(encData);
 		GagaMap authInfo = niceCertify.getCertifyCellPhoneResultInfo(customer);
 		GagaMap authInfo = niceCertify.getCertifyCellPhoneResultInfo(customer);
 		customer.setCi(authInfo.getString("sCi"));
 		customer.setCi(authInfo.getString("sCi"));
 
 
-		// validation
+		// 1.입력 받은 데이터 검증
 
 
+		// 2.고객정보 생성 및 혜택 처리
 
 
+		// 3.알림톡 및 메일 발송
+		try {
+
+		} catch (Exception e) {
+			log.error("error", e);
+		}
 
 
 		return new GagaMap();
 		return new GagaMap();
 	}
 	}

+ 3 - 3
src/main/webapp/WEB-INF/views/web/customer/IdFindFormWeb.html

@@ -219,7 +219,7 @@
 	</div>
 	</div>
 </div>
 </div>
 
 
-<script th:src="@{'/ux/customer/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/ux/customer/customer.js"></script>
+<script th:src="@{'/biz/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/biz/customer.js"></script>
 <script th:inline="javascript">
 <script th:inline="javascript">
 /*<![CDATA[*/
 /*<![CDATA[*/
 
 
@@ -245,7 +245,7 @@
 
 
 		let jsonData = JSON.stringify(custInfo);
 		let jsonData = JSON.stringify(custInfo);
 		//console.log('jsonData', jsonData);
 		//console.log('jsonData', jsonData);
-		ajaxJsonSubmit('/customer/id/find', jsonData, fnInfoConfirmCallBack);
+		gagajf.ajaxJsonSubmit('/customer/id/find', jsonData, fnInfoConfirmCallBack);
 	});
 	});
 
 
 	// 휴대폰 인증
 	// 휴대폰 인증
@@ -265,7 +265,7 @@
 			custInfo.encData = encData;
 			custInfo.encData = encData;
 			custInfo.authMethod = authMethod;
 			custInfo.authMethod = authMethod;
 			let jsonData = JSON.stringify(custInfo);
 			let jsonData = JSON.stringify(custInfo);
-			ajaxJsonSubmit('/customer/id/find', jsonData, fnInfoConfirmCallBack)
+			gagajf.ajaxJsonSubmit('/customer/id/find', jsonData, fnInfoConfirmCallBack)
 		}
 		}
 	};
 	};
 
 

+ 5 - 5
src/main/webapp/WEB-INF/views/web/customer/JoinFormWeb.html

@@ -165,7 +165,7 @@
 	</div>
 	</div>
 </div>
 </div>
 
 
-<script th:src="@{'/ux/customer/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/ux/customer/customer.js"></script>
+<script th:src="@{'/biz/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/biz/customer.js"></script>
 <script th:inline="javascript">
 <script th:inline="javascript">
 /*<![CDATA[*/
 /*<![CDATA[*/
 	let custIdCheck = false;
 	let custIdCheck = false;
@@ -182,7 +182,7 @@
 				let custInfo = {};
 				let custInfo = {};
 				custInfo.custId = custId;
 				custInfo.custId = custId;
 				let jsonData = JSON.stringify(custInfo);
 				let jsonData = JSON.stringify(custInfo);
-				ajaxJsonSubmit('/customer/join/id/check', jsonData, fnIdConfirmCallBack);
+				gagajf.ajaxJsonSubmit('/customer/join/id/check', jsonData, fnIdConfirmCallBack);
 			}
 			}
 		}
 		}
 	});
 	});
@@ -322,7 +322,7 @@
 				let custInfo = {};
 				let custInfo = {};
 				custInfo.email = email;
 				custInfo.email = email;
 				let jsonData = JSON.stringify(custInfo);
 				let jsonData = JSON.stringify(custInfo);
-				ajaxJsonSubmit('/customer/email/check', jsonData, fnEmailConfirmCallBack);
+				gagajf.ajaxJsonSubmit('/customer/email/check', jsonData, fnEmailConfirmCallBack);
 			}
 			}
 		}
 		}
 	});
 	});
@@ -360,7 +360,7 @@
 				let custInfo = {};
 				let custInfo = {};
 				custInfo.cellPhnno = cellPhnno;
 				custInfo.cellPhnno = cellPhnno;
 				let jsonData = JSON.stringify(custInfo);
 				let jsonData = JSON.stringify(custInfo);
-				ajaxJsonSubmit('/customer/cellphnno/check', jsonData, fnPhoneConfirmCallBack);
+				gagajf.ajaxJsonSubmit('/customer/cellphnno/check', jsonData, fnPhoneConfirmCallBack);
 			}
 			}
 		}
 		}
 	});
 	});
@@ -393,7 +393,7 @@
 			let custInfo = {};
 			let custInfo = {};
 			custInfo.encData = encData;
 			custInfo.encData = encData;
 			let jsonData = JSON.stringify(custInfo);
 			let jsonData = JSON.stringify(custInfo);
-			ajaxJsonSubmit('/customer/authentication/validation', jsonData, fnInfoConfirmCallBack);
+			gagajf.ajaxJsonSubmit('/customer/authentication/validation', jsonData, fnInfoConfirmCallBack);
 		}
 		}
 	};
 	};
 
 

+ 2 - 2
src/main/webapp/WEB-INF/views/web/customer/PasswordChangeFormWeb.html

@@ -104,7 +104,7 @@
 	</div>
 	</div>
 </div>
 </div>
 
 
-<script th:src="@{'/ux/customer/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/ux/customer/customer.js"></script>
+<script th:src="@{'/biz/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/biz/customer.js"></script>
 <script th:inline="javascript">
 <script th:inline="javascript">
 /*<![CDATA[*/
 /*<![CDATA[*/
 
 
@@ -221,7 +221,7 @@
 		fnCheckPassword();
 		fnCheckPassword();
 		fnCheckConfirmPassword();
 		fnCheckConfirmPassword();
 		let jsonData = JSON.stringify(resetPasswordForm);
 		let jsonData = JSON.stringify(resetPasswordForm);
-		ajaxJsonSubmit('/customer/password/reset', jsonData, fnSavePasswordCallback);
+		gagajf.ajaxJsonSubmit('/customer/password/reset', jsonData, fnSavePasswordCallback);
 	});
 	});
 
 
 	var fnSavePasswordCallback = function (result) {
 	var fnSavePasswordCallback = function (result) {

+ 4 - 4
src/main/webapp/WEB-INF/views/web/customer/PasswordFindFormWeb.html

@@ -189,7 +189,7 @@
 	</div>
 	</div>
 </div>
 </div>
 
 
-<script th:src="@{'/ux/customer/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/ux/customer/customer.js"></script>
+<script th:src="@{'/biz/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/biz/customer.js"></script>
 <script th:inline="javascript">
 <script th:inline="javascript">
 /*<![CDATA[*/
 /*<![CDATA[*/
 	let custIdCheck = false;
 	let custIdCheck = false;
@@ -204,7 +204,7 @@
 		let custInfo = {};
 		let custInfo = {};
 		custInfo.custId = custId;
 		custInfo.custId = custId;
 		let jsonData = JSON.stringify(custInfo);
 		let jsonData = JSON.stringify(custInfo);
-		ajaxJsonSubmit('/customer/id/check', jsonData, fnIdConfirmCallBack)
+		gagajf.ajaxJsonSubmit('/customer/id/check', jsonData, fnIdConfirmCallBack)
 	});
 	});
 
 
 	var fnIdConfirmCallBack = function (result) {
 	var fnIdConfirmCallBack = function (result) {
@@ -244,7 +244,7 @@
 		custInfo.authMethod = 'custInfo';
 		custInfo.authMethod = 'custInfo';
 		let jsonData = JSON.stringify(custInfo);
 		let jsonData = JSON.stringify(custInfo);
 		//console.log('jsonData', jsonData);
 		//console.log('jsonData', jsonData);
-		ajaxJsonSubmit('/customer/password/find/custinfo', jsonData, fnInfoConfirmCallBack);
+		gagajf.ajaxJsonSubmit('/customer/password/find/custinfo', jsonData, fnInfoConfirmCallBack);
 	});
 	});
 
 
 	// 휴대폰 인증
 	// 휴대폰 인증
@@ -294,7 +294,7 @@
 			custInfo.encData = encData;
 			custInfo.encData = encData;
 			custInfo.authMethod = authMethod;
 			custInfo.authMethod = authMethod;
 			let jsonData = JSON.stringify(custInfo);
 			let jsonData = JSON.stringify(custInfo);
-			ajaxJsonSubmit('/customer/password/find/certify', jsonData, fnInfoConfirmCallBack)
+			gagajf.ajaxJsonSubmit('/customer/password/find/certify', jsonData, fnInfoConfirmCallBack)
 		}
 		}
 	};
 	};
 
 

+ 0 - 46
src/main/webapp/ux/customer/customer.js → src/main/webapp/biz/customer.js

@@ -181,49 +181,3 @@ var fnValidationPwdSameConfirmPwd = function (password, confirmPassword) {
 	}
 	}
 	return result;
 	return result;
 };
 };
-
-
-
-/*
-* 임시사용
-*
-* */
-var ajaxJsonSubmit = function (url, json, callback) {
-	$.ajax({
-		type : "POST",
-		url : url,
-		dataType : 'json',
-		data : json,
-		beforeSend : function(xhr, opts) { // 통신 전
-			// when validation is false
-			// AJAX call
-			xhr.setRequestHeader('AJAX', 'true');
-			// dataType: "json"일 때
-			xhr.setRequestHeader('Accept', 'application/json');
-			xhr.setRequestHeader('Content-Type', 'application/json');
-		},
-		success : function(result) {
-			if (typeof(result.status) == 'undefined' || result.status === 200) { // 성공
-				if (!gagajf.isNull(result.message)) {
-					if (mcxDialog.alert(result.message)) {
-						if (typeof(callback) === 'function') {
-							callback.call(this, result);
-						}
-					}
-				} else {
-					if (typeof(callback) == "function") {
-						callback.call(this, result);
-					}
-				}
-			} else { // 실패
-				if (!gagajf.isNull(result.error.message)) {
-					mcxDialog.alert(result.error.message);
-				}
-			}
-		},
-		error : function() {
-			// error code
-			mcxDialog.alert('오류로 인해 처리되지 않았습니다.');
-		}
-	});
-}