Explorar o código

샵링커 재고 오류 테스트

jmh %!s(int64=4) %!d(string=hai) anos
pai
achega
1af0d570ba

+ 13 - 3
src/main/java/com/style24/batch/biz/job/shoplinker/TsbShoplinkerStockJob.java

@@ -137,6 +137,8 @@ public class TsbShoplinkerStockJob extends TsbAbstractJob<Collection<ShoplinkerG
 	private int callGoodsRegApi(ShoplinkerGoods map, StringBuilder sbRequest, String fileNm) throws IOException {
 
 		int succCnt = 0;
+		String xmlPath = "";
+		String xmlUrl = "";
 		String responseXmlData = "";
 		StringBuilder xmlFileName = new StringBuilder();
 		com.gagaframework.shoplinker.domain.goods.result.Shoplinker shoplinkerResult;
@@ -148,9 +150,9 @@ public class TsbShoplinkerStockJob extends TsbAbstractJob<Collection<ShoplinkerG
 			// XML 파일 생성
 			xmlFileName = new StringBuilder();
 			xmlFileName.append("stock_"+fileNm).append(".xml");
-			String xmlPath = GagaFileUtil.getConcatenationPath(map.getXmlPath(), xmlFileName.toString());
+			xmlPath = GagaFileUtil.getConcatenationPath(map.getXmlPath(), xmlFileName.toString());
 			shoplinkerUtil.makeRequestXmlFile(sbRequest.toString(), xmlPath);
-			String xmlUrl = GagaFileUtil.getConcatenationPath(map.getDomainUrl(), xmlFileName.toString());
+			xmlUrl = GagaFileUtil.getConcatenationPath(map.getDomainUrl(), xmlFileName.toString());
 
 			// API 호출URL
 			String apiUrl = GagaShoplinkerConstants.API_DOMAIN + map.getApiSubUrl() + URLEncoder.encode(xmlUrl);
@@ -175,7 +177,15 @@ public class TsbShoplinkerStockJob extends TsbAbstractJob<Collection<ShoplinkerG
 
 		} catch (Exception e) {
 			log.error("callGoodsRegApi error", e);
-			map.setXmlTxt(sbRequest.toString());
+			
+			java.io.File file = new java.io.File(xmlUrl);
+			String errStr = "[파일존재여부] : "+file.exists();
+			errStr += "\n[xmlPath] : "+xmlPath;
+			errStr += "\n[xmlUrl] : "+xmlUrl;
+			errStr += "\n\n[responseXmlData] : "+responseXmlData;
+			errStr += "\n\n[xml] : "+sbRequest.toString();
+			
+			map.setXmlTxt(errStr);
 			map.setApiResult(TscConstants.ShoplinkerApiStat.S_ERROR.value());
 			map.setApiMessage("API 오류 " +StringUtils.abbreviate(responseXmlData, 0 , 120));
 

+ 1 - 1
src/main/resources/config/application-brdg.yml

@@ -161,7 +161,7 @@ cron:
     shoplinker:
         #stock.send10: 0 0 10 * * *          #재고 10시 (1일 1회)
         stock.send10: 2 22 2 29 2 ?          #재고 10시 (1일 1회)
-        stock.send15: 0 50 * * * *           #재고 15시 (1일 1회)
+        stock.send15: 0 0/20 * * * *           #재고 15시 (1일 1회)
         #order.receive: 0 5 5-15 * * MON-FRI #주문 (평일 5시 ~ 15시 5분에 실행)
         order.receive: 2 22 2 29 2 ?         #주문 (평일 5시 ~ 15시 5분에 실행)
         #invoice.send: 0 16 * * * *          #송장 (1시간 1회)