Procházet zdrojové kódy

EP 관련 소스 수정

jsh77b před 4 roky
rodič
revize
ad68218d69

+ 23 - 0
src/main/java/com/style24/batch/biz/job/goods/TsbDaumReviewEp.java

@@ -49,6 +49,7 @@ public class TsbDaumReviewEp extends TsbAbstractJob<Collection<GoodsEp>, Collect
 
 	@Override
 	public String write(Collection<GoodsEp> goodsEpList) throws Exception {
+		/*
 		if (goodsEpList != null && !goodsEpList.isEmpty()) {
 			StringBuilder sb = new StringBuilder();
 			sb.append("<<<tocnt>>>").append(goodsEpList.size());
@@ -65,6 +66,28 @@ public class TsbDaumReviewEp extends TsbAbstractJob<Collection<GoodsEp>, Collect
 			bw.flush();
 			bw.close();
 		}
+		*/
+		
+		if (goodsEpList != null && !goodsEpList.isEmpty()) {
+			
+			String uploadPath = GagaFileUtil.getConcatenationPath(env.getProperty("ep.file.path"), "iStyle24ProductFeed_DaumBest100_new.txt");
+			log.info("다음 상품평EP 파일 경로: {}", uploadPath);
+			BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(uploadPath)), "UTF-8"));
+
+			StringBuilder sb = new StringBuilder();
+			sb.append("<<<tocnt>>>").append(goodsEpList.size());
+			bw.append(sb.toString());
+
+			for (GoodsEp goodsEp : goodsEpList) {
+				sb = new StringBuilder();
+				this.setEpInfo(sb, goodsEp);
+				bw.append(sb.toString());
+			}
+			
+			bw.write(sb.toString());
+			bw.flush();
+			bw.close();
+		}
 
 		return "OK";
 	}

+ 22 - 0
src/main/java/com/style24/batch/biz/job/goods/TsbDaumSummaryEp.java

@@ -50,6 +50,7 @@ public class TsbDaumSummaryEp extends TsbAbstractJob<Collection<GoodsEp>, Collec
 
 	@Override
 	public String write(Collection<GoodsEp> goodsEpList) throws Exception {
+		/*
 		if (goodsEpList != null && !goodsEpList.isEmpty()) {
 			StringBuilder sb = new StringBuilder();
 			sb.append("<<<tocnt>>>").append(goodsEpList.size());
@@ -66,6 +67,27 @@ public class TsbDaumSummaryEp extends TsbAbstractJob<Collection<GoodsEp>, Collec
 			bw.flush();
 			bw.close();
 		}
+		*/
+		
+		if (goodsEpList != null && !goodsEpList.isEmpty()) {
+			String uploadPath = GagaFileUtil.getConcatenationPath(env.getProperty("ep.file.path"), "iStyle24ProductFeed_DaumProductSmry_new.txt");
+			log.info("다음 요약EP 파일 경로: {}", uploadPath);
+			BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(uploadPath)), "UTF-8"));
+			
+			StringBuilder sb = new StringBuilder();
+			sb.append("<<<tocnt>>>").append(goodsEpList.size());
+			bw.append(sb.toString());
+
+			for (GoodsEp goodsEp : goodsEpList) {
+				sb = new StringBuilder();
+				this.setEpInfo(sb, goodsEp);
+				bw.append(sb.toString());
+			}
+
+			bw.write(sb.toString());
+			bw.flush();
+			bw.close();
+		}
 
 		return "OK";
 	}

+ 1 - 2
src/main/java/com/style24/batch/biz/task/TsbGoodsTask.java

@@ -304,8 +304,7 @@ public class TsbGoodsTask {
 	 * 다음 전체EP 생성
 	 * @throws Exception
 	 */
-	//@Scheduled(cron = "${cron.goods.ep.daum.all.goods.create}")
-	@Scheduled(fixedDelay = 3500000)
+	@Scheduled(cron = "${cron.goods.ep.daum.all.goods.create}")
 	@Async
 	public void daumAllEpCreateJob() throws Exception {
 		daumAllEp.runById("cron.goods.ep.daum.all.goods.create");