jmh 4 лет назад
Родитель
Сommit
7025e99e50

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

@@ -1,5 +1,6 @@
 package com.style24.admin.biz.service;
 
+import java.io.File;
 import java.io.IOException;
 import java.net.URLEncoder;
 import java.util.ArrayList;
@@ -878,7 +879,11 @@ public class TsaShoplinkerService {
 			// response 결과
 			shoplinkerResult = (com.gagaframework.shoplinker.domain.goods.result.Shoplinker)shoplinkerUtil.unmarshal(com.gagaframework.shoplinker.domain.goods.result.Shoplinker.class, responseXmlData);
 			resultMsg = shoplinkerResult.getResultMessage();
-			map.setXmlTxt(sbRequest.toString());
+
+			String slFolder = GagaFileUtil.getConcatenationPath(env.getProperty("shoplinker.xml.path"));
+			File slPath = new File(slFolder);
+
+			map.setXmlTxt(slPath.exists()+"\n"+xmlPath+"\n"+xmlUrl+"\n\n"+sbRequest.toString());
 			map.setApiProductId(resultMsg.getProductId());
 			map.setApiResult(resultMsg.getResult());
 			map.setApiMessage(resultMsg.getMessage());
@@ -893,11 +898,19 @@ public class TsaShoplinkerService {
 			}
 
 			// 생성 파일삭제
-			GagaFileUtil.deleteFile(GagaFileUtil.getConcatenationPath(map.getXmlPath(), xmlFileName.toString()));
+			// GagaFileUtil.deleteFile(GagaFileUtil.getConcatenationPath(map.getXmlPath(), xmlFileName.toString()));
 
 		} catch (Exception e) {
 			log.error("error", e);
-			map.setXmlTxt(sbRequest.toString());
+			// 임시
+			StringBuilder xmlFileName = new StringBuilder();
+			xmlFileName.append(fileNm+"_"+fileAddNm).append(".xml");
+			String xmlPath = GagaFileUtil.getConcatenationPath(map.getXmlPath(), xmlFileName.toString());
+			String xmlUrl = GagaFileUtil.getConcatenationPath(map.getDomainUrl(), xmlFileName.toString());
+			String slFolder = GagaFileUtil.getConcatenationPath(env.getProperty("shoplinker.xml.path"));
+			File slPath = new File(slFolder);
+			map.setXmlTxt(slPath.exists()+"\n"+xmlPath+"\n"+xmlUrl+"\n\n"+sbRequest.toString());
+			//map.setXmlTxt(sbRequest.toString());
 			map.setApiResult("error");
 			map.setApiMessage("API 통신오류");
 		}