jmh 4 rokov pred
rodič
commit
8c196131e0

+ 30 - 19
src/main/java/com/style24/core/biz/service/TscShoplinkerService.java

@@ -892,19 +892,11 @@ public class TscShoplinkerService {
 			}
 
 			// 생성 파일삭제
-			// GagaFileUtil.deleteFile(GagaFileUtil.getConcatenationPath(map.getXmlPath(), xmlFileName.toString()));
+			GagaFileUtil.deleteFile(GagaFileUtil.getConcatenationPath(map.getXmlPath(), xmlFileName.toString()));
 
 		} catch (Exception e) {
 			log.error("error", e);
-			// 임시
-			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.setXmlTxt(sbRequest.toString());
 			map.setApiResult("error");
 			map.setApiMessage("API 통신오류");
 		}
@@ -1004,7 +996,7 @@ public class TscShoplinkerService {
 		currentlyPage = map.getInt("currentlyPage");
 		currListCount = map.getInt("currListCount");
 
-		slkSearch.setTxt(shoplinkerOrder.getApiStDate()+ " 총페이지: "+totalPage+ "("+totalCount+"건) || "+currentlyPage);
+		slkSearch.setTxt("["+shoplinkerOrder.getInfoStr()+"]"+ " 총페이지: "+totalPage+ "("+totalCount+"건) || "+currentlyPage);
 		updateCallApiRunable(slkSearch);
 
 		if( currentlyPage < 1 ) currentlyPage = 1;
@@ -1068,9 +1060,14 @@ public class TscShoplinkerService {
 			*/
 			sbRequest.append("			<customer_id>").append("a0021915").append("</customer_id>\n");
 			sbRequest.append("			<shoplinker_id><![CDATA[").append("yes2424").append("]]></shoplinker_id>\n");
-			sbRequest.append("			<order_flag>004</order_flag>\n");// 테스트용
-			sbRequest.append("			<st_date>").append(shoplinkerOrder.getApiStDate().replace("-", "")).append("</st_date>\n");
-			sbRequest.append("			<ed_date>").append(shoplinkerOrder.getApiStDate().replace("-", "")).append("</ed_date>\n");
+			sbRequest.append("			<order_flag>004</order_flag>\n"); // 테스트용
+			sbRequest.append("			<st_date>").append(shoplinkerOrder.getStDate().replace("-", "")).append("</st_date>\n");
+			sbRequest.append("			<ed_date>").append(shoplinkerOrder.getEdDate().replace("-", "")).append("</ed_date>\n");
+			if( "BATCH".equals(shoplinkerOrder.getAcType())){
+				sbRequest.append("			<sdt_time>").append(shoplinkerOrder.getStTime()).append("</sdt_time>\n");
+				sbRequest.append("			<edt_time>").append(shoplinkerOrder.getEdTime()).append("</edt_time>\n");
+			}
+
 			sbRequest.append("			<page_no>").append(shoplinkerOrder.getOrderPageNo()).append("</page_no>\n");
 
 			sbRequest.append("		</Order>\n");
@@ -1171,8 +1168,8 @@ public class TscShoplinkerService {
 
 			}else {
 				// 테스트용
-				xmlUrl = "http://ts5000.ipdisk.co.kr:8999/shoplinker/order/0409/order_real_"+shoplinkerOrder.getOrderPageNo()+".xml";
-				xmlUrl = "http://ts5000.ipdisk.co.kr:8999/shoplinker/order/order_time.xml";
+				xmlUrl = "http://ts5000.ipdisk.co.kr:8999/shoplinker/order/0528/order_real_"+shoplinkerOrder.getOrderPageNo()+".xml";
+				//xmlUrl = "http://ts5000.ipdisk.co.kr:8999/shoplinker/order/order_time.xml";
 
 				try {
 					// API 호출
@@ -1259,7 +1256,7 @@ public class TscShoplinkerService {
 			returnMap.setString("RESULT_TYPE", "TRUE");
 
 			// 생성 파일삭제
-			GagaFileUtil.deleteFile(GagaFileUtil.getConcatenationPath(shoplinkerOrder.getXmlPath(), xmlFileName.toString()));
+			// GagaFileUtil.deleteFile(GagaFileUtil.getConcatenationPath(shoplinkerOrder.getXmlPath(), xmlFileName.toString()));
 
 		}catch(Exception e) {
 			log.error("xml 생성오류 ", e);
@@ -1479,7 +1476,12 @@ public class TscShoplinkerService {
 					resultMsg = (com.gagaframework.shoplinker.domain.invoice.ResultMessage)shoplinkerUtil.unmarshal(com.gagaframework.shoplinker.domain.invoice.ResultMessage.class, responseXmlData);
 
 					apiHstMap.setApiType("INVOICE");
-					apiHstMap.setXmlTxt(sbRequest.toString());
+
+					String slFolder = GagaFileUtil.getConcatenationPath(env.getProperty("shoplinker.xml.path")+"/invoice");
+					File slPath = new File(slFolder);
+					apiHstMap.setXmlTxt(slPath.exists()+"\n"+xmlPath+"\n"+xmlUrl+"\n\n"+sbRequest.toString());
+
+					//apiHstMap.setXmlTxt(sbRequest.toString());
 					apiHstMap.setOrdDtlNo(info.getOrdDtlNo());
 					apiHstMap.setApiResult(resultMsg.getResult());
 					apiHstMap.setApiMessage(resultMsg.getMessage());
@@ -1490,7 +1492,16 @@ public class TscShoplinkerService {
 				} catch (Exception e) {
 					log.error("error", e);
 					apiHstMap.setApiType("INVOICE");
-					apiHstMap.setXmlTxt(sbRequest.toString());
+
+					StringBuilder xmlFileName = new StringBuilder();
+					xmlFileName.append("invoice_"+info.getOrdDtlNo()+"_"+fileAddNm).append(".xml");
+					String xmlPath = GagaFileUtil.getConcatenationPath(shoplinkerInvoice.getXmlPath(), xmlFileName.toString());
+					String xmlUrl = GagaFileUtil.getConcatenationPath(shoplinkerInvoice.getDomainUrl(), xmlFileName.toString());
+					String slFolder = GagaFileUtil.getConcatenationPath(env.getProperty("shoplinker.xml.path")+"/invoice");
+					File slPath = new File(slFolder);
+					apiHstMap.setXmlTxt(slPath.exists()+"\n"+xmlPath+"\n"+xmlUrl+"\n\n"+sbRequest.toString());
+
+					// apiHstMap.setXmlTxt(sbRequest.toString());
 					apiHstMap.setOrdDtlNo(info.getOrdDtlNo());
 					apiHstMap.setApiResult("error");
 					apiHstMap.setApiMessage("API 통신오류");

+ 6 - 2
src/main/java/com/style24/persistence/domain/ShoplinkerOrder.java

@@ -19,10 +19,13 @@ public class ShoplinkerOrder extends TscBaseDomain {
 	private String customerId; 					// 고객사 코드(샵링커 가입코드)
 	private String shoplinkerId;
 	private String orderFlag; 					// 주문타입 - 일반[신규OR발주]:000/ 발주확인:007/ 정산확정: 002/ 송장등록:003/ 송장전송완료:004
-	private String stDate;
-	private String edDate;
+	private String stDate;						// 시작날짜 YYYMMDD
+	private String edDate;						// 종료날짜 YYMMDD
+	private String stTime;						// 시작시간 HH24MISS
+	private String edTime;						// 종료시간 HH24MISS
 	private Integer orderPageNo;
 	private String apiStDate;
+	private String infoStr;
 
 	// Response
 	private Integer orderIfIdx; 				// 주문수집차수
@@ -113,6 +116,7 @@ public class ShoplinkerOrder extends TscBaseDomain {
 	private int pageUnit = 10;
 
 	private String sid;
+	private String acType = "";					// 실행위치 BATCH:배치 /  ADMIN :관리자
 
 	public ShoplinkerOrder() {