|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.ibeetl.jlw.web;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.jlw.Interceptor.GetFile;
|
|
|
|
|
import cn.jlw.Interceptor.RFile;
|
|
|
|
@ -22,6 +23,7 @@ import com.ibeetl.jlw.enums.MatchTypeEnum;
|
|
|
|
|
import com.ibeetl.jlw.enums.QuestionBusinessTypeEnum;
|
|
|
|
|
import com.ibeetl.jlw.service.CourseInfoService;
|
|
|
|
|
import com.ibeetl.jlw.service.ResourcesQuestionService;
|
|
|
|
|
import com.ibeetl.jlw.service.TeacherOpenCourseMergeResourcesQuestionService;
|
|
|
|
|
import com.ibeetl.jlw.service.UniversitiesCollegesJurisdictionCurriculumResourcesService;
|
|
|
|
|
import com.ibeetl.jlw.web.query.CourseInfoQuery;
|
|
|
|
|
import com.ibeetl.jlw.web.query.ResourcesQuestionQuery;
|
|
|
|
@ -68,13 +70,19 @@ public class ResourcesQuestionController{
|
|
|
|
|
private static final String API = "/api/resourcesQuestion";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired private ResourcesQuestionService resourcesQuestionService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ResourcesQuestionService resourcesQuestionService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
FileService fileService;
|
|
|
|
|
|
|
|
|
|
@Autowired private CourseInfoService courseInfoService;
|
|
|
|
|
@Autowired private UniversitiesCollegesJurisdictionCurriculumResourcesService universitiesCollegesJurisdictionCurriculumResourcesService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private CourseInfoService courseInfoService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private UniversitiesCollegesJurisdictionCurriculumResourcesService universitiesCollegesJurisdictionCurriculumResourcesService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private TeacherOpenCourseMergeResourcesQuestionService teacherOpenCourseMergeResourcesQuestionService;
|
|
|
|
|
|
|
|
|
|
/* 前端接口 */
|
|
|
|
|
|
|
|
|
@ -194,7 +202,11 @@ public class ResourcesQuestionController{
|
|
|
|
|
// 如果为空字符串,那么代表这个学校,还没有授权的课程,所以是不会显示任何东西的。
|
|
|
|
|
condition.setCourseInfoIds(StrUtil.blankToDefault(ids, "未授权应用"));
|
|
|
|
|
}
|
|
|
|
|
if (coreUser.isAdmin()) {
|
|
|
|
|
resourcesQuestionService.getTestItemManageSystemOAndUniversities(page);
|
|
|
|
|
} else {
|
|
|
|
|
resourcesQuestionService.queryByCondition(page);
|
|
|
|
|
}
|
|
|
|
|
return JsonResult.success(page);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -245,8 +257,7 @@ public class ResourcesQuestionController{
|
|
|
|
|
|
|
|
|
|
if (coreUser.isAdmin()) {
|
|
|
|
|
resourcesQuestion.setAddType(AddTypeEnum.ADMIN_ADD);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
resourcesQuestion.setAddType(AddTypeEnum.FACULTY_ADD);
|
|
|
|
|
}
|
|
|
|
|
resourcesQuestion.setOrgId(coreUser.getOrgId());
|
|
|
|
@ -268,6 +279,13 @@ public class ResourcesQuestionController{
|
|
|
|
|
public JsonResult<String> putOnShelves(@Validated(ValidateConfig.UPDATE.class) ResourcesQuestion resourcesQuestion, BindingResult result) {
|
|
|
|
|
if (result.hasErrors()) {
|
|
|
|
|
return JsonResult.failMessage(result);
|
|
|
|
|
} else {
|
|
|
|
|
if (ObjectUtil.equals(resourcesQuestion.getSourceType(), 1)) {
|
|
|
|
|
if (ObjectUtil.isEmpty(resourcesQuestion.getResourcesQuestionId())) {
|
|
|
|
|
return JsonResult.failMessage("更新失败");
|
|
|
|
|
}
|
|
|
|
|
teacherOpenCourseMergeResourcesQuestionService.batchEditUpDownStatus(resourcesQuestion.getResourcesQuestionId().toString(), resourcesQuestion.getQuestionStatus());
|
|
|
|
|
return JsonResult.success();
|
|
|
|
|
} else {
|
|
|
|
|
boolean success = resourcesQuestionService.edit(resourcesQuestion);
|
|
|
|
|
if (success) {
|
|
|
|
@ -276,6 +294,8 @@ public class ResourcesQuestionController{
|
|
|
|
|
return JsonResult.failMessage("更新失败");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -362,6 +382,7 @@ public class ResourcesQuestionController{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 验证是否有操作该数据的权限
|
|
|
|
|
*
|
|
|
|
|
* @param resourcesQuestion
|
|
|
|
|
* @param coreUser
|
|
|
|
|
*/
|
|
|
|
@ -569,6 +590,7 @@ public class ResourcesQuestionController{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置有效性
|
|
|
|
|
*
|
|
|
|
|
* @param offset 主影响单元格所在列,即此单元格由哪个单元格影响联动
|
|
|
|
|
* @param sheet
|
|
|
|
|
* @param rowNum 行数
|
|
|
|
@ -600,11 +622,11 @@ public class ResourcesQuestionController{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 计算formula
|
|
|
|
|
*
|
|
|
|
|
* @param offset 偏移量,如果给0,表示从A列开始,1,就是从B列
|
|
|
|
|
* @param rowId 第几行
|
|
|
|
|
* @param colCount 一共多少列
|
|
|
|
|
* @return 如果给入参 1,1,10. 表示从B1-K1。最终返回 $B$1:$K$1
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
public static String getRange(int offset, int rowId, int colCount) {
|
|
|
|
|
char start = (char) ('A' + offset);
|
|
|
|
@ -695,6 +717,7 @@ public class ResourcesQuestionController{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询题目类型下的题目数量
|
|
|
|
|
*
|
|
|
|
|
* @param courseInfoQuery 课程信息
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
@ -742,6 +765,7 @@ public class ResourcesQuestionController{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 教师端-题目配置页-题目设置-获取题目类型
|
|
|
|
|
*
|
|
|
|
|
* @param courseInfoQuery 题目信息
|
|
|
|
|
* @param coreUser
|
|
|
|
|
* @return
|
|
|
|
@ -755,6 +779,7 @@ public class ResourcesQuestionController{
|
|
|
|
|
/**
|
|
|
|
|
* 教师端-题目配置页-题目设置-获取题目类型
|
|
|
|
|
* 此接口只获取理论课程类的题目类型和数量
|
|
|
|
|
*
|
|
|
|
|
* @param courseInfoQuery 课程信息查询
|
|
|
|
|
* @param courseLabelTypePlural 课程分类标签 考证课程类 等等
|
|
|
|
|
* @param seeAdminAndSelf 除了超管,其他身份需要传true
|
|
|
|
|