|
|
@ -1,6 +1,7 @@
|
|
|
|
package com.ibeetl.jlw.service;
|
|
|
|
package com.ibeetl.jlw.service;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
@ -38,6 +39,8 @@ import javax.validation.constraints.NotNull;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
|
|
|
|
import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
|
|
|
|
|
|
|
|
|
|
|
@ -49,9 +52,10 @@ import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
|
|
|
|
@Service
|
|
|
|
@Service
|
|
|
|
@Transactional
|
|
|
|
@Transactional
|
|
|
|
@Slf4j
|
|
|
|
@Slf4j
|
|
|
|
public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpenCourseChatLog> implements DeleteResourcesBy{
|
|
|
|
public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpenCourseChatLog> implements DeleteResourcesBy {
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired private TeacherOpenCourseChatLogDao teacherOpenCourseChatLogDao;
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private TeacherOpenCourseChatLogDao teacherOpenCourseChatLogDao;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private TeacherDao teacherDao;
|
|
|
|
private TeacherDao teacherDao;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
@ -59,8 +63,8 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private WebPlatformService webPlatformService;
|
|
|
|
private WebPlatformService webPlatformService;
|
|
|
|
|
|
|
|
|
|
|
|
public PageQuery<TeacherOpenCourseChatLog>queryByCondition(PageQuery query){
|
|
|
|
public PageQuery<TeacherOpenCourseChatLog> queryByCondition(PageQuery query) {
|
|
|
|
PageQuery<TeacherOpenCourseChatLog> ret = teacherOpenCourseChatLogDao.queryByCondition(query);
|
|
|
|
PageQuery<TeacherOpenCourseChatLog> ret = teacherOpenCourseChatLogDao.queryByCondition(query);
|
|
|
|
CollectionUtil.emptyIfNull(ret.getList()).forEach(item -> {
|
|
|
|
CollectionUtil.emptyIfNull(ret.getList()).forEach(item -> {
|
|
|
|
String headImg = webPlatformService.getHeadImgByIdentity(item.getUserId());
|
|
|
|
String headImg = webPlatformService.getHeadImgByIdentity(item.getUserId());
|
|
|
|
item.set("headImg", headImg);
|
|
|
|
item.set("headImg", headImg);
|
|
|
@ -68,8 +72,9 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
|
|
|
|
queryListAfter(ret.getList());
|
|
|
|
queryListAfter(ret.getList());
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public PageQuery<TeacherOpenCourseChatLogTree> queryByCondition(PageQuery query, Boolean placeholder){
|
|
|
|
|
|
|
|
PageQuery<TeacherOpenCourseChatLogTree> ret = teacherOpenCourseChatLogDao.queryByCondition2(query);
|
|
|
|
public PageQuery<TeacherOpenCourseChatLogTree> queryByCondition(PageQuery query, Boolean placeholder) {
|
|
|
|
|
|
|
|
PageQuery<TeacherOpenCourseChatLogTree> ret = teacherOpenCourseChatLogDao.queryByCondition2(query);
|
|
|
|
CollectionUtil.emptyIfNull(ret.getList()).forEach(item -> {
|
|
|
|
CollectionUtil.emptyIfNull(ret.getList()).forEach(item -> {
|
|
|
|
String headImg = webPlatformService.getHeadImgByIdentity(item.getUserId());
|
|
|
|
String headImg = webPlatformService.getHeadImgByIdentity(item.getUserId());
|
|
|
|
item.set("headImg", headImg);
|
|
|
|
item.set("headImg", headImg);
|
|
|
@ -78,8 +83,8 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public PageQuery<TeacherOpenCourseChatLog>queryByConditionQuery(PageQuery query){
|
|
|
|
public PageQuery<TeacherOpenCourseChatLog> queryByConditionQuery(PageQuery query) {
|
|
|
|
PageQuery<TeacherOpenCourseChatLog> ret = teacherOpenCourseChatLogDao.queryByConditionQuery(query);
|
|
|
|
PageQuery<TeacherOpenCourseChatLog> ret = teacherOpenCourseChatLogDao.queryByConditionQuery(query);
|
|
|
|
CollectionUtil.emptyIfNull(ret.getList()).forEach(item -> {
|
|
|
|
CollectionUtil.emptyIfNull(ret.getList()).forEach(item -> {
|
|
|
|
String headImg = webPlatformService.getHeadImgByIdentity(item.getUserId());
|
|
|
|
String headImg = webPlatformService.getHeadImgByIdentity(item.getUserId());
|
|
|
|
item.set("headImg", headImg);
|
|
|
|
item.set("headImg", headImg);
|
|
|
@ -88,18 +93,106 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void deleteByList(List list){
|
|
|
|
public PageQuery<TeacherOpenCourseChatLog> queryByConditionQueryWithChangStatus(TeacherOpenCourseChatLogQuery query) {
|
|
|
|
|
|
|
|
PageQuery<TeacherOpenCourseChatLog> ret = teacherOpenCourseChatLogDao.queryByConditionQuery(query.getPageQuery());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(ret.getList())) {
|
|
|
|
|
|
|
|
CoreUser user = getUser();
|
|
|
|
|
|
|
|
Object bean = null;
|
|
|
|
|
|
|
|
// 学生或者教师身份才能看到真正的数字
|
|
|
|
|
|
|
|
if (user != null && user.isTeacher()) {
|
|
|
|
|
|
|
|
Teacher teacher = teacherDao.getByUserId(user.getId());
|
|
|
|
|
|
|
|
if (teacher != null) {
|
|
|
|
|
|
|
|
bean = teacher;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (user != null && user.isStudent()) {
|
|
|
|
|
|
|
|
Student student = studentDao.getByUserId(user.getId());
|
|
|
|
|
|
|
|
if (student != null) {
|
|
|
|
|
|
|
|
bean = student;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//remark /api/teacherOpenCourseChatLog/setScore.do 也有标记已读的逻辑
|
|
|
|
|
|
|
|
if (bean != null) {
|
|
|
|
|
|
|
|
switch (query.getChatLogSendType()==null?ChatLogSendTypeEnum.normal:query.getChatLogSendType()) {
|
|
|
|
|
|
|
|
case normal:
|
|
|
|
|
|
|
|
if (query.getTeacherOpenCourseChatLogParentId()!=null){
|
|
|
|
|
|
|
|
if (bean instanceof Student){
|
|
|
|
|
|
|
|
List<Long> idList = ret.getList().stream().filter(e->Objects.equals(e.getStudentReadStatus(),0)).map(TeacherOpenCourseChatLog::getTeacherOpenCourseChatLogId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
readChatLogByIds(idList,1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case student_ask:
|
|
|
|
|
|
|
|
if (bean instanceof Teacher) {
|
|
|
|
|
|
|
|
List<Long> idList = ret.getList().stream().filter(e->Objects.equals(e.getTeacherReadStatus(),0)).map(TeacherOpenCourseChatLog::getTeacherOpenCourseChatLogId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
readChatLogByIds(idList,2);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case specify_ask:
|
|
|
|
|
|
|
|
case random_ask:
|
|
|
|
|
|
|
|
//if (bean instanceof Student) {
|
|
|
|
|
|
|
|
// List<Long> idList = ret.getList().stream().filter(e->Objects.equals(e.getStudentReadStatus(),0)).map(TeacherOpenCourseChatLog::getTeacherOpenCourseChatLogId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
// readChatLogByIds(idList,1);
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CollectionUtil.emptyIfNull(ret.getList()).forEach(item -> {
|
|
|
|
|
|
|
|
String headImg = webPlatformService.getHeadImgByIdentity(item.getUserId());
|
|
|
|
|
|
|
|
item.set("headImg", headImg);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
queryListAfter(ret.getList());
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 标记消息为已读
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param ids id
|
|
|
|
|
|
|
|
* @param type 类型 1学生 2教师
|
|
|
|
|
|
|
|
* @author zhouzhao
|
|
|
|
|
|
|
|
* @date 2023/05/09 10:38:44
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public void readChatLogByIds(List<Long> ids,int type) {
|
|
|
|
|
|
|
|
if (CollUtil.isEmpty(ids)) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (Long id : ids) {
|
|
|
|
|
|
|
|
TeacherOpenCourseChatLog teacherOpenCourseChatLog = teacherOpenCourseChatLogDao.unique(id);
|
|
|
|
|
|
|
|
if (teacherOpenCourseChatLog != null) {
|
|
|
|
|
|
|
|
if (type==1) {
|
|
|
|
|
|
|
|
teacherOpenCourseChatLog.setStudentReadStatus(1);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
teacherOpenCourseChatLog.setTeacherReadStatus(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
teacherOpenCourseChatLog.setTeacherReadStatus(1);
|
|
|
|
|
|
|
|
teacherOpenCourseChatLogDao.updateById(teacherOpenCourseChatLog);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void deleteByList(List list) {
|
|
|
|
String ids = "";
|
|
|
|
String ids = "";
|
|
|
|
ToolUtils.deleteNullList(list);
|
|
|
|
ToolUtils.deleteNullList(list);
|
|
|
|
for(int i=0;null != list && i<list.size();i++){
|
|
|
|
for (int i = 0; null != list && i < list.size(); i++) {
|
|
|
|
ids += list.get(i).toString()+(i==list.size()-1?"":",");
|
|
|
|
ids += list.get(i).toString() + (i == list.size() - 1 ? "" : ",");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(StringUtils.isNotBlank(ids)){
|
|
|
|
if (StringUtils.isNotBlank(ids)) {
|
|
|
|
teacherOpenCourseChatLogDao.deleteByIds(ids);
|
|
|
|
teacherOpenCourseChatLogDao.deleteByIds(ids);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void deleteTeacherOpenCourseChatLog(String ids){
|
|
|
|
public void deleteTeacherOpenCourseChatLog(String ids) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
teacherOpenCourseChatLogDao.deleteTeacherOpenCourseChatLogByIds(ids);
|
|
|
|
teacherOpenCourseChatLogDao.deleteTeacherOpenCourseChatLogByIds(ids);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
@ -107,7 +200,7 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String addAll(TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery){
|
|
|
|
public String addAll(TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery) {
|
|
|
|
String msg = "";
|
|
|
|
String msg = "";
|
|
|
|
List<TeacherOpenCourseChatLog> teacherOpenCourseChatLogList = new ArrayList<>();
|
|
|
|
List<TeacherOpenCourseChatLog> teacherOpenCourseChatLogList = new ArrayList<>();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -115,11 +208,12 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
teacherOpenCourseChatLogList.add(JSONObject.parseObject(teacherOpenCourseChatLogQuery.getTeacherOpenCourseChatLogJsonStr(), TeacherOpenCourseChatLog.class));
|
|
|
|
teacherOpenCourseChatLogList.add(JSONObject.parseObject(teacherOpenCourseChatLogQuery.getTeacherOpenCourseChatLogJsonStr(), TeacherOpenCourseChatLog.class));
|
|
|
|
} catch (Exception e1) {}
|
|
|
|
} catch (Exception e1) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ToolUtils.deleteNullList(teacherOpenCourseChatLogList);
|
|
|
|
ToolUtils.deleteNullList(teacherOpenCourseChatLogList);
|
|
|
|
if(null != teacherOpenCourseChatLogList && teacherOpenCourseChatLogList.size()>0){
|
|
|
|
if (null != teacherOpenCourseChatLogList && teacherOpenCourseChatLogList.size() > 0) {
|
|
|
|
for(int i=0;i<teacherOpenCourseChatLogList.size();i++){
|
|
|
|
for (int i = 0; i < teacherOpenCourseChatLogList.size(); i++) {
|
|
|
|
TeacherOpenCourseChatLog teacherOpenCourseChatLog = teacherOpenCourseChatLogList.get(i);
|
|
|
|
TeacherOpenCourseChatLog teacherOpenCourseChatLog = teacherOpenCourseChatLogList.get(i);
|
|
|
|
teacherOpenCourseChatLog.setTeacherOpenCourseChatLogAddTime(new Date());
|
|
|
|
teacherOpenCourseChatLog.setTeacherOpenCourseChatLogAddTime(new Date());
|
|
|
|
teacherOpenCourseChatLog.setUserId(teacherOpenCourseChatLogQuery.getUserId());
|
|
|
|
teacherOpenCourseChatLog.setUserId(teacherOpenCourseChatLogQuery.getUserId());
|
|
|
@ -130,7 +224,7 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
|
|
|
|
return msg;
|
|
|
|
return msg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public JsonResult add(TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery){
|
|
|
|
public JsonResult add(TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery) {
|
|
|
|
String msg = "";
|
|
|
|
String msg = "";
|
|
|
|
TeacherOpenCourseChatLog teacherOpenCourseChatLog = teacherOpenCourseChatLogQuery.pojo();
|
|
|
|
TeacherOpenCourseChatLog teacherOpenCourseChatLog = teacherOpenCourseChatLogQuery.pojo();
|
|
|
|
|
|
|
|
|
|
|
@ -165,6 +259,7 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取全路径的ID
|
|
|
|
* 获取全路径的ID
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param chatLog
|
|
|
|
* @param chatLog
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -207,60 +302,60 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
|
|
|
|
Assert.isTrue(validationResult.isSuccess(), JSONUtil.toJsonStr(validationResult.getErrorMessages()));
|
|
|
|
Assert.isTrue(validationResult.isSuccess(), JSONUtil.toJsonStr(validationResult.getErrorMessages()));
|
|
|
|
|
|
|
|
|
|
|
|
// 教师身份,添加上级ID为0
|
|
|
|
// 教师身份,添加上级ID为0
|
|
|
|
if(isTeacherAdding) {
|
|
|
|
if (isTeacherAdding) {
|
|
|
|
teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogParentId(0L);
|
|
|
|
teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogParentId(0L);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(null == teacherOpenCourseChatLogQuery.getTeacherOpenCourseChatLogStatus()){
|
|
|
|
if (null == teacherOpenCourseChatLogQuery.getTeacherOpenCourseChatLogStatus()) {
|
|
|
|
teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogStatus(1);
|
|
|
|
teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogStatus(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return add(teacherOpenCourseChatLogQuery);
|
|
|
|
return add(teacherOpenCourseChatLogQuery);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String edit(TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery){
|
|
|
|
public String edit(TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery) {
|
|
|
|
String msg = "";
|
|
|
|
String msg = "";
|
|
|
|
teacherOpenCourseChatLogDao.updateTemplateById(BeanUtil.copyProperties(teacherOpenCourseChatLogQuery, TeacherOpenCourseChatLog.class));
|
|
|
|
teacherOpenCourseChatLogDao.updateTemplateById(BeanUtil.copyProperties(teacherOpenCourseChatLogQuery, TeacherOpenCourseChatLog.class));
|
|
|
|
return msg;
|
|
|
|
return msg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String updateGivenByIds(TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery){
|
|
|
|
public String updateGivenByIds(TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery) {
|
|
|
|
String msg = "";
|
|
|
|
String msg = "";
|
|
|
|
if(StringUtils.isNotBlank(teacherOpenCourseChatLogQuery.get_given())){
|
|
|
|
if (StringUtils.isNotBlank(teacherOpenCourseChatLogQuery.get_given())) {
|
|
|
|
boolean flag = teacherOpenCourseChatLogDao.updateGivenByIds(teacherOpenCourseChatLogQuery) > 0;
|
|
|
|
boolean flag = teacherOpenCourseChatLogDao.updateGivenByIds(teacherOpenCourseChatLogQuery) > 0;
|
|
|
|
if(!flag){
|
|
|
|
if (!flag) {
|
|
|
|
msg = "更新指定参数失败";
|
|
|
|
msg = "更新指定参数失败";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
msg = "指定参数为空";
|
|
|
|
msg = "指定参数为空";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
return msg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public List<TeacherOpenCourseChatLog> getValues (Object paras){
|
|
|
|
public List<TeacherOpenCourseChatLog> getValues(Object paras) {
|
|
|
|
return sqlManager.select(SqlId.of("jlw.teacherOpenCourseChatLog.getTeacherOpenCourseChatLogValues"), TeacherOpenCourseChatLog.class, paras);
|
|
|
|
return sqlManager.select(SqlId.of("jlw.teacherOpenCourseChatLog.getTeacherOpenCourseChatLogValues"), TeacherOpenCourseChatLog.class, paras);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public List<TeacherOpenCourseChatLog> getValuesByQuery (TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery){
|
|
|
|
public List<TeacherOpenCourseChatLog> getValuesByQuery(TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery) {
|
|
|
|
return teacherOpenCourseChatLogDao.getValuesByQuery(teacherOpenCourseChatLogQuery);
|
|
|
|
return teacherOpenCourseChatLogDao.getValuesByQuery(teacherOpenCourseChatLogQuery);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public TeacherOpenCourseChatLog getInfo (Long teacherOpenCourseChatLogId){
|
|
|
|
public TeacherOpenCourseChatLog getInfo(Long teacherOpenCourseChatLogId) {
|
|
|
|
TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery = new TeacherOpenCourseChatLogQuery();
|
|
|
|
TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery = new TeacherOpenCourseChatLogQuery();
|
|
|
|
teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogId(teacherOpenCourseChatLogId);
|
|
|
|
teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogId(teacherOpenCourseChatLogId);
|
|
|
|
teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogStatusPlural("1,2");//需要根据实际情况来
|
|
|
|
teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogStatusPlural("1,2");//需要根据实际情况来
|
|
|
|
List<TeacherOpenCourseChatLog> list = teacherOpenCourseChatLogDao.getValuesByQuery(teacherOpenCourseChatLogQuery);
|
|
|
|
List<TeacherOpenCourseChatLog> list = teacherOpenCourseChatLogDao.getValuesByQuery(teacherOpenCourseChatLogQuery);
|
|
|
|
if(null != list && list.size()>0){
|
|
|
|
if (null != list && list.size() > 0) {
|
|
|
|
return list.get(0);
|
|
|
|
return list.get(0);
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public TeacherOpenCourseChatLog getInfo (TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery){
|
|
|
|
public TeacherOpenCourseChatLog getInfo(TeacherOpenCourseChatLogQuery teacherOpenCourseChatLogQuery) {
|
|
|
|
List<TeacherOpenCourseChatLog> list = teacherOpenCourseChatLogDao.getValuesByQuery(teacherOpenCourseChatLogQuery);
|
|
|
|
List<TeacherOpenCourseChatLog> list = teacherOpenCourseChatLogDao.getValuesByQuery(teacherOpenCourseChatLogQuery);
|
|
|
|
if(null != list && list.size()>0){
|
|
|
|
if (null != list && list.size() > 0) {
|
|
|
|
return list.get(0);
|
|
|
|
return list.get(0);
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -279,7 +374,7 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
|
|
|
|
* 功能描述: <br>
|
|
|
|
* 功能描述: <br>
|
|
|
|
* 讨论日志-分析
|
|
|
|
* 讨论日志-分析
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param teacherOpenCourseId 开课ID
|
|
|
|
* @param teacherOpenCourseId 开课ID
|
|
|
|
* @return {@link TeacherOpenCourseChatLogAnalysis}
|
|
|
|
* @return {@link TeacherOpenCourseChatLogAnalysis}
|
|
|
|
* @Author: lx
|
|
|
|
* @Author: lx
|
|
|
|
* @Date: 2022/12/12 23:14
|
|
|
|
* @Date: 2022/12/12 23:14
|
|
|
@ -292,7 +387,7 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
|
|
|
|
* 功能描述: <br>
|
|
|
|
* 功能描述: <br>
|
|
|
|
* 评论添加的类型,分组汇总
|
|
|
|
* 评论添加的类型,分组汇总
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param teacherOpenCourseId 开课ID
|
|
|
|
* @param teacherOpenCourseId 开课ID
|
|
|
|
* @return {@link List< TeacherOpenCourseChatLogGroupInfoVO>}
|
|
|
|
* @return {@link List< TeacherOpenCourseChatLogGroupInfoVO>}
|
|
|
|
* @Author: lx
|
|
|
|
* @Author: lx
|
|
|
|
* @Date: 2022/12/12 23:14
|
|
|
|
* @Date: 2022/12/12 23:14
|
|
|
@ -303,6 +398,7 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 根据登录身份,互动获取未读数
|
|
|
|
* 根据登录身份,互动获取未读数
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param dto
|
|
|
|
* @param dto
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -344,7 +440,7 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
|
|
|
|
* @param dto dto
|
|
|
|
* @param dto dto
|
|
|
|
* @author zhouzhao
|
|
|
|
* @author zhouzhao
|
|
|
|
* @date 2023/05/06 02:13:50
|
|
|
|
* @date 2023/05/06 02:13:50
|
|
|
|
* @desc 这里呢,如果是学生身份,他一直不回答,那么这个未读数就一直存在。如果是教师,未读数取决于学生回答里面的阅读状态 0未读 1已读
|
|
|
|
* @desc 这里呢,如果是学生身份,他一直不回答,那么这个未读数就一直存在。如果是教师,未读数取决于学生回答里面的阅读状态 0未读 1已读
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public Integer getTeacherAskUnReadCount(ChatLogUnReadNumDTO dto) {
|
|
|
|
public Integer getTeacherAskUnReadCount(ChatLogUnReadNumDTO dto) {
|
|
|
|
|
|
|
|
|
|
|
@ -355,13 +451,13 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
|
|
|
|
Teacher teacher = teacherDao.getByUserId(user.getId());
|
|
|
|
Teacher teacher = teacherDao.getByUserId(user.getId());
|
|
|
|
if (teacher != null) {
|
|
|
|
if (teacher != null) {
|
|
|
|
dto.setTeacherId(teacher.getTeacherId());
|
|
|
|
dto.setTeacherId(teacher.getTeacherId());
|
|
|
|
count = teacherOpenCourseChatLogDao.getTeacherAskUnReadCountByTeacher(dto);
|
|
|
|
count = teacherOpenCourseChatLogDao.getTeacherAskUnReadCountByTeacher(dto);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else if (user != null && user.isStudent()) {
|
|
|
|
} else if (user != null && user.isStudent()) {
|
|
|
|
Student student = studentDao.getByUserId(user.getId());
|
|
|
|
Student student = studentDao.getByUserId(user.getId());
|
|
|
|
if (student != null) {
|
|
|
|
if (student != null) {
|
|
|
|
dto.setStudentId(student.getStudentId());
|
|
|
|
dto.setStudentId(student.getStudentId());
|
|
|
|
count = teacherOpenCourseChatLogDao.getTeacherAskUnReadCountByStudent(dto);
|
|
|
|
count = teacherOpenCourseChatLogDao.getTeacherAskUnReadCountByStudent(dto);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -375,7 +471,7 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
|
|
|
|
* @param dto dto
|
|
|
|
* @param dto dto
|
|
|
|
* @author zhouzhao
|
|
|
|
* @author zhouzhao
|
|
|
|
* @date 2023/05/06 02:14:44
|
|
|
|
* @date 2023/05/06 02:14:44
|
|
|
|
* @desc 这里呢,如果是老师身份,他一直不回答,那么这个未读数就一直存在。如果是学生,未读数取决于老师回答里面的阅读状态 0未读 1已读
|
|
|
|
* @desc 这里呢,如果是老师身份,他一直不回答,那么这个未读数就一直存在。如果是学生,未读数取决于老师回答里面的阅读状态 0未读 1已读
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public Integer getStudentAskUnReadCount(ChatLogUnReadNumDTO dto) {
|
|
|
|
public Integer getStudentAskUnReadCount(ChatLogUnReadNumDTO dto) {
|
|
|
|
CoreUser user = getUser();
|
|
|
|
CoreUser user = getUser();
|
|
|
@ -385,13 +481,13 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
|
|
|
|
Teacher teacher = teacherDao.getByUserId(user.getId());
|
|
|
|
Teacher teacher = teacherDao.getByUserId(user.getId());
|
|
|
|
if (teacher != null) {
|
|
|
|
if (teacher != null) {
|
|
|
|
dto.setTeacherId(teacher.getTeacherId());
|
|
|
|
dto.setTeacherId(teacher.getTeacherId());
|
|
|
|
count = teacherOpenCourseChatLogDao.getStudentAskUnReadCountByTeacher(dto);
|
|
|
|
count = teacherOpenCourseChatLogDao.getStudentAskUnReadCountByTeacher(dto);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else if (user != null && user.isStudent()) {
|
|
|
|
} else if (user != null && user.isStudent()) {
|
|
|
|
Student student = studentDao.getByUserId(user.getId());
|
|
|
|
Student student = studentDao.getByUserId(user.getId());
|
|
|
|
if (student != null) {
|
|
|
|
if (student != null) {
|
|
|
|
dto.setStudentId(student.getStudentId());
|
|
|
|
dto.setStudentId(student.getStudentId());
|
|
|
|
count = teacherOpenCourseChatLogDao.getStudentAskUnReadCountByStudent(dto);
|
|
|
|
count = teacherOpenCourseChatLogDao.getStudentAskUnReadCountByStudent(dto);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|