Browse Source

샵링커수정, 엑셀다운로드기능추가, 제휴몰 고객센터연락처추가

jmh 4 years ago
parent
commit
9d31bc6cad

+ 60 - 0
src/main/java/com/style24/admin/biz/dao/TsaShoplinkerDao.java

@@ -0,0 +1,60 @@
+package com.style24.admin.biz.dao;
+
+import java.util.Collection;
+
+import com.gagaframework.web.parameter.GagaMap;
+import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.ShoplinkerInvoice;
+import com.style24.persistence.domain.ShoplinkerOrder;
+import com.style24.persistence.domain.ShoplinkerSearch;
+
+/**
+ * 샵링커 Dao
+ *
+ * @author jmh
+ * @since 2021. 5. 20
+ */
+@ShopDs
+public interface TsaShoplinkerDao {
+
+	/**
+	 * 상품등록-상품 목록 엑셀
+	 *
+	 * @param shoplinkerSearch
+	 * @return
+	 * @author jmh
+	 * @since 2021. 5. 20
+	 */
+	Collection<GagaMap> getGoodsSendExcelList(ShoplinkerSearch shoplinkerSearch);
+
+	/**
+	 * 재고- 목록 엑셀
+	 *
+	 * @param shoplinkerSearch
+	 * @return
+	 * @author jmh
+	 * @since 2021. 5. 20
+	 */
+	Collection<GagaMap> getStockExcelList(ShoplinkerSearch shoplinkerSearch);
+
+	/**
+	 * 주문- 목록 엑셀
+	 *
+	 * @param shoplinkerSearch
+	 * @return
+	 * @author jmh
+	 * @since 2021. 5. 20
+	 */
+	Collection<GagaMap> getOrderExcelList(ShoplinkerOrder shoplinkerOrder);
+
+	/**
+	 * 송장- 목록 엑셀
+	 *
+	 * @param shoplinkerSearch
+	 * @return
+	 * @author jmh
+	 * @since 2021. 5. 20
+	 */
+	Collection<GagaMap> getInvoiceExcelList(ShoplinkerInvoice shoplinkerInvoice);
+
+}

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

@@ -0,0 +1,185 @@
+package com.style24.admin.biz.service;
+
+import java.util.Collection;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.gagaframework.excel.GagaExcelUtil;
+import com.gagaframework.excel.env.GagaExcelConstants;
+import com.gagaframework.web.parameter.GagaMap;
+import com.style24.admin.biz.dao.TsaShoplinkerDao;
+import com.style24.admin.support.env.TsaConstants;
+import com.style24.core.support.message.TscMessageByLocale;
+import com.style24.persistence.domain.ShoplinkerInvoice;
+import com.style24.persistence.domain.ShoplinkerOrder;
+import com.style24.persistence.domain.ShoplinkerSearch;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * 영업망관리 샵링커 Service
+ *
+ * @author gagamel
+ * @since 2020. 11. 4
+ */
+@Service
+@Slf4j
+@SuppressWarnings("deprecation")
+public class TsaShoplinkerService {
+
+	@Autowired
+	private TscMessageByLocale message;
+
+	@Autowired
+	private TsaShoplinkerDao shoplinkerDao;
+
+
+	/**
+	 * 상품등록-상품 목록 엑셀다운로드
+	 *
+	 * @param shoplinkerSearch
+	 * @param excelFilenameWithPath - 경로를 포함한 엑셀파일명
+	 * @return
+	 * @author jmh
+	 * @since 2021. 06. 29
+	 */
+	public void getGoodsSendExcelList(ShoplinkerSearch shoplinkerSearch, String excelFilenameWithPath) {
+
+		// 헤더 title 설정
+		String[] listTitles = {"샵링커상품코드", "API구분", "IF결과", "IF결과메세지", "자사상품코드", "자사옵션코드", "등록자", "전송일자"};
+
+		// DB 처리 시 사용되는 파라미터명(셀명) 설정
+		String[] cellNames = {"API_PRODUCT_ID", "API_TYPE", "API_RESULT", "API_MESSAGE", "GOODS_CD", "OPT_CD", "REG_NM", "REG_DT"};
+
+		String[] cellTypes = {
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_LEFT.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name()};
+
+		Collection<GagaMap> dataList = shoplinkerDao.getGoodsSendExcelList(shoplinkerSearch);
+
+		try {
+
+			GagaExcelUtil.createExcel(excelFilenameWithPath, dataList, "샵링커 상품 정보", listTitles, cellNames, cellTypes, TsaConstants.EXCEL_FOOTER_TITLE);
+
+		} catch (Exception e) {
+			throw new IllegalStateException(e);
+		}
+	}
+
+	/**
+	 * 재고전송-목록 엑셀다운로드
+	 *
+	 * @param shoplinkerSearch
+	 * @param excelFilenameWithPath - 경로를 포함한 엑셀파일명
+	 * @return
+	 * @author jmh
+	 * @since 2021. 06. 29
+	 */
+	public void getStockExcelList(ShoplinkerSearch shoplinkerSearch, String excelFilenameWithPath) {
+
+		// 헤더 title 설정
+		String[] listTitles = {"IF결과", "IF결과메세지", "상품코드", "상품명", "옵션코드", "옵션1", "옵션2", "재고", "전송일자"};
+
+		// DB 처리 시 사용되는 파라미터명(셀명) 설정
+		String[] cellNames = {"API_RESULT", "API_MESSAGE", "GOODS_CD", "GOODS_NM", "OPT_CD", "OPT_CD1", "OPT_CD2", "QUANTITY", "REG_DT"};
+
+		String[] cellTypes = {
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_LEFT.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_LEFT.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name()};
+
+		Collection<GagaMap> dataList = shoplinkerDao.getStockExcelList(shoplinkerSearch);
+
+		try {
+
+			GagaExcelUtil.createExcel(excelFilenameWithPath, dataList, "샵링커 재고 정보", listTitles, cellNames, cellTypes, TsaConstants.EXCEL_FOOTER_TITLE);
+
+		} catch (Exception e) {
+			throw new IllegalStateException(e);
+		}
+	}
+
+	/**
+	 * 주문수집-목록 엑셀다운로드
+	 *
+	 * @param shoplinkerSearch
+	 * @param excelFilenameWithPath - 경로를 포함한 엑셀파일명
+	 * @return
+	 * @author jmh
+	 * @since 2021. 06. 29
+	 */
+	public void getOrderExcelList(ShoplinkerOrder shoplinkerOrder, String excelFilenameWithPath) {
+
+		// 헤더 title 설정
+		String[] listTitles = { "제휴몰주문등록상태", "실패사유", "업로드실패사유", "스타일24 주문번호", "샵링커 주문번호", "쇼핑몰 주문번호", "쇼핑몰 명", "배송상태[발주확인]"
+				,"주문 상품번호", "샵링커 상품번호", "자사 상품코드", "상품명", "주문수량", "주문금액", "판매단가", "공급가", "옵션명", "주문수집일자", "제휴몰등록일"};
+
+		// DB 처리 시 사용되는 파라미터명(셀명) 설정
+		String[] cellNames = {"UPLOAD_STAT", "UPLOAD_FAIL_CD", "UPLOAD_FAIL_REASON", "ORD_NO", "SHOPLINKER_ORDER_ID", "EXTMALL_ORDER_ID", "MALL_NAME", "BAESONG_STATUS"
+				, "ORDER_PRODUCT_ID", "SHOPLINKER_PRODUCT_ID", "PARTNER_PRODUCT_ID", "PRODUCT_NAME", "QUANTITY", "ORDER_PRICE", "SALE_PRICE", "SUPPLY_PRICE", "SKU", "ORDER_REG_DATE", "EXTMALL_REG_DT"};
+
+		String[] cellTypes = {
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_LEFT.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_LEFT.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_LEFT.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_LEFT.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_LEFT.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name()};
+
+		Collection<GagaMap> dataList = shoplinkerDao.getOrderExcelList(shoplinkerOrder);
+
+		try {
+
+			GagaExcelUtil.createExcel(excelFilenameWithPath, dataList, "샵링커 주문 정보", listTitles, cellNames, cellTypes, TsaConstants.EXCEL_FOOTER_TITLE);
+
+		} catch (Exception e) {
+			throw new IllegalStateException(e);
+		}
+	}
+
+	/**
+	 * 송장전송-목록 엑셀다운로드
+	 *
+	 * @param shoplinkerSearch
+	 * @param excelFilenameWithPath - 경로를 포함한 엑셀파일명
+	 * @return
+	 * @author jmh
+	 * @since 2021. 06. 29
+	 */
+	public void getInvoiceExcelList(ShoplinkerInvoice shoplinkerInvoice, String excelFilenameWithPath) {
+
+		// 헤더 title 설정
+		String[] listTitles = {"IF결과", "IF결과메세지", "샵링커 주문번호", "쇼핑몰 주문번호", "스타일24 주문번호", "주문상세번호", "배송업체", "송장번호", "전송일시"};
+
+		// DB 처리 시 사용되는 파라미터명(셀명) 설정
+		String[] cellNames = {"API_RESULT", "API_MESSAGE", "AGENT_ORDER_ID", "EXTMALL_ORDER_ID", "ORD_NO", "ORD_DTL_NO", "SHIP_COMP_NM", "DELIVERY_INVOICE", "REG_DT"};
+
+		String[] cellTypes = {
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_LEFT.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_LEFT.name(),
+			GagaExcelConstants.CellType.CHAR_CENTER.name()};
+
+		Collection<GagaMap> dataList = shoplinkerDao.getInvoiceExcelList(shoplinkerInvoice);
+
+		try {
+
+			GagaExcelUtil.createExcel(excelFilenameWithPath, dataList, "샵링커 송장 정보", listTitles, cellNames, cellTypes, TsaConstants.EXCEL_FOOTER_TITLE);
+
+		} catch (Exception e) {
+			throw new IllegalStateException(e);
+		}
+	}
+
+
+}

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

@@ -282,7 +282,7 @@ public class TsaOcmController extends TsaBaseController {
 		// 외부몰주문등록
 		if ("createExtmallOrder".equals(extmallOrder.getProcJob())) {
 			// DB 처리 시 사용되는 파라미터명(셀명) 설정
-			String[] extMallOrderNames = {"ordDt", "extmallId", "extmallOrderId", "agentOrderId", "extmallProdId", "goodsCd", "sku", "optCd", "currPrice", "cpnDcAmt", "ordQty", "delvFee", "ordNm", "ordTelno", "ordPhnno", "ordEmail", "recipNm", "recipTelno", "recipPhnno", "recipZipcode", "recipBaseAddr", "recipDtlAddr", "delvMemo"};
+			String[] extMallOrderNames = {"ordDt", "extmallId", "extmallOrderId", "agentOrderId", "extmallProdId", "goodsCd", "sku", "optCd", "currPrice", "ordQty", "delvFee", "ordNm", "ordTelno", "ordPhnno", "ordEmail", "recipNm", "recipTelno", "recipPhnno", "recipZipcode", "recipBaseAddr", "recipDtlAddr", "delvMemo"};
 
 			ecxelGoodsList = GagaExcelUtil.getList(
 				GagaFileUtil.getConcatenationPath(targetPath, extmallOrder.getExcelFileNm()), 0, extMallOrderNames, 0);

+ 128 - 1
src/main/java/com/style24/admin/biz/web/TsaShoplinkerController.java

@@ -6,11 +6,14 @@ import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
+import org.springframework.core.io.InputStreamResource;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -31,6 +34,7 @@ import com.gagaframework.web.util.GagaDateUtil;
 import com.gagaframework.web.util.GagaFileUtil;
 import com.style24.admin.biz.service.TsaOcmService;
 import com.style24.admin.biz.service.TsaRendererService;
+import com.style24.admin.biz.service.TsaShoplinkerService;
 import com.style24.admin.support.controller.TsaBaseController;
 import com.style24.admin.support.security.session.TsaSession;
 import com.style24.core.biz.service.TscOrderOcmService;
@@ -67,6 +71,9 @@ public class TsaShoplinkerController extends TsaBaseController {
 	@Autowired
 	private TscShoplinkerService shoplinkerService;
 
+	@Autowired
+	private TsaShoplinkerService admShoplinkerService;
+
 	@Autowired
 	private TsaOcmService ocmService;
 
@@ -690,7 +697,127 @@ public class TsaShoplinkerController extends TsaBaseController {
 		return runMap;
 	}
 
+	/**
+	 * 상품목록 - 기본정보 엑셀다운로드
+	 *
+	 * @param shoplinkerSearch
+	 * @return
+	 * @author jmh
+	 * @since 2021. 06. 29
+	 */
+	@GetMapping("/goods/excel/list")
+	public ResponseEntity<InputStreamResource> downloadGoodsInfoExcelList(HttpServletRequest request, ShoplinkerSearch shoplinkerSearch) throws Exception {
+		String excelfileName = "샵링커_상품_" + GagaDateUtil.getTodayDateTime() + ".xlsx";
+		String excelFilenameWithPath = GagaFileUtil.getConcatenationPath(env.getProperty("download.path"), "excel", excelfileName);
+
+		if (!StringUtils.isBlank(shoplinkerSearch.getBrandList())) {
+			try {
+				String[] arrBrandCd = mapper.readValue(shoplinkerSearch.getBrandList(), String[].class);
+				shoplinkerSearch.setMultiBrand(arrBrandCd);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException("브랜드코드 검색중 오류로 인해 조회되지 않았습니다.");
+			}
+		}
+
+		// multi row 검색관련 처리
+		if (!StringUtils.isBlank(shoplinkerSearch.getCondition())) {
+			shoplinkerSearch.setConditionList(shoplinkerSearch.getCondition().replaceAll("\r", "").trim().split("\n"));
+		}
+
+		shoplinkerSearch.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
+		shoplinkerSearch.setPageable(new TscPageRequest(shoplinkerSearch.getPageNo() - 1, shoplinkerSearch.getPageSize()));
+		shoplinkerSearch.getPageable().setTotalCount(shoplinkerService.getGoodsSendListCount(shoplinkerSearch));
+
+		admShoplinkerService.getGoodsSendExcelList(shoplinkerSearch, excelFilenameWithPath);
+
+		return GagaFileUtil.writeFile(request, excelFilenameWithPath);
+	}
+
+	/**
+	 * 재고이력- 엑셀다운로드
+	 *
+	 * @param shoplinkerSearch
+	 * @return
+	 * @author jmh
+	 * @since 2021. 06. 29
+	 */
+	@GetMapping("/stock/excel/list")
+	public ResponseEntity<InputStreamResource> downloadStockInfoExcelList(HttpServletRequest request, ShoplinkerSearch shoplinkerSearch) throws Exception {
+		String excelfileName = "샵링커_재고_" + GagaDateUtil.getTodayDateTime() + ".xlsx";
+		String excelFilenameWithPath = GagaFileUtil.getConcatenationPath(env.getProperty("download.path"), "excel", excelfileName);
 
+		if (!StringUtils.isBlank(shoplinkerSearch.getBrandList())) {
+			try {
+				String[] arrBrandCd = mapper.readValue(shoplinkerSearch.getBrandList(), String[].class);
+				shoplinkerSearch.setMultiBrand(arrBrandCd);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException("브랜드코드 검색중 오류로 인해 조회되지 않았습니다.");
+			}
+		}
+
+		// multi row 검색관련 처리
+		if (!StringUtils.isBlank(shoplinkerSearch.getCondition())) {
+			shoplinkerSearch.setConditionList(shoplinkerSearch.getCondition().replaceAll("\r", "").trim().split("\n"));
+		}
+
+		shoplinkerSearch.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
+		shoplinkerSearch.setPageable(new TscPageRequest(shoplinkerSearch.getPageNo() - 1, shoplinkerSearch.getPageSize()));
+		shoplinkerSearch.getPageable().setTotalCount(shoplinkerService.getStockListCount(shoplinkerSearch));
+
+		admShoplinkerService.getStockExcelList(shoplinkerSearch, excelFilenameWithPath);
+
+		return GagaFileUtil.writeFile(request, excelFilenameWithPath);
+	}
+
+	/**
+	 * 주문수집- 엑셀다운로드
+	 *
+	 * @param shoplinkerOrder
+	 * @return
+	 * @author jmh
+	 * @since 2021. 06. 29
+	 */
+	@GetMapping("/order/excel/list")
+	public ResponseEntity<InputStreamResource> downloadOrderInfoExcelList(HttpServletRequest request, ShoplinkerOrder shoplinkerOrder) throws Exception {
+		String excelfileName = "샵링커_주문_" + GagaDateUtil.getTodayDateTime() + ".xlsx";
+		String excelFilenameWithPath = GagaFileUtil.getConcatenationPath(env.getProperty("download.path"), "excel", excelfileName);
+
+
+
+		shoplinkerOrder.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
+		shoplinkerOrder.setPageable(new TscPageRequest(shoplinkerOrder.getPageNo() - 1, shoplinkerOrder.getPageSize()));
+		shoplinkerOrder.getPageable().setTotalCount(shoplinkerService.getShoplinkerOrderListCount(shoplinkerOrder));
+
+		admShoplinkerService.getOrderExcelList(shoplinkerOrder, excelFilenameWithPath);
+
+		return GagaFileUtil.writeFile(request, excelFilenameWithPath);
+	}
+
+	/**
+	 * 송장전송- 엑셀다운로드
+	 *
+	 * @param shoplinkerInvoice
+	 * @return
+	 * @author jmh
+	 * @since 2021. 06. 29
+	 */
+	@GetMapping("/invoice/excel/list")
+	public ResponseEntity<InputStreamResource> downloadOrderInfoExcelList(HttpServletRequest request, ShoplinkerInvoice shoplinkerInvoice) throws Exception {
+		String excelfileName = "샵링커_송장_" + GagaDateUtil.getTodayDateTime() + ".xlsx";
+		String excelFilenameWithPath = GagaFileUtil.getConcatenationPath(env.getProperty("download.path"), "excel", excelfileName);
+
+
+
+		shoplinkerInvoice.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
+		shoplinkerInvoice.setPageable(new TscPageRequest(shoplinkerInvoice.getPageNo() - 1, shoplinkerInvoice.getPageSize()));
+		shoplinkerInvoice.getPageable().setTotalCount(shoplinkerService.getSendInvoiceListCount(shoplinkerInvoice));
+
+		admShoplinkerService.getInvoiceExcelList(shoplinkerInvoice, excelFilenameWithPath);
+
+		return GagaFileUtil.writeFile(request, excelFilenameWithPath);
+	}
 
 
 	/*

+ 1 - 0
src/main/java/com/style24/persistence/domain/Extmall.java

@@ -18,6 +18,7 @@ public class Extmall extends TscBaseDomain {
 	private String extmallId;		// 제휴몰ID
 	private String extmallUserId;	// 제휴몰사용자ID
 	private String extmallNm;		// 제휴몰명
+	private String extmallTel;		// 고객센터연락처
 	private String supplyCompCd;	// 공급업체코드
 	private String sellStoreCd;		// 판매매장코드
 	private float stockSellRate;	// 재고판매비율

+ 4 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaOcm.xml

@@ -9,6 +9,7 @@
 		     , EXTMALL_ID        /*외부몰ID*/
 		     , EXTMALL_USER_ID   /*외부몰사용자ID*/
 		     , EXTMALL_NM        /*외부몰명*/
+		     , EXTMALL_TEL		 /*고객센터연락처*/
 		     , SUPPLY_COMP_CD    /*업체코드*/
 		     , SELL_STORE_CD     /*판매매장코드*/
 		     , STOCK_SELL_RATE   /*재고판매비율*/
@@ -41,6 +42,7 @@
 		     , PRICE_ACCEPT_RATE
 		     , DWDP_YN
 		     , CNCLSMS_SEND_YN
+		     , EXTMALL_TEL
 		     , USE_YN
 		     , REG_NO
 		     , REG_DT
@@ -58,6 +60,7 @@
 		     , IFNULL(#{priceAcceptRate},0)
 		     , #{dwdpYn}
 		     , #{cnclsmsSendYn}
+		     , #{extmallTel}
 		     , #{useYn}
 		     , #{regNo}
 		     , NOW()
@@ -73,6 +76,7 @@
 		     , PRICE_ACCEPT_RATE = IFNULL(#{priceAcceptRate},0)
 		     , DWDP_YN = #{dwdpYn}
 		     , CNCLSMS_SEND_YN = #{cnclsmsSendYn}
+		     , EXTMALL_TEL = #{extmallTel}
 		     , USE_YN = #{useYn}
 		     , UPD_NO = #{updNo}
 		     , UPD_DT = NOW()

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

@@ -0,0 +1,277 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.style24.admin.biz.dao.TsaShoplinkerDao">
+
+	<select id="getGoodsSendExcelList" parameterType="ShoplinkerSearch" resultType="paramMap">
+		/* TsaShoplinkerDao.getGoodsSendExcelList */
+		SELECT
+			 IFNULL(B.GOODS_NM, '') AS GOODS_NM
+			, IFNULL(B.BRAND_CD, '') AS BRAND_CD
+			, CASE WHEN 'OPTION' = A.API_TYPE THEN '단품'
+				  WHEN 'PRODUCT' =  A.API_TYPE THEN '상품'
+				  WHEN 'NOTI' =  A.API_TYPE THEN '품목(고시)'
+				  WHEN 'CERT' =  A.API_TYPE THEN '인증'
+				  WHEN 'IMAGE' =  A.API_TYPE THEN '이미지'
+			  END API_TYPE
+			, IFNULL(A.API_RESULT, '') AS API_RESULT
+			, IFNULL(A.API_MESSAGE, '') AS API_MESSAGE
+			, IFNULL(A.API_PRODUCT_ID, '') AS API_PRODUCT_ID
+			, IFNULL(A.GOODS_CD, '') AS GOODS_CD
+			, IFNULL(A.OPT_CD, '') AS OPT_CD
+			, IFNULL(A.QTY, '') AS QTY
+			, IFNULL(A.ORD_DTL_NO, '') AS ORD_DTL_NO
+			, IFNULL(A.REG_DT, '') AS REG_DT
+			, fn_get_user_nm(A.REG_NO) AS REG_NM
+		FROM SHOPLINKER_SYNC_HST A
+		LEFT OUTER JOIN TB_GOODS B ON A.GOODS_CD = B.GOODS_CD
+
+		WHERE 1=1
+		<include refid="getListCondition_sql"/>
+
+		ORDER BY REG_DT DESC
+	</select>
+
+	<!-- 상품 목록 조건 정보 -->
+	<sql id="getListCondition_sql">
+
+		        <if test="goodsCd != null and goodsCd != ''">
+		        AND UPPER(A.GOODS_CD) LIKE CONCAT('%',UPPER(#{goodsCd}),'%')
+		        </if>
+		    	<if test="conditionList != null and conditionList.length>0">
+		        AND UPPER(A.GOODS_CD) IN
+		            <foreach collection="conditionList" item="item" index="index"  open="(" close=")" separator=",">
+		       		UPPER(#{item})
+		            </foreach>
+		        </if>
+
+		        <if test="goodsNm != null and goodsNm != ''">
+		        AND UPPER(B.GOODS_NM) LIKE CONCAT('%',UPPER(#{goodsNm}),'%')
+		        </if>
+		        <if test="brandCd != null and brandCd != ''">
+		        AND B.BRAND_CD = #{brandCd}
+		        </if>
+		        <if test="multiBrand != null and multiBrand != ''">
+		        AND B.BRAND_CD IN
+		            <foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
+		        #{item}
+		            </foreach>
+		        </if>
+
+	            <if test="stDate != null and stDate != ''">
+		        AND A.REG_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
+	            </if>
+	            <if test="edDate != null and edDate != ''">
+	            <![CDATA[
+		        AND A.REG_DT < DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
+	            ]]>
+	            </if>
+
+		        <if test="apiType != null and apiType != ''">
+		        AND API_TYPE = #{apiType}
+		        </if>
+		        <if test="apiType == null or apiType == ''">
+		        AND API_TYPE in ('OPTION','PRODUCT','NOTI','CERT','IMAGE')
+		        </if>
+
+		        <if test="apiResult != null and apiResult != ''">
+		        AND API_RESULT = #{apiResult}
+		        </if>
+
+	</sql>
+
+
+	<select id="getStockExcelList" parameterType="ShoplinkerSearch" resultType="paramMap">
+	/* TscShoplinkerDao.getStockList */
+		SELECT
+			A.API_TYPE
+			, A.API_RESULT
+			, A.API_MESSAGE
+			, A.GOODS_CD
+			, A.OPT_CD
+			, A.QTY as QUANTITY
+			, A.REG_DT
+			, B.GOODS_NM
+			, B.BRAND_CD
+			, C.OPT_CD1
+			, C.OPT_CD2
+		FROM
+			SHOPLINKER_SYNC_HST A
+			INNER JOIN TB_GOODS B ON A.GOODS_CD = B.GOODS_CD
+			INNER JOIN TB_OPTION C ON A.GOODS_CD = C.GOODS_CD AND A.OPT_CD = C.OPT_CD
+		WHERE A.API_TYPE = 'STOCK'
+		ORDER BY A.REG_DT DESC, A.GOODS_CD, A.OPT_CD
+
+		<include refid="getListCondition_sql"/>
+
+	</select>
+
+	<!-- 샵링커주문수집-목록 -->
+	<select id="getOrderExcelList" parameterType="ShoplinkerOrder" resultType="paramMap">
+		/* TscShoplinkerDao.getShoplinkerOrderList */
+		SELECT * FROM
+		(
+			SELECT
+				A.*
+				, B.VENDOR_ID
+				, B.EXTMALL_ID
+				, B.EXTMALL_NM
+				, B.AGENT_ORDER_ID
+				, B.EXTMALL_ORDER_ID
+				, FN_GET_CODE_NM('G021', IFNULL(B.UPLOAD_STAT, 'G021_50')) AS UPLOAD_STAT
+				, FN_GET_CODE_NM('G022', B.UPLOAD_FAIL_CD) AS UPLOAD_FAIL_CD
+				, B.UPLOAD_FAIL_REASON
+				, IFNULL(B.ORD_NO, '') AS ORD_NO
+				, B.DELV_ADDR_SQ
+				, B.REG_DT AS EXTMALL_REG_DT
+			FROM SHOPLINKER_ORDER A
+				LEFT OUTER JOIN TB_EXTMALL_ORDER_UPLOAD B
+					ON A.SHOPLINKER_ORDER_ID = B.AGENT_ORDER_ID
+			WHERE 1=1
+
+			<include refid="getSlkOrderListCondition_sql"/>
+		) A
+
+		ORDER BY EXTMALL_REG_DT, REG_DT DESC
+
+	</select>
+
+	<!-- 샵링커주문수집 조건 정보 -->
+	<sql id="getSlkOrderListCondition_sql">
+
+			<if test="stDate != null and stDate != ''">
+	        AND A.ORDER_REG_DATE >= DATE_FORMAT(replace(#{stDate}, '-', ''), '%Y%m%d%H%i%S')
+            </if>
+            <if test="edDate != null and edDate != ''">
+            <![CDATA[
+	        AND A.ORDER_REG_DATE < DATE_FORMAT(DATE_ADD(replace(#{edDate}, '-', ''), INTERVAL 1 DAY), '%Y%m%d%H%i%S')
+            ]]>
+            </if>
+
+			<if test="extmallId != null and extmallId != ''">
+	        AND A.MALL_ID = #{extmallId}
+	        </if>
+
+			<if test="uploadStat != null and uploadStat != ''">
+	        AND B.UPLOAD_STAT = #{uploadStat}
+	        </if>
+	        <if test="uploadFailCd != null and uploadFailCd != ''">
+	        AND B.UPLOAD_FAIL_CD = #{uploadFailCd}
+	        </if>
+
+	        <if test='conditionList != null and conditionList.length>0'>
+	            <choose>
+	              <when test='search != null and search == "shoplinkerOrderId"'>
+	              	AND UPPER(A.SHOPLINKER_ORDER_ID) IN
+			            <foreach collection="conditionList" item="item" index="index"  open="(" close=")" separator=",">
+			       		UPPER(#{item})
+			            </foreach>
+	              </when>
+
+	              <when test='search != null and search == "mallOrderId"'>
+	              	AND UPPER(B.EXTMALL_ORDER_ID) IN
+			            <foreach collection="conditionList" item="item" index="index"  open="(" close=")" separator=",">
+			       		UPPER(#{item})
+			            </foreach>
+	              </when>
+
+	              <when test='search != null and search == "ordNo"'>
+	              	AND UPPER(B.ORD_NO) IN
+			            <foreach collection="conditionList" item="item" index="index"  open="(" close=")" separator=",">
+			       		UPPER(#{item})
+			            </foreach>
+	              </when>
+	            </choose>
+	        </if>
+	</sql>
+
+
+	<!-- 송장전송-전송 목록 -->
+	<select id="getInvoiceExcelList" parameterType="ShoplinkerInvoice" resultType="paramMap">
+		/* TscShoplinkerDao.getInvoiceExcelList */
+		SELECT * FROM
+		(
+			SELECT
+				OD.ORD_NO
+				, OD.ORD_DTL_NO
+				, (SELECT SHIP_COMP_NM FROM TB_SHIP_COMPANY S WHERE S.SHIP_COMP_CD = OD.SHIP_COMP_CD ) AS SHIP_COMP_NM
+				, OD.SHIP_COMP_CD AS DELIVERY_CODE-- 배송업체(택배사코드)
+				, OD.INVOICE_NO AS DELIVERY_INVOICE-- 송장번호
+
+				, OD.VENDOR_ID -- 외부몰벤더ID
+				, OD.EXTMALL_ID -- 외부몰ID(외부몰)
+				, OD.AGENT_ORDER_ID -- 에이전트주문번호
+				, OD.EXTMALL_ORDER_ID -- 외부몰주문번호
+				, OD.DELV_ASSIGN_STAT -- 출고지정상태(P:대기,Y:수락,N:거부)
+				, OD.ORD_EXCH_GB -- 주문교환구분(O:주문,E:교환)
+				, OD.ORD_DTL_STAT -- 주문상세상태(공통코드G013)
+				, FN_GET_CODE_NM('G013', OD.ORD_DTL_STAT) AS ORD_DTL_STAT_NM
+				, OD.DELV_STDT
+
+				, SL.API_RESULT
+				, SL.API_MESSAGE
+				, SL.XML_TXT
+				, SL.REG_DT
+			FROM
+				TB_ORDER_DETAIL OD
+				LEFT OUTER JOIN SHOPLINKER_SYNC_HST SL ON OD.ORD_DTL_NO = SL.ORD_DTL_NO AND SL.API_TYPE = 'INVOICE'
+			WHERE OD.VENDOR_ID = 'G003_V001'
+			ORDER BY OD.ORD_NO, OD.ORD_DTL_NO
+		) A
+		WHERE 1=1
+		<include refid="getSlkInvoiceCondition_sql"/>
+
+	</select>
+
+	<!-- 상품 목록 조건 정보 -->
+	<sql id="getSlkInvoiceCondition_sql">
+
+			<if test="stDate != null and stDate != ''">
+	        AND DELV_STDT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
+            </if>
+            <if test="edDate != null and edDate != ''">
+            <![CDATA[
+	        AND DELV_STDT < DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
+            ]]>
+            </if>
+
+	        <if test="apiResult != null and apiResult != ''">
+	        AND API_RESULT = #{apiResult}
+	        </if>
+
+			<if test='conditionList != null and conditionList.length>0'>
+	            <choose>
+	              <when test='search != null and search == "agentOrderId"'>
+	              	AND UPPER(A.AGENT_ORDER_ID) IN
+			            <foreach collection="conditionList" item="item" index="index"  open="(" close=")" separator=",">
+			       		UPPER(#{item})
+			            </foreach>
+	              </when>
+
+	              <when test='search != null and search == "extmallOrderId"'>
+	              	AND UPPER(A.EXTMALL_ORDER_ID) IN
+			            <foreach collection="conditionList" item="item" index="index"  open="(" close=")" separator=",">
+			       		UPPER(#{item})
+			            </foreach>
+	              </when>
+
+	              <when test='search != null and search == "ordNo"'>
+	              	AND UPPER(A.ORD_NO) IN
+			            <foreach collection="conditionList" item="item" index="index"  open="(" close=")" separator=",">
+			       		UPPER(#{item})
+			            </foreach>
+	              </when>
+
+	              <when test='search != null and search == "deliveryInvoice"'>
+	              	AND UPPER(A.DELIVERY_INVOICE) IN
+			            <foreach collection="conditionList" item="item" index="index"  open="(" close=")" separator=",">
+			       		UPPER(#{item})
+			            </foreach>
+	              </when>
+
+	            </choose>
+	        </if>
+	</sql>
+
+</mapper>
+
+

+ 12 - 2
src/main/webapp/WEB-INF/views/ocm/ExtmallForm.html

@@ -112,6 +112,13 @@
 								<option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
 							</select>
 						</td>
+
+						<th>고객센터연락처</th>
+						<td>
+							<input type="text" class="w150" name="extmallTel" maxlength="20"/>
+						</td>
+						<td colspan="4"></td>
+						<!-- 숨김처리 사용안하기로 함
 						<th>판매매장코드</th>
 						<td>
 							<input type="text" class="w150" name="sellStoreCd" maxlength="20"/>
@@ -124,6 +131,7 @@
 						<td>
 							<input type="text" class="w100 aR" name="priceAcceptRate" maxlength="3" required="required" data-valid-type="real" data-valid-name="가격차이허용율"/>%
 						</td>
+						 -->
 					</tr>
 					<tr>
 						<th>직접회수여부</th>
@@ -181,9 +189,10 @@
 			headerName: "업체", field: "supplyCompCd", width: 150, cellClass: 'text-center',
 			valueGetter: function (params) { return gagaAgGrid.lookupValue(supplyCompList, params.data.supplyCompCd); }
 		},
-		{headerName: "판매매장코드", field: "sellStoreCd", width: 120, cellClass: 'text-center'},
+		{headerName: "고객센터연락처", field: "extmallTel", width: 150, cellClass: 'text-center'},
+		/* {headerName: "판매매장코드", field: "sellStoreCd", width: 120, cellClass: 'text-center'},
 		{headerName: "재고판매비율(%)", field: "stockSellRate", width: 150, cellClass: 'text-center'},
-		{headerName: "가격차이허용율(%)", field: "priceAcceptRate", width: 150, cellClass: 'text-center'},
+		{headerName: "가격차이허용율(%)", field: "priceAcceptRate", width: 150, cellClass: 'text-center'}, */
 		{
 			headerName: "직접회수여부", field: "dwdpYn", width: 150, cellClass: 'text-center',
 			cellRenderer: function (params) {
@@ -215,6 +224,7 @@
 		$('#detailForm input[name=extmallId]').val(event.data.extmallId);
 		$('#detailForm input[name=extmallUserId]').val(event.data.extmallUserId);
 		$('#detailForm input[name=extmallNm]').val(event.data.extmallNm);
+		$('#detailForm input[name=extmallTel]').val(event.data.extmallTel);
 		$('#detailForm select[name=supplyCompCd]').val(event.data.supplyCompCd);
 		$('#detailForm input[name=sellStoreCd]').val(event.data.sellStoreCd);
 		$('#detailForm input[name=stockSellRate]').val(event.data.stockSellRate);

+ 17 - 5
src/main/webapp/WEB-INF/views/ocm/ExtmallOrderRegisterForm.html

@@ -114,11 +114,23 @@
 
 	//엑셀업로드 클릭 시
 	$('#btnExcelUpload').on('click', function() {
-		if( click_bool ){
-			cfnExcelUploadPopup('createExtmallOrder', 'createExtmallOrder');
-		}else{
-			mcxDialog.alert("주문등록 처리중입니다. 잠시후 시도해주세요.");
-		}
+
+		var alertMsg = "<span style='color:red'>※ 테스트 주의 ※ <br>품절시 알림톡이 발송되오니, <br>연락처는 자신의 핸드폰번호 또는 010-0000-000으로 넣어주세요.</span>";
+		mcxDialog.confirm(alertMsg, {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function() {
+
+				if( click_bool ){
+					cfnExcelUploadPopup('createExtmallOrder', 'createExtmallOrder');
+				}else{
+					mcxDialog.alert("주문등록 처리중입니다. 잠시후 시도해주세요.");
+				}
+
+			}
+		});
+
+
 	});
 
 	//주문등록 클릭 시

+ 84 - 65
src/main/webapp/WEB-INF/views/shoplinker/ShoplinkerGoodsSendForm.html

@@ -30,73 +30,76 @@
 			<div class="panelStyle">
 				<div class="panelTitle">
 					<h3><i class="fa fa-info-circle"></i>아래 검색조건 중 상품코드나 등록일을 꼭 입력해 주세요.</h3>
+					<span class="panelControl">
+						<i class="fa fa-chevron-up"></i>
+					</span>
 				</div>
-				<table class="frmStyle">
-					<colgroup>
-						<col style="width: 10%;"/>
-						<col style="width: 40%;"/>
-						<col style="width: 10%;"/>
-						<col style="width: 40%;"/>
-						<!-- <col style="width: 10%;"/>
-						<col style="width: 20%;"/> -->
-					</colgroup>
-					<tr>
-						<th>전송일자<em class="required" title="필수"></em></th>
-						<td colspan="5" id="sellTerms"></td>
-					</tr>
-					<tr>
-						<th>상품코드<em class="required" title="필수"></em></th>
-						<td>
-							<textarea class="textareaR3 w20p" name="condition" id="condition"></textarea>
-						</td>
-
-						<th>브랜드</th>
-						<td>
-							<input type="text" class="w100" name="searchTxt" id="searchTxt" maxlength="20" />
-							<button type="button" class="btn icn" id="btnSearchBrand"><i class="fa fa-search"></i></button>
-							<!-- <input type="text" class="w100" name="brandCd" readonly="readonly"/> -->
-							<span id="brandText"></span>
-							<input type="hidden" name="brandList"/>
-						</td>
-					</tr>
-					<tr>
-						<th>API구분</th>
-						<td>
-							<select name="apiType" id="apiType" required="required" data-valid-name="API구분">
-								<option value="">[전체]</option>
-								<option value="OPTION">단품</option>
-								<option value="PRODUCT">상품</option>
-								<option value="NOTI">품목(고시)</option>
-								<option value="CERT">인증</option>
-								<option value="IMAGE">이미지</option>
-							</select>
-						</td>
-
-						<th>IF결과</th>
-						<td>
-							<select name="apiResult" id="apiResult">
-								<option value="">[전체]</option>
-								<option value="true">전송완료</option>
-								<option value="false">전송실패</option>
-								<option value="error">오류</option>
-							</select>
-						</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" onclick="$('#searchForm')[0].reset();">초기화</button>
-						<button type="button" class="btn btn-primary btn-lg" id="btnGoodsUpload">엑셀업로드</button>
-						<!-- <button type="button" class="btn btn-default btn-lg" onclick="fnGoodsExcelDownLoad('');">샵링커상품 엑셀다운로드</button> -->
-						<!-- <button type="button" class="btn btn-default btn-lg" onclick="fnGoodsExcelDownLoad('');">테스트</button> -->
-						<button th:if="${sessionInfo.userId == 'jmh'}" type="button" class="btn btn-default btn-lg" onclick="fnTest();">테스트</button>
-					</li>
-				</ul>
-
-				<p class="cRed">※ 엑셀업로드시 한번에 최대 500개까지 가능합니다.(적정량 250개 이하)</p>
-				<p class="cRed">※ 업로드 후 약 10분 후 결과를 조회해주세요. </p>
+				<div class="panelContent">
+					<table class="frmStyle">
+						<colgroup>
+							<col style="width: 10%;"/>
+							<col style="width: 40%;"/>
+							<col style="width: 10%;"/>
+							<col style="width: 40%;"/>
+							<!-- <col style="width: 10%;"/>
+							<col style="width: 20%;"/> -->
+						</colgroup>
+						<tr>
+							<th>전송일자<em class="required" title="필수"></em></th>
+							<td colspan="5" id="sellTerms"></td>
+						</tr>
+						<tr>
+							<th>상품코드<em class="required" title="필수"></em></th>
+							<td>
+								<textarea class="textareaR3 w30p" name="condition" id="condition"></textarea>
+							</td>
+
+							<th>브랜드</th>
+							<td>
+								<input type="text" class="w100" name="searchTxt" id="searchTxt" maxlength="20" />
+								<button type="button" class="btn icn" id="btnSearchBrand"><i class="fa fa-search"></i></button>
+								<!-- <input type="text" class="w100" name="brandCd" readonly="readonly"/> -->
+								<span id="brandText"></span>
+								<input type="hidden" name="brandList"/>
+							</td>
+						</tr>
+						<tr>
+							<th>API구분</th>
+							<td>
+								<select name="apiType" id="apiType" required="required" data-valid-name="API구분">
+									<option value="">[전체]</option>
+									<option value="OPTION">단품</option>
+									<option value="PRODUCT">상품</option>
+									<option value="NOTI">품목(고시)</option>
+									<option value="CERT">인증</option>
+									<option value="IMAGE">이미지</option>
+								</select>
+							</td>
+
+							<th>IF결과</th>
+							<td>
+								<select name="apiResult" id="apiResult">
+									<option value="">[전체]</option>
+									<option value="true">전송완료</option>
+									<option value="false">전송실패</option>
+									<option value="error">오류</option>
+								</select>
+							</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" onclick="$('#searchForm')[0].reset();">초기화</button>
+							<button type="button" class="btn btn-primary btn-lg" id="btnGoodsUpload">엑셀업로드</button>
+							<!-- <button th:if="${sessionInfo.userId == 'jmh'}" type="button" class="btn btn-default btn-lg" onclick="fnTest();">테스트</button> -->
+						</li>
+					</ul>
+					<p class="dot">엑셀업로드시 한번에 최대 500개까지 가능합니다. (적정량 250개 이하)</p>
+					<p class="dot">업로드 후 약 10분 이상 작업소요시간이 걸릴 수 있습니다.</p>
+				</div>
 			</div>
 			<!-- 검색조건 영역 -->
 
@@ -105,6 +108,7 @@
 				<ul class="panelBar">
 					<li>
 						<button type="button" class="btn btn-default btn-lg" onclick="cfnDownloadSampleFile('SF003');">엑셀업로드 양식 다운로드</button>
+						<button type="button" class="btn btn-default btn-lg" onclick="fnExcelDownLoad();">엑셀다운로드</button>
 					</li>
 					<li class="right">
 						검색결과 : <strong><span id="gridRowTotalCount">0</span> 건</strong>&nbsp;
@@ -128,6 +132,8 @@
 				</ul>
 			</div>
 			<!-- //리스트 영역 -->
+
+			<a href="javascript:void(0);" id="ExcelList" style="display: none;">엑셀다운로드</a>
 		</form>
 
 	</div>
@@ -154,6 +160,7 @@
 		},
 		{headerName: "IF결과메세지", field: "apiMessage", width: 300, cellClass: 'text-left'},
 		{headerName: "자사 상품코드", field: "goodsCd", width: 150, cellClass: 'text-center'},
+		{headerName: "옵션코드", field: "optCd", width: 150, cellClass: 'text-center'},
 		{headerName: "상품명", field: "goodsNm", width: 300, cellClass: 'text-left'},
 		{headerName: "xml", field: "xmlTxt", width: 100, cellClass: 'text-center', editable: true,
 			cellEditor: 'agLargeTextCellEditor',
@@ -348,6 +355,18 @@
 	}
 	/**************** 엑셀업로드 // *****************************************************/
 
+	/**************** 엑셀다운로드 *****************************************************/
+	var fnExcelDownLoad = function(){
+		var formId = '#searchForm';
+		if (gridOptions.api.getDisplayedRowCount() <= 0){
+			mcxDialog.alert("조회된 데이터가 없습니다.<br/>다시 조회 후 다운로드 받으세요.");
+			return;
+		}
+
+		var params =  $(formId).serialize();
+		$('#ExcelList').attr({ href : '/shoplinker/goods/excel/list?' + params }).get(0).click();
+	}
+	/**************** 엑셀다운로드 // *****************************************************/
 
 	/**************** 테스트용  *******************************************************/
     // 테스트- 실제 샵링커 호출

+ 95 - 61
src/main/webapp/WEB-INF/views/shoplinker/ShoplinkerInvoiceSendForm.html

@@ -30,71 +30,84 @@
 			<!-- 검색조건 영역 -->
 			<div class="panelStyle">
 				<div class="panelTitle">
-					<h3><i class="fa fa-info-circle"></i>아래 검색조건 중 주문번호나 등록일을 꼭 입력해 주세요.</h3>
+					<h3>
+						<i class="fa fa-info-circle"></i>아래 검색조건 중 주문번호나 등록일을 꼭 입력해 주세요.
+						<br><i class="fa fa-info-circle"></i>[배치주기] 매일 1시간 마다실행
+					</h3>
+					<span class="panelControl">
+						<i class="fa fa-chevron-up"></i>
+					</span>
 				</div>
-				<table class="frmStyle">
-					<colgroup>
-						<col style="width:10%;"/>
-						<col/>
-						<col style="width:10%;"/>
-						<col style="width:13%;"/>
-						<col style="width:10%;"/>
-						<col style="width:22%;"/>
-					</colgroup>
-
-					<tr>
-						<th>배송시작일자</th>
-						<td colspan="5" id="sellTerms"></td>
-					</tr>
-					<tr>
-						<th>벤더/제휴몰</th>
-						<td>
-							<select name="vendorId" required="required" data-valid-name="벤더">
-								<option th:if="${vendorList}" th:each="oneData, status : ${vendorList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-							</select>/
-							<select name="extmallId">
-								<option value="">[전체]</option>
-								<option th:if="${extmallList}" th:each="oneData, status : ${extmallList}" th:value="${oneData.extmallId}" th:text="${'[' + oneData.extmallId + '] ' + oneData.extmallNm}"></option>
-							</select>
-						</td>
-
-						<th>IF결과</th>
-						<td>
-							<select name="apiResult" id="apiResult">
-								<option value="">[전체]</option>
-								<option value="true">전송완료</option>
-								<option value="false">전송실패</option>
-								<option value="error">오류</option>
-							</select>
-						</td>
-						<th>키워드</th>
-						<td>
-							<select name="search" id="search">
-								<option value="agentOrderId">샵링커주문번호</option>
-								<option value="extmallOrderId">쇼핑몰주문번호</option>
-								<option value="ordNo">스타일24주문번호</option>
-							</select>
-							<textarea class="textareaR3 w40p" name="condition" id="condition"></textarea>
-						</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" onclick="$('#searchForm')[0].reset();">초기화</button> -->
-						<button type="button" class="btn btn-primary btn-lg" id="btnSendInvoice">송장전송</button>
-						<!-- <button type="button" class="btn btn-primary btn-lg" id="btnInvoiceUpload">엑셀업로드</button> -->
-					</li>
-				</ul>
-				<p class="cRed">※ 송장전송클릭시 > 약 10분 후 결과를 조회해주세요.(처리할 수량에 따라 소요시간이 늘어날 수 있습니다.)</p>
 
+				<div class="panelContent">
+					<table class="frmStyle">
+						<colgroup>
+							<col style="width:10%;"/>
+							<col/>
+							<col style="width:10%;"/>
+							<col style="width:13%;"/>
+							<col style="width:10%;"/>
+							<col style="width:22%;"/>
+						</colgroup>
+
+						<tr>
+							<th>배송시작일자</th>
+							<td colspan="5" id="sellTerms"></td>
+						</tr>
+						<tr>
+							<th>벤더/제휴몰</th>
+							<td>
+								<select name="vendorId" required="required" data-valid-name="벤더">
+									<option th:if="${vendorList}" th:each="oneData, status : ${vendorList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+								</select>/
+								<select name="extmallId">
+									<option value="">[전체]</option>
+									<option th:if="${extmallList}" th:each="oneData, status : ${extmallList}" th:value="${oneData.extmallId}" th:text="${'[' + oneData.extmallId + '] ' + oneData.extmallNm}"></option>
+								</select>
+							</td>
+
+							<th>IF결과</th>
+							<td>
+								<select name="apiResult" id="apiResult">
+									<option value="default">[전체-전송완료제외]</option>
+									<option value="">[전체]</option>
+									<option value="wait">전송예정</option>
+									<option value="true">전송완료</option>
+									<option value="false">전송실패</option>
+									<option value="error">오류</option>
+								</select>
+							</td>
+							<th>키워드</th>
+							<td>
+								<select name="search" id="search">
+									<option value="agentOrderId">샵링커주문번호</option>
+									<option value="extmallOrderId">쇼핑몰주문번호</option>
+									<option value="ordNo">스타일24주문번호</option>
+									<option value="deliveryInvoice">운송장번호</option>
+								</select>
+								<textarea class="textareaR3 w50p" name="condition" id="condition"></textarea>
+							</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" onclick="$('#searchForm')[0].reset();">초기화</button> -->
+							<button type="button" class="btn btn-primary btn-lg" id="btnSendInvoice">송장전송</button>
+							<!-- <button type="button" class="btn btn-primary btn-lg" id="btnInvoiceUpload">엑셀업로드</button> -->
+						</li>
+					</ul>
+				</div>
 			</div>
 			<!-- 검색조건 영역 -->
 
 			<!-- 리스트 영역 -->
 			<div class="panelStyle">
 				<ul class="panelBar">
+					<li>
+						<button type="button" class="btn btn-default btn-lg" onclick="fnExcelDownLoad();">엑셀다운로드</button>
+					</li>
 					<li class="right">
 						검색결과 : <strong><span id="gridRowTotalCount">0</span> 건</strong>&nbsp;
 						쪽번호 <span id="pgNo">0</span>/ <strong id="endPgNo">0</strong>&nbsp;&nbsp;
@@ -117,6 +130,8 @@
 				</ul>
 			</div>
 			<!-- //리스트 영역 -->
+
+			<a href="javascript:void(0);" id="ExcelList" style="display: none;">엑셀다운로드</a>
 		</form>
 
 	</div>
@@ -135,6 +150,10 @@
 		{headerName: "No", width: 60, cellClass: 'text-center',
 			valueGetter: function(params) { return cfnGridNumner('searchForm',params.node.rowIndex, 'A');}
 		},
+		{headerName: "IF결과", field: "apiResult", width: 100, cellClass: 'text-center',
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(procGbValue, params.value); }
+		},
+		{headerName: "전송결과메세지", field: "apiMessage", width: 380, cellClass: 'text-center'},
 		{headerName: "샵링커주문번호", field: "agentOrderId", width: 130, cellClass: 'text-center'},
 		{headerName: "쇼핑몰주문번호", field: "extmallOrderId", width: 130, cellClass: 'text-center'},
 		{
@@ -155,10 +174,6 @@
 		{headerName: "주문상세번호", field: "ordDtlNo", width: 130, cellClass: 'text-center'},
 		{headerName: "배송업체", field: "shipCompNm", width: 150, cellClass: 'text-center'},
 		{headerName: "송장번호", field: "deliveryInvoice", width: 130, cellClass: 'text-center'},
-		{headerName: "IF결과", field: "apiResult", width: 100, cellClass: 'text-center',
-			valueFormatter: function (params) { return gagaAgGrid.lookupValue(procGbValue, params.value); }
-		},
-		{headerName: "전송결과메세지", field: "apiMessage", width: 420, cellClass: 'text-center'},
 		{headerName: "전송일시", field: "regDt", width: 150, cellClass: 'text-center'}
 		/*{headerName: "xml", field: "xmlTxt", width: 100, cellClass: 'text-center', editable: true,
 			cellEditor: 'agLargeTextCellEditor',
@@ -296,6 +311,25 @@
 		});
 	});
 
+	/**************** 엑셀다운로드 *****************************************************/
+	var fnExcelDownLoad = function(){
+		var formId = '#searchForm';
+		if (gridOptions.api.getDisplayedRowCount() <= 0){
+			mcxDialog.alert("조회된 데이터가 없습니다.<br/>다시 조회 후 다운로드 받으세요.");
+			return;
+		}
+
+		var fromDate = parseInt($('#searchForm input[name=stDate]').val().replaceAll("-", ""));
+		var toDate =parseInt($('#searchForm input[name=edDate]').val().replaceAll("-", ""));
+		if( 4 < (toDate - fromDate)){
+			mcxDialog.alert("배송시작일자를 3일 이내의 기간으로 설정 후 다운로드해주세요.");
+			return;
+		}
+
+		var params =  $(formId).serialize();
+		$('#ExcelList').attr({ href : '/shoplinker/invoice/excel/list?' + params }).get(0).click();
+	}
+	/**************** 엑셀다운로드 // *****************************************************/
 
 	/**************** 엑셀업로드 방식 ********************************************************/
 	/*

+ 5 - 0
src/main/webapp/WEB-INF/views/shoplinker/ShoplinkerOrderDetailForm.html

@@ -179,6 +179,11 @@
 			</table>
 			<!-- //TABLE -->
 			<br>
+
+			<!--
+				아래 4개 상점은 쇼핑몰주문번호를 배송번호로 대처함(같은 주문건은 배송번호로 알 수 있음)
+				APISHOP_0003 옥션 / APISHOP_0010 지마켓 / APISHOP_0286 카카오톡스토어 / APISHOP_0287 위메프
+			-->
 			<div th:if="${extOrderInfo}">
 				<h4>제휴몰 업로드정보</h4>
 				<!-- TABLE -->

+ 69 - 30
src/main/webapp/WEB-INF/views/shoplinker/ShoplinkerOrderForm.html

@@ -28,26 +28,34 @@
 		<form id="orderCollectionForm" name="orderCollectionForm" action="#" th:action="@{'/shoplinker/check/api_runable'}" th:method="post">
 
 			<div class="panelStyle">
-				<table class="frmStyle">
-					<colgroup>
-						<col style="width:10%;"/>
-						<col/>
-					</colgroup>
-					<tr>
-						<th>샵링커 주문수집일<em class="required" title="필수"></em></th>
-						<td colspan="7">
-							<input name="apiStDate" id="apiStDate" type="text" class="w80 schDate" maxlength="10" required="required" data-valid-name="주문수집일" />
-							&nbsp;&nbsp;&nbsp;&nbsp;
-							<button th:if="${sessionInfo.userId == 'jmh'}" type="button" class="btn btn-primary btn-lg" id="btnCollection">주문수집</button>
-							&nbsp;<span class="runable_info"></span>
-						</td>
-					</tr>
-				</table>
-				<!-- <p class="cRed">※ 주문수집 시 샵링커에는 발주획인상태로 변경됩니다.</p> -->
-				<p class="cRed">※ 샵링커 주문수집 => 제휴몰 주문등록 => (제휴몰 주문등록 성공목록만) STYLE24에 주문등록이 됩니다.</p>
-				<p class="cRed">※ 샵링커 주문수집 시 동일한 목록은 '제휴몰 주문등록'이 되지 않습니다. </p>
-				<p class="cRed">※ 주문수집 건수가 많아질 수록 대기시간이 오래걸리므로 하루씩 수집합니다.</p>
-				<p class="cRed">※ [제휴몰 주문등록 상태]가 '미매핑'건은 옵션정보가 없는것으로 딜상품입니다.</p>
+				<div class="panelTitle">
+					<h3><i class="fa fa-info-circle"></i>[배치주기] 평일: 7시~15시 한시간 단위 / 7시: 전날 15 ~ 금일 6시 / 월요일 7시: 전주 금요일 15 ~ 금일 6시</h3>
+					<span class="panelControl">
+						<i class="fa fa-chevron-up"></i>
+					</span>
+				</div>
+
+				<div class="panelContent">
+					<table class="frmStyle">
+						<colgroup>
+							<col style="width:10%;"/>
+							<col/>
+						</colgroup>
+						<tr>
+							<th>샵링커 주문수집일<em class="required" title="필수"></em></th>
+							<td colspan="7">
+								<input name="apiStDate" id="apiStDate" type="text" class="w80 schDate" maxlength="10" required="required" data-valid-name="주문수집일" />
+								&nbsp;&nbsp;&nbsp;&nbsp;
+								<button th:if="${sessionInfo.userId == 'jmh'}" type="button" class="btn btn-primary btn-lg" id="btnCollection">주문수집</button>
+								&nbsp;<span class="runable_info"></span>
+							</td>
+						</tr>
+					</table>
+					<p class="dot">실패사유가 <font color="red">가용재고없음</font>일 경우 고객에게 일림이 발송된 건으로 엑셀업로드를 하지 말아주세요.</p>
+					<p class="dot">샵링커 주문수집 => 제휴몰 주문등록 => (제휴몰 주문등록 성공목록만) STYLE24에 주문등록이 됩니다.</p>
+					<p class="dot">샵링커 주문수집 시 동일한 목록은 '제휴몰 주문등록'이 되지 않습니다. </p>
+					<p class="dot">[제휴몰 주문등록 상태]가 <font color="red">미매핑</font>건은 옵션정보가 없는것으로 <font color="red">제휴몰주문업로드</font> 해주세요.(딜상품)</p>
+				</div>
 			</div>
 		</form>
 
@@ -124,6 +132,9 @@
 			<!-- 리스트 영역 -->
 			<div class="panelStyle">
 				<ul class="panelBar">
+					<li>
+						<button type="button" class="btn btn-default btn-lg" onclick="fnExcelDownLoad();">엑셀다운로드</button>
+					</li>
 					<li class="right">
 						검색결과 : <strong><span id="gridRowTotalCount">0</span> 건</strong>&nbsp;
 						쪽번호 <span id="pgNo">0</span>/ <strong id="endPgNo">0</strong>&nbsp;&nbsp;
@@ -146,6 +157,8 @@
 				</ul>
 			</div>
 			<!-- //리스트 영역 -->
+
+			<a href="javascript:void(0);" id="ExcelList" style="display: none;">엑셀다운로드</a>
 		</form>
 
 	</div>
@@ -207,7 +220,7 @@
 				}
 			}
 		},
-		{headerName: "쇼핑몰 주문번호", field: "mallOrderId", width: 130, cellClass: 'text-center'},
+		{headerName: "쇼핑몰 주문번호", field: "extmallOrderId", width: 130, cellClass: 'text-center'},
 		{headerName: "쇼핑몰 명", field: "mallName", width: 130, cellClass: 'text-center'},
 		{headerName: "배송상태[발주확인]", field: "baesongStatus", width: 130, cellClass: 'text-center'},
 		{headerName: "주문 상품번호", field: "orderProductId", width: 130, cellClass: 'text-center'},
@@ -219,8 +232,12 @@
 		{headerName: "판매단가", field: "salePrice", width: 130, cellClass: 'text-center'},
 		{headerName: "공급가", field: "supplyPrice", width: 130, cellClass: 'text-center'},
 		{headerName: "옵션명", field: "sku", width: 130, cellClass: 'text-center'},
-		{headerName: "주문일자", field: "orderdate", width: 130, cellClass: 'text-center'},
-		{headerName: "주문수집일자", field: "orderRegDate", width: 130, cellClass: 'text-center'},
+		{headerName: "주문수집일자", field: "orderRegDate", width: 150, cellClass: 'text-center',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
+			}
+		},
+		{headerName: "제휴몰등록일", field: "extmallRegDt", width: 130, cellClass: 'text-center'}
 	];
 
 	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
@@ -337,6 +354,26 @@
 	}
 	/**************** 검색 // *****************************************************/
 
+	/**************** 엑셀다운로드 *****************************************************/
+	var fnExcelDownLoad = function(){
+		var formId = '#searchForm';
+		if (gridOptions.api.getDisplayedRowCount() <= 0){
+			mcxDialog.alert("조회된 데이터가 없습니다.<br/>다시 조회 후 다운로드 받으세요.");
+			return;
+		}
+
+		var fromDate = parseInt($('#searchForm input[name=stDate]').val().replaceAll("-", ""));
+		var toDate =parseInt($('#searchForm input[name=edDate]').val().replaceAll("-", ""));
+		if( 4 < (toDate - fromDate)){
+			mcxDialog.alert("주문수집일자를 3일 이내의 기간으로 설정 후 다운로드해주세요.");
+			return;
+		}
+
+		var params =  $(formId).serialize();
+		$('#ExcelList').attr({ href : '/shoplinker/order/excel/list?' + params }).get(0).click();
+	}
+	/**************** 엑셀다운로드 // *****************************************************/
+
 	$(document).ready(function() {
 
 		cfnCreateCalendar('#terms', 'stDate', 'edDate', true, '수집');
@@ -358,8 +395,8 @@
 		}
 
 		var testDate = Number($("#orderCollectionForm input[name=apiStDate]").val().replaceAll("-", ""));
-		if( testDate < 20210401 || 20210515 < testDate){
-			mcxDialog.alert("※ 테스트 주문수집시 ※<br>실제운영 주문건을 가져오므로 4월부터 ~ 5/15 사이 날짜로 조회해주세요.");
+		if( testDate < 20210401 || 20210601 < testDate){
+			mcxDialog.alert("※ 테스트 주문수집시 ※<br>실제운영 주문건을 가져오므로 4월부터 ~ 6월이전 사이 날짜로 조회해주세요.");
 			return;
 		}
 
@@ -405,15 +442,17 @@
 
 				}else{
 					// 현재 진행중
-					var resultTxt = result.txt;
-					resultTxt = resultTxt.replace("제휴몰", "제휴몰남은수 "+result.remainExtCnt);
-					resultTxt = resultTxt.replace("스타일24", "스타일24남은수 "+result.remainStyleCnt )
-					$(".runable_info").html(resultTxt);
-
 					$("#btnCollection").html("주문수집중");
 					$("#btnCollection").removeClass("btn-primary");
 					$("#btnCollection").addClass("btn-dark");
 
+					var resultTxt = result.txt;
+					if( null != resultTxt ){
+						resultTxt = resultTxt.replace("제휴몰", "제휴몰남은수 "+result.remainExtCnt.addComma());
+						resultTxt = resultTxt.replace("스타일24", "스타일24남은수 "+result.remainStyleCnt.addComma() )
+						$(".runable_info").html(resultTxt);
+					}
+
 					setTimeout(function(){
 						fnGetCallRunableInfo();
 					}, 20000 );

+ 86 - 53
src/main/webapp/WEB-INF/views/shoplinker/ShoplinkerStockForm.html

@@ -31,62 +31,73 @@
 			<!-- 검색조건 영역 -->
 			<div class="panelStyle">
 				<div class="panelTitle">
-					<h3><i class="fa fa-info-circle"></i>아래 검색조건 중 상품코드나 등록일을 꼭 입력해 주세요.</h3>
+					<h3>
+						<i class="fa fa-info-circle"></i>아래 검색조건 중 상품코드나 전송일자을 꼭 입력해 주세요.
+						<br><i class="fa fa-info-circle"></i>[배치주기] 매일 --미정
+					</h3>
+					<span class="panelControl">
+						<i class="fa fa-chevron-up"></i>
+					</span>
 				</div>
-				<table class="frmStyle">
-					<colgroup>
-						<col style="width: 10%;"/>
-						<col style="width: 23%;"/>
-						<col style="width: 10%;"/>
-						<col style="width: 23%;"/>
-						<col style="width: 10%;"/>
-						<col style="width: 24%;"/>
-						<col/>
-					</colgroup>
-
-					<tr>
-						<th>전송일자</th>
-						<td colspan="6" id="sellTerms"></td>
-					</tr>
-					<tr>
-						<th>상품코드<em class="required" title="필수"></em></th>
-						<td>
-							<textarea class="textareaR3 w40p" name="condition" id="condition"></textarea>
-						</td>
-
-						<th>브랜드</th>
-						<td>
-							<input type="text" class="w100" name="searchTxt" id="searchTxt" maxlength="20" />
-							<button type="button" class="btn icn" id="btnSearchBrand"><i class="fa fa-search"></i></button>
-							<!-- <input type="text" class="w100" name="brandCd" readonly="readonly"/> -->
-							<span id="brandText"></span>
-							<input type="hidden" name="brandList"/>
-						</td>
-
-						<th>IF결과</th>
-						<td colspan="3">
-							<select name="apiResult" id="apiResult">
-								<option value="">[전체]</option>
-								<option value="true">전송완료</option>
-								<option value="false">전송실패</option>
-								<option value="error">오류</option>
-							</select>
-						</td>
-					</tr>
-				</table>
-
-				<ul class="panelBar">
-					<li class="center">
-						<button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
-					</li>
-				</ul>
 
+				<div class="panelContent">
+					<table class="frmStyle">
+						<colgroup>
+							<col style="width: 10%;"/>
+							<col style="width: 23%;"/>
+							<col style="width: 10%;"/>
+							<col style="width: 23%;"/>
+							<col style="width: 10%;"/>
+							<col style="width: 24%;"/>
+							<col/>
+						</colgroup>
+
+						<tr>
+							<th>전송일자</th>
+							<td colspan="6" id="sellTerms"></td>
+						</tr>
+						<tr>
+							<th>상품코드<em class="required" title="필수"></em></th>
+							<td>
+								<textarea class="textareaR3 w50p" name="condition" id="condition"></textarea>
+							</td>
+
+							<th>브랜드</th>
+							<td>
+								<input type="text" class="w100" name="searchTxt" id="searchTxt" maxlength="20" />
+								<button type="button" class="btn icn" id="btnSearchBrand"><i class="fa fa-search"></i></button>
+								<!-- <input type="text" class="w100" name="brandCd" readonly="readonly"/> -->
+								<span id="brandText"></span>
+								<input type="hidden" name="brandList"/>
+							</td>
+
+							<th>IF결과</th>
+							<td colspan="3">
+								<select name="apiResult" id="apiResult">
+									<option value="">[전체]</option>
+									<option value="true">전송완료</option>
+									<option value="false">전송실패</option>
+									<option value="error">오류</option>
+								</select>
+							</td>
+						</tr>
+					</table>
+
+					<ul class="panelBar">
+						<li class="center">
+							<button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
+						</li>
+					</ul>
+				</div>
 			</div>
 			<!-- 검색조건 영역 -->
 
 			<!-- 리스트 영역 -->
 			<div class="panelStyle">
 				<ul class="panelBar">
+					<li>
+						<button type="button" class="btn btn-default btn-lg" onclick="fnExcelDownLoad();">엑셀다운로드</button>
+					</li>
 					<li class="right">
 						검색결과 : <strong><span id="gridRowTotalCount">0</span> 건</strong>&nbsp;
 						쪽번호 <span id="pgNo">0</span>/ <strong id="endPgNo">0</strong>&nbsp;&nbsp;
@@ -109,6 +120,8 @@
 				</ul>
 			</div>
 			<!-- //리스트 영역 -->
+
+			<a href="javascript:void(0);" id="ExcelList" style="display: none;">엑셀다운로드</a>
 		</form>
 
 	</div>
@@ -124,16 +137,16 @@
 		{headerName: "No", width: 60, cellClass: 'text-center',
 			valueGetter: function(params) { return cfnGridNumner('searchForm',params.node.rowIndex, 'A');}
 		},
+		{headerName: "IF결과", field: "apiResult", width: 100, cellClass: 'text-center',
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(procGbValue, params.value); }
+		},
+		{headerName: "전송결과메세지", field: "apiMessage", width: 350, cellClass: 'text-center'},
 		{headerName: "상품코드", field: "goodsCd", width: 130, cellClass: 'text-center'},
 		{headerName: "상품명", field: "goodsNm", width: 250, cellClass: 'text-center'},
 		{headerName: "옵션코드", field: "optCd", width: 130, cellClass: 'text-center'},
-		{headerName: "옵션1", field: "optCd1", width: 150, cellClass: 'text-center'},
+		{headerName: "옵션1", field: "optCd1", width: 130, cellClass: 'text-center'},
 		{headerName: "옵션2", field: "optCd2", width: 130, cellClass: 'text-center'},
 		{headerName: "재고", field: "quantity", width: 80, cellClass: 'text-center'},
-		{headerName: "IF결과", field: "apiResult", width: 100, cellClass: 'text-center',
-			valueFormatter: function (params) { return gagaAgGrid.lookupValue(procGbValue, params.value); }
-		},
-		{headerName: "전송결과메세지", field: "apiMessage", width: 420, cellClass: 'text-center'},
 		{headerName: "전송일시", field: "regDt", width: 150, cellClass: 'text-center'}
 	];
 
@@ -236,6 +249,26 @@
 	}
 	/**************** 검색 // *****************************************************/
 
+	/**************** 엑셀다운로드 *****************************************************/
+	var fnExcelDownLoad = function(){
+		var formId = '#searchForm';
+		if (gridOptions.api.getDisplayedRowCount() <= 0){
+			mcxDialog.alert("조회된 데이터가 없습니다.<br/>다시 조회 후 다운로드 받으세요.");
+			return;
+		}
+
+		var fromDate = parseInt($('#searchForm input[name=stDate]').val().replaceAll("-", ""));
+		var toDate =parseInt($('#searchForm input[name=edDate]').val().replaceAll("-", ""));
+		if( 4 < (toDate - fromDate)){
+			mcxDialog.alert("전송일자를 3일 이내의 기간으로 설정 후 다운로드해주세요.");
+			return;
+		}
+
+		var params =  $(formId).serialize();
+		$('#ExcelList').attr({ href : '/shoplinker/stock/excel/list?' + params }).get(0).click();
+	}
+	/**************** 엑셀다운로드 // *****************************************************/
+
 	$(document).ready(function() {
 
 		cfnCreateCalendar('#sellTerms', 'stDate', 'edDate', true, '등록일', 'X');