admin
2020-05-19 744594ef1a2f530fc3e86ea9dc48b62247f79420
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 @@
   }
   
   
}