讨论日志分析

beetlsql3-dev
Mlxa0324 2 years ago
parent 689517ec58
commit 685ec4c9e8

@ -1,6 +1,7 @@
package com.ibeetl.jlw.dao;
import com.ibeetl.jlw.entity.TeacherOpenCourseChatLog;
import com.ibeetl.jlw.entity.TeacherOpenCourseChatLogAnalysis;
import com.ibeetl.jlw.web.query.TeacherOpenCourseChatLogQuery;
import org.beetl.sql.core.engine.PageQuery;
import org.beetl.sql.mapper.BaseMapper;
@ -28,4 +29,11 @@ public interface TeacherOpenCourseChatLogDao extends BaseMapper<TeacherOpenCours
List<TeacherOpenCourseChatLog> getByIds(String ids);
List<TeacherOpenCourseChatLog> getValuesByQuery(TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery);
List<TeacherOpenCourseChatLog> getValuesByQueryNotWithPermission(TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery);
/**
* -
* @param teacherOpenCourseId
* @return
*/
TeacherOpenCourseChatLogAnalysis analysis(Long teacherOpenCourseId);
}

@ -0,0 +1,40 @@
package com.ibeetl.jlw.entity;
import com.ibeetl.admin.core.annotation.DictEnum;
import com.ibeetl.admin.core.entity.BaseEntity;
import com.ibeetl.jlw.enums.ChatLogSendTypeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* ---
* @author lx
*/
@Data
@EqualsAndHashCode(callSuper=false)
public class TeacherOpenCourseChatLogAnalysis extends BaseEntity {
/**
*
*/
@DictEnum
private ChatLogSendTypeEnum chatLogSendType;
/**
*
*/
private Integer typeCount;
/**
*
*/
private Integer peopleCount;
/**
*
*/
private BigDecimal avgScore;
}

@ -9,6 +9,7 @@ import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.admin.core.web.JsonReturnCode;
import com.ibeetl.jlw.dao.TeacherOpenCourseChatLogDao;
import com.ibeetl.jlw.entity.TeacherOpenCourseChatLog;
import com.ibeetl.jlw.entity.TeacherOpenCourseChatLogAnalysis;
import com.ibeetl.jlw.web.query.TeacherOpenCourseChatLogQuery;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -80,6 +81,7 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
if(null != teacherOpenCourseChatLogList && teacherOpenCourseChatLogList.size()>0){
for(int i=0;i<teacherOpenCourseChatLogList.size();i++){
TeacherOpenCourseChatLog teacherOpenCourseChatLog = teacherOpenCourseChatLogList.get(i);
teacherOpenCourseChatLog.setTeacherOpenCourseChatLogAddTime(new Date());
teacherOpenCourseChatLog.setUserId(teacherOpenCourseChatLogQuery.getUserId());
teacherOpenCourseChatLog.setOrgId(teacherOpenCourseChatLogQuery.getOrgId());
}
@ -160,4 +162,12 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
log.info("需要实现删除操作!");
}
/**
* -
* @param teacherOpenCourseId
* @return
*/
public TeacherOpenCourseChatLogAnalysis analysis(@NotNull(message = "开课ID不能为空") Long teacherOpenCourseId) {
return teacherOpenCourseChatLogDao.analysis(teacherOpenCourseId);
}
}

@ -347,5 +347,14 @@ public class TeacherOpenCourseChatLogController{
return JsonResult.success(page);
}
/**
* --
* @param teacherOpenCourseId
* @return
*/
@PostMapping(MODEL + "/analysis.json")
@Function("teacherOpenCourseChatLog.query")
public JsonResult analysis(Long teacherOpenCourseId) {
return JsonResult.success(teacherOpenCourseChatLogService.analysis(teacherOpenCourseId));
}
}

@ -1,5 +1,6 @@
package com.ibeetl.jlw.web.query;
import cn.hutool.core.util.EnumUtil;
import cn.jlw.validate.ValidateConfig;
import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.web.query.PageParam;
@ -181,7 +182,8 @@ public class TeacherOpenCourseChatLogQuery extends PageParam {
pojo.setTeacherOpenCourseChatLogStatus(this.getTeacherOpenCourseChatLogStatus());
pojo.setTeacherOpenCourseChatLogAddTime(this.getTeacherOpenCourseChatLogAddTime());
try {
pojo.setChatLogSendType(ChatLogSendTypeEnum.valueOf(this.getChatLogSendType().split(",")[0]));
pojo.setChatLogSendType(
EnumUtil.likeValueOf(ChatLogSendTypeEnum.class, this.getChatLogSendType().split(",")[0]));
}catch (Exception e) {
pojo.setChatLogSendType(ChatLogSendTypeEnum.normal);
}

@ -554,4 +554,21 @@ getValuesByQueryNotWithPermission
@}
analysis
===
* 互动类型分析
SELECT
t.chat_log_send_type,
count( 1 ) AS type_count,
count( 1 ) AS people_count,
round(
avg(
ifnull( student_score, 0 ))) AS avg_score
FROM
teacher_open_course_chat_log t
where 1=1
and t.teacher_open_course_chat_log_status = 1
and t.teacher_open_course_id = #teacherOpenCourseId#
GROUP BY
t.chat_log_send_type

Loading…
Cancel
Save