| | |
| | | import com.qxueyou.scc.school.model.SchHandoutReCourse; |
| | | |
| | | /** |
| | | * 科目类别管理controller |
| | | * 科目类别管理controller |
| | | * |
| | | * @author 德虎 |
| | | * @history 2014-11-25 新建 夏德虎 |
| | | * @author 德虎 |
| | | * @history 2014-11-25 新建 夏德虎 |
| | | * |
| | | */ |
| | | @Controller |
| | |
| | | ISysBusinessCacheService sysBusinessCacheService ;*/ |
| | | |
| | | /** |
| | | * APP2.0: 课程超市 选课 获取所有分类 <br> |
| | | * APP2.0: 课程超市 选课 获取所有分类 <br> |
| | | * URL /org/courcecategory/courseCatNew<br> |
| | | * |
| | | * @method GET |
| | | * @return 返回值JSON串:<br> |
| | | * @return 返回值JSON串:<br> |
| | | * |
| | | * <pre> |
| | | * [{"index":1,"code":"1CKJR","categoryName":"财会金融","categoryId":"18","imgPath":"/web/res/img/app/coursemarket_ico_accounting.png"}, |
| | | * [{"index":1,"code":"1CKJR","categoryName":"财会金融","categoryId":"18","imgPath":"/web/res/img/app/coursemarket_ico_accounting.png"}, |
| | | * ...... |
| | | * {"index":8,"code":"9QB","categoryName":"全部","categoryId":"26","imgPath":"/web/res/img/app/coursemarket_ico_classify.png"}] |
| | | * {"index":8,"code":"9QB","categoryName":"全部","categoryId":"26","imgPath":"/web/res/img/app/coursemarket_ico_classify.png"}] |
| | | * </pre> |
| | | * |
| | | * 字段值说明: |
| | | * 字段值说明: |
| | | * |
| | | * <pre> |
| | | * index:索引 |
| | | * code:编码 |
| | | * categoryName:名字 |
| | | * index:索引 |
| | | * code:编码 |
| | | * categoryName:名字 |
| | | * categoryId:id |
| | | * imgPath:logo URL |
| | | * </pre> |
| | |
| | | page.setPageNum(1); |
| | | page.setPageSize(Integer.MAX_VALUE); |
| | | |
| | | // 1. 查询该机构下所有的科目 |
| | | // 1. 查询该机构下所有的科目 |
| | | String hql = "select c from OrgCourseCategory c where c.deleteFlag is false and c.categoryLevel = ? order by c.code asc "; |
| | | |
| | | List<OrgCourseCategory> lstLastCategory = commonDAO.findList(hql, page, CollectionUtils.newList(OrgCourseCategory.CATEGORY_LEVEL_FIRST), OrgCourseCategory.class); |
| | |
| | | } |
| | | |
| | | /** |
| | | * APP2.0: 课程超市 所有查询条件 <br> |
| | | * APP2.0: 课程超市 所有查询条件 <br> |
| | | * URL /org/courcecategory/courseCatContitionNew<br> |
| | | * |
| | | * 返回值JSON串:<br> |
| | | * 返回值JSON串:<br> |
| | | * |
| | | * <pre> |
| | | * { |
| | | * "course":[ |
| | | * {"code":"0QB","children":[],"index":1,"categoryName":"全部","categoryId":"26","parentId":null}, |
| | | * {"code":"1CKJR","children":[],"index":2,"categoryName":"财会金融","categoryId":"18","parentId":null}, |
| | | * {"code":"2YYKS","children":[],"index":3,"categoryName":"语言考试","categoryId":"19","parentId":null}, |
| | | * {"code":"3YYL","children":[],"index":4,"categoryName":"医药类","categoryId":"20","parentId":null}, |
| | | * {"code":"4JGL","children":[],"index":5,"categoryName":"建工类","categoryId":"21","parentId":null}, |
| | | * {"code":"5ZYKZ","children":null,"index":6,"categoryName":"职业考证","categoryId":"22","parentId":null}, |
| | | * {"code":"0QB","children":[],"index":1,"categoryName":"全部","categoryId":"26","parentId":null}, |
| | | * {"code":"1CKJR","children":[],"index":2,"categoryName":"财会金融","categoryId":"18","parentId":null}, |
| | | * {"code":"2YYKS","children":[],"index":3,"categoryName":"语言考试","categoryId":"19","parentId":null}, |
| | | * {"code":"3YYL","children":[],"index":4,"categoryName":"医药类","categoryId":"20","parentId":null}, |
| | | * {"code":"4JGL","children":[],"index":5,"categoryName":"建工类","categoryId":"21","parentId":null}, |
| | | * {"code":"5ZYKZ","children":null,"index":6,"categoryName":"职业考证","categoryId":"22","parentId":null}, |
| | | * {"code":"6XLJY","children":[ |
| | | * {"code":null,"index":1,"categoryName":"经济学","categoryId":"5","parentId":"23"}, |
| | | * {"code":null,"index":2,"categoryName":"法学","categoryId":"6","parentId":"23"} |
| | | * ],"index":7,"categoryName":"学历教育","categoryId":"23","parentId":null}, |
| | | * {"code":"7ITJN","children":[],"index":8,"categoryName":"IT技能","categoryId":"24","parentId":null}, |
| | | * {"code":"8QT","children":[],"index":9,"categoryName":"其他","categoryId":"25","parentId":null} |
| | | * {"code":null,"index":1,"categoryName":"经济学","categoryId":"5","parentId":"23"}, |
| | | * {"code":null,"index":2,"categoryName":"法学","categoryId":"6","parentId":"23"} |
| | | * ],"index":7,"categoryName":"学历教育","categoryId":"23","parentId":null}, |
| | | * {"code":"7ITJN","children":[],"index":8,"categoryName":"IT技能","categoryId":"24","parentId":null}, |
| | | * {"code":"8QT","children":[],"index":9,"categoryName":"其他","categoryId":"25","parentId":null} |
| | | * ], |
| | | * "city":[{"name":"深圳","index":1,"code":"sz"},{"name":"广州","index":2,"code":"gz"}], |
| | | * "sort":[{"name":"价格由低到高","index":1,"code":"PRICE_ASC"},{"name":"价格由高到低","index":2,"code":"PRICE_DESC"}] |
| | | * "city":[{"name":"深圳","index":1,"code":"sz"},{"name":"广州","index":2,"code":"gz"}], |
| | | * "sort":[{"name":"价格由低到高","index":1,"code":"PRICE_ASC"},{"name":"价格由高到低","index":2,"code":"PRICE_DESC"}] |
| | | * } |
| | | * |
| | | * <pre> |
| | |
| | | } |
| | | |
| | | /** |
| | | * APP2.0: 该机构下所有课程的分类和科目 URL: /org/courcecategory/courseCategoryNew |
| | | * APP2.0: 该机构下所有课程的分类和科目 URL: /org/courcecategory/courseCategoryNew |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | @RequestMapping(value = "courseCategoryNew", method = RequestMethod.GET) |
| | | public @ResponseBody List<OrgCourseCategory> getCourseCategoryData() { |
| | | |
| | | // 1. 查询该机构下所有的科目 |
| | | // 1. 查询该机构下所有的科目 |
| | | String hql = "select courseId,name,price,imgPath,courseCategoryId " + " from OrgCourse c where c.deleteFlag is false"; |
| | | |
| | | // 2. 查询该机构下所有的科目对应的类别 |
| | | // 2. 查询该机构下所有的科目对应的类别 |
| | | String hql_type = "select distinct c.category.categoryId,c.category.categoryName from OrgCourse c where " + " c.deleteFlag is false order by c.createTime "; |
| | | |
| | | List<Object> args = new ArrayList<Object>(1); |
| | | // 如果是游客班 查所有机构 1:表示游客班 |
| | | // 如果是游客班 查所有机构 1:表示游客班 |
| | | // if (!orgClassService.isCurrentVistorClass()) { |
| | | // hql = hql.concat(" and c.org.organizationId=?"); |
| | | // hql_type = "select distinct c.category.categoryId,c.category.categoryName from OrgCourse c where " + " c.org.organizationId=? and c.deleteFlag is false order by c.createTime "; |
| | | // args = CollectionUtils.newList(ClientUtils.getOrgId()); |
| | | // } |
| | | |
| | | // 1. 查询该机构下所有的科目 |
| | | // 1. 查询该机构下所有的科目 |
| | | List<OrgCollegeCourse> lstCourse = categoryService.queryOrgCourseListNew(hql, args); |
| | | |
| | | // 2. 查询该机构下所有的科目对应的类别 |
| | | // 2. 查询该机构下所有的科目对应的类别 |
| | | List<OrgCourseCategory> lstCategory = categoryService.queryOrgCourseCategoryList(hql_type, args); |
| | | |
| | | // 组装结构 |
| | | // 组装结构 |
| | | List<OrgCollegeCourse> newLstCourse = null; |
| | | for (OrgCourseCategory category : lstCategory) { |
| | | newLstCourse = new ArrayList<OrgCollegeCourse>(); |
| | |
| | | } |
| | | category.setCourseList(newLstCourse); |
| | | } |
| | | // 不限制值 |
| | | // 不限制值 |
| | | String not_limit = Constants.NOT_LIMIT_VALUE; |
| | | // 重新组装类型 添加不限 |
| | | // 重新组装类型 添加不限 |
| | | List<OrgCourseCategory> lstLastCategory = new ArrayList<OrgCourseCategory>(); |
| | | // 添加第一个不限 |
| | | // 添加第一个不限 |
| | | OrgCourseCategory category = new OrgCourseCategory(); |
| | | category.setCategoryId(not_limit); |
| | | category.setCategoryName("不限"); |
| | | category.setCategoryName("不限"); |
| | | |
| | | List<OrgCollegeCourse> lstLastCourse = new ArrayList<OrgCollegeCourse>(); |
| | | OrgCollegeCourse course = new OrgCollegeCourse(); |
| | | course.setCourseId(not_limit); |
| | | course.setName("不限"); |
| | | course.setName("不限"); |
| | | |
| | | lstLastCategory.add(category); |
| | | lstLastCategory.addAll(lstCategory); |
| | |
| | | for (OrgCourseCategory cate : lstLastCategory) { |
| | | lstLastCourse = new ArrayList<OrgCollegeCourse>(); |
| | | lstLastCourse.add(course); |
| | | if (not_limit.equals(cate.getCategoryId())) {// 不限 |
| | | if (not_limit.equals(cate.getCategoryId())) {// 不限 |
| | | lstLastCourse.addAll(lstCourse); |
| | | } else { |
| | | lstLastCourse.addAll(cate.getCourseList()); |
| | |
| | | return lstLastCategory; |
| | | } |
| | | |
| | | /******************************************************************* 上面为App接口,下面为后台接口 **************************/ |
| | | /******************************************************************* 上面为App接口,下面为后台接口 **************************/ |
| | | |
| | | /** |
| | | * 科目类别列表 |
| | | * 科目类别列表 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据科目ID查询科目 |
| | | * 根据科目ID查询科目 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * 新增 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * 删除 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 更新 |
| | | * 更新 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 新增类别层级 |
| | | * 新增类别层级 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | return result; |
| | | } |
| | | |
| | | return new Result(false,"参数错误"); |
| | | return new Result(false,"参数错误"); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 类别层级数据 |
| | | * 类别层级数据 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | if(null == orgCollegeCourse){ |
| | | continue; |
| | | } |
| | | //去除掉不content内容 |
| | | //去除掉不content内容 |
| | | orgCollegeCourse.setContent(""); |
| | | |
| | | if(null == map.get(orgCollegeCourse.getCourseCategoryId())){ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 视频类别层级数据 |
| | | * 视频类别层级数据 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 讲义类别层级数据 |
| | | * 讲义类别层级数据 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 练习类别层级数据 |
| | | * 练习类别层级数据 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 讲义类别层级数据 |
| | | * 讲义类别层级数据 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询视频讲义练习在各个科目下的数量 |
| | | * @param type 1:视频 2:讲义 3:练习 |
| | | * 查询视频讲义练习在各个科目下的数量 |
| | | * @param type 1:视频 2:讲义 3:练习 |
| | | * @return |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | |
| | | } |
| | | |
| | | /** |
| | | * ztree层级数据 |
| | | * ztree层级数据 |
| | | * |
| | | * @return |
| | | *//* |
| | |
| | | } |
| | | |
| | | *//** |
| | | * ztree层级数据 |
| | | * ztree层级数据 |
| | | * |
| | | * @return |
| | | *//* |
| | |
| | | }*/ |
| | | |
| | | /** |
| | | * 查询 |
| | | * 查询 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询专业信息 |
| | | * 查询专业信息 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取机构名字 |
| | | * 获取机构名字 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除科目 |
| | | * 删除科目 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除专业 |
| | | * 删除专业 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 3初始化科目 |
| | | * 3初始化科目 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | |
| | | i++; |
| | | } |
| | | return new Result(true,"总共有"+lstCourse.size()+",初始化了"+i+"条"); |
| | | return new Result(true,"总共有"+lstCourse.size()+",初始化了"+i+"条"); |
| | | } |
| | | |
| | | /** |
| | | * 2先初始化课件数据,再初始化上面的科目 |
| | | * 2先初始化课件数据,再初始化上面的科目 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/initCourseWare", method = RequestMethod.POST) |
| | | public @ResponseBody Result initCourseWare() { |
| | | |
| | | //视频 |
| | | //视频 |
| | | int i = 0; |
| | | String hql = " from MediaVideoReCourse where deleteFlag is false"; |
| | | List<MediaVideoReCourse> videos = commonDAO.find(hql, MediaVideoReCourse.class); |
| | |
| | | commonService.save(course); |
| | | i++; |
| | | } |
| | | //讲义 |
| | | //讲义 |
| | | int y = 0; |
| | | hql = " from SchHandoutReCourse where deleteFlag is false"; |
| | | List<SchHandoutReCourse> handouts = commonDAO.find(hql, SchHandoutReCourse.class); |
| | |
| | | commonService.save(course); |
| | | y++; |
| | | } |
| | | //练习 |
| | | //练习 |
| | | int z = 0; |
| | | hql = " from ExerciseReCourse where deleteFlag is false"; |
| | | List<ExerciseReCourse> exers = commonDAO.find(hql, ExerciseReCourse.class); |
| | |
| | | commonService.save(course); |
| | | z++; |
| | | } |
| | | return new Result(true,"视频总共"+videos.size()+"个,成功了"+i+"个"+"讲义总共"+handouts.size()+"个,成功了"+y+"个"+"练习总共"+exers.size()+"个,成功了"+z+"个"); |
| | | return new Result(true,"视频总共"+videos.size()+"个,成功了"+i+"个"+"讲义总共"+handouts.size()+"个,成功了"+y+"个"+"练习总共"+exers.size()+"个,成功了"+z+"个"); |
| | | } |
| | | |
| | | /** |
| | | * 1初始化班级 机构ID |
| | | * 1初始化班级 机构ID |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | commonService.save(orgClass); |
| | | i++; |
| | | } |
| | | return new Result(true,"班级总共"+ocs.size()+",成功了"+i+"个"); |
| | | return new Result(true,"班级总共"+ocs.size()+",成功了"+i+"个"); |
| | | } |
| | | |
| | | /** |
| | | * 初始化levelCode |
| | | * 初始化levelCode |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | @SuppressWarnings("unused") |
| | | private String generateLevelCode(String name) { |
| | | |
| | | // 转拼音 |
| | | //使用微软自带中文输入法用鼠标翻页,选择第一页之后的数据时,会生成(li'zhi.dr)这种账号 |
| | | // 转拼音 |
| | | //使用微软自带中文输入法用鼠标翻页,选择第一页之后的数据时,会生成(li'zhi.dr)这种账号 |
| | | String[] arrUnidecode = WordProcessUtils.toPinyin(name.replace(" ",""), " ").replaceAll("'", "").split(" "); |
| | | |
| | | String orgCode = ""; |