From 44327a748a3e6e04a21faa85e44c89e60a954f23 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期二, 19 五月 2020 11:43:33 +0800
Subject: [PATCH] 活动通用券 取消验证

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java |   56 ++++++++++++++++++++++++++++++--------------------------
 1 files changed, 30 insertions(+), 26 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 c720981..911bbd4 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
@@ -930,36 +930,43 @@
 			throw new GoodsEvaluateException(1, "璇蜂繚瀛樼涓�閮ㄥ垎淇℃伅");
 		}
 
-		if (StringUtil.isNullOrEmpty(commentInfo.getCoupon())) {
-			throw new GoodsEvaluateException(1, "鍒搁潰棰濅笉鑳戒负绌�");
-		}
-
-		if (StringUtil.isNullOrEmpty(commentInfo.getTagDesc())) {
-			throw new GoodsEvaluateException(1, "鎻忚堪璇笉鑳戒负绌�");
-		}
-
-		String tagUrl = commentInfo.getTagUrl();
-		String content = commentInfo.getContent();
-		if (StringUtil.isNullOrEmpty(tagUrl) && StringUtil.isNullOrEmpty(content)) {
-			throw new GoodsEvaluateException(1, "璇勮璇拰閾炬帴涓嶈兘鍚屾椂涓虹┖");
-		}
-
-		String endTime = commentInfo.getEndTime();
-		if (!StringUtil.isNullOrEmpty(endTime)) {
-			try {
-				SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-				sdf.parse(endTime);
-			} catch (Exception e) {
-				throw new GoodsEvaluateException(1, "璇峰~鍐欐纭殑鏃堕棿鏍煎紡锛�2020-03-05");
+		GoodsEvaluate resultObj = goodsEvaluateDao.getById(pid);
+		if (resultObj == null)
+			throw new GoodsEvaluateException(1, "绗竴閮ㄥ垎淇℃伅缂哄け");
+		
+		if (EvaluateEnum.activity != resultObj.getType()) {
+			if (StringUtil.isNullOrEmpty(commentInfo.getCoupon())) {
+				throw new GoodsEvaluateException(1, "鍒搁潰棰濅笉鑳戒负绌�");
 			}
-		} else {
-			throw new GoodsEvaluateException(1, "璇峰~鍐欏埜鎴鏃堕棿");
+
+			if (StringUtil.isNullOrEmpty(commentInfo.getTagDesc())) {
+				throw new GoodsEvaluateException(1, "鎻忚堪璇笉鑳戒负绌�");
+			}
+
+			String tagUrl = commentInfo.getTagUrl();
+			String content = commentInfo.getContent();
+			if (StringUtil.isNullOrEmpty(tagUrl) && StringUtil.isNullOrEmpty(content)) {
+				throw new GoodsEvaluateException(1, "璇勮璇拰閾炬帴涓嶈兘鍚屾椂涓虹┖");
+			}
+
+			String endTime = commentInfo.getEndTime();
+			if (!StringUtil.isNullOrEmpty(endTime)) {
+				try {
+					SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+					sdf.parse(endTime);
+				} catch (Exception e) {
+					throw new GoodsEvaluateException(1, "璇峰~鍐欐纭殑鏃堕棿鏍煎紡锛�2020-03-05");
+				}
+			} else {
+				throw new GoodsEvaluateException(1, "璇峰~鍐欏埜鎴鏃堕棿");
+			}
 		}
 
 		if (commentInfo.getNeedSpin() == null) {
 			commentInfo.setNeedSpin(false);
 		}
 		
+		String content = commentInfo.getContent();
 		if (!StringUtil.isNullOrEmpty(content) && commentInfo.getNeedSpin()) {
 			try {
 				convertLinkManager.convertLinkFromText(content, Constant.LINK_TOKEN_VERIFY_UID, true);
@@ -972,9 +979,6 @@
 			}
 		}
 
-		GoodsEvaluate resultObj = goodsEvaluateDao.getById(pid);
-		if (resultObj == null)
-			throw new GoodsEvaluateException(1, "绗竴閮ㄥ垎淇℃伅缂哄け");
 
 		List<CommentInfo> comments = new ArrayList<>();
 		CommentInfo currencyCoupon = null;

--
Gitblit v1.8.0