From 8c04d27e5cebb7e654c208533e9567c4df2c8acc Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期四, 12 十二月 2019 14:21:44 +0800
Subject: [PATCH] 券时间限制

---
 fanli/src/main/java/com/yeshi/fanli/job/BrandInfoJob.java |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/job/BrandInfoJob.java b/fanli/src/main/java/com/yeshi/fanli/job/BrandInfoJob.java
index 3f0ea82..b563cde 100644
--- a/fanli/src/main/java/com/yeshi/fanli/job/BrandInfoJob.java
+++ b/fanli/src/main/java/com/yeshi/fanli/job/BrandInfoJob.java
@@ -5,6 +5,7 @@
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
+import com.yeshi.fanli.log.LogHelper;
 import com.yeshi.fanli.service.inter.brand.BrandInfoService;
 import com.yeshi.fanli.util.Constant;
 
@@ -31,10 +32,15 @@
 		long count = brandInfoService.countValidByCid(null);
 		if (count == 0)
 			return;
-
-		for (int page = 1; page < (count / 100) + 1; page++) {
-			brandInfoService.addShopAndGoods((page - 1) * 100, 100);
+		
+		long totalPage = (count / 100) + 1;
+		for (long page = 0; page < totalPage; page++) {
+			try {
+				brandInfoService.addShopAndGoods(page * 100, 100);
+			} catch (Exception e) {
+			   LogHelper.errorDetailInfo(e);
+			}
 		}
 	}
-
+	
 }

--
Gitblit v1.8.0