|
|
@@ -1,12 +1,10 @@
|
|
|
package com.style24.admin.biz.web;
|
|
|
|
|
|
import java.io.File;
|
|
|
-import java.io.IOException;
|
|
|
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;
|
|
|
|
|
|
@@ -145,6 +143,32 @@ public class TsaShoplinkerController extends TsaBaseController {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 샵링커상품등록-상품등록엑셀업로드 수량체크
|
|
|
+ *
|
|
|
+ * @param paramMap
|
|
|
+ * @return GagaMap
|
|
|
+ * @throws Exception
|
|
|
+ * @author jmh
|
|
|
+ * @since 2021.5.20
|
|
|
+ */
|
|
|
+ @PostMapping("/goods/send/excelupload/register/chk")
|
|
|
+ @ResponseBody
|
|
|
+ public GagaResponse shoplinkerGoodsRegisterChk(@RequestBody ShoplinkerGoods shoplinkerGoods) throws Exception {
|
|
|
+
|
|
|
+ String targetPath = GagaFileUtil.getConcatenationPath(env.getProperty("upload.excel.target.path"), "excel");
|
|
|
+ Collection<GagaMap> ecxelGoodsList = new ArrayList<>();
|
|
|
+ String[] goodsNames = {"goodsCd"};
|
|
|
+ ecxelGoodsList = GagaExcelUtil.getList(GagaFileUtil.getConcatenationPath(targetPath, shoplinkerGoods.getExcelFileNm()), 0, goodsNames, 0);
|
|
|
+
|
|
|
+ if (ecxelGoodsList != null && ecxelGoodsList.size() > EXCEL_ROW_COUNT) {
|
|
|
+ GagaFileUtil.deleteFile(GagaFileUtil.getConcatenationPath(targetPath, shoplinkerGoods.getExcelFileNm()));
|
|
|
+ throw new IllegalStateException("엑셀 파일의 건수를 " +EXCEL_ROW_COUNT + "건 이하로 사용하세요.");
|
|
|
+ }
|
|
|
+
|
|
|
+ return super.ok(message.getMessage("SUCC_0007"));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 샵링커상품등록-상품등록엑셀업로드
|
|
|
*
|
|
|
@@ -208,7 +232,6 @@ log.info(" #### SHOPLINKER CHKE 1 - "+runMap.getRunCnt()+" | "+runMap.getSidOver
|
|
|
// 3. xml 데이터 생성
|
|
|
shoplinkerGoods.setCustomerId(env.getProperty("shoplinker.customer_id"));
|
|
|
shoplinkerGoods.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
- log.info(" #### SHOPLINKER CHK2 ");
|
|
|
admShoplinkerService.createShoplinkerXml(ecxelGoodsList, shoplinkerGoods);
|
|
|
|
|
|
// 4. 파일 삭제
|