فهرست منبع

회원 > 활동회원 개발 중

JUSEUNG 5 سال پیش
والد
کامیت
e40b33aa61

+ 28 - 0
src/main/java/com/style24/admin/biz/dao/TsaCustomerDao.java

@@ -0,0 +1,28 @@
+package com.style24.admin.biz.dao;
+
+import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.Customer;
+import com.style24.persistence.domain.CustomerSearch;
+import org.springframework.stereotype.Repository;
+
+import java.util.Collection;
+
+/**
+ * 회원 Dao
+ * 
+ * @author jsshin
+ * @since 2020. 11. 3
+ */
+@ShopDs
+@Repository
+public interface TsaCustomerDao {
+
+	/**
+	 * 활동회원 목록
+	 * @param customerSearch - 검색조건
+	 * @return Collection<Customer>
+	 * @author jsshin
+	 * @since 2020. 01. 12
+	 */
+	Collection<Customer> getCustomerActiveList(CustomerSearch customerSearch);
+}

+ 30 - 0
src/main/java/com/style24/admin/biz/service/TsaCustomerService.java

@@ -0,0 +1,30 @@
+package com.style24.admin.biz.service;
+
+import com.style24.admin.biz.dao.TsaCustomerDao;
+import com.style24.persistence.domain.Customer;
+import com.style24.persistence.domain.CustomerSearch;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Collection;
+
+/**
+ * 회원 Service
+ *
+ * @author jsshin
+ * @since 2020. 01. 12
+ */
+@Service
+@Slf4j
+public class TsaCustomerService {
+
+	@Autowired
+	private TsaCustomerDao customerDao;
+
+
+	public Collection<Customer> getCustomerActiveList(CustomerSearch customerSearch) {
+		return customerDao.getCustomerActiveList(customerSearch);
+	}
+}

+ 32 - 0
src/main/java/com/style24/persistence/domain/CustomerSearch.java

@@ -0,0 +1,32 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TscBaseDomain;
+import lombok.Data;
+
+/**
+ * 회원 검색조건 Admin - Domain
+ *
+ * @author jsshin
+ * @since 2020. 01. 12
+ */
+@SuppressWarnings("serial")
+@Data
+public class CustomerSearch extends TscBaseDomain {
+
+	// 검색조건
+	private String searchDateGb;
+	private String searchGb;
+	private String searchTxt;
+	private String stDate;
+	private String edDate;
+
+	private String siteCd;
+	private String cellPhnno;
+	private String custGb;
+	private String custGrade;
+	private String managedRsn;
+	private String smsAgreeYn;
+	private String emailAgreeYn;
+	private String appAgreeYn;
+
+}

+ 108 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaCustomer.xml

@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.style24.admin.biz.dao.TsaCustomerDao">
+
+	<!-- 활동회원목록 -->
+	<select id="getCustomerActiveList" parameterType="CustomerSearch" resultType="Customer">
+		/* TsaCustomer.getCustomerActiveList */
+		SELECT CUST_NO
+		     , CUST_ID
+		     , CUST_NM
+		     , PASSWD
+		     , BIRTH_YMD
+		     , BIRTH_SM
+		     , SEX_GB
+		     , CELL_PHNNO
+		     , APP_AGREE_YN
+		     , DATE_FORMAT(APP_AGREE_DT, '%Y%m%d%H%i%S') AS APP_AGREE_DT
+		     , SMS_AGREE_YN
+		     , DATE_FORMAT(SMS_AGREE_DT, '%Y%m%d%H%i%S') AS SMS_AGREE_DT
+		     , EMAIL
+		     , EMAIL_AGREE_YN
+		     , DATE_FORMAT(EMAIL_AGREE_DT, '%Y%m%d%H%i%S') AS EMAIL_AGREE_DT
+		     , HOME_POST_NO
+		     , HOME_BASE_ADDR
+		     , HOME_DTL_ADDR
+		     , SITE_CD
+		     , FRONT_GB
+		     , AF_LINK_CD
+		     , CUST_GB
+		     , CUST_GRADE
+		     , DATE_FORMAT(JOIN_DT, '%Y%m%d%H%i%S') AS JOIN_DT
+		     , FOREIGNER_YN
+		     , CUST_STAT
+		     , DATE_FORMAT(PASSWD_CHG_DT, '%Y%m%d%H%i%S') AS PASSWD_CHG_DT
+		     , TEMP_PASSWD_YN
+		     , DATE_FORMAT(LOGIN_LDT, '%Y%m%d%H%i%S') AS LOGIN_LDT
+		     , NV_JOIN_ID
+		     , NV_ACCESS_TOKEN
+		     , DATE_FORMAT(NV_JOIN_DT, '%Y%m%d%H%i%S') AS NV_JOIN_DT
+		     , KK_JOIN_ID
+		     , KK_ACCESS_TOKEN
+		     , DATE_FORMAT(KK_JOIN_DT, '%Y%m%d%H%i%S') AS KK_JOIN_DT
+		     , YS_JOIN_ID
+		     , YS_ACCESS_TOKEN
+		     , DATE_FORMAT(YS_JOIN_DT, '%Y%m%d%H%i%S') AS YS_JOIN_DT
+		     , CI
+		     , DATE_FORMAT(AUTH_DT, '%Y%m%d%H%i%S') AS AUTH_DT
+		     , MANAGED_RSN
+		     , MANAGED_DTL_RSN
+		     , MANAGED_DT
+		     , SECEDE_RSN
+		     , SECEDE_DTL_RSN
+		     , SECEDE_DT
+		     , FN_GET_USER_NM(REG_NO)              AS REG_NM
+		     , DATE_FORMAT(REG_DT, '%Y%m%d%H%i%S') AS REG_DT
+		     , FN_GET_USER_NM(UPD_NO)              AS UPD_NM
+		     , DATE_FORMAT(UPD_DT, '%Y%m%d%H%i%S') AS UPD_DT
+		FROM   TB_CUSTOMER
+		WHERE  CUST_STAT = 'G104_10'
+		<if test="searchGb == 'custNo'">
+		AND    CUST_NO = #{searchTxt}
+		</if>
+		<if test="searchGb == 'custNm'">
+		AND    LOWER(CUST_NM) LIKE CONCAT('%',LOWER(#{searchTxt}),'%')
+		</if>
+		<if test="searchGb == 'email'">
+		AND    LOWER(EMAIL) LIKE CONCAT('%',LOWER(#{searchTxt}),'%')
+		</if>
+		<if test="searchGb == 'custId'">
+		AND    LOWER(CUST_ID) LIKE CONCAT('%',LOWER(#{searchTxt}),'%')
+		</if>
+		<if test="siteCd != null and siteCd != ''">
+		AND    SITE_CD = #{siteCd}
+		</if>
+		<if test="cellPhnno != null and cellPhnno != ''">
+		AND    CELL_PHNNO = #{cellPhnno}
+		</if>
+		<if test="custGb != null and custGb != ''">
+		AND    CUST_GB = #{custGb}
+		</if>
+		<if test="custGrade != null and custGrade != ''">
+		AND    CUST_GRADE = #{custGrade}
+		</if>
+		<if test="managedRsn != null and managedRsn != ''">
+		AND    MANAGED_RSN = #{managedRsn}
+		</if>
+		<if test="smsAgreeYn != null and smsAgreeYn != ''">
+		AND   SMS_AGREE_YN = #{smsAgreeYn}
+		</if>
+		<if test="emailAgreeYn != null and emailAgreeYn != ''">
+		AND   EMAIL_AGREE_YN = #{emailAgreeYn}
+		</if>
+		<if test="appAgreeYn != null and appAgreeYn != ''">
+		AND   APP_AGREE_YN = #{appAgreeYn}
+		</if>
+		<if test="stDate != null and edDate != '' and stDate != null and edDate != ''">
+		     <if test="searchDateGb == 'joinDt'">
+		AND   JOIN_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
+		AND   JOIN_DT <![CDATA[<]]> DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
+		     </if>
+		     <if test="searchDateGb == 'loginLdt'">
+		AND   LOGIN_LDT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
+		AND   LOGIN_LDT <![CDATA[<]]> DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
+		     </if>
+		</if>
+	</select>
+
+</mapper>

+ 265 - 0
src/main/webapp/WEB-INF/views/customer/CustomerActiveListForm.html

@@ -0,0 +1,265 @@
+<!DOCTYPE html>
+<html lang="ko"
+	  xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : CustomerActiveListForm.html
+ * @desc    : 활동회원목록 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2021 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.01.12   jsshin     최초 작성
+ *******************************************************************************
+ -->
+<div id="main">
+	<!-- 메인타이틀 영역 -->
+	<div class="main-title">
+	</div>
+	<!-- //메인타이틀 영역 -->
+
+	<!-- 메뉴 설명 -->
+	<div class="infoBox menu-desc">
+	</div>
+	<!-- //메뉴 설명 -->
+
+	<!-- 검색조건 영역 -->
+	<div class="panelStyle">
+		<form id="searchForm" name="searchForm" action="#" th:action="@{'/customer/active/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
+			<table class="frmStyle" aria-describedby="검색조건">
+				<colgroup>
+					<col style="width:10%;"/>
+					<col style="width:20%;"/>
+					<col style="width:10%;"/>
+					<col style="width:15%;"/>
+					<col style="width:10%;"/>
+					<col style="width:20%;"/>
+					<col/>
+				</colgroup>
+				<tbody>
+				<tr>
+					<th class="dashR">검색구분</th>
+					<td class="dashR">
+						<select name="searchGb">
+							<option value="">선택</option>
+							<option value="custNo">회원번호 </option>
+							<option value="custNm">회원명 </option>
+							<option value="email">이메일</option>
+							<option value="custId">아이디</option>
+						</select>
+						<input type="text" class="w200" name="searchTxt" id="searchTxt"/>
+					</td>
+
+					<th class="dashR">사이트</th>
+					<td class="dashR">
+						<select name="siteCd"> <!-- 회원구분(공통코드G100) -->
+							<option value="">전체</option>
+							<option th:if="${siteList}" th:each="oneData, status : ${siteList}" th:value="${oneData.cd}" th:text="|[${oneData.cd}] ${oneData.cdNm}|"></option>
+						</select>
+					</td>
+					<th class="dashR">수신여부</th>
+					<td class="dashR">
+						<label class="chkBox">
+							<input type="checkbox" name='emailAgreeYn' value='Y'/> 메일 수신여부
+						</label>
+						<label class="chkBox">
+							<input type="checkbox" name='smsAgreeYn' value='Y'/> SMS 수신여부
+						</label>
+					</td>
+				</tr>
+				<tr>
+					<th class="dashR">회원구분</th>
+					<td class="dashR">
+						<select name="custGb"> <!-- 회원구분(공통코드G100) -->
+							<option value="">전체</option>
+							<option th:if="${custGbList}" th:each="oneData, status : ${custGbList}" th:value="${oneData.cd}" th:text="|[${oneData.cd}] ${oneData.cdNm}|"></option>
+						</select>
+					</td>
+
+					<th class="dashR">회원등급</th>
+					<td class="dashR">
+						<select name="custGrade"> <!-- 회원등급(공통코드G110) -->
+							<option value="">전체</option>
+							<option th:if="${custGradeList}" th:each="oneData, status : ${custGradeList}" th:value="${oneData.cd}" th:text="|[${oneData.cd}] ${oneData.cdNm}|"></option>
+						</select>
+					</td>
+
+					<th class="dashR">관리대상</th>
+					<td class="dashR">
+						<select name="managedRsn"> <!-- 관리대상지정사유(공통코드G120) -->
+							<option value="">전체</option>
+							<option th:if="${managedRsnList}" th:each="oneData, status : ${managedRsnList}" th:value="${oneData.cd}" th:text="|[${oneData.cd}] ${oneData.cdNm}|"></option>
+						</select>
+					</td>
+				</tr>
+				<tr>
+					<th class="dashR">휴대폰번호</th>
+					<td class="dashR" colspan="5">
+						<input type="text" class="w200" name="cellPhnno" id="cellPhnno"/>
+					</td>
+				</tr>
+				<tr>
+					<th class="dashR">조회일자</th>
+					<td class="dashR" colspan="5" >
+						<select name="searchDateGb">
+							<option value="joinDt">가입일자</option>
+							<option value="loginLdt">로그인일자</option>
+						</select>
+						<span id="terms"></span>
+					</td>
+				</tr>
+				</tbody>
+			</table>
+
+			<ul class="panelBar">
+				<li class="center">
+					<button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
+					<button type="button" class="btn btn-gray btn-lg" onclick="$('#searchForm')[0].reset();">초기화</button>
+				</li>
+			</ul>
+		</form>
+	</div>
+	<!-- //검색조건 영역 -->
+
+	<!-- 리스트 영역 -->
+	<div class="panelStyle">
+		<div id="gridList" style="width: 100%; height: 570px" class="ag-theme-balham lh60"></div>
+	</div>
+	<!-- //리스트 영역 -->
+</div>
+
+<script th:inline="javascript">
+	/*<![CDATA[*/
+	// 사이트목록
+	const siteList = gagajf.convertToArray([[${siteList}]]);
+	// 회원구분
+	const custGbList = gagajf.convertToArray([[${custGbList}]]);
+	// 회원등급
+	const custGradeList = gagajf.convertToArray([[${custGradeList}]]);
+	// 관리대상
+	const managedRsnList = gagajf.convertToArray([[${managedRsnList}]]);
+	// 성별
+	const genderGb = {"F":"여성", "M":"남성"};
+
+	// specify the columns
+	const columnDefs = [
+		{
+			headerName: "사이트", field:'siteCd', width:100, cellClass: 'text-center',
+			valueGetter: function (params) { return gagaAgGrid.lookupValue(siteList, params.data.siteCd); }
+		},
+		{headerName: "회원ID", field:'custId', width:120, cellClass: 'text-center'},
+		{headerName: "회원NO", field:'custNo', width:100, cellClass: 'text-center'},
+		{
+			headerName: "회원명", field:'custNm', width:100, cellClass: 'text-center',
+			cellRenderer: function(params) { return '<a href="javascript:void(0);">' + params.value + '</a>'; }
+		},
+		{
+			headerName: "회원구분", field:'custGb', width:100, cellClass: 'text-center',
+			valueGetter: function (params) { return gagaAgGrid.lookupValue(custGbList, params.data.custGb); }
+		},
+		{
+			headerName: "등급", field:'custGrade', width:100, cellClass: 'text-center',
+			valueGetter: function (params) { return gagaAgGrid.lookupValue(custGradeList, params.data.custGrade); }
+		},
+		{
+			headerName: "관리대상", field:'managedRsn', width:230, cellClass: 'text-center',
+			valueGetter: function (params) { return gagaAgGrid.lookupValue(managedRsnList, params.data.managedRsn); }
+		},
+		{
+			headerName: "가입일자", field:'joinDt', width:120, cellClass: 'text-center',
+			valueGetter: function (params) { return gagaAgGrid.toDateFormat(params.data.joinDt); }
+		},
+		{
+			headerName: "로그인일자", field:'loginLdt', width:120, cellClass: 'text-center',
+			valueGetter: function (params) { return gagaAgGrid.toDateFormat(params.data.loginLdt); }
+		},
+		{headerName: "핸드폰", field:'cellPhnno', width:140, cellClass: 'text-center'},
+		{headerName: "이메일", field:'email', width:220, cellClass: 'text-center'},
+		{
+			headerName: "성별", field:'sexGb', width:50, cellClass: 'text-center',
+			valueGetter: function (params) { return gagaAgGrid.lookupValue(genderGb, params.data.sexGb); }
+		},
+		{
+			headerName: "생년월일", field:'birthYmd', width:90, cellClass: 'text-center', hide:true,
+			valueGetter: function (params) { return gagaAgGrid.toDateFormat(params.data.birthYmd); }
+		},
+		{headerName: "기본주소", field:'homeBaseAddr', width:350, cellClass: 'text-center'},
+		{headerName: "상세주소", field:'homeDtlAddr', width:250, cellClass: 'text-center'},
+		{headerName: "수신동의(SMS)", field:'smsAgreeYn', width:110, cellClass: 'text-center'},
+		{headerName: "수신동의(메일)", field:'emailAgreeYn', width:110, cellClass: 'text-center'}
+	];
+
+	// Get GridOptions
+	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	// 이미지가 있을 경우 높이 지정
+	gridOptions.rowHeight = 60;
+
+	// 셀 클릭 이벤트
+	gridOptions.onCellClicked = function(event) {
+		 if (event.colDef.field == 'custNm') {
+			// 고객 상세
+			cfnOpenCustDetailPopup(event.data.custNo);
+		}
+	}
+
+	// 조회
+	$('#btnSearch').on('click', function() {
+		// 유효성 체크
+		let validation = fnValidationCheck();
+		if (!validation) {
+			return;
+		}
+		// Fetch data
+		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
+	});
+	
+	var fnValidationCheck = function () {
+		// 입력 값 체크
+		const $searchGb = $('#searchForm select[name=searchGb]');	// 검색구분
+		const $searchNm = $('#searchForm input[name=searchNm]');	// 검색내용
+		let isSearchVaild = true;
+		let validationMessage;
+
+		// 검색구분: O / 검색내용: X
+		if (!gagajf.isNull($searchGb.val())) {
+			if (gagajf.isNull($searchNm.val())) {
+				validationMessage = '내용을 입력해주세요';
+				isSearchVaild = false;
+			}
+		}
+
+		// 검색구분: X / 검색내용: O
+		if (!gagajf.isNull($searchNm.val())) {
+			if (gagajf.isNull($searchGb.val())) {
+				validationMessage = '검색구분을 선택해주세요';
+				isSearchVaild = false;
+			}
+		}
+		if (!isSearchVaild) {
+			mcxDialog.alertC(validationMessage, {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$searchNm.focus();
+				}
+			});
+		}
+
+		return isSearchVaild;
+
+	}
+
+	$(document).ready(function() {
+		// 공통 달력 생성
+		cfnCreateCalendar('#terms', 'stDate', 'edDate', true);
+		$('.btnToday').trigger('click');
+
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+	});
+	/*]]>*/
+</script>
+
+</html>