zoukankan      html  css  js  c++  java
  • 查询课程列表(过滤出可以试听的)

    public List<VCmCheckTrainCourseDef> getVctcdList(Pagination page){
      List<CmCheckTrainCourseDef> cctcList = (List<CmCheckTrainCourseDef>) page.getList();
      List<CmCheckCourseExperience> expList = courseExpService.getAll();
      List<VCmCheckTrainCourseDef> vcctcdList = new ArrayList<VCmCheckTrainCourseDef>();
      Set<CmCheckTrainCourseInfo> set = null;
      int flag = 0;
      int j = 0;
      for (CmCheckTrainCourseDef cctcd : cctcList) {
        flag = 0;
        set = cctcd.getCmCheckTrainCourseInfos();
        for (CmCheckTrainCourseInfo courseInfo : set) {
          if (flag == 1) {
            break;
          }
          j=j+1;
          System.out.println(j);
          for (int i=0;i<expList.size();i++) {
            VCmCheckTrainCourseDef vcctcd = null;
            if (courseInfo.getCtciId() == expList.get(i).getCmCheckTrainCourseInfo().getCtciId()) {
              flag = 1;
              j=0;
              vcctcd = new VCmCheckTrainCourseDef(cctcd, true);
              vcctcdList.add(vcctcd);
              break;
            }else {
              if (flag == 0 && j==set.size() && i==expList.size()-1) {
              j=0;
              flag=1;
              vcctcd = new VCmCheckTrainCourseDef(cctcd, false);
              vcctcdList.add(vcctcd);
            }
          }
        }
      }
    }
      return vcctcdList;
    }

    提示:

      1.碰到可试听的课程直接退出循环,遍历下一个课程

      2.如果最后一个课程,还是没有可试听的,就处理为不可试听

  • 相关阅读:
    web前端性能意义、关注重点、测试方案、优化技巧
    前端性能优化和规范
    高性能网站性能优化与系统架构(ZT)
    【转载】12306铁道部订票网站性能分析
    构架高性能WEB网站的几点知识
    减少图片HTTP 请求的方案
    网站性能优化:动态缩略图技术实现思路
    不错的jquery插件
    jQuery 遍历
    JavaScript slice() 方法
  • 原文地址:https://www.cnblogs.com/luoxiaolei/p/5132552.html
Copyright © 2011-2022 走看看