Jelajahi Sumber

Merge branch '#2021-09-14화_통계' into develop

LMC 4 tahun lalu
induk
melakukan
54daf969d0

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

@@ -32,4 +32,37 @@ public interface TsaStatisticsDao {
 	 */
 	Collection<Statistics> getDailyOrderList(Statistics statistics);
 
+	/**
+	  * 상품별 주문목록 조회
+	  * @param Statistics - 통계 정보
+	  * @return Collection<Statistics>
+	  * @author lmc
+	  * @since 2021. 9. 14.
+	  */
+	Collection<Statistics> getGoodsOrderList(Statistics statistics);
+
+	/**
+	 * 제휴몰 주문 목록 조회
+	 * @return Collection<Statistics>
+	 * @author lmc
+	 * @since 2021. 9. 15.
+	 */
+	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);
+
 }

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

@@ -45,4 +45,45 @@ public class TsaStatisticsService {
 		return statisticsDao.getDailyOrderList(statistics);
 	}
 
+	/**
+	  * 상품별 주문 목록 조회
+	  * @param
+	  * @return Collection<Statistics>
+	  * @author lmc
+	  * @since 2021. 9. 14.
+	  */
+	public Collection<Statistics> getGoodsOrderList(Statistics statistics) {
+		return statisticsDao.getGoodsOrderList(statistics);
+	}
+
+	/**
+	 * 제휴몰 주문 목록 조회
+	 * @return Collection<Statistics>
+	 * @author lmc
+	 * @since 2021. 9. 15.
+	 */
+	public Collection<Statistics> getExtmallOrderList(Statistics statistics) {
+		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);
+	}
+
 }

+ 20 - 0
src/main/java/com/style24/admin/biz/web/TsaBusinessController.java

@@ -613,6 +613,26 @@ public class TsaBusinessController extends TsaBaseController {
 		return mav;
 	}
 
+	/**
+	 * 제휴채널 화면(팝업)
+	 * author: 이명철
+	 * return: ModelAndView
+	 * since: 2021. 9. 14.
+	 */
+	@GetMapping("/aflink/popup/form")
+	public ModelAndView aflinkPopupForm(Aflink aflink) {
+		ModelAndView mav = new ModelAndView();
+
+		mav.addObject("params", aflink);
+
+		// 제휴채널 콤보박스 목록
+		mav.addObject("afChannelList", rendererService.getCommonCodeList("G053"));
+
+		mav.setViewName("business/AflinkPopupForm");
+
+		return mav;
+	}
+
 	/**
 	 * 제휴채널 목록
 	 * @param afChannel - 제휴채널

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

@@ -149,4 +149,233 @@ public class TsaStatisticsController extends TsaBaseController {
 		return statisticsService.getDailyOrderList(statistics);
 	}
 
+
+	/**
+	  * 상품별 주문 화면
+	  * @param 없음
+	  * @return ModelAndView
+	  * @author lmc
+	  * @since 2021. 9. 14.
+	  */
+	@GetMapping("/goods/trading/form")
+	public ModelAndView goodsTradingForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 정상이월구분
+		mav.addObject("formalGbList", rendererService.getAvailCommonCodeList("G009"));
+
+		mav.setViewName("statistics/GoodsTradingForm");
+		return mav;
+	}
+
+	/**
+	 * 상품별 주문 목록
+	 * @return Collection<Statistics>
+	 * @author lmc
+	 * @since 2021. 9. 14.
+	 */
+	@PostMapping("/goods/order/list")
+	@ResponseBody
+	public Collection<Statistics> getGoodsOrderList(@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.getGoodsOrderList(statistics);
+	}
+
+
+	/**
+	 * 제휴몰 주문 목록 화면
+	 * @return ModelAndView
+	 * @author lmc
+	 * @since 2021. 9. 15.
+	 */
+	@GetMapping("/extmall/trading/form")
+	public ModelAndView extmallTradingForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 정상이월구분
+		mav.addObject("formalGbList", rendererService.getAvailCommonCodeList("G009"));
+
+		mav.setViewName("statistics/ExtmallTradingForm");
+		return mav;
+	}
+
+	/**
+	 * 제휴몰 주문 조회
+	 * @return Collection<Statistics>
+	 * @author lmc
+	 * @since 2021. 9. 15.
+	 */
+	@PostMapping("/extmall/order/list")
+	@ResponseBody
+	public Collection<Statistics> getExtmallOrderList(@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.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 - 1
src/main/java/com/style24/persistence/domain/Aflink.java

@@ -14,13 +14,16 @@ import lombok.Data;
 @Data
 public class Aflink extends TscBaseDomain {
 
+	private String callbackFn;	// 콜백함수명
+	private String searchTxt;	// 검색어
+	private String multiGb;	    // 다중선택여부
 	private String afLinkCd;	// 제휴링크코드
 	private String afLinkNm;	// 제휴링크명
 	private String afChannel;	// 제휴채널
 	private float feeRate;		// 수수료율(마진율)
 	private int dispOrd;		// 표시순서
 	private String useYn;		// 사용여부
-	
+
 	// 검색조건
 	private String callBackFun;		// 콜백함수
 

+ 34 - 5
src/main/java/com/style24/persistence/domain/Statistics.java

@@ -16,29 +16,47 @@ import lombok.Data;
 public class Statistics extends TscBaseDomain {
 
 	private String day;			// 일자
-	private int totOrdAmt;		// 매출액
-	private int yoyTotOrdAmt;	// 전년동기대비매출액
+	private int cartCpnAmt;		// 장바구니쿠폰할인금액
+	private int savePntAmt;		// 기타포인트
+	private int tmtbAmt;		// 다다익선금액
+	private long totAmt;	    // 총금액
+	private long payAmt;	    // 판매금액
+	private int goodsCpnAmt;	// 상품쿠폰금액
+	private int stockQty;		// 현재고
+	private long totOrdAmt;		// 매출액
+	private long yoyTotOrdAmt;	// 전년동기대비매출액
 	private int selfAmt;		// 자사직방문매출액
-	private int channelAmt;		// 채널매출액
-	private int extmallAmt;		// 제휴몰매출액
-	private int cnclAmt;		// 취/반품액
+	private long channelAmt;	// 채널매출액
+	private long selfmallAmt;	// 자사몰매출액
+	private long extmallAmt;	// 제휴몰매출액
+	private long cnclAmt;		// 취/반품액
 	private int ordCnt;			// 주문건수
 	private int sellQty;		// 판매수량
 	private int cnclQty;		// 취/반품수량
+	private long exUsacAmt;		// 예상 정산액C*(1-D)
+	private long realOrdAmt;	// 실결제금액
 
 	// 검색조건
 	private String dayGb;		// 날짜구분(D:일별, W:주별, M:월별)
 	private String startDt;		// 시작일
 	private String endDt;		// 종료일
+	private String frontGb;	    // 프론트구분
 	private String frontGbP;	// 프론트구분(=디바이스구분)PC웹
 	private String frontGbM;	// 프론트구분(=디바이스구분)모바일웹
 	private String frontGbA;	// 프론트구분(=디바이스구분)앱
 	private String mallGb;		// 몰구분
 
 	private String extmallIdList;
+
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiGoodsCd;	// 상품코드
+
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
 	private String[] multiExtmallId;	// 제휴몰ID
 
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiFormalGb;	// 제휴몰ID
+
 	private String distributionGbWms;	// 유통구분(WMS)
 	private String distributionGbScm;	// 유통구분(SCM)
 
@@ -46,6 +64,9 @@ public class Statistics extends TscBaseDomain {
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
 	private String[] multiSupplyCompCd;	// 공급업체코드
 
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiDistributionGb;	// 물류구분
+
 	private String afLinkCdList;
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
 	private String[] multiAfLinkCd;		// 제휴채널코드
@@ -58,6 +79,9 @@ public class Statistics extends TscBaseDomain {
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
 	private String[] multiItemkindCd;	// 품목코드
 
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiFrontGb;	// 화면구분
+
 	// 일일거래내역
 	private Integer ordNo;				// 주문번호
 	private Integer ordDtlNo;			// 주문상세번호
@@ -108,7 +132,12 @@ 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;			// 이월구분
+	private double yoyRate;             // 전년대비 증감율
 
 }

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

@@ -200,7 +200,7 @@
 		       ) ODIH
 		ORDER  BY ODIH.ORD_DTL_ITEM_HST_SQ
 	</select>
-	
+
 	<!-- 일자별주문 목록 -->
 	<select id="getDailyOrderList" parameterType="Statistics" resultType="Statistics">
 		/* TsaStatistics.getDailyOrderList */
@@ -354,4 +354,388 @@
 		     </choose>
 	</select>
 
+	<!-- 상품별 주문 목록 -->
+	<select id="getGoodsOrderList" parameterType="Statistics" resultType="Statistics">
+		/* TsaStatistics.getGoodsOrderList */
+		SELECT
+		    FN_GET_CODE_NM('G009',A.FORMAL_GB) AS FORMAL_GB -- 정상이월구분
+		    , A.GOODS_CD                                    -- 상품코드
+		    , B.GOODS_NM                                    -- 상품명
+		    , SUM(C.STOCK_QTY) AS STOCK_QTY                 -- 현재고수량
+		    , SUM(A.SELL_QTY) AS SELL_QTY                   -- 판매수량
+		    , SUM(A.SELF_AMT + A.CHANNEL_AMT + A.EXTMALL_AMT - A.GOODS_CPN_AMT - A.TMTB_AMT - A.CART_CPN_AMT) AS PAY_AMT -- 상품당결제액
+		    , SUM(A.GOODS_CPN_AMT) AS GOODS_CPN_AMT         -- 즉시/주문상품쿠폰
+		    , SUM(A.TMTB_AMT) AS TMTB_AMT                   -- 다다익선
+		    , SUM(A.CART_CPN_AMT) AS CART_CPN_AMT           -- 장바구니쿠폰
+		    , SUM(A.CNCL_QTY + A.RTN_QTY) AS CNCL_QTY       -- 취/환불수량
+		    , SUM(A.CNCL_AMT + A.RTN_AMT) AS CNCL_AMT       -- 취/환불액
+		    , SUM(A.SAVE_PNT_AMT) AS SAVE_PNT_AMT           -- 지급포인트
+		FROM TB_STAT_ORD_DAY A, TB_GOODS B, TB_GOODS_STOCK C
+		WHERE A.GOODS_CD = B.GOODS_CD
+		    AND B.GOODS_CD = C.GOODS_CD
+		<![CDATA[
+		    AND A.DAY >= STR_TO_DATE(#{startDt},'%Y-%m-%d')
+		    AND A.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="multiExtmallId != null">
+			/* 제휴몰 */
+			<foreach collection="multiExtmallId" item="item" index="index"  open="AND A.EXTMALL_ID 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="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>
+		<if test="multiItemkindCd != null">
+			/* 품목 */
+			<foreach collection="multiItemkindCd" item="item" index="index"  open="AND A.ITEMKIND_CD IN (" close=")" separator=",">#{item}</foreach>
+		</if>
+		<if test="multiGoodsCd != null">
+			/* 상품코드 */
+			<foreach collection="multiGoodsCd" item="item" index="index"  open="AND (" close=")" separator="OR">A.GOODS_CD LIKE CONCAT('%', #{item}, '%')</foreach>
+		</if>
+		<if test="multiFormalGb != null">
+			/* 정상/이월구분 */
+			<foreach collection="multiFormalGb" item="item" index="index"  open="AND B.FORMAL_GB IN (" close=")" separator=",">#{item}</foreach>
+		</if>
+		GROUP BY A.FORMAL_GB, A.GOODS_CD, B.GOODS_NM, B.SELF_GOODS_YN
+		ORDER BY B.SELF_GOODS_YN DESC, A.FORMAL_GB, A.GOODS_CD
+	</select>
+
+	<!-- 제휴몰 주문 목록 조회 -->
+	<select id="getExtmallOrderList" parameterType="Statistics" resultType="Statistics">
+		/* TsaStatistics.getExtmallOrderList */
+		SELECT EXTMALL_NM
+		     , TOT_AMT
+		     , SELL_QTY
+		     , EXTMALL_AMT
+		     , 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
+				    (SELECT EXTMALL_NM FROM TB_EXTMALL X WHERE X.EXTMALL_ID = A.EXTMALL_ID LIMIT 1) AS EXTMALL_NM
+				    , SUM(A.EXTMALL_AMT - A.CNCL_AMT - A.RTN_AMT) AS TOT_AMT /* 총매출 */
+				    , SUM(A.SELL_QTY) AS SELL_QTY /* 판매수량 */
+				    , SUM(A.EXTMALL_AMT) AS EXTMALL_AMT
+				    , 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 SELL_FEE_RATE FROM TB_EXTMALL X WHERE X.EXTMALL_ID = A.EXTMALL_ID LIMIT 1) AS SELL_FEE_RATE -- 수수료율
+				    , (SUM(A.REAL_ORD_AMT) * (1 - (SELECT SELL_FEE_RATE FROM TB_EXTMALL X WHERE X.EXTMALL_ID = A.EXTMALL_ID LIMIT 1) / 100)) AS EX_USAC_AMT
+					, IFNULL((SELECT SUM(X.EXTMALL_AMT - X.CNCL_AMT - X.RTN_AMT)
+				               FROM   TB_STAT_ORD_DAY X
+				               WHERE  1 = 1
+				                 AND X.EXTMALL_ID = A.EXTMALL_ID
+							<![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="multiBrandCd != null">
+									/* 브랜드 */
+									<foreach collection="multiBrandCd" item="item" index="index"  open="AND X.BRAND_CD 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="multiSupplyCompCd != null">
+									/* 공급처 */
+									<foreach collection="multiSupplyCompCd" item="item" index="index"  open="AND X.SUPPLY_COMP_CD 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="multiItemkindCd != null">
+									/* 품목 */
+									<foreach collection="multiItemkindCd" item="item" index="index"  open="AND X.ITEMKIND_CD IN (" close=")" separator=",">#{item}</foreach>
+								</if>
+								<if test="multiFrontGb != null">
+									/* 디바이스 */
+									<foreach collection="multiFrontGb" item="item" index="index"  open="AND X.FRONT_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>
+				              ),0)                                           AS YOY_TOT_ORD_AMT /*전년동기대비매출액*/
+				FROM TB_STAT_ORD_DAY A
+				WHERE 1=1
+				    AND A.EXTMALL_ID IS NOT NULL
+				<![CDATA[
+				    AND A.DAY >= STR_TO_DATE(#{startDt},'%Y-%m-%d')
+				    AND A.DAY <= DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'), INTERVAL 1 DAY)
+				]]>
+				<if test="multiBrandCd != null">
+					/* 브랜드 */
+					<foreach collection="multiBrandCd" item="item" index="index"  open="AND A.BRAND_CD 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="multiSupplyCompCd != null">
+					/* 공급처 */
+					<foreach collection="multiSupplyCompCd" item="item" index="index"  open="AND A.SUPPLY_COMP_CD 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="multiItemkindCd != null">
+					/* 품목 */
+					<foreach collection="multiItemkindCd" item="item" index="index"  open="AND A.ITEMKIND_CD IN (" close=")" separator=",">#{item}</foreach>
+				</if>
+				<if test="multiFrontGb != null">
+					/* 디바이스 */
+					<foreach collection="multiFrontGb" item="item" index="index"  open="AND FRONT_GB IN (" close=")" separator=",">#{item}</foreach>
+				</if>
+				<if test="multiDistributionGb != null">
+					/* 물류구분 */
+					<foreach collection="multiDistributionGb" item="item" index="index"  open="AND DISTRIBUTION_GB IN (" close=")" separator=",">#{item}</foreach>
+				</if>
+				GROUP BY A.EXTMALL_ID
+	) TAB
+	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.CHANNEL_AMT - X.CNCL_AMT - X.RTN_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.TOT_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>

+ 154 - 0
src/main/webapp/WEB-INF/views/business/AflinkPopupForm.html

@@ -0,0 +1,154 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : aflinkPopupForm.html
+ * @desc    : 제휴 채널 팝업 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021-09-14 화  lmc         최초 작성
+ *******************************************************************************
+ -->
+<div class="modalPopup" data-width="600" id="popupAflinkList">
+	<div class="panelStyle"  style="max-height:700px;">
+		<!-- TITLE -->
+		<div class="panelTitle">
+			<strong>제휴채널 목록</strong>
+			<button type="button" class="close" onclick="uifnPopupClose('popupAflinkList');"><em class="fa fa-times"></em></button>
+		</div>
+		<!-- //TITLE -->
+		<!-- 검색 조건 -->
+		<div class="panelContent">
+			<form id="searchAflinkListForm" name="searchAflinkListForm" action="#" th:action="@{'/business/aflink/list'}" onsubmit="$('#btnSearchAflinkList').trigger('click'); return false;">
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:15%;"/>
+						<col/>
+					</colgroup>
+					<tbody>
+						<tr>
+							<th>상위제휴채널</th>
+							<td>
+								<select name="afChannel">
+									<option value="">[전체]</option>
+									<option th:if="${afChannelList}" th:each="oneData, status : ${afChannelList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+								</select>
+							</td>
+						</tr>
+					</tbody>
+				</table>
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-lg" id="btnSearchAflinkList">조회</button>
+					</li>
+				</ul>
+			</form>
+			<!-- 리스트 영역 -->
+			<div class="panelContent">
+				<div id="gridAflinkList" style="width: 100%; height: 380px" class="ag-theme-balham"></div>
+			</div>
+			<!-- //리스트 영역 -->
+
+			<!-- 버튼 배치 영역 -->
+			<ul class="panelBar">
+				<li class="right">
+					<button type="button" class="btn btn-info btn-lg" id="btnConfirmAflink">확인</button>
+				</li>
+			</ul>
+		</div>
+		<!-- //검색 조건 -->
+	</div>
+
+<script th:inline="javascript">
+/*<![CDATA[*/
+	let headerSelection = false;
+	let afChannelList = gagajf.convertToArray([[${afChannelList}]]);
+	let useYnList = { "Y":"Yes", "N":"No" };
+	if([[${params.multiGb}]] == "M") headerSelection = true;
+
+
+	let columnDefs = [
+		{width: 40, minWidth: 40, cellClass: 'text-right', headerCheckboxSelection: headerSelection, checkboxSelection: true, filter: false},
+		{headerName: "제휴채널코드", field: "afLinkCd", width: 100, cellClass: 'text-center'},
+		{
+			headerName: "제휴채널명", field: "afLinkNm", width: 180,
+			cellRenderer: function(params) {
+				return '<a href="javascript:void(0);">' + params.value + '</a>';
+			}
+		},
+		{
+			headerName: "상위제휴채널", field: "afChannel", width: 120, cellClass: 'text-center',
+			valueGetter: function (params) { return gagaAgGrid.lookupValue(afChannelList, params.data.afChannel); }
+		},
+		{
+			headerName: "마진율", field: "feeRate", width: 100, cellClass: 'text-center',
+			cellRenderer: function(params) { return params.value + '%'; }
+		},
+		{headerName: "표시순서", field: "dispOrd", width: 100, cellClass: 'text-center'},
+		{
+			headerName: "사용여부", field: "useYn", width: 100, cellClass: 'text-center',
+			valueGetter: function (params) { return gagaAgGrid.lookupValue(useYnList, params.data.useYn); }
+		}
+	];
+
+	let gridOptionsAflinkList = gagaAgGrid.getGridOptions(columnDefs);
+	if(headerSelection) {	gridOptionsAflinkList.rowSelection = "multiple";	}
+
+	// Row double click
+	gridOptionsAflinkList.onRowDoubleClicked = function(event) {
+		$('#btnConfirmAflink').trigger('click');
+	}
+
+	// 조회
+	$('#btnSearchAflinkList').on('click', function() {
+		// Fetch data
+		var actionUrl = $('#searchAflinkListForm').prop('action') + '?' + $('#searchAflinkListForm').serialize();
+		gagaAgGrid.fetch(actionUrl, gridOptionsAflinkList, '#searchAflinkListForm');
+	});
+
+	// 확인
+	$('#btnConfirmAflink').on('click', function() {
+		var selectedData = gagaAgGrid.selectedRowData(gridOptionsAflinkList);
+
+		if (selectedData.length == 0) {
+			mcxDialog.alert('선택된 품목이 없습니다.');
+			return false;
+		}
+
+		var callbackFn = [[${params.callbackFn}]];
+
+		var jsonData = JSON.stringify(selectedData);
+
+		if (typeof callbackFn != 'undefined' && callbackFn) {
+			if (typeof callbackFn == 'function') {
+				callbackFn(jsonData);
+			} else {
+				if (callbackFn) {
+					if (callbackFn.indexOf("(") == -1) {
+						(new Function(callbackFn + "(" + jsonData + ");"))();
+					} else {
+						(new Function(callbackFn(jsonData)))();
+					}
+				}
+			}
+			uifnPopupClose('popupAflinkList');
+		}
+	});
+
+	$(document).ready(function() {
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridAflinkList', gridOptionsAflinkList);
+
+		//$('#btnSearchAflinkList').trigger('click');
+	});
+/*]]>*/
+</script>
+
+</div>
+
+</html>

+ 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, '주문', undefined, ['btnToday']);
+		$('.btnYesterday').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, '주문', undefined, ['btnToday']);
+		$('.btnYesterday').trigger('click');
+
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+
+		//조회
+		$('#btnSearch').click();
+	});
+/*]]>*/
+</script>
+
+</html>

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

@@ -19,17 +19,17 @@
 		<div class="main-title">
 		</div>
 		<!-- //메인타이틀 영역 -->
-		
+
 		<!-- 메뉴 설명 -->
 		<div class="infoBox menu-desc">
 		</div>
 		<!-- //메뉴 설명 -->
-		
+
 		<!-- 검색조건 영역 -->
 		<div class="panelStyle">
 			<form id="searchForm" name="searchForm" action="#" th:action="@{'/statistics/daily/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%;"/>
@@ -95,7 +95,7 @@
 						</td>
 					</tr>
 				</table>
-				
+
 				<ul class="panelBar">
 					<li class="center">
 						<button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
@@ -105,11 +105,11 @@
 			</form>
 		</div>
 		<!-- 검색조건 영역 -->
-		
+
 		<div class="panelStyle">
 			<div id="chart" class="chartUnit"></div>
 		</div>
-		
+
 		<!-- 리스트 영역 -->
 		<div class="panelStyle">
 			<!-- 버튼 배치 영역 -->
@@ -126,7 +126,7 @@
 				</li>
 			</ul>
 			<!-- //버튼 배치 영역 -->
-			
+
 			<div id="gridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
 		</div>
 		<!-- //리스트 영역 -->
@@ -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',
@@ -185,10 +185,10 @@
 				suppressCount: true
 			}
 		};
-	
+
 	// for expand everything
 	gridOptions.groupDefaultExpanded = -1;
-	
+
 	// 제휴몰 조회 팝업에서 호출
 	var fnSetExtmallInfo = function(result) {
 		var arrExtmallId = [];
@@ -196,24 +196,24 @@
 		var sIndex = 0;
 		$('#extmallIdTxt').html('');
 		$('#searchForm input[name=extmallIdSearchTxt]').val('');
-		
+
 		result.forEach(function(extmall) {
-			sIndex++; 
+			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(jsonData);
 	}
-	
+
 	// 업체 조회 팝업에서 호출
 	var fnSetSupplyCompInfo = function(result) {
 		var arrSupplyCompCd = [];
@@ -221,24 +221,24 @@
 		var sIndex = 0;
 		$('#supplyCompCdTxt').html('');
 		$('#searchForm input[name=supplyCompCdSearchTxt]').val('');
-		
+
 		result.forEach(function(supplyComp) {
-			sIndex++; 
+			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(jsonData);
 	}
-	
+
 	// 제휴채널 조회 팝업에서 호출
 	var fnSetAfLinkInfo = function(result) {
 		var arrAfLinkCd = [];
@@ -246,24 +246,24 @@
 		var sIndex = 0;
 		$('#afLinkCdTxt').html('');
 		$('#searchForm input[name=afLinkCdSearchTxt]').val('');
-		
+
 		result.forEach(function(afLink) {
-			sIndex++; 
+			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(jsonData);
+		$("#searchForm input[name=afLinkCdList]").val(arrAfLinkCd.join(','));
 	}
-	
+
 	// 브랜드 조회 팝업에서 호출
 	var fnSetBrandInfo = function(result) {
 		var arrBrandCd = [];
@@ -271,24 +271,24 @@
 		var bIndex = 0;
 		$('#brandCdTxt').html('');
 		$('#searchForm input[name=brandCdSearchTxt]').val('');
-		
+
 		result.forEach(function(brand){
-			bIndex++; 
+			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(jsonData);
 	}
-	
+
 	// 품목 조회 팝업에서 호출
 	var fnSetItemkindInfo = function(result) {
 		var arrItemkindCd = [];
@@ -296,38 +296,38 @@
 		var bIndex = 0;
 		$('#itemkindCdTxt').html('');
 		$('#searchForm input[name=itemkindCdSearchTxt]').val('');
-		
+
 		result.forEach(function(itemkind){
-			bIndex++; 
+			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(jsonData);
 	}
-	
+
 	// 검색
 	$('#btnSearch').on('click', function() {
 		// 입력 값 체크
 		if (!gagajf.validation($('#searchForm')))
 			return false;
-		
+
 		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', fnCreateTotal);
 	});
-	
+
 	// 합계 생성
 	let fnCreateTotal = function() {
 		// Draw chart
 		fnDrawChart(gagaAgGrid.getAllRowData(gridOptions));
-		
+
 		let totOrdAmt = 0;
 		let yoyTotOrdAmt = 0;
 		let selfAmt = 0;
@@ -337,7 +337,7 @@
 		let ordCnt = 0;
 		let sellQty = 0;
 		let cnclQty = 0;
-		
+
 		gridOptions.api.forEachNode(function(rowNode, index) {
 			if (!rowNode.group) {
 				if (typeof rowNode.data.totOrdAmt == 'number') { totOrdAmt += rowNode.data.totOrdAmt; }
@@ -353,7 +353,7 @@
 		});
 
 		let yoyRate = yoyTotOrdAmt > 0 ? gagaAgGrid.toFixed((totOrdAmt / yoyTotOrdAmt - 1) * 100, 1) : '';
-		
+
 		let data = {
 			day: 'TOTAL',
 			totOrdAmt: totOrdAmt, yoyTotOrdAmt: yoyTotOrdAmt, yoyRate: yoyRate,
@@ -363,11 +363,11 @@
 
 		gagaAgGrid.setPinnedRowData(gridOptions, data, 'top');
 	}
-	
+
 	// 초기화 클릭시
 	$('#btnInit').on('click', function() {
 		$('#searchForm')[0].reset();
-		
+
 		$('#extmallIdTxt').html('');
 		$('#searchForm input[name=extmallIdList]').val('');
 		$('#supplyCompCdTxt').html('');
@@ -379,12 +379,12 @@
 		$('#itemkindCdTxt').html('');
 		$('#searchForm input[name=itemkindCdList]').val('');
 	});
-	
+
 	// 엑셀다운로드
 	$('#btnExcel').on('click', function() {
 		gagaAgGrid.exportToExcel('일자별주문 목록', gridOptions);
 	});
-	
+
 	// 일자구분 변경 시
 	var fnSetDayGb = function(dayGb) {
 		$('#searchForm input[name=dayGb]').val(dayGb);
@@ -394,14 +394,14 @@
 		$('#dayGb' + dayGb).addClass('active');
 		$('#btnSearch').trigger('click');
 	}
-	
+
 	// 그래프 그리기
 	var chart1;
 	var fnDrawChart = function(data) {
 		let dayList = [];
 		let totOrdAmtList = [];
 		let ordCntList = [];
-		
+
 		$(data).each(function(idx, item) {
 			if ($('#dayGbD').hasClass('active')) {
 				dayList.push(item.day.toDate('YYYY-MM-DD').format('MM-DD'));
@@ -411,7 +411,7 @@
 			totOrdAmtList.push((item.totOrdAmt / 1000).toFixed(0));
 			ordCntList.push(item.ordCnt);
 		});
-		
+
 		chart1 = c3.generate({
 			bindto: "#chart",
 			padding: {
@@ -467,7 +467,7 @@
 			} */
 		});
 	}
-	
+
 	// LNB 또는 GNB 클릭시 차트 넓이 변경
 	var chartResize = function() {
 		setTimeout(function () {
@@ -475,13 +475,16 @@
 			chart1.resize();
 		}, 300);
 	}
-	
+
 	$(document).ready(function() {
-		cfnCreateCalendar('#terms', 'startDt', 'endDt', true, '주문');
-		$('.btnRecentWeek').trigger('click');
-		
+		cfnCreateCalendar('#terms', 'startDt', 'endDt', true, '주문', undefined, ['btnToday']);
+		$('.btnYesterday').trigger('click');
+
 		// Create a agGrid
 		gagaAgGrid.createGrid('gridList', gridOptions);
+
+		//조회
+		$('#btnSearch').click();
 	});
 /*]]>*/
 </script>

+ 377 - 0
src/main/webapp/WEB-INF/views/statistics/ExtmallTradingForm.html

@@ -0,0 +1,377 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : ExtmallTradingForm.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/extmall/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>
+							<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>
+							<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="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: "extmallNm", width: 150, cellClass: 'text-center' },
+		{ headerName: "주문/매출 현황", field: "", width: 80, cellClass: 'text-center',
+			children: [
+				{headerName: "총매출(A-B)", field: "totAmt", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+				},
+				{headerName: "매출YOY	(%)", field: "yoyRate", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) { return params.value +'%'; }
+				},
+				{headerName: "판매수", field: "sellQty", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+				},
+				{headerName: "매출액(A)", field: "payAmt", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+				},
+				{headerName: "취/반품 갯수", field: "cnclQty", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+				},
+				{headerName: "취소/반품액(B)", field: "cnclAmt", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+				},
+			]
+		},
+		{ headerName: "결제/예상정산 현황", field: "", width: 100, cellClass: 'text-center',
+			children: [
+				{headerName: "실결제액(C)", field: "realOrdAmt", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+				},
+				{headerName: "수수료율(D)", field: "sellFeeRate", width: 100, cellClass: 'text-right'},
+				{headerName: "예상 정산액C*(1-D)", field: "exUsacAmt", width: 140, cellClass: 'text-right',
+					cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+				}
+			]
+		},
+	];
+
+	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	gridOptions.autoGroupColumnDef = {
+			headerName: "일자",
+			field: "grouping",
+			width: 200,
+			cellRendererParams: {
+				suppressCount: true
+			}
+		};
+
+	// for expand everything
+	gridOptions.groupDefaultExpanded = -1;
+
+	// 제휴몰 조회 팝업에서 호출
+	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.extmallNm     =  'TOTAL';
+		totInfo.totAmt        =  0;
+		totInfo.yoyRate       =  0;
+		totInfo.sellQty       =  0;
+		totInfo.payAmt        =  0;
+		totInfo.extmallAmt    =  0;
+		totInfo.cnclQty       =  0;
+		totInfo.cnclAmt       =  0;
+		totInfo.realOrdAmt    =  0;
+		totInfo.sellFeeRate   =  0;
+		totInfo.exUsacAmt     =  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.payAmt       == 'number' ) { totInfo.payAmt       += rowNode.data.sellQty      ; }
+				if( typeof rowNode.data.extmallAmt   == 'number' ) { totInfo.extmallAmt   += rowNode.data.extmallAmt   ; }
+				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('');
+	});
+
+	// 엑셀다운로드
+	$('#btnExcel').on('click', function() {
+		gagaAgGrid.exportToExcel('일자별주문 목록', gridOptions);
+	});
+
+    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, '주문', undefined, ['btnToday']);
+		$('.btnYesterday').trigger('click');
+
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+
+		//조회
+		$('#btnSearch').click();
+	});
+/*]]>*/
+</script>
+
+</html>

+ 477 - 0
src/main/webapp/WEB-INF/views/statistics/GoodsTradingForm.html

@@ -0,0 +1,477 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : GoodsTradingForm.html
+ * @desc    : 상품별주문 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021-09-14 화   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/goods/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 style="width:25%;"/>
+						<col style="width:10%;"/>
+						<col style="width:20%;"/>
+					</colgroup>
+					<tr>
+						<th>기간<i class="required" title="필수" aria-hidden="true"></i></th>
+						<td colspan="3" id="terms">
+						</td>
+						<th rowspan="5">상품코드/품번</th>
+						<td rowspan="5">
+							<textarea class="textareaR3 w70p" name="goodsCd" placeholder="상품번호/품번 중 입력하세요."></textarea>
+						</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>
+							<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="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: "formalGb", width: 80, cellClass: 'text-center' },
+		{ headerName: "상품정보", field: "day", width: 100, cellClass: 'text-center',
+			children: [
+				{headerName: "상품번호", field: "goodsCd", width: 120, cellClass: 'text-center',
+					cellRenderer: function(params) {
+						return '<a href="javascript:void(0);">' + params.value + '</a>';
+					}
+				},
+				{headerName: "상품명", field: "goodsNm", width: 230, cellClass: 'text-left',
+					cellRenderer: function(params) {
+						return '<a href="javascript:void(0);">' + params.value + '</a>';
+					}
+				}
+			]
+		},
+		{ headerName: "현재고", field: "stockQty", width: 100, cellClass: 'text-right',
+			cellRenderer: function (params) {
+				return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+			}
+		},
+		{ headerName: "판매수", field: "sellQty", width: 100, cellClass: 'text-right' },
+		{ headerName: "매출액(A)", field: "", width: 100, cellClass: 'text-center',
+			children: [
+				{headerName: "판매수", field: "sellQty", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "매출액(판매가*수량)", field: "payAmt", width: 150, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				}
+			]
+		},
+		{ headerName: "쿠폰(B)", field: "", width: 100, cellClass: 'text-center',
+			children: [
+				{headerName: "즉시/주문상품 쿠폰", field: "goodsCpnAmt", width: 150, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "다다익선", field: "tmtbAmt", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "장바구니쿠폰", field: "cartCpnAmt", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				}
+			]
+		},
+		{ headerName: "취소/환불(C)", field: "", width: 100, cellClass: 'text-center',
+			children: [
+				{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: "지급포인트", field: "savePntAmt", 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.stockQty        = 0;
+		totInfo.sellQty         = 0;
+		totInfo.payAmt          = 0;
+		totInfo.goodsCpnAmt     = 0;
+		totInfo.tmtbAmt         = 0;
+		totInfo.cartCpnAmt      = 0;
+		totInfo.cnclQty         = 0;
+		totInfo.cnclAmt         = 0;
+		totInfo.savePntAmt		= 0;
+		totInfo.formalGb        = 'TOTAL';
+		totInfo.goodsCd         = '';
+		totInfo.goodsNm         = '';
+
+		gridOptions.api.forEachNode(function(rowNode, index) {
+			if (!rowNode.group) {
+				if( typeof rowNode.data.stockQty    == 'number') { totInfo.stockQty     += rowNode.data.stockQty    ; }
+				if( typeof rowNode.data.sellQty     == 'number') { totInfo.sellQty      += rowNode.data.sellQty     ; }
+				if( typeof rowNode.data.payAmt      == 'number') { totInfo.payAmt       += rowNode.data.payAmt      ; }
+				if( typeof rowNode.data.goodsCpnAmt == 'number') { totInfo.goodsCpnAmt  += rowNode.data.goodsCpnAmt ; }
+				if( typeof rowNode.data.tmtbAmt     == 'number') { totInfo.tmtbAmt      += rowNode.data.tmtbAmt     ; }
+				if( typeof rowNode.data.cartCpnAmt  == 'number') { totInfo.cartCpnAmt   += rowNode.data.cartCpnAmt  ; }
+				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.savePntAmt  == 'number') { totInfo.savePntAmt	+= rowNode.data.savePntAmt	; }
+			}
+		});
+
+		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);
+	});
+
+	// 일자구분 변경 시
+	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, '주문', undefined, ['btnToday']);
+		$('.btnYesterday').trigger('click');
+
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+
+		//조회
+		$('#btnSearch').click();
+	});
+/*]]>*/
+</script>
+
+</html>

+ 17 - 0
src/main/webapp/ux/js/admin.popup.js

@@ -1099,3 +1099,20 @@ var cfnOpenItemkindListPopup = function(callbackfn, multiGb, searchTxt) {
 	if (typeof(searchTxt) != 'undefined') actionUrl += "&searchTxt=" + encodeURIComponent(searchTxt);
 	cfnOpenModalPopup(actionUrl, "popupItemkindList");
 }
+
+/*
+ * @type   : function
+ * @access : public
+ * @desc   : 제휴채널 팝업
+ * <pre>
+ *     cfnOpenAfLinkListPopup('fnResult');
+ *     cfnOpenAfLinkListPopup('fnResult', 'S');
+ *     cfnOpenAfLinkListPopup('fnResult', 'S', 'TBJ');
+ * </pre>
+ */
+var cfnOpenAfLinkListPopup = function(callbackfn, multiGb, searchTxt){
+	var actionUrl = '/business/aflink/popup/form?callbackFn=' + callbackfn;
+	if (typeof(multiGb) != 'undefined' && multiGb != null && multiGb == "M") actionUrl += "&multiGb=" + multiGb; else actionUrl += "&multiGb=S";
+	if (typeof(searchTxt) != 'undefined') actionUrl += "&searchTxt=" + encodeURIComponent(searchTxt);
+	cfnOpenModalPopup(actionUrl, "popupAflinkList");
+}