From f276a5a1fc38e735499aa95089ff8105bd2ba196 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期五, 24 四月 2020 16:25:53 +0800
Subject: [PATCH] 状态切换

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 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 c78bd7d..4a3cdcb 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
@@ -111,6 +111,28 @@
 	@Resource
 	private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
 
+	
+	@Override
+	public void switchState(String id) throws GoodsEvaluateException {
+		if (id == null) {
+			throw new GoodsEvaluateException(1, "璇蜂紶閫掓纭弬鏁�");
+		}
+		
+		GoodsEvaluate resultObj = goodsEvaluateDao.getById(id);
+		if (resultObj == null) {
+			throw new GoodsEvaluateException(1, "姝ゅ唴瀹瑰凡涓嶅瓨鍦�");
+		}
+		
+		Integer state = resultObj.getState();
+		if (state == null || state == 0) {
+			state = 1;
+		} else {
+			state = 0;
+		}
+		goodsEvaluateDao.updateSatate(id, state);
+	}
+	
+	
 	@Override
 	public String saveHead(MultipartFile file, GoodsEvaluate record) throws GoodsEvaluateException {
 		Integer state = record.getState();

--
Gitblit v1.8.0