|
|
@@ -3,6 +3,7 @@ package com.style24.admin.biz.service;
|
|
|
import java.util.Collection;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.core.env.Environment;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
@@ -33,6 +34,9 @@ public class TsaGoodsService {
|
|
|
@Autowired
|
|
|
private TscMessageByLocale message;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private Environment env;
|
|
|
+
|
|
|
@Autowired
|
|
|
private TsaGoodsDao goodsDao;
|
|
|
|
|
|
@@ -181,4 +185,100 @@ public class TsaGoodsService {
|
|
|
public Collection<Goods> getGoodsList(GoodsSearch goodsSearch) {
|
|
|
return goodsDao.getGoodsList(goodsSearch);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 상품목록 - 기본정보 엑셀다운로드
|
|
|
+ *
|
|
|
+ * @param goodsSearch
|
|
|
+ * @param excelFilenameWithPath - 경로를 포함한 엑셀파일명
|
|
|
+ * @return
|
|
|
+ * @author eskim
|
|
|
+ * @since 2020. 10. 21
|
|
|
+ */
|
|
|
+ public void getGoodsInfoExcelList(GoodsSearch goodsSearch, String excelFilenameWithPath) {
|
|
|
+
|
|
|
+// if ("Y".equals(goodsSearch.getImageViewYn())) {
|
|
|
+// // 헤더 title 설정
|
|
|
+// String[] listTitles = {"이미지", "상품코드", "업체명", "브랜드명", "상품명", "품목", "판매가능재고", "상품상태", "스타일년도", "시즌",
|
|
|
+// "정상가", "판매가", "임직원가", "할인율", "가격변경일", "ERP재고연동여부",
|
|
|
+// "정상이월구분", "승인일시", "EC전송일시"};
|
|
|
+//
|
|
|
+// // DB 처리 시 사용되는 파라미터명(셀명) 설정
|
|
|
+// String[] cellNames = {"IMG_PATH1", "GOODS_CD", "SUPPLY_COMP_CD", "BRAND_GRP_NM", "GOODS_NM", "ITEMKIND_NM",
|
|
|
+// "STOCK_QTY_SUM", "GOODS_STAT", "STYLE_YEAR", "SEASON_CD", "LIST_PRICE", "CURR_PRICE",
|
|
|
+// "STAFF_CURR_PRICE", "DC_RATE", "PRICE_UPD_DT", "ERP_STOCK_LINK_YN",
|
|
|
+// "FORMAL_GB", "APPR_UPD_DT", "ECMONITOR_REG_DT"};
|
|
|
+//
|
|
|
+// String[] cellTypes = {GagaExcelConstants.CellType.IMAGE.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_RIGHT.name(),
|
|
|
+// GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
+// GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_RIGHT.name(),
|
|
|
+// GagaExcelConstants.CellType.CHAR_RIGHT.name(),
|
|
|
+// GagaExcelConstants.CellType.CHAR_RIGHT.name(), GagaExcelConstants.CellType.CHAR_RIGHT.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()};
|
|
|
+//
|
|
|
+// String targetPath = env.getProperty("upload.goods.view");
|
|
|
+// Collection<GagaMap> dataList = goodsDao.getGoodsInfoExcelList(goodsSearch); // map형식으로 조회
|
|
|
+// if (dataList != null && !dataList.isEmpty()) {
|
|
|
+// for (GagaMap gagaMap : dataList) {
|
|
|
+// if ("A".equals(gagaMap.get("IMG_TYPE").toString())) {
|
|
|
+// if (!StringUtils.isEmpty(gagaMap.get("IMG_PATH6"))) {
|
|
|
+// gagaMap.set("IMG_PATH1", targetPath + gagaMap.get("IMG_PATH6").toString().replace("/1000/", "/100/"));
|
|
|
+//
|
|
|
+// } else {
|
|
|
+// gagaMap.set("IMG_PATH1", targetPath + gagaMap.get("IMG_PATH1").toString().replace("/1000/", "/100/"));
|
|
|
+// }
|
|
|
+// gagaMap.set("IMG_PATH1", gagaMap.get("IMG_PATH1").toString());
|
|
|
+// } else {
|
|
|
+//
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// try {
|
|
|
+// GagaExcelUtil.createExcel(excelFilenameWithPath, dataList, "상품 정보", listTitles, cellNames, cellTypes, TsaConstants.EXCEL_FOOTER_TITLE);
|
|
|
+// } catch (Exception e) {
|
|
|
+// throw new IllegalStateException(e);
|
|
|
+// }
|
|
|
+//
|
|
|
+// } else {
|
|
|
+// // 헤더 title 설정
|
|
|
+// String[] listTitles = {"상품코드", "업체명", "브랜드명", "상품명", "품목", "재고", "상품상태", "스타일년도", "시즌", "정상가",
|
|
|
+// "판매가", "할인율", "가격변경일", "ERP재고연동여부", "정상이월구분", "반품가능 여부", "교환가능 여부", "무료반품가능 여부",
|
|
|
+// "무료교환 여부", "이미지 여부"};
|
|
|
+//
|
|
|
+// // DB 처리 시 사용되는 파라미터명(셀명) 설정
|
|
|
+// String[] cellNames = {"GOODS_CD", "SUPPLY_COMP_CD", "BRAND_ENM", "GOODS_NM", "ITEMKIND_NM",
|
|
|
+// "STOCK_QTY_SUM", "GOODS_STAT", "STYLEyEAR", "SEASON_CD", "LIST_PRICE", "CURR_PRICE",
|
|
|
+// "DC_RATE", "PRICE_UPD_DT", "ERP_STOCK_LINK_YN", "ERP_PRICE_LINK_YN", "FORMAL_GB", "RETURNABLE_YN",
|
|
|
+// "CHANGEABLE_YN", "RETURN_FEE_FREE_YN", "CHANGE_FEE_FREE_YN", "GOODS_IMAGE_YN"};
|
|
|
+//
|
|
|
+// String[] cellTypes = {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_RIGHT.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
+// GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
+// GagaExcelConstants.CellType.CHAR_RIGHT.name(),
|
|
|
+// GagaExcelConstants.CellType.CHAR_RIGHT.name(), GagaExcelConstants.CellType.CHAR_RIGHT.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_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
+// GagaExcelConstants.CellType.CHAR_CENTER.name()};
|
|
|
+//
|
|
|
+// Collection<GagaMap> dataList = goodsDao.getGoodsInfoExcelList(goodsSearch);
|
|
|
+//
|
|
|
+// try {
|
|
|
+// GagaExcelUtil.createExcel(excelFilenameWithPath, dataList, "상품 정보", listTitles, cellNames, cellTypes, TsaConstants.EXCEL_FOOTER_TITLE);
|
|
|
+// } catch (Exception e) {
|
|
|
+// throw new IllegalStateException(e);
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|