From c3a5e164cbabbfc5f66e1356cb0de657ce3f58b9 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 20 三月 2020 13:56:02 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java |   34 +++++++++++++++++++++++++++++++++-
 1 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java
index 654dbcf..cd41e0c 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java
@@ -490,9 +490,15 @@
 				String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl,
 						JDApiUtil.POSITION_SHARE + "", "1");
 				String template = configService.get(ConfigKeyEnum.quickShareJDCommentText.getKey());
+				if (jumpLink == null) {
+					throw new GoodsEvaluateException(1, "璇ュ晢鍝佽浆閾惧け璐�");
+				}
 				commentText = template.replace("[閾炬帴]", jumpLink);
 			} else if (goodsType == Constant.SOURCE_TYPE_PDD) {
 				String jumpLink = PinDuoDuoApiUtil.getPromotionUrl(goodsId, PinDuoDuoApiUtil.PID_SHARE + "", "1");
+				if (jumpLink == null) {
+					throw new GoodsEvaluateException(1, "璇ュ晢鍝佽浆閾惧け璐�");
+				}
 				String template = configService.get(ConfigKeyEnum.quickSharePDDCommentText.getKey());
 				commentText = template.replace("[閾炬帴]", jumpLink);
 			}
@@ -1517,7 +1523,11 @@
 		executor.execute(new Runnable() {
 			@Override
 			public void run() {
+				// 鏇存柊淇℃伅
 				updateGoodInfo(list);
+				
+				// 鍒犻櫎宸茶繃鏈�
+				removeOverdue();
 			}
 		});
 
@@ -1664,6 +1674,9 @@
 			@Override
 			public void run() {
 				updateGoodInfo(listOBJ);
+				
+				// 鍒犻櫎宸茶繃鏈�
+				removeOverdue();
 			}
 		});
 
@@ -2324,5 +2337,24 @@
 		}
 	}
 	
-	
+	private void removeOverdue() {
+		List<GoodsEvaluate> list = goodsEvaluateDao.queryOverdue();
+		if (list == null || list.size() == 0) {
+			return;
+		}
+		long nm = 1000 * 60;// 涓�鍒嗛挓鐨勬绉掓暟
+		long nh = 1000 * 60 * 60;// 涓�灏忔椂鐨勬绉掓暟
+		long nd = 1000 * 24 * 60 * 60;// 涓�澶╃殑姣鏁�
+		
+		long time = java.lang.System.currentTimeMillis();
+		for (GoodsEvaluate goodsEvaluate: list) {
+			long diff = time - goodsEvaluate.getEndTime().getTime();
+			long min = diff % nd % nh / nm; 
+			
+			// 杩囨湡瓒呰繃10鍒嗛挓灏卞垹闄�
+			if (min > 10) {
+				goodsEvaluateDao.remove(goodsEvaluate);
+			}
+		}
+	}
 }

--
Gitblit v1.8.0