From 5af10f175689549ca44b74e9fc1c7ee0ec92c2d7 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期二, 21 四月 2020 14:26:38 +0800
Subject: [PATCH] 后台改造

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java
index 984f532..700b80d 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java
@@ -722,4 +722,29 @@
 			}
 		}
 	}
+	
+	@Override
+	public void switchState(Long id) throws SpecialException {
+		if (id == null) {
+			throw new SpecialException(1, "璇蜂紶閫掓纭弬鏁�");
+		}
+		
+		Special resultObj = specialMapper.selectByPrimaryKey(id);
+		if (resultObj == null) {
+			throw new SpecialException(1, "姝ゅ唴瀹瑰凡涓嶅瓨鍦�");
+		}
+		
+		Long state = resultObj.getState();
+		if (state == null || state == 0) {
+			state = 1L;
+		} else {
+			state = 0L;
+		}
+		
+		Special updateObj = new Special();
+		updateObj.setId(id);
+		updateObj.setState(state);
+		specialMapper.updateByPrimaryKeySelective(updateObj);
+	}
+	
 }

--
Gitblit v1.8.0