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/FloatADServiceImpl.java | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java index 9b3b57f..7788f95 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java @@ -216,6 +216,31 @@ floatADMapper.updateByPrimaryKey(exchangeObject); } + + @Override + public void switchState(Long id) throws FloatADException { + if (id == null) { + throw new FloatADException(1, "璇蜂紶閫掓纭弬鏁�"); + } + FloatAD resultObj = floatADMapper.selectByPrimaryKey(id); + if (resultObj == null) { + throw new FloatADException(1, "姝ゅ唴瀹瑰凡涓嶅瓨鍦�"); + } + + Integer state = resultObj.getState(); + if (state == null || state == 0) { + state = 1; + } else { + state = 0; + } + + FloatAD updateObj = new FloatAD(); + updateObj.setId(id); + updateObj.setState(state); + floatADMapper.updateByPrimaryKeySelective(updateObj); + } + + @Override @Transactional(rollbackFor=Exception.class) public int deleteByPrimaryKeyList(List<Long> list) throws Exception{ -- Gitblit v1.8.0