From 744594ef1a2f530fc3e86ea9dc48b62247f79420 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 19 五月 2020 17:13:23 +0800
Subject: [PATCH] 饿了么绘图,添加口碑

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java
index c957007..8cc434f 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java
@@ -314,6 +314,30 @@
 	}
 
 	@Override
+	public void switchState(Long id) throws GoodsClassException {
+		if (id == null) {
+			throw new GoodsClassException(1, "璇蜂紶閫掓纭弬鏁�");
+		}
+		GoodsClass resultObj = goodsClassMapper.selectByPrimaryKey(id);
+		if (resultObj == null) {
+			throw new GoodsClassException(1, "姝ゅ唴瀹瑰凡涓嶅瓨鍦�");
+		}
+		
+		Integer state = resultObj.getState();
+		if (state == null || state == 0) {
+			state = 1;
+		} else {
+			state = 0;
+		}
+		
+		GoodsClass updateObj = new GoodsClass();
+		updateObj.setId(id);
+		updateObj.setState(state);
+		goodsClassMapper.updateByPrimaryKeySelective(updateObj);
+	}
+	
+	
+	@Override
 	@Cacheable(value = "classCache", key = "'getEffectiveClassCache'")
 	public List<GoodsClass> getEffectiveClassCache() {
 		return goodsClassMapper.getEffectiveClass();

--
Gitblit v1.8.0