From 6543afb9698fcdd89fdffba5f71b3df97c7b0833 Mon Sep 17 00:00:00 2001
From: admin <2780501319@qq.com>
Date: 星期日, 23 二月 2020 12:23:53 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java |   11 +++++++----
 1 files changed, 7 insertions(+), 4 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 cf9a789..8d7ffaa 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
@@ -76,7 +76,7 @@
 	private PinDuoDuoCacheUtil pinDuoDuoCacheUtil;
 
 	@Override
-	public void saveHead(MultipartFile file, GoodsEvaluate record) throws GoodsEvaluateException {
+	public String saveHead(MultipartFile file, GoodsEvaluate record) throws GoodsEvaluateException {
 		Integer state = record.getState();
 		if (state == null) {
 			state = 0;
@@ -119,13 +119,15 @@
 			record.setStartTime(new Date());
 		record.setPublishTime(record.getStartTime());
 
-		if (StringUtil.isNullOrEmpty(record.getId())) {
-			record.setId(UUID.randomUUID().toString().replace("-", ""));
+		String id = record.getId();
+		if (StringUtil.isNullOrEmpty(id)) {
+			id = UUID.randomUUID().toString().replace("-", "");
+			record.setId(id);
 			record.setShareNumReal(0);
 			record.setCreateTime(new Date());
 			goodsEvaluateDao.save(record);
 		} else {
-			GoodsEvaluate resultObj = goodsEvaluateDao.getById(record.getId());
+			GoodsEvaluate resultObj = goodsEvaluateDao.getById(id);
 			if (resultObj == null)
 				throw new GoodsEvaluateException(1, "淇敼鍐呭宸蹭笉瀛樺湪");
 
@@ -137,6 +139,7 @@
 			resultObj.setTitle(tilte);
 			goodsEvaluateDao.save(resultObj);
 		}
+		return id;
 	}
 
 	/**

--
Gitblit v1.8.0