Explorar o código

git status
git
;
1

yujung %!s(int64=4) %!d(string=hai) anos
pai
achega
20858f9d95

+ 17 - 0
src/main/java/com/style24/admin/biz/web/TsaStatisticsController.java

@@ -969,4 +969,21 @@ public class TsaStatisticsController extends TsaBaseController {
 
 		return statisticsService.getCustomerAgeOrderList(statistics);
 	}
+
+	/**
+	 * 회원활동현황 화면
+	 * @return
+	 * @author swkim
+	 * @since 2021. 9. 28
+	 */
+	@GetMapping("/customer/active/form")
+	public ModelAndView customerActiveForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 회원등급
+		mav.addObject("gradeGbList", rendererService.getAvailCommonCodeList("G110"));
+		mav.setViewName("statistics/CustomerActiveForm");
+
+		return mav;
+	}
 }

+ 297 - 0
src/main/webapp/WEB-INF/views/statistics/CustomerActiveForm.html

@@ -0,0 +1,297 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : CustomerActiveForm.html
+ * @desc    : 회원활동현황 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.09.29   yujung       최초 작성
+ *******************************************************************************
+ -->
+	<div id="main">
+		<!-- 메인타이틀 영역 -->
+		<div class="main-title"></div>
+		<!-- //메인타이틀 영역 -->
+
+		<!-- 메뉴 설명 -->
+		<div class="infoBox menu-desc"></div>
+		<!-- //메뉴 설명 -->
+
+		<!-- 검색조건 영역 -->
+		<div class="panelStyle">
+			* 2020년 12월 25일 02:00 기준 / 휴면 회원 제외
+			<!-- 리스트 영역 -->
+			<div class="panelStyle">
+				<ul class="panelBar">
+					<li class="left" style="width: 50%;">
+						<div id="chart1" class="chartUnit c3" style="max-height: 300px; position: relative;">
+						</div>
+						<button type="button" class="btn btn-default btn-lg" onclick="fnExcelDownLoad();">엑셀다운로드</button>
+					</li>
+					<li class="right"  style="width: 50%;">
+						<div id="chart2" class="chartUnit c3" style="max-height: 300px; position: relative;"></div>
+					</li>
+				</ul>
+				<ul>
+					<li class="left"  style="width: 50%;">
+						<div id="chart3" class="chartUnit c3" style="max-height: 300px; position: relative;"></div>
+						<button type="button" class="btn btn-default btn-lg" onclick="fnExcelDownLoad();">엑셀다운로드</button>
+					</li>
+				</ul>
+			</div>
+		</div>
+			<!-- //리스트 영역 -->
+	</div>
+
+<style>
+.ag-header-group-text{
+	margin-left: calc(50% - 25px);
+}
+</style>
+<script th:inline="javascript">
+/*<![CDATA[*/
+
+	//chart1	======================
+	var chart1  =   c3.generate({
+		bindto: "#chart1",
+		data: {
+			columns: [
+				['3개월 이내', 76],
+				['~6개월', 21],
+				['~9개월', 0],
+				['~12개월', 0],
+				['1년~', 3],
+			],
+			type : 'pie',
+		},
+		title: {
+			text: '미로그인 회원 현황'
+		},
+		color : {pattern : ['#FF7043', '#48C9B0', '#FFD54F', '', '']},
+		legend: {
+			padding: 15, //범례 item 우측 간격
+		},
+		axis: {
+			x: {
+				type: 'category',
+				padding: {left:0, right: 0.7}, //x축 data 좌우 여백
+
+			},
+		},
+		padding: {bottom: 40},
+		size: {
+			height: 300
+		},
+
+	});
+
+	//chart2	======================
+	var chart2  =   c3.generate({
+		bindto: "#chart2",
+		data: {
+			columns: [
+				['SMS/LMS', 444,202],
+				['이메일', 455,900],
+				['푸시', 289,900],
+				['미동의', 80,900],
+			],
+			type : 'pie',
+		},
+		title: {
+			text: '마케팅 수신동의 현황'
+		},
+		color : {pattern : ['#FF7043', '#48C9B0', '#FFD54F', '', '']},
+		legend: {
+			padding: 15, //범례 item 우측 간격
+		},
+		axis: {
+			x: {
+				type: 'category',
+				padding: {left:0, right: 0.7}, //x축 data 좌우 여백
+
+			},
+		},
+		padding: {bottom: 40},
+		size: {
+			height: 300
+		},
+
+	})
+
+	//chart3	======================
+	var chart3  =   c3.generate({
+		bindto: "#chart3",
+		data: {
+			columns: [
+				['SMS/LMS', 444,202],
+				['이메일', 455,900],
+				['푸시', 289,900],
+				['미동의', 80,900],
+			],
+			type : 'bar',
+		},
+		title: {
+			text: '휴면전환 잔여일별 회원현황'
+		},
+		color : {pattern : ['#FF7043', '#48C9B0', '#FFD54F', '', '']},
+		legend: {
+			padding: 15, //범례 item 우측 간격
+		},
+		axis: {
+			x: {
+				type: 'category',
+				padding: {left:0, right: 0.7}, //x축 data 좌우 여백
+
+			},
+		},
+		padding: {bottom: 40},
+		size: {
+			height: 300
+		},
+
+	});
+
+    var fnExcelDownLoad = function(){
+
+    	var totalRows = gridOptions.api.getDisplayedRowCount();
+		if(totalRows==0){
+			mcxDialog.alert('조회된 내역이 없습니다.');
+			return;
+		}
+
+    	var date = new Date().format("YYYYMMDDHHmmss");
+		var params = {
+						fileName : "연령별주문현황_"+ date,
+						sheetName: "DATA"
+					 };
+		gridOptions.api.exportDataAsExcel(params);
+    }
+
+	// 브랜드 조회 팝업에서 호출
+	var fnSetBrandInfo = function(result) {
+		var arrBrandCd = [];
+		var brandCdTxt = "";
+		var bIndex = 0;
+		$('#brandCdTxt').html('');
+		$('#searchForm input[name=brandCdSearchTxt]').val('');
+
+		result.forEach(function(brand){
+			bIndex++;
+			arrBrandCd.push(brand.brandCd);
+		});
+
+		// 조회 값이 하나일 경우 화면에 코드 노출. 그 외는 갯수 처리
+		if (bIndex == 1) {
+			$('#searchForm input[name=brandCdSearchTxt]').val(arrBrandCd[0]);
+		} else {
+			brandCdTxt = bIndex + " 개";
+			$('#brandCdTxt').html(brandCdTxt);
+		}
+
+		var jsonData = JSON.stringify(arrBrandCd);
+		$("#searchForm input[name=brandCdList]").val(arrBrandCd.join(","));
+	}
+
+	// 품목 조회 팝업에서 호출
+	var fnSetItemkindInfo = function(result) {
+		var arrItemkindCd = [];
+		var itemkindCdTxt = "";
+		var bIndex = 0;
+		$('#itemkindCdTxt').html('');
+		$('#searchForm input[name=itemkindCdSearchTxt]').val('');
+
+		result.forEach(function(itemkind){
+			bIndex++;
+			arrItemkindCd.push(itemkind.itemkindCd);
+		});
+
+		// 조회 값이 하나일 경우 화면에 코드 노출. 그 외는 갯수 처리
+		if (bIndex == 1) {
+			$('#searchForm input[name=itemkindCdSearchTxt]').val(arrItemkindCd[0]);
+		} else {
+			itemkindCdTxt = bIndex + " 개";
+			$('#itemkindCdTxt').html(itemkindCdTxt);
+		}
+
+		var jsonData = JSON.stringify(arrItemkindCd);
+		$("#searchForm input[name=itemkindCdList]").val(arrItemkindCd.join(','));
+	}
+
+	// 검색
+	$('#btnSearch').on('click', function() {
+		// 입력 값 체크
+		if (!gagajf.validation($('#searchForm')))
+			return false;
+
+		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', fnCreateTotal);
+	});
+
+	// 합계 생성
+	let fnCreateTotal = function() {
+		let len = 0;
+
+		let totInfo = {};
+		totInfo.age     = '';
+		totInfo.sexGb = 'TOTAL';
+		totInfo.totOrdAmt   = 0;
+		totInfo.ordAmt     = 0;
+		totInfo.cnclAmt = 0;
+		totInfo.ordCnt  = 0;
+		totInfo.cnclQty  = 0;
+		totInfo.avgOrdCnt     = 0;
+		totInfo.avgSellQty    = 0;
+		totInfo.custPrice    = 0;
+
+		gridOptions.api.forEachNode(function(rowNode, index) {
+			if (!rowNode.group) {
+				if( typeof rowNode.data.totOrdAmt      == 'number') { totInfo.totOrdAmt       += rowNode.data.totOrdAmt      ; }
+				if( typeof rowNode.data.ordAmt     == 'number') { totInfo.ordAmt      += rowNode.data.ordAmt     ; }
+				if( typeof rowNode.data.cnclAmt == 'number') { totInfo.cnclAmt  += rowNode.data.cnclAmt ; }
+				if( typeof rowNode.data.ordCnt  == 'number') { totInfo.ordCnt   += rowNode.data.ordCnt  ; if (rowNode.data.ordCnt > 0) len++; }
+				if( typeof rowNode.data.cnclQty  == 'number') { totInfo.cnclQty   += rowNode.data.cnclQty  ; }
+				if( typeof rowNode.data.avgOrdCnt  == 'number') { totInfo.avgOrdCnt   += rowNode.data.avgOrdCnt  ; }
+				if( typeof rowNode.data.avgSellQty     == 'number') { totInfo.avgSellQty      += rowNode.data.avgSellQty     ; }
+				if( typeof rowNode.data.custPrice    == 'number') { totInfo.custPrice     += rowNode.data.custPrice    ; }
+			}
+		});
+
+		totInfo.avgOrdCnt = (Math.round(totInfo.avgOrdCnt / len * 10) / 10);
+		totInfo.avgSellQty = (Math.round(totInfo.avgSellQty / len * 10) / 10);
+		totInfo.custPrice = Math.floor(totInfo.custPrice / len);
+
+		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
+	}
+
+	// 초기화 클릭시
+	$('#btnInit').on('click', function() {
+		$('#searchForm')[0].reset();
+
+		$('#brandCdTxt').html('');
+		$('#searchForm input[name=brandCdList]').val('');
+		$('#itemkindCdTxt').html('');
+		$('#searchForm input[name=itemkindCdList]').val('');
+	});
+
+	// 엑셀다운로드
+	$('#btnExcel').on('click', function() {
+		gagaAgGrid.exportToExcel('일자별주문 목록', gridOptions);
+	});
+
+	$(document).ready(function() {
+		cfnCreateCalendar('#terms', 'startDt', 'endDt', true, '주문', undefined, ['btnToday']);
+		$('.btnYesterday').trigger('click');
+
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+
+	});
+/*]]>*/
+</script>
+
+</html>