Explorar o código

Merge branch 'develop' into bin2107

bin2107 %!s(int64=5) %!d(string=hai) anos
pai
achega
1bada0e076

+ 5 - 0
src/main/java/com/style24/front/biz/dao/TsfCustomerDao.java

@@ -1,10 +1,13 @@
 package com.style24.front.biz.dao;
 package com.style24.front.biz.dao;
 
 
 import com.style24.core.support.annotation.ShopDs;
 import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.CustDeliveryAddr;
 import com.style24.persistence.domain.CustSnsInfo;
 import com.style24.persistence.domain.CustSnsInfo;
 import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.WishList;
 import com.style24.persistence.domain.WishList;
 
 
+import java.util.Collection;
+
 /**
 /**
  * 고객(회원) Dao
  * 고객(회원) Dao
  * 
  * 
@@ -142,4 +145,6 @@ public interface TsfCustomerDao {
 	 * @since 2021. 03. 22
 	 * @since 2021. 03. 22
 	 */
 	 */
 	int updateCustomerInfo(Customer customer);
 	int updateCustomerInfo(Customer customer);
+
+
 }
 }

+ 11 - 0
src/main/java/com/style24/front/biz/dao/TsfPlanningDao.java

@@ -271,4 +271,15 @@ public interface TsfPlanningDao {
 	 */
 	 */
 	int getCustAnswerCount(Plan plan);
 	int getCustAnswerCount(Plan plan);
 	
 	
+	/**
+	 * 설문조사 선착순 키운트
+	 *
+	 * @param poll
+	 * @return int
+	 * @author sowon
+	 * @date 2021. 4. 5
+	 */
+	int getCustAnswerPartiCount(Poll poll);
+	
+	
 }
 }

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

@@ -26,6 +26,7 @@ import com.style24.front.support.security.TsfLoginDetails;
 import com.style24.front.support.security.session.TsfSession;
 import com.style24.front.support.security.session.TsfSession;
 import com.style24.persistence.domain.Coupon;
 import com.style24.persistence.domain.Coupon;
 import com.style24.persistence.domain.CustAccount;
 import com.style24.persistence.domain.CustAccount;
+import com.style24.persistence.domain.CustDeliveryAddr;
 import com.style24.persistence.domain.CustSnsInfo;
 import com.style24.persistence.domain.CustSnsInfo;
 import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.Login;
 import com.style24.persistence.domain.Login;
@@ -916,4 +917,15 @@ public class TsfCustomerService {
 		return resultMap;
 		return resultMap;
 	}
 	}
 
 
+	/**
+	 * 마이페이지 - 배송지 목록
+	 * @param  custDeliveryAddr - 고객번호
+	 * @return Collection<CustDeliveryAddr> - 배송목록
+	 * @author jsshin
+	 * @since 2021. 04. 01
+	 */
+	public Collection<CustDeliveryAddr> getCustomerDeliveryAddrList(CustDeliveryAddr custDeliveryAddr) {
+		return coreCustomerService.getCustomerDeliveryAddrList(custDeliveryAddr);
+	}
+
 }
 }

+ 13 - 0
src/main/java/com/style24/front/biz/service/TsfPlanningService.java

@@ -418,6 +418,19 @@ public class TsfPlanningService {
 	public int getCustAnswerCount(Plan plan) {
 	public int getCustAnswerCount(Plan plan) {
 		return planningDao.getCustAnswerCount(plan);
 		return planningDao.getCustAnswerCount(plan);
 	}
 	}
+	
+	/**
+	 * 설문조사 중복카운트
+	 *
+	 * @param plan
+	 * @return int
+	 * @author sowon
+	 * @date 2021. 4. 5
+	 */
+	public int getCustAnswerPartiCount(Poll poll) {
+		return planningDao.getCustAnswerPartiCount(poll);
+	}
+
 
 
 
 
 }
 }

+ 48 - 12
src/main/java/com/style24/front/biz/web/TsfMypageController.java

@@ -4,6 +4,11 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collection;
 import java.util.List;
 import java.util.List;
 
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.style24.core.biz.service.TscKcpService;
+import com.style24.persistence.domain.CustDeliveryAddr;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.stereotype.Controller;
@@ -120,10 +125,13 @@ public class TsfMypageController extends TsfBaseController {
 	
 	
 	@Autowired
 	@Autowired
 	private TsfCartService cartService;
 	private TsfCartService cartService;
-	
+
 	@Autowired
 	@Autowired
 	private TsfCommonService commonService;
 	private TsfCommonService commonService;
 
 
+	@Autowired
+	private TscKcpService kcpService;
+
 	/**
 	/**
 	 * 마이페이지 메인 화면
 	 * 마이페이지 메인 화면
 	 *
 	 *
@@ -826,7 +834,7 @@ public class TsfMypageController extends TsfBaseController {
 
 
 	/**
 	/**
 	 * 마이페이지 배송지 정보 수정
 	 * 마이페이지 배송지 정보 수정
-	 * 
+	 *
 	 * @param Order
 	 * @param Order
 	 * @return GagaMap
 	 * @return GagaMap
 	 * @author card007
 	 * @author card007
@@ -844,10 +852,10 @@ public class TsfMypageController extends TsfBaseController {
 			result.set("status", GagaResponseStatus.FAIL.getCode());
 			result.set("status", GagaResponseStatus.FAIL.getCode());
 			result.set("message", "배송지 수정에 실패했습니다.");
 			result.set("message", "배송지 수정에 실패했습니다.");
 		}
 		}
-		
+
 		result.set("status", GagaResponseStatus.SUCCESS.getCode());
 		result.set("status", GagaResponseStatus.SUCCESS.getCode());
 		result.set("message", "정상적으로 배송지가 수정되었습니다.");
 		result.set("message", "정상적으로 배송지가 수정되었습니다.");
-		
+
 		return result;
 		return result;
 	}
 	}
 
 
@@ -1388,16 +1396,12 @@ public class TsfMypageController extends TsfBaseController {
 	@ResponseBody
 	@ResponseBody
 	public GagaMap getAccountCheck(@RequestBody CustAccount custAccount) throws Exception {
 	public GagaMap getAccountCheck(@RequestBody CustAccount custAccount) throws Exception {
 		custAccount.setIpAddress(TsfSession.getIpAddress());
 		custAccount.setIpAddress(TsfSession.getIpAddress());
-
-		GagaMap result = coreCustomerService.checkAccount(custAccount);
-		
+		boolean isValid = false;
+		GagaMap result = kcpService.checkAccount(custAccount);
 		if("0000".equals(result.get("recCd"))) {
 		if("0000".equals(result.get("recCd"))) {
-			result.set("status", GagaResponseStatus.SUCCESS.getCode());
-			result.set("isValid", true);
-		} else {
-			throw new IllegalStateException(message.getMessage("FAIL_0004"));
+			isValid = true;
 		}
 		}
-
+		result.set("isValid", isValid);
 		return result;
 		return result;
 	}
 	}
 
 
@@ -1536,5 +1540,37 @@ public class TsfMypageController extends TsfBaseController {
 		return customerService.changePassword(customer);
 		return customerService.changePassword(customer);
 	}
 	}
 
 
+	/**
+	 * 마이페이지 - 배송지관리
+	 *
+	 * @return ModelAndView
+	 * @author jsshin
+	 * @since 2021. 04. 01
+	 */
+	@GetMapping("/delivery/addr/form")
+	public ModelAndView getDeliveryListForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName(super.getDeviceViewName("mypage/MypageCustDeliveryAddrForm"));
+
+		return mav;
+	}
+
+	/**
+	 * 마이페이지 - 배송지목록
+	 *
+	 * @return Collection<CustDeliveryAddr>
+	 * @author jsshin
+	 * @since 2021. 04. 02
+	 */
+	@GetMapping("/customer/delivery/addr/list")
+	@ResponseBody
+	public Collection<CustDeliveryAddr> getCustomerDeliveryAddrList() {
+		CustDeliveryAddr custDeliveryAddr = new CustDeliveryAddr();
+		custDeliveryAddr.setCustNo(TsfSession.getInfo().getCustNo());
+		return customerService.getCustomerDeliveryAddrList(custDeliveryAddr);
+	}
+
+
 	/*신주승 끝*/
 	/*신주승 끝*/
 }
 }

+ 10 - 0
src/main/java/com/style24/front/biz/web/TsfPlanningController.java

@@ -358,6 +358,8 @@ public class TsfPlanningController extends TsfBaseController {
 		
 		
 		poll = planningService.getPollQuestionInfo(plan);
 		poll = planningService.getPollQuestionInfo(plan);
 		String partYn = poll.getDupPartiYn(); 
 		String partYn = poll.getDupPartiYn(); 
+		String comYn = poll.getFstComYn();
+		int partiCnt = poll.getPartiCnt();
 		// 중복참여가 아닌경우
 		// 중복참여가 아닌경우
 		if(partYn.equals("N")) {
 		if(partYn.equals("N")) {
 			int count = planningService.getCustAnswerCount(plan);
 			int count = planningService.getCustAnswerCount(plan);
@@ -366,6 +368,14 @@ public class TsfPlanningController extends TsfBaseController {
 				result.set("status","1");
 				result.set("status","1");
 			}
 			}
 		}
 		}
+		else if (comYn.equals("Y")) {
+			int count = planningService.getCustAnswerPartiCount(poll);
+			if (count>=partiCnt) {
+				result.set("msg","선착순 응모가 마감되었습니다.");
+				result.set("status","2");
+			}
+			
+		}
 		return result;
 		return result;
 	}
 	}
 	
 	

+ 9 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfPlanning.xml

@@ -1041,4 +1041,13 @@
 		 AND NOW() BETWEEN P.DISP_STDT AND P.DISP_EDDT 
 		 AND NOW() BETWEEN P.DISP_STDT AND P.DISP_EDDT 
 		 AND NOW() BETWEEN TP.POLL_STDT AND TP.POLL_EDDT	
 		 AND NOW() BETWEEN TP.POLL_STDT AND TP.POLL_EDDT	
 	</select>
 	</select>
+	
+	<!-- 설문자 선착순 카운트 -->
+	<select id="getCustAnswerPartiCount" parameterType="Poll" resultType="int">
+		/* TsfPlanning.getCustAnswerPartiCount */
+		SELECT DISTINCT count(*) AS COUNT
+		FROM TB_POLL_ANSWER A INNER JOIN TB_POLL_QUESTION B ON A.POLL_QSQ = B.POLL_QSQ 
+		WHERE B.POLL_SQ = #{pollSq}
+		GROUP BY b.POLL_QSQ, B.POLL_SQ			
+	</select>
 </mapper>
 </mapper>

+ 182 - 0
src/main/webapp/WEB-INF/views/web/mypage/MypageCustDeliveryAddrFormWeb.html

@@ -0,0 +1,182 @@
+<!DOCTYPE html>
+<html lang="ko" xmlns:th="http://www.thymeleaf.org"
+	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
+	layout:decorator="web/common/layout/MypageLayoutWeb">
+<!--
+ *******************************************************************************
+ * @source  : MypageCustDeliveryAddrFormWeb.html
+ * @desc    : 마이페이지 > 배송지 관리 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2021 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.04.02   jsshin     최초 작성
+ *******************************************************************************
+ -->
+
+<body>
+<th:block layout:fragment="content">
+<div class="content myAddressList"> <!-- 페이지특정 클래스 = myAddressList -->
+	<div class="cont_body">
+		<!-- CONT-BODY -->
+		<div class="lnb">
+			<div class="lnb_tit">
+				<h2>마이페이지</h2>
+			</div>
+			<div class="lnb_list">
+				<ul id="mypageLnbList"></ul>
+			</div>
+		</div>
+		<div class="cont">
+			<div class="sec_head">
+				<h3 class="subH1">배송지 관리</h3>
+			</div>
+			<div class="sec_body">
+				<h4 class="subH3">배송지 목록</h4>
+				<!-- 데이터 있을 시 -->
+				<div id="data" class="tbl type1">
+					<table>
+						<colgroup>
+							<col width="*">
+							<col width="170">
+						</colgroup>
+						<tbody id="custDeliveryList">
+
+						</tbody>
+					</table>
+				</div>
+				<!-- //데이터 있을 시 -->
+				<!-- 데이터 없을 시 -->
+				<div id="nodata" class="nodata">
+					<div class="txt_box">
+						<p>
+							현재 노출 할 수 있는 데이터가 없습니다.<br>
+						</p>
+					</div>
+				</div>
+				<!-- //데이터 없을 시 -->
+			</div>
+			<div class="btn_footer_area">
+				<button type="button" id="btnAdrsaddPop" class="btn btn_dark btn_md"><span>배송지 추가</span></button>
+			</div>
+		</div>
+		<!-- // CONT-BODY -->
+	</div>
+</div>
+	<script th:inline="javascript">
+	/*<![CDATA[*/
+
+	var fnCustDeliveryAddList = function () {
+		$.get('/mypage/customer/delivery/addr/list', fnCustDeliveryAddListCallback);
+	}
+
+	var fnCustDeliveryAddListCallback = function (result) {
+		console.log('result', result);
+		if (result.length < 1) {
+			$('#nodata').show();
+			return;
+		}
+		$('#nodata').hide();
+		$('#custDeliveryList').html('');
+		let html = '';
+		$.each(result, function (idx, custDeliveryAddr){
+			if (custDeliveryAddr.defaultYn  === 'Y') {
+				html += '<tr class="addrs_default">\n';
+			} else {
+				html += '<tr>\n';
+			}
+			html +=	'    <td>\n';
+			html +=	'        <div class="block_line">\n';
+			html +=	'            <ul>\n';
+			html +=	'                <li>\n';
+			html +=	'                   <span>'+custDeliveryAddr.recipNm +'</span>\n';
+			if (custDeliveryAddr.defaultYn  === 'Y') {
+				html += '                   <span class="tag">기본 배송지</span>\n';
+			}
+			if (custDeliveryAddr.shotDelvUseYn  === 'Y') {
+				html += '                   <span class="tag primary_line">총알배송</span>\n';
+			}
+			html +=	'                </li>\n';
+			html +=	'                <li>\n';
+			html +=	'                    <span class="phone_number">'+custDeliveryAddr.recipPhnno+'</span>\n';
+			html +=	'                </li>\n';
+			html +=	'                <li>\n';
+			html +=	'                   <span>'+custDeliveryAddr.recipBaseAddr + custDeliveryAddr.recipDtlAddr +'</span>\n';
+			html +=	'                </li>\n';
+			html +=	'                <li>\n';
+			html +=	'                   배송요청 사항&nbsp;:&nbsp;<span>'+ custDeliveryAddr.delvMemo +'</span>\n';
+			html +=	'                </li>\n';
+			html +=	'            </ul>\n';
+			html +=	'        </div>\n';
+			html +=	'    </td>\n';
+			html +=	'    <td>\n';
+			html +=	'        <div class="button_box">\n';
+			html +=	'            <p>';
+			html +=	'                <button type="button" class="btn btn_default btn_sm" onclick="fnChangeDeliveryAddr(custDeliveryAddr.custDelvAddrSq)">';
+			html +=	'                    <span>수정</span>';
+			html +=	'                </button>';
+			html +=	'            </p>';
+			html +=	'            <p>';
+			html +=	'                <button type="button" class="btn btn_dark btn_sm">';
+			html +=	'                   <span>삭제</span>';
+			html +=	'                </button>';
+			html +=	'            </p>';
+			html +=	'        </div>\n';
+			html +=	'    </td>\n';
+			html += '</tr>\n';
+		});
+		$('#custDeliveryList').html(html);
+
+	}
+
+	// 배송지 추가
+	$('#btnAdrsaddPop').on('click', function () {
+		$.ajax( {
+			type		: "POST",
+			url 		: '/common/delvAddrAddPop',
+			dataType 	: 'html',
+			beforeSend : function(xhr, settings) {
+				xhr.setRequestHeader("AJAX"			, "true");
+				xhr.setRequestHeader('Accept'		, 'application/json');
+				xhr.setRequestHeader('Content-Type'	, 'application/json');
+				gagajf.showProgressbar(true);
+			},
+			success 	: function(result) {
+				$("#adrsAddPop .modal-dialog .modal-content").html(result);
+				$("#adrsAddPop").modal("show");
+			}
+		});
+	});
+
+	var delvAddrSet = function (delvObj) {
+		if(!gagajf.isNull(delvObj.custDelvAddrSq)) {
+			fnCustDeliveryAddList();
+		}
+	}
+
+	$(document).ready(function() {
+
+		// 마이페이지 LNB 설정
+		fnSetMypageLnbList(8);
+
+		// 마이페이지 location 설정
+		fnSetMypageLocation('배송지 관리');
+
+		// 배송목록 조회
+		fnCustDeliveryAddList();
+
+
+	});
+
+
+
+
+	/*]]>*/
+</script>
+</th:block>
+</body>
+</html>
+
+

+ 4 - 6
src/main/webapp/WEB-INF/views/web/mypage/MypageCustModifyFormWeb.html

@@ -353,18 +353,16 @@
 			return;
 			return;
 		}
 		}
 		let custInfo = {};
 		let custInfo = {};
-		custInfo.accountNm = $('input[name=accountNm]').val();
-		custInfo.accountNo = $('input[name=accountNo]').val();
-		custInfo.bankCd = $('input[name=bankCd]').val();
+		custInfo.accountNm = $('#custModiFyForm input[name=accountNm]').val();
+		custInfo.accountNo = $('#custModiFyForm input[name=accountNo]').val();
+		custInfo.bankCd = $('#custModiFyForm input[name=bankCd]').val();
 		let jsonData = JSON.stringify(custInfo)
 		let jsonData = JSON.stringify(custInfo)
-		console.log(jsonData);
+		//console.log(jsonData);
 		gagajf.ajaxJsonSubmit('/mypage/account/check', jsonData, fnAccountCheckCallback);
 		gagajf.ajaxJsonSubmit('/mypage/account/check', jsonData, fnAccountCheckCallback);
-		//ajaxSubmit('/mypage/account/check','html','accountHolder')
 	});
 	});
 
 
 	// 계좌인증 콜백
 	// 계좌인증 콜백
 	var fnAccountCheckCallback = function (result) {
 	var fnAccountCheckCallback = function (result) {
-		console.log(result);
 		let msg = '계좌인증에 성공했습니다.'
 		let msg = '계좌인증에 성공했습니다.'
 		if (result.isValid) { // 유효하면 true
 		if (result.isValid) { // 유효하면 true
 			accountCheck = true;
 			accountCheck = true;

+ 4 - 0
src/main/webapp/WEB-INF/views/web/planning/PlanningDetailFormWeb.html

@@ -645,6 +645,10 @@ var fnJoinConfirm = function () {
 				mcxDialog.alert(result.msg);
 				mcxDialog.alert(result.msg);
 				return;
 				return;
 			}
 			}
+			if (result.status == "2") {
+				mcxDialog.alert(result.msg);
+				return;
+			}
 			document.pollListForm.submit();
 			document.pollListForm.submit();
 		}
 		}
 	})
 	})