admin
2020-05-19 744594ef1a2f530fc3e86ea9dc48b62247f79420
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsServiceImpl.java
@@ -186,6 +186,31 @@
      }
   }
   
   @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);
   }
   /**
    * 上传图片
@@ -236,6 +261,9 @@
            deleteByPrimaryKey(id);
   }
   @Transactional
   @Override