Bladeren bron

Merge remote-tracking branch 'origin/develop' into jsh77b

jsh77b 4 jaren geleden
bovenliggende
commit
421e2a9c55

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

@@ -89,4 +89,12 @@ public interface TsaStatisticsDao {
 	 */
 	Collection<Statistics> getCategoryOrderDetailList(Statistics statistics);
 
+	/**
+	 * 클래임 주문 조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 24.
+	 */
+	Collection<Statistics> getClaimOrderList(Statistics statistics);
+
 }

+ 4 - 4
src/main/java/com/style24/admin/biz/service/TsaShoplinkerService.java

@@ -409,7 +409,7 @@ public class TsaShoplinkerService {
 					dtlDesc += "<span class=\"st_model_info\" style=\"display: block;margin-top: 20px;color: #666;font-size: 16px;font-weight: 200;text-align: center;\">"+goodsMap.getModelInfo()+"</span>";
 					dtlDesc += "<div class=\"st_view\" style=\"margin-top: 40px;\">";
 					for(String img : dImgModelList) {
-						dtlDesc += "<img src=\""+ img +"\" alt=\"\" style=\"display: block;margin: 10px auto 0;\">";
+						dtlDesc += "<img src=\""+ img +"\" alt=\"\" style=\"display: block;margin: 10px auto 0; max-width: 100%;\">";
 					}
 					dtlDesc += "</div>";
 					dtlDesc += "</div>";
@@ -421,7 +421,7 @@ public class TsaShoplinkerService {
 					dtlDesc += "<span class=\"st_tit_view\" style=\"display: block;color: #222;font-size: 32px;font-weight: 300;text-align: center;\">PRODUCT VIEW</span>";
 					dtlDesc += "<div class=\"st_view\" style=\"margin-top: 40px;\">";
 					for(String img : dImgDetailList) {
-						dtlDesc += "<img src=\""+ img +"\" alt=\"\" style=\"display: block;margin: 10px auto 0;\">";
+						dtlDesc += "<img src=\""+ img +"\" alt=\"\" style=\"display: block;margin: 10px auto 0; max-width: 100%;\">";
 					}
 	                dtlDesc += "</div>";
 	        		dtlDesc += " </div>";
@@ -432,7 +432,7 @@ public class TsaShoplinkerService {
 	        		dtlDesc += "<div class=\"st_view_fabric_box\" style=\"margin-top: 100px;text-align: center;\">";
 	        		dtlDesc += "<span class=\"st_tit_view\" style=\"display: block;color: #222;font-size: 32px;font-weight: 300;text-align: center;\">FABRIC</span>";
 	        		dtlDesc += "<div class=\"st_view\" style=\"margin-top: 40px;\">";
-	        		dtlDesc += "<img src=\""+dMaterial +"\" alt=\"\" style=\"display: block;margin: 10px auto 0;margin-top: 0;\">";
+	        		dtlDesc += "<img src=\""+dMaterial +"\" alt=\"\" style=\"display: block;margin: 10px auto 0;margin-top: 0; max-width: 100%;\">";
 	                dtlDesc += "</div>";
 	                dtlDesc += "</div>";
 				}
@@ -444,7 +444,7 @@ public class TsaShoplinkerService {
 	                dtlDesc += "<div class=\"st_view\" style=\"margin-top: 40px;\">";
 	                dtlDesc += "<span style=\"display:inline-block;\">";
 	                for(String img : dLabelList) {
-						dtlDesc += "<img src=\""+ img +"\" alt=\"\" style=\"float:left; margin-top:0; margin-left:20px;\">";
+						dtlDesc += "<img src=\""+ img +"\" alt=\"\" style=\"float:left; margin-top:0; margin-left:20px; max-width: 100%;\">";
 					}
 	                dtlDesc += "</span>";
 	                dtlDesc += "</div>";

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

@@ -116,4 +116,14 @@ public class TsaStatisticsService {
 		return statisticsDao.getCategoryOrderDetailList(statistics);
 	}
 
+	/**
+	 * 클래임 주문조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 24.
+	 */
+	public Collection<Statistics> getClaimOrderList(Statistics statistics) {
+		return statisticsDao.getClaimOrderList(statistics);
+	}
+
 }

+ 58 - 1
src/main/java/com/style24/admin/biz/web/TsaStatisticsController.java

@@ -501,7 +501,7 @@ public class TsaStatisticsController extends TsaBaseController {
 
 		return statisticsService.getCategoryOrderList(statistics);
 	}
-	
+
 	/**
 	 * 카테고리 주문 상세 조회
 	 * author: 이명철
@@ -514,5 +514,62 @@ public class TsaStatisticsController extends TsaBaseController {
 		return statisticsService.getCategoryOrderDetailList(statistics);
 	}
 
+	/**
+	 * 클래임 주문 화면
+	 * author: 이명철
+	 * return: ModelAndView
+	 * since: 2021. 9. 24.
+	 */
+	@GetMapping("/claim/trading/form")
+	public ModelAndView claimTradingForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 정상이월구분
+		mav.addObject("formalGbList", rendererService.getAvailCommonCodeList("G009"));
+
+		mav.setViewName("statistics/ClaimTradingForm");
+		return mav;
+	}
+
+	/**
+	 * 클래임 주문 조회
+	 * author: 이명철
+	 * return: Collection<Statistics>
+	 * since: 2021. 9. 24.
+	 */
+	@PostMapping("/claim/order/list")
+	@ResponseBody
+	public Collection<Statistics> getClaimOrderList(@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.getClaimOrderList(statistics);
+	}
 
 }

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

@@ -156,5 +156,15 @@ public class Statistics extends TscBaseDomain {
 	private long custPrice;             //고객단가
 	private long compOrdAmt;            //비교
 
+	private long clmAmt;      //클래임금액
+	private int clmQty;       //클랭미수량
+	private int amtRate;      //금액비
+	private int clmRate;      //클래임율
+	private int rtnQty;       //반품수량
+	private long rtnAmt;      //반품금액
+	private int chgQty;       //교환수량
+	private long chgDelvFee;  //교환금액
+
+
 
 }

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

@@ -121,7 +121,7 @@
         	AND A.MAIN_COLOR_CD = B.COLOR_CD
         </if>
         <if test='colorListYn != null and colorListYn == "Y"'>
-			AND (B.SYS_IMG_NM LIKE '%_01.jpg' or B.SYS_IMG_NM LIKE '%_02.jpg' )
+			AND (B.SYS_IMG_NM LIKE CONCAT('%',B.COLOR_CD,'_01%') OR B.SYS_IMG_NM LIKE CONCAT('%',B.COLOR_CD,'_02%' ))
         </if>
 		ORDER BY B.COLOR_CD, B.DISP_ORD
 	</select>

+ 49 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaStatistics.xml

@@ -982,4 +982,53 @@
 		GROUP BY C.BRAND_ENM, A.GOODS_CD, B.GOODS_NM
 	</select>
 
+	<!-- 클래임 주문조회 -->
+	<select id="getClaimOrderList" parameterType="Statistics" resultType="Statistics">
+		/* TsaStatistics.getClaimOrderList */
+		SELECT
+		    DATE_FORMAT(DAY, '%m-%d') AS DAY
+		    , SUM(A.CNCL_AMT + A.RTN_AMT + A.CHG_DELV_FEE) AS CLM_AMT /*클레임액*/
+		    , SUM(A.CNCL_QTY + A.RTN_QTY + A.CHG_QTY) AS CLM_QTY /*클레임수*/
+		    , ROUND(FLOOR(SUM(A.CNCL_AMT + A.RTN_AMT + A.CHG_DELV_FEE) / SUM(A.SELF_AMT + A.CHANNEL_AMT + A.EXTMALL_AMT) * 100 * 10) / 10, 1) AS AMT_RATE
+		    , ROUND(FLOOR(SUM(A.CNCL_QTY + A.RTN_QTY + A.CHG_QTY) / SUM(A.SELL_QTY) * 100 * 10) / 10, 1) AS CLM_RATE
+		    , SUM(A.CNCL_QTY) AS CNCL_QTY /*취소수*/
+		    , SUM(A.CNCL_AMT) AS CNCL_AMT /*취소액*/
+		    , SUM(A.RTN_QTY) AS RTN_QTY /*반품수*/
+		    , SUM(A.RTN_AMT) AS RTN_AMT /*반품액*/
+		    , SUM(A.CHG_QTY) AS CHG_QTY /*교환수*/
+		    , SUM(A.CHG_DELV_FEE) AS CHG_DELV_FEE /*교환배송비*/
+		FROM TB_STAT_ORD_DAY A
+		WHERE 1=1
+	        <![CDATA[
+	        /* 직접선택 */
+	        AND A.DAY >= DATE_FORMAT(#{startDt}, '%Y%m%d')
+	        AND A.DAY <  DATE_ADD(DATE_FORMAT(#{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="multiSupplyCompCd != null">
+				/* 공급처 */
+				<foreach collection="multiSupplyCompCd" item="item" index="index"  open="AND A.SUPPLY_COMP_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="multiAfLinkCd != null">
+				/* 채널 */
+				<foreach collection="multiAfLinkCd" item="item" index="index"  open="AND A.AF_LINK_CD IN (" close=")" separator=",">#{item}</foreach>
+			</if>
+		GROUP BY DATE_FORMAT(DAY, '%m-%d')
+	</select>
+
 </mapper>

+ 437 - 0
src/main/webapp/WEB-INF/views/statistics/ClaimTradingForm.html

@@ -0,0 +1,437 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : ClaimTradingForm.html
+ * @desc    : 브랜드별주문 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021-09-24 금   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/claim/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>
+							<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: "day", width: 100, cellClass: 'text-center' },
+		{ headerName: "클래임 합산", field: "", width: 120, cellClass: 'text-right',
+			children: [
+				{headerName: "클래임액(A+B+C)", field: "clmAmt", width: 150, cellClass: 'text-center',
+					cellRenderer: function(params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "클래임상품수(A+B+C)", field: "clmQty", width: 150, cellClass: 'text-right',
+					cellRenderer: function(params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "금액비(%)", field: "amtRate", width: 120, cellClass: 'text-right',
+					cellRenderer: function(params) {
+						return params.value +'%';
+					}
+				},
+				{headerName: "클래임율(%)", field: "clmRate", width: 120, cellClass: 'text-right',
+					cellRenderer: function(params) {
+						return params.value +'%';
+					}
+				},
+			]
+		},
+		{ headerName: "취소(A)", 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: "반품(B)", field: "", width: 100, cellClass: 'text-center',
+			children: [
+				{headerName: "반품상품수", field: "rtnQty", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "반품액", field: "rtnAmt", 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: "chgQty", width: 120, cellClass: 'text-right',
+					cellRenderer: function (params) {
+						return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+					}
+				},
+				{headerName: "교환액", field: "chgDelvFee", 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.day     = 'TOTAL';
+		totInfo.clmAmt      = 0;
+		totInfo.clmQty      = 0;
+		totInfo.amtRate     = 0;
+		totInfo.clmRate     = 0;
+		totInfo.cnclQty     = 0;
+		totInfo.cnclAmt     = 0;
+		totInfo.rtnQty      = 0;
+		totInfo.rtnAmt      = 0;
+		totInfo.chgQty      = 0;
+		totInfo.chgDelvFee	= 0;
+
+		gridOptions.api.forEachNode(function(rowNode, index) {
+			if (!rowNode.group) {
+				if( typeof rowNode.data.clmAmt     == 'number') { totInfo.clmAmt     += rowNode.data.clmAmt     ; }
+				if( typeof rowNode.data.clmQty     == 'number') { totInfo.clmQty     += rowNode.data.clmQty     ; }
+				if( typeof rowNode.data.amtRate    == 'number') { totInfo.amtRate    += rowNode.data.amtRate    ; }
+				if( typeof rowNode.data.clmRate    == 'number') { totInfo.clmRate    += rowNode.data.clmRate    ; }
+				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.rtnQty     == 'number') { totInfo.rtnQty     += rowNode.data.rtnQty     ; }
+				if( typeof rowNode.data.rtnAmt     == 'number') { totInfo.rtnAmt     += rowNode.data.rtnAmt     ; }
+				if( typeof rowNode.data.chgQty     == 'number') { totInfo.chgQty     += rowNode.data.chgQty     ; }
+				if( typeof rowNode.data.chgDelvFee == 'number') { totInfo.chgDelvFee += rowNode.data.chgDelvFee ; }
+			}
+		});
+
+		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);
+
+	});
+/*]]>*/
+</script>
+
+</html>