| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void switchState(Long id) throws BanLiShopGoodsException {
|
| | | if (id == null) {
|
| | | throw new BanLiShopGoodsException(1, "请传递正确参数");
|
| | | }
|
| | | BanLiShopGoods resultObj = banLiShopGoodsMapper.selectByPrimaryKey(id);
|
| | | if (resultObj == null) {
|
| | | throw new BanLiShopGoodsException(1, "此内容已不存在");
|
| | | }
|
| | | |
| | | Integer state = resultObj.getState();
|
| | | if (state == null || state == 0) {
|
| | | state = 1;
|
| | | } else {
|
| | | state = 0;
|
| | | }
|
| | | |
| | | BanLiShopGoods updateObj = new BanLiShopGoods();
|
| | | updateObj.setId(id);
|
| | | updateObj.setState(state);
|
| | | banLiShopGoodsMapper.updateByPrimaryKeySelective(updateObj);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 上传图片
|
| | |
| | | deleteByPrimaryKey(id);
|
| | |
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | @Transactional
|
| | | @Override
|