Merge remote-tracking branch 'origin/beetlsql3-dev' into beetlsql3-dev

beetlsql3-dev
wgf 2 years ago
commit d5b83ec2c7

@ -65,19 +65,32 @@ import static java.util.stream.Collectors.joining;
@Slf4j
public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<TeacherOpenCourseQuestionSetting> implements DeleteResourcesBy {
@Autowired private TeacherOpenCourseQuestionSettingDao teacherOpenCourseQuestionSettingDao;
@Autowired private ResourcesQuestionSnapshotDao resourcesQuestionSnapshotDao;
@Autowired private TeacherOpenCourseQuestionLogDao teacherOpenCourseQuestionLogDao;
@Autowired private QuestionLogSummaryDao questionLogSummaryDao;
@Autowired private StudentDao studentDao;
@Autowired private ResourcesQuestionSnapshotService resourcesQuestionSnapshotService;
@Autowired private TeacherOpenCourseQuestionLogService teacherOpenCourseQuestionLogService;
@Autowired private TeacherOpenCourseQuestionLogWrongService teacherOpenCourseQuestionLogWrongService;
@Autowired private ResourcesQuestionService resourcesQuestionService;
@Autowired private CourseInfoService courseInfoService;
@Autowired private TeacherOpenCourseMergeResourcesQuestionService teacherOpenCourseMergeResourcesQuestionService;
@Autowired private TeacherOpenCourseMergeCourseInfoService teacherOpenCourseMergeCourseInfoService;
@Autowired private QuestionSettingRedisDelayQueueImpl questionSettingRedisDelayQueue;
@Autowired
private TeacherOpenCourseQuestionSettingDao teacherOpenCourseQuestionSettingDao;
@Autowired
private ResourcesQuestionSnapshotDao resourcesQuestionSnapshotDao;
@Autowired
private TeacherOpenCourseQuestionLogDao teacherOpenCourseQuestionLogDao;
@Autowired
private QuestionLogSummaryDao questionLogSummaryDao;
@Autowired
private StudentDao studentDao;
@Autowired
private ResourcesQuestionSnapshotService resourcesQuestionSnapshotService;
@Autowired
private TeacherOpenCourseQuestionLogService teacherOpenCourseQuestionLogService;
@Autowired
private TeacherOpenCourseQuestionLogWrongService teacherOpenCourseQuestionLogWrongService;
@Autowired
private ResourcesQuestionService resourcesQuestionService;
@Autowired
private CourseInfoService courseInfoService;
@Autowired
private TeacherOpenCourseMergeResourcesQuestionService teacherOpenCourseMergeResourcesQuestionService;
@Autowired
private TeacherOpenCourseMergeCourseInfoService teacherOpenCourseMergeCourseInfoService;
@Autowired
private QuestionSettingRedisDelayQueueImpl questionSettingRedisDelayQueue;
@Autowired
private QuestionLogSummaryService questionLogSummaryService;
@ -129,7 +142,8 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
} catch (Exception e) {
try {
teacherOpenCourseQuestionSettingList.add(JSONObject.parseObject(teacherOpenCourseQuestionSettingQuery.getTeacherOpenCourseQuestionSettingJsonStr(), TeacherOpenCourseQuestionSetting.class));
} catch (Exception e1) {}
} catch (Exception e1) {
}
}
ToolUtils.deleteNullList(teacherOpenCourseQuestionSettingList);
if (null != teacherOpenCourseQuestionSettingList && teacherOpenCourseQuestionSettingList.size() > 0) {
@ -176,7 +190,7 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
/**
* ID +
*
*
* <p>
* ID
*
* @param teacherOpenCourseId
@ -199,7 +213,7 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
/**
* ID +
*
*
* <p>
* ID
*
* @param query
@ -250,6 +264,7 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
/**
*
*
* @param list
* @param student
*/
@ -344,7 +359,7 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
*
*
*
*
* <p>
*
*
*
@ -377,9 +392,10 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
/**
*
*
* <p>
*
*
*
* @param settingQuery
* @return
*/
@ -423,7 +439,9 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
}
});
if (ObjectUtil.isNotEmpty(map)) { settingDTOList = map.values(); }
if (ObjectUtil.isNotEmpty(map)) {
settingDTOList = map.values();
}
}
// 随机抽取题目的方式
@ -459,11 +477,12 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
/**
*
*
* <p>
*
*
*
*
*
* @param teacherOpenCourseId ID
* @param courseInfoIdWithQuestionSettingOptions KeyValueID
*/
@ -503,18 +522,20 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
settingQuery.setTeacherOpenCourseQuestionSettingName(courseInfo.getCourseInfoName());
addSettingByOpenCourse(settingQuery, courseInfoIdPair);
}
} catch (Exception e) { }
} catch (Exception e) {
}
});
}
/**
*
*
* <p>
*
*
*
*
*
* @param teacherOpenCourseId ID
* @param courseInfoIdWithQuestionSettingOptions KeyValueID
*/
@ -553,7 +574,8 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
settingQuery.setTeacherOpenCourseQuestionSettingName(courseInfo.getCourseInfoName());
addSettingBySystemCourse(settingQuery, courseInfoIdPair);
}
} catch (Exception e) { }
} catch (Exception e) {
}
});
}
@ -574,6 +596,7 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
/**
*
*
*
* @param teacherOpenCourseId
* @param teacherOpenCourseQuestionSettingName
*/
@ -713,6 +736,7 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
/**
* ID
*
* @param questionSettingId
* @return
*/
@ -728,6 +752,7 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
/**
* ID
*
*
* @param questionSettingId
* @return
*/
@ -1003,6 +1028,7 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
/**
*
*
* @param list
*/
public void fullQuestionSettingOptions(List<TeacherOpenCourseQuestionSetting> list) {

@ -1,10 +1,13 @@
package com.ibeetl.jlw.web;
import cn.hutool.core.util.StrUtil;
import cn.jlw.Interceptor.SCoreUser;
import cn.jlw.validate.ValidateConfig;
import com.ibeetl.admin.core.annotation.Function;
import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.file.FileService;
import com.ibeetl.admin.core.util.BeanCopyUtil;
import com.ibeetl.admin.core.util.PlatformException;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.jlw.entity.TeacherOpenCourseQuestionSetting;
import com.ibeetl.jlw.enums.GlobalPushStatusEnum;
@ -22,10 +25,16 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import static cn.jlw.util.CacheUserUtil.getStudent;
import static com.ibeetl.admin.core.util.ExcelUtil.convertData;
import static com.ibeetl.admin.core.util.ExcelUtil.write;
/**
* --
@ -40,9 +49,11 @@ public class TeacherOpenCourseQuestionSettingController{
private static final String API = "/api/teacherOpenCourseQuestionSetting";
@Autowired private TeacherOpenCourseQuestionSettingService teacherOpenCourseQuestionSettingService;
@Autowired
private TeacherOpenCourseQuestionSettingService teacherOpenCourseQuestionSettingService;
@Autowired FileService fileService;
@Autowired
FileService fileService;
/* 前端接口 */
@ -67,6 +78,86 @@ public class TeacherOpenCourseQuestionSettingController{
}
}
@GetMapping(API + "/exportPageList.do")
public void exportPageList(TeacherOpenCourseQuestionSettingQuery condition, HttpServletResponse response, @SCoreUser CoreUser coreUser) throws IOException {
if (null == coreUser) {
throw new PlatformException("请登录后再操作");
} else {
if (condition.getTeacherOpenCourseQuestionSettingType() == null) {
throw new PlatformException("参数错误");
}
if (coreUser.isStudent()) {
condition.setTeacherOpenCourseQuestionSettingPushStatus(GlobalPushStatusEnum.PUSH);
condition.setTeacherOpenCourseQuestionSettingStatus(1);
}
condition.setPage(1);
condition.setLimit(Long.MAX_VALUE);
PageQuery page = condition.getPageQuery();
teacherOpenCourseQuestionSettingService.queryByConditionQuery(page);
String baseName = "";
for (Object o : page.getList()) {
TeacherOpenCourseQuestionSetting setting = (TeacherOpenCourseQuestionSetting) o;
GlobalPushStatusEnum teacherOpenCourseQuestionSettingPushStatus = setting.getTeacherOpenCourseQuestionSettingPushStatus();
setting.set("teacherOpenCourseQuestionSettingPushStatusText",teacherOpenCourseQuestionSettingPushStatus.getText());
}
/** 构建表头 */
Map<String, String> header = new LinkedHashMap<>(11);
switch (condition.getTeacherOpenCourseQuestionSettingType()) {
case EXAM:
header.put("teacherOpenCourseQuestionSettingName", "考试名称");
header.put("teacherOpenCourseQuestionSettingSchoolClassNames", "考试班级");
header.put("teacherOpenCourseQuestionStartTime", "考试开始时间");
header.put("teacherOpenCourseQuestionEndTime", "考试结束时间");
header.put("avgSuccessCount", "平均答对数量");
header.put("avgErrorCount", "平均答错数量");
header.put("avgSuccessRate", "平均正确率");
header.put("avgScore", "平均得分");
header.put("teacherOpenCourseQuestionSettingPushStatusText", "状态");
baseName = "考试记录-导出";
break;
case HOMEWORK_QUESTION:
header.put("teacherOpenCourseQuestionSettingName", "题库作业名称");
header.put("teacherOpenCourseQuestionSettingSchoolClassNames", "考试班级");
header.put("teacherOpenCourseQuestionStartTime", "作业开始时间");
header.put("teacherOpenCourseQuestionEndTime", "作业结束时间");
header.put("avgPassRate", "及格率");
header.put("avgScore", "平均得分");
header.put("teacherOpenCourseQuestionSettingPushStatusText", "状态");
baseName = "题库作业-导出";
break;
case HOMEWORK_FILE:
header.put("teacherOpenCourseQuestionSettingName", "题库作业名称");
header.put("teacherOpenCourseQuestionSettingSchoolClassNames", "作业班级");
header.put("messageAddTime", "作业附件");
header.put("avgScore", "平均得分");
header.put("avgPassRate", "及格率");
header.put("teacherOpenCourseQuestionStartTime", "作业开始时间");
header.put("teacherOpenCourseQuestionEndTime", "作业结束时间");
header.put("teacherOpenCourseQuestionSettingPushStatusText", "状态");
baseName = "附件作业-导出";
break;
default:
throw new PlatformException("参数错误");
}
List<Map<String, Object>> maps = BeanCopyUtil.baseEntity2MapWithParallel(page.getList());
String filename = StrUtil.format("{} {}.xlsx", baseName, System.currentTimeMillis());
write(response, filename, "Sheet1", header.values(), convertData(header.keySet(), maps));
}
}
@GetMapping(API + "/getInfo.do")
public JsonResult<TeacherOpenCourseQuestionSetting> getInfo(TeacherOpenCourseQuestionSettingQuery param, @SCoreUser CoreUser coreUser) {
@ -95,6 +186,7 @@ public class TeacherOpenCourseQuestionSettingController{
/**
* -
*
* @param teacherOpenCourseQuestionSettingQuery
* @param result
* @param coreUser
@ -146,6 +238,7 @@ public class TeacherOpenCourseQuestionSettingController{
/**
*
*
* @param ids
* @param pushStatus
* @return
@ -158,6 +251,7 @@ public class TeacherOpenCourseQuestionSettingController{
/**
*
*
* @param teacherOpenCourseId ID
* @param questionSettingId ID
* @param questionSettingType
@ -170,6 +264,7 @@ public class TeacherOpenCourseQuestionSettingController{
/**
*
*
* @param teacherOpenCourseId ID
* @param questionSettingType
* @return
@ -181,6 +276,7 @@ public class TeacherOpenCourseQuestionSettingController{
/**
*
*
* @param ids
* @return
*/
@ -192,6 +288,7 @@ public class TeacherOpenCourseQuestionSettingController{
/**
*
*
* @param ids
* @return
*/
@ -310,6 +407,7 @@ public class TeacherOpenCourseQuestionSettingController{
/**
*
*
* @param ids
* @return
*/
@ -323,6 +421,7 @@ public class TeacherOpenCourseQuestionSettingController{
/**
*
*
* @param ids
* @return
*/
@ -336,6 +435,7 @@ public class TeacherOpenCourseQuestionSettingController{
/**
*
*
* @param ids
* @param pushStatus
* @return
@ -351,6 +451,7 @@ public class TeacherOpenCourseQuestionSettingController{
/**
*
*
* @param teacherOpenCourseId ID
* @param questionSettingId ID
* @param questionSettingType

Loading…
Cancel
Save