|
|
|
@ -1,8 +1,10 @@
|
|
|
|
|
package com.ibeetl.jlw.web;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.jlw.Interceptor.SCoreUser;
|
|
|
|
|
import cn.jlw.Interceptor.TStudent;
|
|
|
|
|
import cn.jlw.Interceptor.TTeacher;
|
|
|
|
@ -11,6 +13,7 @@ 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.service.CoreUserService;
|
|
|
|
|
import com.ibeetl.admin.core.util.BeanCopyUtil;
|
|
|
|
|
import com.ibeetl.admin.core.web.JsonResult;
|
|
|
|
|
import com.ibeetl.jlw.entity.Student;
|
|
|
|
|
import com.ibeetl.jlw.entity.Teacher;
|
|
|
|
@ -19,6 +22,7 @@ import com.ibeetl.jlw.entity.dto.TeacherOpenCourseChatLogStudentDTO;
|
|
|
|
|
import com.ibeetl.jlw.entity.dto.TeacherOpenCourseChatLogTeacherDTO;
|
|
|
|
|
import com.ibeetl.jlw.service.TeacherOpenCourseChatLogService;
|
|
|
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseChatLogQuery;
|
|
|
|
|
import lombok.SneakyThrows;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.commons.logging.Log;
|
|
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
|
@ -31,9 +35,14 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import static com.ibeetl.admin.core.util.ExcelUtil.convertData;
|
|
|
|
|
import static com.ibeetl.admin.core.util.ExcelUtil.write;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 开课互动 课程开课-互动-评论日志 接口
|
|
|
|
|
* 切记不要对非线程安全的静态变量进行写操作
|
|
|
|
@ -41,7 +50,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
|
@Validated
|
|
|
|
|
public class TeacherOpenCourseChatLogController{
|
|
|
|
|
public class TeacherOpenCourseChatLogController extends BaseController {
|
|
|
|
|
|
|
|
|
|
private final Log log = LogFactory.getLog(this.getClass());
|
|
|
|
|
private static final String MODEL = "/jlw/teacherOpenCourseChatLog";
|
|
|
|
@ -424,4 +433,34 @@ public class TeacherOpenCourseChatLogController{
|
|
|
|
|
public JsonResult analysis(Long teacherOpenCourseId) {
|
|
|
|
|
return JsonResult.success(teacherOpenCourseChatLogService.analysis(teacherOpenCourseId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 学校管理员端-讨论日志-分析 互动存档
|
|
|
|
|
* @param teacherOpenCourseId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@SneakyThrows
|
|
|
|
|
@PostMapping(MODEL + "/export.json")
|
|
|
|
|
public void export(TeacherOpenCourseChatLogQuery condition,@SCoreUser CoreUser coreUser) {
|
|
|
|
|
|
|
|
|
|
/** 构建表头 */
|
|
|
|
|
Map<String, String> header = new LinkedHashMap<>(11);
|
|
|
|
|
header.put("teacherOpenCourseChatLogAddTime", "提问时间");
|
|
|
|
|
header.put("studentIdText", "提问学生");
|
|
|
|
|
header.put("chatLogSendTypeText", "提问方式");
|
|
|
|
|
header.put("schoolClassIdsText", "所属班级");
|
|
|
|
|
header.put("chatContent", "提问内容");
|
|
|
|
|
header.put("universitiesCollegesContactsEmail", "学生回答");
|
|
|
|
|
header.put("addTime", "添加时间");
|
|
|
|
|
|
|
|
|
|
PageQuery pageQuery = condition.getPageQuery();
|
|
|
|
|
pageQuery.setPageNumber(1);
|
|
|
|
|
pageQuery.setPageSize(Integer.MAX_VALUE);
|
|
|
|
|
PageQuery<TeacherOpenCourseChatLog> data = teacherOpenCourseChatLogService.queryByConditionQuery(pageQuery);
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> maps = BeanCopyUtil.baseEntity2MapWithParallel(data.getList());
|
|
|
|
|
|
|
|
|
|
String filename = StrUtil.format("讨论列表导出-{}.xlsx", DateUtil.now());
|
|
|
|
|
write(response, filename,"Sheet1", header.values(), convertData(header.keySet(), maps));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|