Procházet zdrojové kódy

2021-09-16 목 1. 상품별 주문, 2. 제휴별 주문, 3. 채널별 주문, 4. 브랜드별 주문 추가

LMC před 4 roky
rodič
revize
f1d9358b4d

+ 16 - 0
src/main/java/com/style24/admin/biz/dao/TsaStatisticsDao.java

@@ -49,4 +49,20 @@ public interface TsaStatisticsDao {
 	 */
 	Collection<Statistics> getExtmallOrderList(Statistics statistics);
 
+	/**
+	 * 채널 주문 목록 조회
+	 * @return Collection<Statistics>
+	 * @author lmc
+	 * @since 2021. 9. 15.
+	 */
+	Collection<Statistics> getChannelOrderList(Statistics statistics);
+
+	/**
+	 * 브랜드 주문 목록 조 회
+	 * @return Collection<Statistics>
+	 * @author lmc
+	 * @since 2021. 9. 16.
+	 */
+	Collection<Statistics> getBrandOrderList(Statistics statistics);
+
 }

+ 20 - 0
src/main/java/com/style24/admin/biz/service/TsaStatisticsService.java

@@ -66,4 +66,24 @@ public class TsaStatisticsService {
 		return statisticsDao.getExtmallOrderList(statistics);
 	}
 
+	/**
+	 * 채널 주문 목록 조회
+	 * @return Collection<Statistics>
+	 * @author lmc
+	 * @since 2021. 9. 15.
+	 */
+	public Collection<Statistics> getChannelOrderList(Statistics statistics) {
+		return statisticsDao.getChannelOrderList(statistics);
+	}
+
+	/**
+	 * 브랜드 주문 목록 조회
+	 * @return Collection<Statistics>
+	 * @author lmc
+	 * @since 2021. 9. 16.
+	 */
+	public Collection<Statistics> getBrandOrderList(Statistics statistics) {
+		return statisticsDao.getBrandOrderList(statistics);
+	}
+
 }

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

@@ -268,4 +268,114 @@ public class TsaStatisticsController extends TsaBaseController {
 		return statisticsService.getExtmallOrderList(statistics);
 	}
 
+	/**
+	 * 채널 주문 목록 화면
+	 * @return ModelAndView
+	 * @author lmc
+	 * @since 2021. 9. 15.
+	 */
+	@GetMapping("/channel/trading/form")
+	public ModelAndView channelTradingForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 정상이월구분
+		mav.addObject("formalGbList", rendererService.getAvailCommonCodeList("G009"));
+
+		mav.setViewName("statistics/ChannelTradingForm");
+		return mav;
+	}
+
+	/**
+	 * 채널 주문 목록 조회
+	 * @return Collection<Statistics>
+	 * @author lmc
+	 * @since 2021. 9. 16.
+	 */
+	@PostMapping("/channel/order/list")
+	@ResponseBody
+	public Collection<Statistics> getChannelOrderList(@RequestBody Statistics statistics) {
+
+		if (!StringUtils.isBlank(statistics.getExtmallIdList())) {
+			statistics.setMultiExtmallId(statistics.getExtmallIdList().split(","));
+		}
+
+		if (!StringUtils.isBlank(statistics.getSupplyCompCdList())) {
+			statistics.setMultiSupplyCompCd(statistics.getSupplyCompCdList().split(","));
+		}
+
+		if (!StringUtils.isBlank(statistics.getAfLinkCdList())) {
+			statistics.setMultiAfLinkCd(statistics.getAfLinkCdList().split(","));
+		}
+
+		if (!StringUtils.isBlank(statistics.getBrandCdList())) {
+			statistics.setMultiBrandCd(statistics.getBrandCdList().split(","));
+		}
+
+		if (!StringUtils.isBlank(statistics.getItemkindCdList())) {
+			statistics.setMultiItemkindCd(statistics.getItemkindCdList().split(","));
+		}
+
+		if (!StringUtils.isBlank(statistics.getGoodsCd())) {
+			statistics.setMultiGoodsCd(statistics.getGoodsCd().split(System.lineSeparator()));
+		}
+
+		if (!StringUtils.isBlank(statistics.getFormalGb())) {
+			statistics.setMultiFrontGb(statistics.getExtmallIdList().split(","));
+		}
+
+		return statisticsService.getChannelOrderList(statistics);
+	}
+
+	/**
+	 * 브랜드 주문 목록 화면
+	 * @return ModelAndView
+	 * @author lmc
+	 * @since 2021. 9. 16.
+	 */
+	@GetMapping("/brand/trading/form")
+	public ModelAndView brandTradingForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 정상이월구분
+		mav.addObject("formalGbList", rendererService.getAvailCommonCodeList("G009"));
+
+		mav.setViewName("statistics/BrandTradingForm");
+		return mav;
+	}
+
+	@PostMapping("/brand/order/list")
+	@ResponseBody
+	public Collection<Statistics> getBrandOrderList(@RequestBody Statistics statistics) {
+
+		if (!StringUtils.isBlank(statistics.getExtmallIdList())) {
+			statistics.setMultiExtmallId(statistics.getExtmallIdList().split(","));
+		}
+
+		if (!StringUtils.isBlank(statistics.getSupplyCompCdList())) {
+			statistics.setMultiSupplyCompCd(statistics.getSupplyCompCdList().split(","));
+		}
+
+		if (!StringUtils.isBlank(statistics.getAfLinkCdList())) {
+			statistics.setMultiAfLinkCd(statistics.getAfLinkCdList().split(","));
+		}
+
+		if (!StringUtils.isBlank(statistics.getBrandCdList())) {
+			statistics.setMultiBrandCd(statistics.getBrandCdList().split(","));
+		}
+
+		if (!StringUtils.isBlank(statistics.getItemkindCdList())) {
+			statistics.setMultiItemkindCd(statistics.getItemkindCdList().split(","));
+		}
+
+		if (!StringUtils.isBlank(statistics.getGoodsCd())) {
+			statistics.setMultiGoodsCd(statistics.getGoodsCd().split(System.lineSeparator()));
+		}
+
+		if (!StringUtils.isBlank(statistics.getFormalGb())) {
+			statistics.setMultiFrontGb(statistics.getExtmallIdList().split(","));
+		}
+
+		return statisticsService.getBrandOrderList(statistics);
+	}
+
 }

+ 4 - 0
src/main/java/com/style24/persistence/domain/Statistics.java

@@ -27,6 +27,7 @@ public class Statistics extends TscBaseDomain {
 	private long yoyTotOrdAmt;	// 전년동기대비매출액
 	private int selfAmt;		// 자사직방문매출액
 	private long channelAmt;	// 채널매출액
+	private long selfmallAmt;	// 자사몰매출액
 	private long extmallAmt;	// 제휴몰매출액
 	private long cnclAmt;		// 취/반품액
 	private int ordCnt;			// 주문건수
@@ -131,6 +132,9 @@ public class Statistics extends TscBaseDomain {
 	private int realSellAmt;			// 실판매금액(=상품총액. 쿠폰과 다다익선만 차감. 상품권과 포인트는 포함)
 	private double sellFeeRate;			// 판매수수료율
 	private int sellFeeAmt;				// 수수료(실판매금액 * 판매수수료율)
+	private int totAmt10;				// 정상
+	private int totAmt20;				// 이월
+	private int amtRate10;				// 정상비
 	private String mdId;				// 담당MD아이디
 	private String mdNm;				// 담당MD명
 	private String formalGb;			// 이월구분

+ 220 - 1
src/main/java/com/style24/persistence/mybatis/shop/TsaStatistics.xml

@@ -430,7 +430,7 @@
 		     , SELL_FEE_RATE
 		     , EX_USAC_AMT
 		     , YOY_TOT_ORD_AMT
-		     , IFNULL(ROUND((YOY_TOT_ORD_AMT - TOT_AMT) / YOY_TOT_ORD_AMT * 100,1),1) YOY_RATE
+		     , ROUND(IF(TOT_AMT = 0, 1, TOT_AMT) / IF(YOY_TOT_ORD_AMT = 0, 1, YOY_TOT_ORD_AMT) * 100 - 100,1) AS YOY_RATE
 		  FROM (
 				SELECT
 				    (SELECT EXTMALL_NM FROM TB_EXTMALL X WHERE X.EXTMALL_ID = A.EXTMALL_ID LIMIT 1) AS EXTMALL_NM
@@ -499,4 +499,223 @@
 	ORDER BY TAB.EXTMALL_NM
 	</select>
 
+	<!-- 채널 주문목록 조회 -->
+	<select id="getChannelOrderList" parameterType="Statistics" resultType="Statistics">
+		/* TsaStatistics.getChannelOrderList */
+		SELECT AF_LINK_CD
+		     , AF_LINK_NM
+		     , CHANNEL_AMT
+		     , TOT_AMT
+		     , SELL_QTY
+		     , CNCL_QTY
+		     , CNCL_AMT
+		     , REAL_ORD_AMT
+		     , SELL_FEE_RATE
+		     , EX_USAC_AMT
+		     , YOY_TOT_ORD_AMT
+		     , ROUND(IF(TOT_AMT = 0, 1, TOT_AMT) / IF(YOY_TOT_ORD_AMT = 0, 1, YOY_TOT_ORD_AMT) * 100 - 100,1) AS YOY_RATE
+		  FROM (
+				SELECT
+				    AF_LINK_CD
+				    , (SELECT AF_LINK_NM FROM TB_AF_LINK X WHERE X.AF_LINK_CD = A.AF_LINK_CD) AS AF_LINK_NM
+				    , SUM(A.CHANNEL_AMT) AS CHANNEL_AMT
+				    , SUM(A.CHANNEL_AMT - A.CNCL_AMT - A.RTN_AMT) AS TOT_AMT /* 총매출 */
+				    , SUM(A.SELL_QTY) AS SELL_QTY  /* 판매수량 */
+				    , SUM(A.CNCL_QTY + A.RTN_QTY) AS CNCL_QTY /* 취/반품수량 */
+				    , SUM(A.CNCL_AMT + A.RTN_AMT) AS CNCL_AMT /* 취/반품액 */
+				    , SUM(A.REAL_ORD_AMT) AS REAL_ORD_AMT /* 실결제금액 */
+				    , (SELECT FEE_RATE FROM TB_AF_LINK X WHERE X.AF_LINK_CD = A.AF_LINK_CD) AS SELL_FEE_RATE
+				    , (SUM(A.REAL_ORD_AMT) * (1 - (SELECT FEE_RATE FROM TB_AF_LINK X WHERE X.AF_LINK_CD = A.AF_LINK_CD) / 100)) AS EX_USAC_AMT
+					, IFNULL((SELECT SUM(X.SELF_AMT + X.CHANNEL_AMT + X.EXTMALL_AMT)
+				                FROM   TB_STAT_ORD_DAY X
+				               WHERE  1 = 1
+				                 AND X.AF_LINK_CD = A.AF_LINK_CD
+							<![CDATA[
+							     AND X.DAY >= STR_TO_DATE(#{startDt},'%Y-%m-%d')
+							     AND X.DAY <= DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY)
+							]]>
+							<if test="multiFrontGb != null">
+								/* 디바이스 */
+								<foreach collection="multiFrontGb" item="item" index="index"  open="AND X.FRONT_GB IN (" close=")" separator=",">#{item}</foreach>
+							</if>
+							<if test="multiFormalGb != null">
+								/* 정상/이월구분 */
+								<foreach collection="multiFormalGb" item="item" index="index"  open="AND X.FORMAL_GB IN (" close=")" separator=",">#{item}</foreach>
+							</if>
+							<if test="multiDistributionGb != null">
+								/* 물류구분 */
+								<foreach collection="multiDistributionGb" item="item" index="index"  open="AND X.DISTRIBUTION_GB IN (" close=")" separator=",">#{item}</foreach>
+							</if>
+							<if test="multiSupplyCompCd != null">
+								/* 공급처 */
+								<foreach collection="multiSupplyCompCd" item="item" index="index"  open="AND X.SUPPLY_COMP_CD IN (" close=")" separator=",">#{item}</foreach>
+							</if>
+							<if test="multiItemkindCd != null">
+								/* 품목 */
+								<foreach collection="multiItemkindCd" item="item" index="index"  open="AND X.ITEMKIND_CD IN (" close=")" separator=",">#{item}</foreach>
+							</if>
+				              ),0)                                           AS YOY_TOT_ORD_AMT /*전년동기대비매출액*/
+				FROM TB_STAT_ORD_DAY A
+				WHERE 1=1
+				<![CDATA[
+				    AND DAY >= STR_TO_DATE(#{startDt},'%Y-%m-%d')
+				    AND DAY <= DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY)
+				]]>
+				    AND EXISTS(
+				          SELECT 1
+				          FROM TB_AF_LINK X
+				          WHERE X.AF_LINK_CD = A.AF_LINK_CD
+				            AND X.AF_CHANNEL != 'G053_01'
+				      )
+				<if test="multiFrontGb != null">
+					/* 디바이스 */
+					<foreach collection="multiFrontGb" item="item" index="index"  open="AND A.FRONT_GB IN (" close=")" separator=",">#{item}</foreach>
+				</if>
+				<if test="multiFormalGb != null">
+					/* 정상/이월구분 */
+					<foreach collection="multiFormalGb" item="item" index="index"  open="AND A.FORMAL_GB IN (" close=")" separator=",">#{item}</foreach>
+				</if>
+				<if test="multiDistributionGb != null">
+					/* 물류구분 */
+					<foreach collection="multiDistributionGb" item="item" index="index"  open="AND A.DISTRIBUTION_GB IN (" close=")" separator=",">#{item}</foreach>
+				</if>
+				<if test="multiSupplyCompCd != null">
+					/* 공급처 */
+					<foreach collection="multiSupplyCompCd" item="item" index="index"  open="AND A.SUPPLY_COMP_CD IN (" close=")" separator=",">#{item}</foreach>
+				</if>
+				<if test="multiItemkindCd != null">
+					/* 품목 */
+					<foreach collection="multiItemkindCd" item="item" index="index"  open="AND A.ITEMKIND_CD IN (" close=")" separator=",">#{item}</foreach>
+				</if>
+				GROUP BY AF_LINK_CD
+
+	) TAB
+	ORDER BY AF_LINK_NM
+	</select>
+
+	<!-- 브랜드 주문목록 조회 -->
+	<select id="getBrandOrderList" parameterType="Statistics" resultType="Statistics">
+		/* TsaStatistics.getBrandOrderList */
+		SELECT
+		    BRAND_CD /*브랜드코드*/
+		    , BRAND_ENM /*브랜드명*/
+		    , TOT_AMT /*총매출*/
+		    , SELL_QTY /*판매수량*/
+		    , SELFMALL_AMT /*자사몰매출*/
+		    , EXTMALL_AMT /*제휴몰매출*/
+		    , CNCL_AMT /*취/반품액*/
+		    , TOT_AMT_10 /*정상매출*/
+		    , TOT_AMT_20 /*이월매출*/
+		    , ROUND( ((FLOOR(TOT_AMT_10 / TOT_AMT * 10000 / 10)) / 10), 1) AS AMT_RATE_10 /*정상비*/
+		    , ROUND(IF(TOT_AMT = 0, 1, TOT_AMT) / IF(YOY_TOT_ORD_AMT = 0, 1, YOY_TOT_ORD_AMT) * 100 - 100,1) AS YOY_RATE /*증가율*/
+		    , YOY_TOT_ORD_AMT
+		FROM (
+		    SELECT
+		        BRAND_CD
+		        , BRAND_ENM
+		        , SELF_YN
+		        , SUM(TOT_AMT) AS TOT_AMT
+		        , SUM(SELL_QTY) AS SELL_QTY
+		        , SUM(SELFMALL_AMT) AS SELFMALL_AMT
+		        , SUM(EXTMALL_AMT) AS EXTMALL_AMT
+		        , SUM(CNCL_AMT) AS CNCL_AMT
+		        , SUM(CASE WHEN FORMAL_GB = 'G009_10' THEN TOT_AMT ELSE 0 END) AS TOT_AMT_10 /*정상매출*/
+		        , SUM(CASE WHEN FORMAL_GB = 'G009_20' THEN TOT_AMT ELSE 0 END) AS TOT_AMT_20 /*이월매출*/
+		        , X.YOY_TOT_ORD_AMT
+		    FROM (
+		        SELECT
+		            A.BRAND_CD -- 브랜드코드
+		            , B.BRAND_ENM -- 브랜드명
+		            , B.SELF_YN -- 자사여부
+		            , A.FORMAL_GB -- 정상이월구분
+		            , SUM(A.SELF_AMT + A.CHANNEL_AMT + A.EXTMALL_AMT - A.CNCL_AMT - A.RTN_AMT) AS TOT_AMT -- 총매출
+		            , SUM(A.SELL_QTY) AS SELL_QTY -- 판매수량
+		            , SUM(A.SELF_AMT + A.CHANNEL_AMT) AS SELFMALL_AMT -- 자사몰매출
+		            , SUM(A.EXTMALL_AMT) AS EXTMALL_AMT -- 제휴몰매출
+		            , SUM(A.CNCL_AMT + A.RTN_AMT) AS CNCL_AMT -- 취/반품액
+					, IFNULL((SELECT SUM(X.SELF_AMT + X.CHANNEL_AMT + X.EXTMALL_AMT)
+				                FROM TB_STAT_ORD_DAY X
+				               WHERE A.BRAND_CD = X.BRAND_CD
+							<![CDATA[
+							     AND X.DAY >= STR_TO_DATE(#{startDt},'%Y-%m-%d')
+							     AND X.DAY <= DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY)
+							]]>
+							<if test="multiFrontGb != null">
+								/* 디바이스 */
+								<foreach collection="multiFrontGb" item="item" index="index"  open="AND X.FRONT_GB IN (" close=")" separator=",">#{item}</foreach>
+							</if>
+							<if test="multiFormalGb != null">
+								/* 정상/이월구분 */
+								<foreach collection="multiFormalGb" item="item" index="index"  open="AND X.FORMAL_GB IN (" close=")" separator=",">#{item}</foreach>
+							</if>
+							<if test="multiDistributionGb != null">
+								/* 물류구분 */
+								<foreach collection="multiDistributionGb" item="item" index="index"  open="AND X.DISTRIBUTION_GB IN (" close=")" separator=",">#{item}</foreach>
+							</if>
+							<if test="multiSupplyCompCd != null">
+								/* 공급처 */
+								<foreach collection="multiSupplyCompCd" item="item" index="index"  open="AND X.SUPPLY_COMP_CD IN (" close=")" separator=",">#{item}</foreach>
+							</if>
+							<if test="multiItemkindCd != null">
+								/* 품목 */
+								<foreach collection="multiItemkindCd" item="item" index="index"  open="AND X.ITEMKIND_CD IN (" close=")" separator=",">#{item}</foreach>
+							</if>
+							<if test="multiExtmallId != null">
+								/* 제휴몰 */
+								<foreach collection="multiExtmallId" item="item" index="index"  open="AND X.EXTMALL_ID IN (" close=")" separator=",">#{item}</foreach>
+							</if>
+							<if test="multiAfLinkCd != null">
+								/* 채널 */
+								<foreach collection="multiAfLinkCd" item="item" index="index"  open="AND X.AF_LINK_CD IN (" close=")" separator=",">#{item}</foreach>
+							</if>
+							<if test="multiBrandCd != null">
+								/* 브랜드 */
+								<foreach collection="multiBrandCd" item="item" index="index"  open="AND Y.BRAND_CD IN (" close=")" separator=",">#{item}</foreach>
+							</if>
+				              ),0)                                           AS YOY_TOT_ORD_AMT /*전년동기대비매출액*/
+		        FROM TB_STAT_ORD_DAY A, TB_BRAND B
+		        WHERE A.BRAND_CD = B.BRAND_CD
+				<![CDATA[
+			      AND DAY >= STR_TO_DATE(#{startDt},'%Y-%m-%d')
+			      AND DAY <= DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY)
+				]]>
+				<if test="multiFrontGb != null">
+					/* 디바이스 */
+					<foreach collection="multiFrontGb" item="item" index="index"  open="AND A.FRONT_GB IN (" close=")" separator=",">#{item}</foreach>
+				</if>
+				<if test="multiFormalGb != null">
+					/* 정상/이월구분 */
+					<foreach collection="multiFormalGb" item="item" index="index"  open="AND A.FORMAL_GB IN (" close=")" separator=",">#{item}</foreach>
+				</if>
+				<if test="multiDistributionGb != null">
+					/* 물류구분 */
+					<foreach collection="multiDistributionGb" item="item" index="index"  open="AND A.DISTRIBUTION_GB IN (" close=")" separator=",">#{item}</foreach>
+				</if>
+				<if test="multiSupplyCompCd != null">
+					/* 공급처 */
+					<foreach collection="multiSupplyCompCd" item="item" index="index"  open="AND A.SUPPLY_COMP_CD IN (" close=")" separator=",">#{item}</foreach>
+				</if>
+				<if test="multiItemkindCd != null">
+					/* 품목 */
+					<foreach collection="multiItemkindCd" item="item" index="index"  open="AND A.ITEMKIND_CD IN (" close=")" separator=",">#{item}</foreach>
+				</if>
+				<if test="multiExtmallId != null">
+					/* 제휴몰 */
+					<foreach collection="multiExtmallId" item="item" index="index"  open="AND A.EXTMALL_ID IN (" close=")" separator=",">#{item}</foreach>
+				</if>
+				<if test="multiAfLinkCd != null">
+					/* 채널 */
+					<foreach collection="multiAfLinkCd" item="item" index="index"  open="AND A.AF_LINK_CD IN (" close=")" separator=",">#{item}</foreach>
+				</if>
+				<if test="multiBrandCd != null">
+					/* 브랜드 */
+					<foreach collection="multiBrandCd" item="item" index="index"  open="AND A.BRAND_CD IN (" close=")" separator=",">#{item}</foreach>
+				</if>
+		        GROUP BY A.BRAND_CD, B.BRAND_ENM, B.SELF_YN, A.FORMAL_GB
+		    ) X
+		    GROUP BY BRAND_CD, BRAND_ENM, SELF_YN
+		) Z
+		ORDER BY SELF_YN DESC, BRAND_ENM
+	</select>
+
 </mapper>

+ 444 - 0
src/main/webapp/WEB-INF/views/statistics/BrandTradingForm.html

@@ -0,0 +1,444 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : BrandTradingForm.html
+ * @desc    : 브랜드별주문 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021-09-16 목   lmc        최초 작성
+ *******************************************************************************
+ -->
+	<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="@{'/statistics/brand/order/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
+				<input type="hidden" name="dayGb" value="D"/>
+
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:10%;"/>
+						<col style="width:25%;"/>
+						<col style="width:10%;"/>
+						<col/>
+					</colgroup>
+					<tr>
+						<th>기간<i class="required" title="필수" aria-hidden="true"></i></th>
+						<td colspan="3" id="terms"></td>
+					</tr>
+					<tr>
+						<th>디바이스</th>
+						<td>
+							<label class="chkBox checked"><input type="checkbox" name="multiFrontGb" value="P" checked="checked"/>PC웹</label>
+							<label class="chkBox checked"><input type="checkbox" name="multiFrontGb" value="M" checked="checked"/>모바일웹</label>
+							<label class="chkBox checked"><input type="checkbox" name="multiFrontGb" value="A" checked="checked"/>APP</label>
+						</td>
+						<th>제휴몰</th>
+						<td>
+							<input type="text" class="w100" name="extmallIdSearchTxt" id="extmallIdSearchTxt" maxlength="20"/>
+							<button type="button" class="btn icn" onclick="cfnOpenExtmallListPopup('fnSetExtmallInfo', 'M');"><i class="fa fa-search"></i></button>
+							<span id="extmallIdTxt"></span>
+							<input type="hidden" name="extmallIdList"/>
+						</td>
+					</tr>
+					<tr>
+						<th>물류구분</th>
+						<td>
+							<label class="chkBox checked"><input type="checkbox" name="multiDistributionGb" value="SCM" checked="checked"/>입점</label>
+							<label class="chkBox checked"><input type="checkbox" name="multiDistributionGb" value="WMS" checked="checked"/>위탁</label>
+						</td>
+						<th></th>
+						<td></td>
+					</tr>
+					<tr>
+						<th>공급업체</th>
+						<td>
+							<input type="text" class="w100" name="supplyCompCdSearchTxt" id="supplyCompCdSearchTxt" maxlength="20"/>
+							<button type="button" class="btn icn" onclick="cfnOpenCompanyListPopup('fnSetSupplyCompInfo', 'M');"><i class="fa fa-search"></i></button>
+							<span id="supplyCompCdTxt"></span>
+							<input type="hidden" name="supplyCompCdList"/>
+						</td>
+						<th>제휴채널</th>
+						<td>
+							<input type="text" class="w100" name="afLinkCdSearchTxt" id="afLinkCdSearchTxt" maxlength="20" />
+							<button type="button" class="btn icn" onclick="cfnOpenAfLinkListPopup('fnSetAfLinkInfo', 'M');"><i class="fa fa-search"></i></button>
+							<span id="afLinkCdTxt"></span>
+							<input type="hidden" name="afLinkCdList"/>
+						</td>
+					</tr>
+					<tr>
+						<th>브랜드</th>
+						<td>
+							<input type="text" class="w100" name="brandCdSearchTxt" id="brandCdSearchTxt" maxlength="20" />
+							<button type="button" class="btn icn" onclick="cfnOpenBrandListPopup('fnSetBrandInfo', 'M');"><i class="fa fa-search"></i></button>
+							<span id="brandCdTxt"></span>
+							<input type="hidden" name="brandCdList"/>
+						</td>
+						<th>품목</th>
+						<td>
+							<input type="text" class="w100" name="itemkindCdSearchTxt" id="itemkindCdSearchTxt" maxlength="20" />
+							<button type="button" class="btn icn" onclick="cfnOpenItemkindListPopup('fnSetItemkindInfo', 'M');"><i class="fa fa-search"></i></button>
+							<span id="itemkindTxt"></span>
+							<input type="hidden" name="itemkindCdList"/>
+						</td>
+					</tr>
+				</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" id="btnInit">초기화</button>
+					</li>
+				</ul>
+			</form>
+		</div>
+		<!-- 검색조건 영역 -->
+
+		<!-- 리스트 영역 -->
+		<div class="panelStyle">
+			<ul class="panelBar">
+				<li>
+					<button type="button" class="btn btn-default btn-lg" onclick="fnExcelDownLoad();">엑셀다운로드</button>
+				</li>
+			</ul>
+			<div id="gridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
+		</div>
+		<!-- //리스트 영역 -->
+	</div>
+
+<style>
+.ag-header-group-text{
+	margin-left: calc(50% - 25px);
+}
+</style>
+<script th:inline="javascript">
+/*<![CDATA[*/
+	let columnDefs = [
+		{ headerName: "브랜드번호", field: "brandCd", width: 100, cellClass: 'text-center' },
+		{ headerName: "브랜드명", field: "brandEnm", width: 180, cellClass: 'text-center'},
+		{ headerName: "브랜드 매출액", field: "", width: 120, cellClass: 'text-center',
+			children: [
+				{headerName: "총매출액(A+B+C)", field: "totAmt", width: 120, cellClass: 'text-center',
+					cellRenderer: function(params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "판매 개수", field: "sellQty", width: 120, cellClass: 'text-left',
+					cellRenderer: function(params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "YOY(%)", field: "yoyRate", width: 100, cellClass: 'text-left',
+					cellRenderer: function(params) {
+						return params.value +'%';
+					}
+				},
+			]
+		},
+		{ headerName: "매출 현황", field: "", width: 100, cellClass: 'text-center',
+			children: [
+				{headerName: "자사몰 매출액(A)", field: "selfmallAmt", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "제휴몰 매출액(B)", field: "extmallAmt", width: 150, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "취/반품액(C)", field: "cnclAmt", width: 150, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+			]
+		},
+		{ headerName: "정상이월 결제비중", field: "", width: 100, cellClass: 'text-center',
+			children: [
+				{headerName: "정상", field: "totAmt10", width: 150, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "이월", field: "totAmt20", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "정상비", field: "amtRate10", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				}
+			]
+		},
+	];
+
+	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	// Row Click
+	gridOptions.onCellClicked = function(event) {
+		var goodsCd = event.data.goodsCd;
+		if (event.colDef.field == "goodsCd"){
+			cfnOpenGoodsDetailPopup('U',goodsCd);
+		}
+		if (event.colDef.field == "goodsNm"){
+			cfnOpenGoodsDetailPopup('U',goodsCd);
+		}
+	}
+
+    gridOptions.excelStyles = [
+        {
+            id: 'text-center',
+            dataType: 'string',
+			font: {size : 10, bold: false}
+        },
+        {
+            id: 'text-left',
+            dataType: 'string',
+			font: {size : 10, bold: false}
+        },
+        {
+            id: 'text-right',
+            dataType: 'number',
+			font: {size : 10, bold: false}
+        }
+    ];
+
+    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 fnSetExtmallInfo = function(result) {
+		var arrExtmallId = [];
+		var extmallIdTxt = "";
+		var sIndex = 0;
+		$('#extmallIdTxt').html('');
+		$('#searchForm input[name=extmallIdSearchTxt]').val('');
+
+		result.forEach(function(extmall) {
+			sIndex++;
+			arrExtmallId.push(extmall.extmallId);
+		});
+
+		// 조회 값이 하나일 경우 화면에 코드 노출. 그 외는 갯수 처리
+		if (sIndex == 1) {
+			$('#searchForm input[name=extmallIdSearchTxt]').val(arrExtmallId[0]);
+		} else {
+			extmallIdTxt = sIndex + " 개";
+			$('#extmallIdTxt').html(extmallIdTxt);
+		}
+
+		var jsonData = JSON.stringify(arrExtmallId);
+		$("#searchForm input[name=extmallIdList]").val(arrExtmallId.join(','));
+	}
+
+	// 업체 조회 팝업에서 호출
+	var fnSetSupplyCompInfo = function(result) {
+		var arrSupplyCompCd = [];
+		var supplyCompCdTxt = "";
+		var sIndex = 0;
+		$('#supplyCompCdTxt').html('');
+		$('#searchForm input[name=supplyCompCdSearchTxt]').val('');
+
+		result.forEach(function(supplyComp) {
+			sIndex++;
+			arrSupplyCompCd.push(supplyComp.supplyCompCd);
+		});
+
+		// 조회 값이 하나일 경우 화면에 코드 노출. 그 외는 갯수 처리
+		if (sIndex == 1) {
+			$('#searchForm input[name=supplyCompCdSearchTxt]').val(arrSupplyCompCd[0]);
+		} else {
+			supplyCompCdTxt = sIndex + " 개";
+			$('#supplyCompCdTxt').html(supplyCompCdTxt);
+		}
+
+		var jsonData = JSON.stringify(arrSupplyCompCd);
+		$("#searchForm input[name=supplyCompCdList]").val(arrSupplyCompCd.join(','));
+	}
+
+	// 제휴채널 조회 팝업에서 호출
+	var fnSetAfLinkInfo = function(result) {
+		var arrAfLinkCd = [];
+		var afLinkCdTxt = "";
+		var sIndex = 0;
+		$('#afLinkCdTxt').html('');
+		$('#searchForm input[name=afLinkCdSearchTxt]').val('');
+
+		result.forEach(function(afLink) {
+			sIndex++;
+			arrAfLinkCd.push(afLink.afLinkCd);
+		});
+
+		// 조회 값이 하나일 경우 화면에 코드 노출. 그 외는 갯수 처리
+		if (sIndex == 1) {
+			$('#searchForm input[name=afLinkCdSearchTxt]').val(arrAfLinkCd[0]);
+		} else {
+			afLinkCdTxt = sIndex + " 개";
+			$('#afLinkCdTxt').html(afLinkCdTxt);
+		}
+
+		var jsonData = JSON.stringify(arrAfLinkCd);
+		$("#searchForm input[name=afLinkCdList]").val(arrAfLinkCd.join(","));
+	}
+
+	// 브랜드 조회 팝업에서 호출
+	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 totInfo = {};
+		totInfo.brandCd     = 'TOTAL';
+		totInfo.totAmt      = 0;
+		totInfo.sellQty     = 0;
+		totInfo.selfmallAmt = 0;
+		totInfo.extmallAmt  = 0;
+		totInfo.cnclAmt     = 0;
+		totInfo.totAmt10    = 0;
+		totInfo.totAmt20    = 0;
+		totInfo.amtRate10   = 0;
+		totInfo.yoyRate     = 0;
+		totInfo.yoyTotOrdAmt= 0;
+
+		gridOptions.api.forEachNode(function(rowNode, index) {
+			if (!rowNode.group) {
+				if( typeof rowNode.data.totAmt      == 'number') { totInfo.totAmt       += rowNode.data.totAmt      ; }
+				if( typeof rowNode.data.sellQty     == 'number') { totInfo.sellQty      += rowNode.data.sellQty     ; }
+				if( typeof rowNode.data.selfmallAmt == 'number') { totInfo.selfmallAmt  += rowNode.data.selfmallAmt ; }
+				if( typeof rowNode.data.extmallAmt  == 'number') { totInfo.extmallAmt   += rowNode.data.extmallAmt  ; }
+				if( typeof rowNode.data.cnclAmt     == 'number') { totInfo.cnclAmt      += rowNode.data.cnclAmt     ; }
+				if( typeof rowNode.data.totAmt10    == 'number') { totInfo.totAmt10     += rowNode.data.totAmt10    ; }
+				if( typeof rowNode.data.totAmt20    == 'number') { totInfo.totAmt20     += rowNode.data.totAmt20    ; }
+				if( typeof rowNode.data.amtRate10   == 'number') { totInfo.amtRate10    += rowNode.data.amtRate10   ; }
+				if( typeof rowNode.data.yoyTotOrdAmt== 'number') { totInfo.yoyTotOrdAmt += rowNode.data.yoyTotOrdAmt; }
+			}
+		});
+
+		//값이 0이면 제수가 0이므로 오류방지처리
+		if(totInfo.totAmt == 0) totInfo.totAmt = 1;
+		if(totInfo.yoyTotOrdAmt == 0) totInfo.yoyTotOrdAmt = 1;
+		totInfo.yoyRate = (totInfo.totAmt / totInfo.yoyTotOrdAmt * 100 - 100).toFixed(1);
+
+		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
+	}
+
+	// 초기화 클릭시
+	$('#btnInit').on('click', function() {
+		$('#searchForm')[0].reset();
+
+		$('#extmallIdTxt').html('');
+		$('#searchForm input[name=extmallIdList]').val('');
+		$('#supplyCompCdTxt').html('');
+		$('#searchForm input[name=supplyCompCdList]').val('');
+		$('#afLinkCdTxt').html('');
+		$('#searchForm input[name=afLinkCdList]').val('');
+		$('#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, '주문');
+		$('.btnRecentWeek').trigger('click');
+
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+
+		//조회
+		$('#btnSearch').click();
+	});
+/*]]>*/
+</script>
+
+</html>

+ 427 - 0
src/main/webapp/WEB-INF/views/statistics/ChannelTradingForm.html

@@ -0,0 +1,427 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : ChannelTradingForm.html
+ * @desc    : 채널주문 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021-09-15 수   lmc         최초 작성
+ *******************************************************************************
+ -->
+	<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="@{'/statistics/channel/order/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
+				<input type="hidden" name="dayGb" value="D"/>
+
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:10%;"/>
+						<col style="width:25%;"/>
+						<col style="width:10%;"/>
+						<col/>
+					</colgroup>
+					<tr>
+						<th>기간<i class="required" title="필수" aria-hidden="true"></i></th>
+						<td colspan="3" id="terms">
+						</td>
+					</tr>
+					<tr>
+						<th>디바이스</th>
+						<td>
+							<label class="chkBox checked"><input type="checkbox" name="multiFrontGb" value="P" checked="checked"/>PC웹</label>
+							<label class="chkBox checked"><input type="checkbox" name="multiFrontGb" value="M" checked="checked"/>모바일웹</label>
+							<label class="chkBox checked"><input type="checkbox" name="multiFrontGb" value="A" checked="checked"/>APP</label>
+						</td>
+						<th></th>
+						<td></td>
+					</tr>
+					<tr>
+						<th>물류구분</th>
+						<td>
+							<label class="chkBox checked"><input type="checkbox" name="multiDistributionGb" value="SCM" checked="checked"/>입점</label>
+							<label class="chkBox checked"><input type="checkbox" name="multiDistributionGb" value="WMS" checked="checked"/>위탁</label>
+						</td>
+						<th>정상/이월구분</th>
+						<td>
+							<label th:if="${formalGbList}" th:each="oneData, status : ${formalGbList}" class="chkBox checked"><input type="checkbox" name="multiFormalGb" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}" checked="checked"/></label>
+						</td>
+					</tr>
+					<tr>
+						<th>공급업체</th>
+						<td>
+							<input type="text" class="w100" name="supplyCompCdSearchTxt" id="supplyCompCdSearchTxt" maxlength="20"/>
+							<button type="button" class="btn icn" onclick="cfnOpenCompanyListPopup('fnSetSupplyCompInfo', 'M');"><i class="fa fa-search"></i></button>
+							<span id="supplyCompCdTxt"></span>
+							<input type="hidden" name="supplyCompCdList"/>
+						</td>
+						<th>품목</th>
+						<td>
+							<input type="text" class="w100" name="itemkindCdSearchTxt" id="itemkindCdSearchTxt" maxlength="20" />
+							<button type="button" class="btn icn" onclick="cfnOpenItemkindListPopup('fnSetItemkindInfo', 'M');"><i class="fa fa-search"></i></button>
+							<span id="itemkindTxt"></span>
+							<input type="hidden" name="itemkindCdList"/>
+						</td>
+					</tr>
+				</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" id="btnInit">초기화</button>
+					</li>
+				</ul>
+			</form>
+		</div>
+		<!-- 검색조건 영역 -->
+
+		<!-- 리스트 영역 -->
+		<div class="panelStyle">
+			<ul class="panelBar">
+				<li>
+					<button type="button" class="btn btn-default btn-lg" onclick="fnExcelDownLoad();">엑셀다운로드</button>
+				</li>
+			</ul>
+			<div id="gridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
+		</div>
+		<!-- //리스트 영역 -->
+	</div>
+
+<style>
+.ag-header-group-text{
+	margin-left: calc(50% - 25px);
+}
+</style>
+<script th:inline="javascript">
+/*<![CDATA[*/
+	let columnDefs = [
+		{ headerName: "채널별", field: "afLinkCd", width: 120, cellClass: 'text-center', hide:true },
+		{ headerName: "채널별", field: "afLinkNm", width: 120, cellClass: 'text-center' },
+		{ headerName: "주문/매출 현황", field: "총매출(A-B)", width: 100, cellClass: 'text-center',
+			children: [
+				{headerName: "총매출(A-B)", field: "totAmt", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "매출YOY	(%)", field: "yoyRate", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return params.value +'%';
+					}
+				},
+				{headerName: "판매수", field: "sellCnt", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "매출액(A)", field: "payAmt", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "취/반품갯수", field: "cnclQty", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "취/반품액", field: "cnclAmt", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				}
+			]
+		},
+		{ headerName: "결제/예상정산 현황", field: "", width: 100, cellClass: 'text-center',
+			children: [
+				{headerName: "실결제액(C)", field: "realOrdAmt", width: 120, cellClass: 'text-right',
+					cellRenderer: function(params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "수수로율(D)", field: "sellFeeRate", width: 120, cellClass: 'text-right',
+					cellRenderer: function(params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "예상 정산액C*(1-D)", field: "exUsacAmt", width: 150, cellClass: 'text-right',
+					cellRenderer: function(params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+			]
+		},
+	];
+
+	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	// Row Click
+	gridOptions.onCellClicked = function(event) {
+		var goodsCd = event.data.goodsCd;
+		if (event.colDef.field == "goodsCd"){
+			cfnOpenGoodsDetailPopup('U',goodsCd);
+		}
+		if (event.colDef.field == "goodsNm"){
+			cfnOpenGoodsDetailPopup('U',goodsCd);
+		}
+	}
+
+    gridOptions.excelStyles = [
+        {
+            id: 'text-center',
+            dataType: 'string',
+			font: {size : 10, bold: false}
+        },
+        {
+            id: 'text-left',
+            dataType: 'string',
+			font: {size : 10, bold: false}
+        },
+        {
+            id: 'text-right',
+            dataType: 'number',
+			font: {size : 10, bold: false}
+        }
+    ];
+
+    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 fnSetExtmallInfo = function(result) {
+		var arrExtmallId = [];
+		var extmallIdTxt = "";
+		var sIndex = 0;
+		$('#extmallIdTxt').html('');
+		$('#searchForm input[name=extmallIdSearchTxt]').val('');
+
+		result.forEach(function(extmall) {
+			sIndex++;
+			arrExtmallId.push(extmall.extmallId);
+		});
+
+		// 조회 값이 하나일 경우 화면에 코드 노출. 그 외는 갯수 처리
+		if (sIndex == 1) {
+			$('#searchForm input[name=extmallIdSearchTxt]').val(arrExtmallId[0]);
+		} else {
+			extmallIdTxt = sIndex + " 개";
+			$('#extmallIdTxt').html(extmallIdTxt);
+		}
+
+		var jsonData = JSON.stringify(arrExtmallId);
+		$("#searchForm input[name=extmallIdList]").val(arrExtmallId.join(','));
+	}
+
+	// 업체 조회 팝업에서 호출
+	var fnSetSupplyCompInfo = function(result) {
+		var arrSupplyCompCd = [];
+		var supplyCompCdTxt = "";
+		var sIndex = 0;
+		$('#supplyCompCdTxt').html('');
+		$('#searchForm input[name=supplyCompCdSearchTxt]').val('');
+
+		result.forEach(function(supplyComp) {
+			sIndex++;
+			arrSupplyCompCd.push(supplyComp.supplyCompCd);
+		});
+
+		// 조회 값이 하나일 경우 화면에 코드 노출. 그 외는 갯수 처리
+		if (sIndex == 1) {
+			$('#searchForm input[name=supplyCompCdSearchTxt]').val(arrSupplyCompCd[0]);
+		} else {
+			supplyCompCdTxt = sIndex + " 개";
+			$('#supplyCompCdTxt').html(supplyCompCdTxt);
+		}
+
+		var jsonData = JSON.stringify(arrSupplyCompCd);
+		$("#searchForm input[name=supplyCompCdList]").val(arrSupplyCompCd.join(','));
+	}
+
+	// 제휴채널 조회 팝업에서 호출
+	var fnSetAfLinkInfo = function(result) {
+		var arrAfLinkCd = [];
+		var afLinkCdTxt = "";
+		var sIndex = 0;
+		$('#afLinkCdTxt').html('');
+		$('#searchForm input[name=afLinkCdSearchTxt]').val('');
+
+		result.forEach(function(afLink) {
+			sIndex++;
+			arrAfLinkCd.push(afLink.afLinkCd);
+		});
+
+		// 조회 값이 하나일 경우 화면에 코드 노출. 그 외는 갯수 처리
+		if (sIndex == 1) {
+			$('#searchForm input[name=afLinkCdSearchTxt]').val(arrAfLinkCd[0]);
+		} else {
+			afLinkCdTxt = sIndex + " 개";
+			$('#afLinkCdTxt').html(afLinkCdTxt);
+		}
+
+		var jsonData = JSON.stringify(arrAfLinkCd);
+		$("#searchForm input[name=afLinkCdList]").val(arrAfLinkCd.join(","));
+	}
+
+	// 브랜드 조회 팝업에서 호출
+	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 totInfo = {};
+		totInfo.afLinkNm     = 'TOTAL';
+		totInfo.channelAmt   = 0;
+		totInfo.totAmt       = 0;
+		totInfo.sellQty      = 0;
+		totInfo.cnclQty      = 0;
+		totInfo.cnclAmt      = 0;
+		totInfo.realOrdAmt   = 0;
+		totInfo.sellFeeRate  = 0;
+		totInfo.exUsacAmt    = 0;
+		totInfo.yoyTotOrdAmt = 0;
+		totInfo.yoyRate		 = 0;
+
+		gridOptions.api.forEachNode(function(rowNode, index) {
+			if (!rowNode.group) {
+				if( typeof rowNode.data.channelAmt   == 'number') { totInfo.channelAmt   += rowNode.data.channelAmt   ; }
+				if( typeof rowNode.data.totAmt       == 'number') { totInfo.totAmt       += rowNode.data.totAmt       ; }
+				if( typeof rowNode.data.sellQty      == 'number') { totInfo.sellQty      += rowNode.data.sellQty      ; }
+				if( typeof rowNode.data.cnclQty      == 'number') { totInfo.cnclQty      += rowNode.data.cnclQty      ; }
+				if( typeof rowNode.data.cnclAmt      == 'number') { totInfo.cnclAmt      += rowNode.data.cnclAmt      ; }
+				if( typeof rowNode.data.realOrdAmt   == 'number') { totInfo.realOrdAmt   += rowNode.data.realOrdAmt   ; }
+				if( typeof rowNode.data.sellFeeRate  == 'number') { totInfo.sellFeeRate  += rowNode.data.sellFeeRate  ; }
+				if( typeof rowNode.data.exUsacAmt    == 'number') { totInfo.exUsacAmt    += rowNode.data.exUsacAmt    ; }
+				if( typeof rowNode.data.yoyTotOrdAmt == 'number') { totInfo.yoyTotOrdAmt +=  rowNode.data.yoyTotOrdAmt; }
+			}
+		});
+
+		//값이 0이면 제수가 0이므로 오류방지처리
+		if(totInfo.totAmt == 0) totInfo.totAmt = 1;
+		if(totInfo.yoyTotOrdAmt == 0) totInfo.yoyTotOrdAmt = 1;
+		totInfo.yoyRate = (totInfo.totAmt / totInfo.yoyTotOrdAmt * 100 - 100).toFixed(1);
+
+		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
+	}
+
+	// 초기화 클릭시
+	$('#btnInit').on('click', function() {
+		$('#searchForm')[0].reset();
+
+		$('#extmallIdTxt').html('');
+		$('#searchForm input[name=extmallIdList]').val('');
+		$('#supplyCompCdTxt').html('');
+		$('#searchForm input[name=supplyCompCdList]').val('');
+		$('#afLinkCdTxt').html('');
+		$('#searchForm input[name=afLinkCdList]').val('');
+		$('#brandCdTxt').html('');
+		$('#searchForm input[name=brandCdList]').val('');
+		$('#itemkindCdTxt').html('');
+		$('#searchForm input[name=itemkindCdList]').val('');
+	});
+
+	// 일자구분 변경 시
+	var fnSetDayGb = function(dayGb) {
+		$('#searchForm input[name=dayGb]').val(dayGb);
+		$('#dayGbD').removeClass('active');
+		$('#dayGbW').removeClass('active');
+		$('#dayGbM').removeClass('active');
+		$('#dayGb' + dayGb).addClass('active');
+		$('#btnSearch').trigger('click');
+	}
+
+	$(document).ready(function() {
+		cfnCreateCalendar('#terms', 'startDt', 'endDt', true, '주문');
+		$('.btnRecentWeek').trigger('click');
+
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+
+		//조회
+		$('#btnSearch').click();
+	});
+/*]]>*/
+</script>
+
+</html>

+ 1 - 1
src/main/webapp/WEB-INF/views/statistics/DailyOrderForm.html

@@ -147,7 +147,7 @@
 		{ headerName: "YOY(%)", field: "yoyRate", width: 100, cellClass: 'text-center' },
 		{
 			headerName: "자사직방문", field: "selfAmt", width: 150, cellClass: 'text-right',
-			cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+			cellRenderer: function (params) { return params.value +'%'; }
 		},
 		{
 			headerName: "채널", field: "channelAmt", width: 150, cellClass: 'text-right',

+ 26 - 11
src/main/webapp/WEB-INF/views/statistics/ExtmallTradingForm.html

@@ -82,6 +82,11 @@
 
 		<!-- 리스트 영역 -->
 		<div class="panelStyle">
+			<ul class="panelBar">
+				<li>
+					<button type="button" class="btn btn-default btn-lg" onclick="fnExcelDownLoad();">엑셀다운로드</button>
+				</li>
+			</ul>
 			<div id="gridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
 		</div>
 		<!-- //리스트 영역 -->
@@ -102,7 +107,7 @@
 					cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
 				},
 				{headerName: "매출YOY	(%)", field: "yoyRate", width: 120, cellClass: 'text-right',
-					cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+					cellRenderer: function (params) { return params.value +'%'; }
 				},
 				{headerName: "판매수", field: "sellQty", width: 120, cellClass: 'text-right',
 					cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
@@ -299,7 +304,6 @@
 		gridOptions.api.forEachNode(function(rowNode, index) {
 			if (!rowNode.group) {
 				if( typeof rowNode.data.totAmt       == 'number' ) { totInfo.totAmt       += rowNode.data.totAmt       ; }
-				if( typeof rowNode.data.yoyRate      == 'number' ) { totInfo.yoyRate      += rowNode.data.yoyRate      ; }
 				if( typeof rowNode.data.sellQty      == 'number' ) { totInfo.sellQty      += rowNode.data.sellQty      ; }
 				if( typeof rowNode.data.payAmt       == 'number' ) { totInfo.payAmt       += rowNode.data.sellQty      ; }
 				if( typeof rowNode.data.extmallAmt   == 'number' ) { totInfo.extmallAmt   += rowNode.data.extmallAmt   ; }
@@ -312,6 +316,11 @@
 			}
 		});
 
+		//값이 0이면 제수가 0이므로 오류방지처리
+		if(totInfo.totAmt == 0) totInfo.totAmt = 1;
+		if(totInfo.yoyTotOrdAmt == 0) totInfo.yoyTotOrdAmt = 1;
+		totInfo.yoyRate = (totInfo.totAmt / totInfo.yoyTotOrdAmt * 100 - 100).toFixed(1);
+
 		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
 	}
 
@@ -336,15 +345,21 @@
 		gagaAgGrid.exportToExcel('일자별주문 목록', gridOptions);
 	});
 
-	// 일자구분 변경 시
-	var fnSetDayGb = function(dayGb) {
-		$('#searchForm input[name=dayGb]').val(dayGb);
-		$('#dayGbD').removeClass('active');
-		$('#dayGbW').removeClass('active');
-		$('#dayGbM').removeClass('active');
-		$('#dayGb' + dayGb).addClass('active');
-		$('#btnSearch').trigger('click');
-	}
+    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);
+    }
 
 	$(document).ready(function() {
 		cfnCreateCalendar('#terms', 'startDt', 'endDt', true, '주문');