增加一个节点的全路径字段

beetlsql3-dev
Mlxa0324 2 years ago
parent 86da796cbf
commit 18705f2c1f

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -556,3 +556,4 @@ create table notice_read
alter table notice_read comment '通知公告等-已读时间记录';
ALTER TABLE teacher_open_course_chat_log ADD COLUMN chat_log_full_id varchar(2000) COMMENT '互动日志全路径ID';

@ -4,6 +4,8 @@ import com.ibeetl.jlw.entity.TeacherOpenCourseChatLog;
import com.ibeetl.jlw.entity.TeacherOpenCourseChatLogAnalysis;
import com.ibeetl.jlw.entity.TeacherOpenCourseChatLogTree;
import com.ibeetl.jlw.entity.dto.ChatLogUnReadNumDTO;
import com.ibeetl.jlw.entity.dto.TeacherOpenCourseChatLogAnalysisDTO;
import com.ibeetl.jlw.entity.vo.TeacherOpenCourseChatLogAnalysisVO;
import com.ibeetl.jlw.entity.vo.TeacherOpenCourseChatLogGroupInfoVO;
import com.ibeetl.jlw.web.query.TeacherOpenCourseChatLogQuery;
import org.beetl.sql.core.engine.PageQuery;
@ -54,4 +56,10 @@ public interface TeacherOpenCourseChatLogDao extends BaseMapper<TeacherOpenCours
* @return
*/
int getUnReadNum(ChatLogUnReadNumDTO dto);
/**
*
* @return
*/
TeacherOpenCourseChatLogAnalysisVO chatLogAnalysis(TeacherOpenCourseChatLogAnalysisDTO dto);
}

@ -36,6 +36,10 @@ public class TeacherOpenCourseChatLog extends BaseEntity{
private Long teacherOpenCourseChatLogParentId;
// 互动日志全路径ID
private String chatLogFullId;
//课程开课ID
@Dict(type="teacher_open_course.teacher_open_course_title.teacher_open_course_status=1")

@ -0,0 +1,21 @@
package com.ibeetl.jlw.entity.dto;
import lombok.Data;
/**
* : <br>
*
*
* @author: mlx
* @description:
* @date: 2023/1/20 0:18
* @version: 1.0
*/
@Data
public class TeacherOpenCourseChatLogAnalysisDTO {
/**
* ID
*/
private Long teacherOpenCourseId;
}

@ -0,0 +1,32 @@
package com.ibeetl.jlw.entity.vo;
import com.ibeetl.admin.core.entity.BaseEntity;
import lombok.Data;
/**
* : <br>
*
*
* @author: mlx
* @description:
* @date: 2023/1/20 0:18
* @version: 1.0
*/
@Data
public class TeacherOpenCourseChatLogAnalysisVO extends BaseEntity {
/**
*
*/
private String chatLogCount;
/**
*
*/
private String studentSendCount;
/**
*
*/
private String teacherSendCount;
}

@ -6,6 +6,7 @@ import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.jlw.Interceptor.GetFile;
import cn.jlw.util.ToolUtils;
import com.beust.jcommander.internal.Maps;
@ -131,13 +132,22 @@ public class CourseInfoService extends CoreBaseService<CourseInfo>{
* @return
*/
public String getCourseInfoFullId(CourseInfo courseInfo) {
if (courseInfo == null) {
return "";
}
Long courseInfoId = courseInfo.getCourseInfoId();
Long courseInfoParentId = courseInfo.getCourseInfoParentId();
if (courseInfoParentId != null && !courseInfoParentId.equals(courseInfoId)) {
CourseInfo parentCi = getById(courseInfoParentId);
CourseInfo parent = getById(courseInfoParentId);
String leftId = getCourseInfoFullId(parent);
return getCourseInfoFullId(parentCi) + "_" + courseInfoId;
String leftText = "";
if (StrUtil.isNotBlank(leftId)) {
leftText = leftId + "_";
}
return leftText + courseInfoId;
}
return courseInfoId.toString();

@ -2,6 +2,7 @@ package com.ibeetl.jlw.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.validation.BeanValidationResult;
import cn.hutool.extra.validation.ValidationUtil;
import cn.hutool.json.JSONUtil;
@ -18,6 +19,8 @@ import com.ibeetl.jlw.dao.TeacherDao;
import com.ibeetl.jlw.dao.TeacherOpenCourseChatLogDao;
import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.entity.dto.ChatLogUnReadNumDTO;
import com.ibeetl.jlw.entity.dto.TeacherOpenCourseChatLogAnalysisDTO;
import com.ibeetl.jlw.entity.vo.TeacherOpenCourseChatLogAnalysisVO;
import com.ibeetl.jlw.entity.vo.TeacherOpenCourseChatLogGroupInfoVO;
import com.ibeetl.jlw.web.query.TeacherOpenCourseChatLogQuery;
import lombok.extern.slf4j.Slf4j;
@ -120,15 +123,53 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
public JsonResult add(TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery){
String msg = "";
TeacherOpenCourseChatLog teacherOpenCourseChatLog = teacherOpenCourseChatLogQuery.pojo();
teacherOpenCourseChatLogDao.insert(teacherOpenCourseChatLog);
teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogId(teacherOpenCourseChatLog.getTeacherOpenCourseChatLogId());
Long chatLogId = teacherOpenCourseChatLog.getTeacherOpenCourseChatLogId();
// 设置全路径日志ID
TeacherOpenCourseChatLog updateEntity = new TeacherOpenCourseChatLog();
updateEntity.setTeacherOpenCourseChatLogId(chatLogId);
updateEntity.setChatLogFullId(getChatLogFullId(teacherOpenCourseChatLog));
teacherOpenCourseChatLogDao.updateTemplateById(updateEntity);
teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogId(chatLogId);
JsonResult jsonResult = new JsonResult();
jsonResult.setData(teacherOpenCourseChatLog.getTeacherOpenCourseChatLogId());//自增的ID丢进去
jsonResult.setData(chatLogId);//自增的ID丢进去
jsonResult.setCode(JsonReturnCode.SUCCESS.getCode());
jsonResult.setMsg(msg);
return jsonResult;
}
/**
* ID
* @param chatLog
* @return
*/
public String getChatLogFullId(TeacherOpenCourseChatLog chatLog) {
if (chatLog == null) {
return "";
}
Long id = chatLog.getTeacherOpenCourseChatLogId();
Long pId = chatLog.getTeacherOpenCourseChatLogParentId();
if (pId != null && !pId.equals(id)) {
TeacherOpenCourseChatLog parent = getInfo(pId);
String leftId = getChatLogFullId(parent);
String leftText = "";
if (StrUtil.isNotBlank(leftId)) {
leftText = leftId + "_";
}
return leftText + id;
}
return id.toString();
}
/**
* -
*
@ -262,4 +303,17 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
return teacherOpenCourseChatLogDao.getUnReadNum(dto);
}
/**
* : <br>
*
*
* @param dto
* @return {@link TeacherOpenCourseChatLogAnalysisVO}
* @Author: lx
* @Date: 2023/1/20 0:35
*/
public TeacherOpenCourseChatLogAnalysisVO chatLogAnalysis(TeacherOpenCourseChatLogAnalysisDTO dto) {
return teacherOpenCourseChatLogDao.chatLogAnalysis(dto);
}
}

@ -19,6 +19,14 @@ import static com.ibeetl.jlw.enums.ChatLogSendTypeEnum.normal;
*/
public class TeacherOpenCourseChatLogQuery extends PageParam {
public String getChatLogFullId() {
return chatLogFullId;
}
public void setChatLogFullId(String chatLogFullId) {
this.chatLogFullId = chatLogFullId;
}
/**
*
*/
@ -35,6 +43,10 @@ public class TeacherOpenCourseChatLogQuery extends PageParam {
@Min(value = 1L, message = "学生互动上级ID最小支持1L", groups = { STUDENT_ADD.class })
@Query(name = "上级ID", display = false)
private Long teacherOpenCourseChatLogParentId;
// 互动日志全路径ID
@Query(name = "互动日志全路径ID", display = false)
private String chatLogFullId;
@NotNull(message = "课程开课ID不能为空", groups ={ ValidateConfig.ADD.class, TEACHER_ADD.class, STUDENT_ADD.class })
@Query(name = "课程开课ID", display = false,type=Query.TYPE_DICT,dict="teacher_open_course.teacher_open_course_title.teacher_open_course_status=1")
private Long teacherOpenCourseId;

@ -85,6 +85,9 @@ queryByCondition
@if(!isEmpty(userId)){
and t.user_id =#userId#
@}
@if(!isEmpty(chatLogFullId)){
and t.chat_log_full_id like #"%"+chatLogFullId+"%"#
@}
@if(!isEmpty(userIdPlural)){
and find_in_set(t.user_id,#userIdPlural#)
@}
@ -194,6 +197,9 @@ queryByConditionQuery
@if(!isEmpty(userId)){
and t.user_id =#userId#
@}
@if(!isEmpty(chatLogFullId)){
and t.chat_log_full_id like #"%"+chatLogFullId+"%"#
@}
@if(!isEmpty(userIdPlural)){
and find_in_set(t.user_id,#userIdPlural#)
@}
@ -389,6 +395,9 @@ getTeacherOpenCourseChatLogValues
@if(!isEmpty(userId)){
and t.user_id =#userId#
@}
@if(!isEmpty(chatLogFullId)){
and t.chat_log_full_id like #"%"+chatLogFullId+"%"#
@}
getValuesByQuery
@ -471,6 +480,9 @@ getValuesByQuery
@if(!isEmpty(userIdPlural)){
and find_in_set(t.user_id,#userIdPlural#)
@}
@if(!isEmpty(chatLogFullId)){
and t.chat_log_full_id like #"%"+chatLogFullId+"%"#
@}
getValuesByQueryNotWithPermission
===
@ -552,6 +564,9 @@ getValuesByQueryNotWithPermission
@if(!isEmpty(userIdPlural)){
and find_in_set(t.user_id,#userIdPlural#)
@}
@if(!isEmpty(chatLogFullId)){
and t.chat_log_full_id like #"%"+chatLogFullId+"%"#
@}
analysis
@ -625,3 +640,21 @@ getUnReadNum
@}
AND ta.teacher_open_course_chat_log_parent_id = teacher_open_course_chat_log_id
)
chatLogAnalysis
===
* 互动日志统计
SELECT
COUNT( 1 ) AS chat_log_count,
SUM( chat_log_send_type = 'student_ask' ) AS student_send_count,
SUM(
FIND_IN_SET( chat_log_send_type, 'specify_ask,random_ask' )) AS teacher_send_count
FROM
teacher_open_course_chat_log t
WHERE
1
@if(isNotEmpty(teacherOpenCourseId)) {
AND t.teacher_open_id = #teacherOpenCourseId#
@}
AND t.teacher_open_course_chat_log_status = 1
Loading…
Cancel
Save