Bladeren bron

임시 비밀번호 수정

jsshin 5 jaren geleden
bovenliggende
commit
d8ebd03e4c

+ 18 - 3
src/main/java/com/style24/admin/biz/service/TsaCustomerService.java

@@ -5,6 +5,7 @@ import com.style24.admin.biz.dao.TsaCustomerDao;
 import com.style24.admin.support.security.session.TsaSession;
 import com.style24.core.biz.service.TscCustomerService;
 import com.style24.core.support.env.TscConstants;
+import com.style24.core.support.session.TscSession;
 import com.style24.core.support.util.CryptoUtils;
 import com.style24.persistence.domain.Counsel;
 import com.style24.persistence.domain.Coupon;
@@ -112,8 +113,12 @@ public class TsaCustomerService {
 	 * @since 2021. 1. 20
 	 */
 	@Transactional("shopTxnManager")
-	public void updateCustomerPassword(Customer customer) {
-		coreCustomerService.updateCustomerPassword(customer);
+	public void saveCustomerPassword(Customer customer) {
+		Integer userNo = TsaSession.getInfo().getUserNo();
+		customer.setRegNo(userNo);
+		customer.setUpdNo(userNo);
+		customer.setTempPasswdYn("Y");
+		coreCustomerService.saveCustomerPassword(customer);
 	}
 
 	/**
@@ -134,6 +139,7 @@ public class TsaCustomerService {
 	/**
 	 * 회원 탈퇴처리
 	 * @param customer - 고객정보
+	 * @return GagaMap - 결과 정보(메시지)
 	 * @author jsshin
 	 * @since 2021. 1. 26
 	 */
@@ -355,5 +361,14 @@ public class TsaCustomerService {
 		return customerDao.getCustomerDormantList(customerSearch);
 	}
 
-
+	/**
+	 * 임시비밀번호 조회
+	 * @param length - 비밀번호 자릿수
+	 * @return 임시비밀번호
+	 * @author jsshin
+	 * @since 2021. 02. 15
+	 */
+	public String getTemporaryPassword(int length) {
+		return coreCustomerService.getTemporaryPassword(length);
+	}
 }

+ 2 - 4
src/main/java/com/style24/admin/biz/web/TsaCustomerController.java

@@ -440,16 +440,14 @@ public class TsaCustomerController extends TsaBaseController {
 	@PostMapping("/password/reset")
 	@ResponseBody
 	public GagaResponse resetCustomerPassword(@RequestBody Customer customer) throws Exception {
-		String tempPasswd = systemService.getTemporaryPassword(10);
+		String tempPasswd = customerService.getTemporaryPassword(10);
 		log.info("tempPasswd  ====> {}", tempPasswd);
-
 		customer.setTempPasswdYn("Y"); // 임시비밀번호여부
 		customer.setPasswd(tempPasswd);
 		customer.setEncodedPasswd(passwordEncoder.encodeSha256(tempPasswd));
-		customer.setRegNo(TsaSession.getInfo().getRegNo());
 
 		// 비밀번호 수정
-		customerService.updateCustomerPassword(customer);
+		customerService.saveCustomerPassword(customer);
 
 		// 카카오 알림톡
 		if (StringUtils.isNotBlank(customer.getCellPhnno())) {