From 51c0049fb70c85bf515dc0fecd96bf13ca23aa28 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 24 四月 2020 18:37:35 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div --- fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassServiceImpl.java | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassServiceImpl.java index a70a564..beaacbc 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassServiceImpl.java @@ -81,6 +81,31 @@ @Override + public void switchState(Long id) throws BrandClassException { + if (id == null) { + throw new BrandClassException(1, "璇蜂紶閫掓纭弬鏁�"); + } + BrandClass resultObj = brandClassMapper.selectByPrimaryKey(id); + if (resultObj == null) { + throw new BrandClassException(1, "姝ゅ唴瀹瑰凡涓嶅瓨鍦�"); + } + + Integer state = resultObj.getState(); + if (state == null || state == 0) { + state = 1; + } else { + state = 0; + } + + BrandClass updateObj = new BrandClass(); + updateObj.setId(id); + updateObj.setState(state); + brandClassMapper.updateByPrimaryKeySelective(updateObj); + } + + + + @Override public void updateOrder(Long id, Integer moveType) throws BrandClassException, Exception{ if (moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) throw new BrandClassException(1, "浼犻�掔殑绫诲瀷涓嶆纭�"); @@ -140,4 +165,7 @@ } + + + } -- Gitblit v1.8.0