From 98b1a0affd69bbe63223c21fdd2c404e8bedfccb Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 20 五月 2020 17:25:08 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/div' into 2.1.2 --- fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java | 27 +++++++++++++++++++++++++++ 1 files changed, 27 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 7df4f67..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 @@ -68,6 +68,8 @@ record.setParams(null); } else if (!StringUtil.isJson(params)) { throw new FloatADException(1, "璺宠浆鍙傛暟闈濲SON鏍煎紡"); + } else { + record.setParams(params.trim()); } FloatADTypeEnum typeEnum = record.getTypeEnum(); @@ -214,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