admin
2020-11-28 dc5be7d38446f70e6ff86df311119c32b41fe7f8
fanli/src/main/java/com/yeshi/fanli/service/impl/help/HelpCenterServiceImpl.java
@@ -11,6 +11,7 @@
import javax.annotation.Resource;
import com.yeshi.fanli.entity.SystemEnum;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -21,8 +22,10 @@
import com.yeshi.fanli.entity.bus.help.HelpCenter;
import com.yeshi.fanli.entity.bus.help.HelpInfo;
import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType;
import com.yeshi.fanli.exception.config.HelpCenterException;
import com.yeshi.fanli.exception.homemodule.HomeNavbarException;
import com.yeshi.fanli.service.inter.help.HelpCenterService;
import com.yeshi.fanli.service.inter.homemodule.AdActivityVersionControlService;
import com.yeshi.fanli.util.FilePathEnum;
@@ -128,6 +131,32 @@
      mongoDBManager.saveHelpInfo(helpInfo);
      return html;
   }
   @Override
   public void switchState(Long id) throws HelpCenterException {
      if (id == null) {
         throw new HelpCenterException(1, "请传递正确参数");
      }
      HelpCenter resultObj = helpCenterMapper.selectByPrimaryKey(id);
      if (resultObj == null) {
         throw new HelpCenterException(1, "此内容已不存在");
      }
      Integer state = resultObj.getState();
      if (state == null || state == 0) {
         state = 1;
      } else {
         state = 0;
      }
      HelpCenter updateObj = new HelpCenter();
      updateObj.setId(id);
      updateObj.setState(state);
      helpCenterMapper.updateByPrimaryKeySelective(updateObj);
   }
   public List<Map<String, Object>> getPosition(String content) {
@@ -232,19 +261,19 @@
   }
   @Override
   public List<HelpCenter> query(int pageIndex, int pageSize, String key, Long cid, Integer orderMode, Integer state) {
      return helpCenterMapper.query(pageIndex, pageSize, key, cid, orderMode, state);
   public List<HelpCenter> query(int pageIndex, int pageSize, String key, Long cid, Integer orderMode, Integer state, SystemEnum system) {
      return helpCenterMapper.query(pageIndex, pageSize, key, cid, orderMode, state,system);
   }
   @Override
   public long countQuery(String key, Long cid, Integer state) {
      return helpCenterMapper.countQuery(key, cid, state);
   public long countQuery(String key, Long cid, Integer state, SystemEnum system) {
      return helpCenterMapper.countQuery(key, cid, state,system);
   }
   @Override
   @Cacheable(value = "helpCenterCache", key = "'queryIdAndTitle-'+#pageId+'-'+#key+'-'+#cid")
   public List<HelpCenter> listValid(long pageId, int pageSize, String key, Long cid) {
      return helpCenterMapper.listValid(pageId, pageSize, key, cid);
   @Cacheable(value = "helpCenterCache", key = "'queryIdAndTitle-'+#pageId+'-'+#key+'-'+#cid+'-'+#system")
   public List<HelpCenter> listValid(long pageId, int pageSize, String key, Long cid, SystemEnum system) {
      return helpCenterMapper.listValid(pageId, pageSize, key, cid,system);
   }
   @Override