admin
2020-07-14 eec7e789a87863c25d92c10ad5dfc22ad80c448d
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5HelpCenterController.java
@@ -7,6 +7,7 @@
import javax.annotation.Resource;
import com.yeshi.fanli.entity.SystemEnum;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.JsonUtil;
@@ -45,7 +46,6 @@
   /**
    * 查询帮助列表
    * @param callback
    * @param pageIndex
    * @param pageSize
    * @param key
    * @param out
@@ -53,6 +53,8 @@
   @RequestMapping(value = "query")
   public void query(String callback, AcceptData acceptData, Long pageId, Integer pageSize, String key, Long cid,
         PrintWriter out) {
      //其他APP无帮助中心列表
      acceptData.setSystem(SystemEnum.blks);
      try {
         if (pageSize == null)
            pageSize = Constant.PAGE_SIZE;
@@ -66,20 +68,22 @@
         if (pageId == null)
            pageId = 0L;
         List<HelpCenter> list1 = helpCenterService.listValid(pageId, pageSize, key, cid);
         List<HelpCenter> list1 = helpCenterService.listValid(pageId, pageSize, key, cid,acceptData.getSystem());
         List<HelpCenter> list = new ArrayList<>();
         if (list1 != null && list1.size() > 0)
            list.addAll(list1);
         if (list.size() == 0) {
            pageId = 0L;
         } else {
            pageId = list.get(list.size() - 1).getId();
            // 版本过滤
            int version = Integer.parseInt(acceptData.getVersion());
            String platform = acceptData.getPlatform().toLowerCase();
            List<AppVersionInfo> versionList = appVersionService.listByPlatformAndMinVersionCode(platform, version);
            List<AppVersionInfo> versionList = appVersionService.listByPlatformAndMinVersionCode(platform, version,acceptData.getSystem());
            if (versionList == null || versionList.size() <= 0) {
               list.clear();
            } else {
@@ -155,20 +159,22 @@
   @RequestMapping(value = "getClass")
   public void getClass(String callback, AcceptData acceptData, PrintWriter out) {
      try {
         List<HelpClass> list = helpClassService.getClassByState(1);
         if (list == null || list.size() == 0) {
            list = new ArrayList<>();
         List<HelpClass> resultList = new ArrayList<>();
         List<HelpClass> list = helpClassService.getClassByState(1,acceptData.getSystem());
         if (list != null && list.size() > 0) {
            resultList.addAll(list);
         }
         // 版本过滤
         int version = Integer.parseInt(acceptData.getVersion());
         String platform = acceptData.getPlatform().toLowerCase();
         List<AppVersionInfo> versionList = appVersionService.listByPlatformAndMinVersionCode(platform, version);
         List<AppVersionInfo> versionList = appVersionService.listByPlatformAndMinVersionCode(platform, version,acceptData.getSystem());
         if (versionList == null || versionList.size() <= 0) {
            list.clear();
            resultList.clear();
         } else {
            List<Long> sourceIdList = new ArrayList<>();
            for (HelpClass record : list) {
            for (HelpClass record : resultList) {
               sourceIdList.add(record.getId());
            }
            List<Long> versionIdList = new ArrayList<>();
@@ -180,12 +186,13 @@
            for (int i = 0; i < list.size(); i++) {
               if (!sets.contains(list.get(i).getId())) {
                  list.remove(i--);
               }
            }
         }
         JSONObject data = new JSONObject();
         data.put("class_list", JsonUtil.getApiCommonGson().toJson(list));
         data.put("class_list", JsonUtil.getApiCommonGson().toJson(resultList));
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
      } catch (Exception e) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));