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

beetlsql3-dev
wgf 2 years ago
commit 4caab36310

@ -62,4 +62,12 @@ public interface TeacherOpenCourseChatLogDao extends BaseMapper<TeacherOpenCours
* @return * @return
*/ */
TeacherOpenCourseChatLogAnalysisVO chatLogAnalysis(TeacherOpenCourseChatLogAnalysisDTO dto); TeacherOpenCourseChatLogAnalysisVO chatLogAnalysis(TeacherOpenCourseChatLogAnalysisDTO dto);
Integer getTeacherAskUnReadCountByTeacher(ChatLogUnReadNumDTO dto);
Integer getTeacherAskUnReadCountByStudent(ChatLogUnReadNumDTO dto);
Integer getStudentAskUnReadCountByTeacher(ChatLogUnReadNumDTO dto);
Integer getStudentAskUnReadCountByStudent(ChatLogUnReadNumDTO dto);
} }

@ -99,5 +99,11 @@ public class TeacherOpenCourseChatLog extends BaseEntity{
//用户ID //用户ID
private Long userId ; private Long userId ;
//学生阅读状态 1已读 0未读
private Integer studentReadStatus;
//教师阅读状态 1已读 0未读
private Integer teacherReadStatus;
} }

@ -1,9 +1,14 @@
package com.ibeetl.jlw.service; package com.ibeetl.jlw.service;
import cn.hutool.core.lang.Assert;
import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.service.CoreBaseService; import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.admin.core.util.PlatformException; import com.ibeetl.admin.core.util.PlatformException;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.jlw.dao.CourseInfoDao;
import com.ibeetl.jlw.dao.CourseLabelDao; import com.ibeetl.jlw.dao.CourseLabelDao;
import com.ibeetl.jlw.entity.CourseInfo;
import com.ibeetl.jlw.entity.CourseLabel; import com.ibeetl.jlw.entity.CourseLabel;
import com.ibeetl.jlw.web.query.CourseLabelQuery; import com.ibeetl.jlw.web.query.CourseLabelQuery;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
@ -13,8 +18,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List; import java.util.List;
import static com.ibeetl.jlw.enums.AddTypeEnum.ADMIN_ADD;
/** /**
* CourseLabel Service * CourseLabel Service
@ -27,6 +35,10 @@ public class CourseLabelService extends CoreBaseService<CourseLabel> {
@Autowired @Autowired
private CourseLabelDao courseLabelDao; private CourseLabelDao courseLabelDao;
@Autowired
private CourseInfoDao courseInfoDao;
public PageQuery<CourseLabel> queryByCondition(PageQuery query) { public PageQuery<CourseLabel> queryByCondition(PageQuery query) {
PageQuery ret = courseLabelDao.queryByCondition(query); PageQuery ret = courseLabelDao.queryByCondition(query);
queryListAfter(ret.getList()); queryListAfter(ret.getList());
@ -66,4 +78,32 @@ public class CourseLabelService extends CoreBaseService<CourseLabel> {
List<CourseLabel> list = courseLabelDao.template(courseLabel); List<CourseLabel> list = courseLabelDao.template(courseLabel);
return CollectionUtils.isEmpty(list) ? null : list.get(0); return CollectionUtils.isEmpty(list) ? null : list.get(0);
} }
public JsonResult<String> delCourseLabelHandler(CourseLabel courseLabel, CoreUser coreUser) {
Assert.isTrue(coreUser.isUniAdmin() || coreUser.isAdmin(), "只允许学校管理员和超管访问该接口!");
CourseLabel cl = queryById(courseLabel.getCourseLabelId());
// 只有超管才能修改系统分配的数据
Assert.isFalse(ADMIN_ADD.equals(cl.getAddType()) && coreUser.isUniAdmin(), "用户无法修改系统分配的数据!");
CourseInfo courseInfo = new CourseInfo();
courseInfo.setCourseLabelId(courseLabel.getCourseLabelId());
courseInfo.setCourseInfoType(1);
long count = courseInfoDao.createLambdaQuery()
.andEq(CourseInfo::getCourseLabelId, courseLabel.getCourseLabelId())
.andEq(CourseInfo::getCourseInfoType, 1)
.andIn(CourseInfo::getCourseInfoStatus, Arrays.asList(1, 2))
.count();
if (count>0){
return JsonResult.failMessage("该标签下有课程,无法删除!");
}
boolean success = updateTemplate(courseLabel);
if (success) {
return JsonResult.success();
} else {
return JsonResult.failMessage("更新失败");
}
}
} }

@ -822,6 +822,17 @@ public class ResourcesQuestionService extends CoreBaseService<ResourcesQuestion>
return ""; return "";
} }
public String formatQuestion(String question) {
if (StringUtils.isNotBlank(question)&&StringUtils.isNotBlank(question.replace("<p>","").replace("<br>","").replace("</p>","").replace("<br/>","").trim())){
return question;
}else {
return "";
}
}
public String getCellFormatValue(Cell cell) { public String getCellFormatValue(Cell cell) {
String value = null; String value = null;
if (cell != null) { if (cell != null) {

@ -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
*/ */
@ -337,4 +433,64 @@ public class TeacherOpenCourseChatLogService extends CoreBaseService<TeacherOpen
public TeacherOpenCourseChatLogAnalysisVO chatLogAnalysis(TeacherOpenCourseChatLogAnalysisDTO dto) { public TeacherOpenCourseChatLogAnalysisVO chatLogAnalysis(TeacherOpenCourseChatLogAnalysisDTO dto) {
return teacherOpenCourseChatLogDao.chatLogAnalysis(dto); return teacherOpenCourseChatLogDao.chatLogAnalysis(dto);
} }
/**
*
*
* @param dto dto
* @author zhouzhao
* @date 2023/05/06 02:13:50
* @desc 0 1
*/
public Integer getTeacherAskUnReadCount(ChatLogUnReadNumDTO dto) {
CoreUser user = getUser();
Integer count = 0;
// 学生或者教师身份才能看到真正的数字
if (user != null && user.isTeacher()) {
Teacher teacher = teacherDao.getByUserId(user.getId());
if (teacher != null) {
dto.setTeacherId(teacher.getTeacherId());
count = teacherOpenCourseChatLogDao.getTeacherAskUnReadCountByTeacher(dto);
}
} else if (user != null && user.isStudent()) {
Student student = studentDao.getByUserId(user.getId());
if (student != null) {
dto.setStudentId(student.getStudentId());
count = teacherOpenCourseChatLogDao.getTeacherAskUnReadCountByStudent(dto);
}
}
return count;
}
/**
*
*
* @param dto dto
* @author zhouzhao
* @date 2023/05/06 02:14:44
* @desc 0 1
*/
public Integer getStudentAskUnReadCount(ChatLogUnReadNumDTO dto) {
CoreUser user = getUser();
Integer count = 0;
// 学生或者教师身份才能看到真正的数字
if (user != null && user.isTeacher()) {
Teacher teacher = teacherDao.getByUserId(user.getId());
if (teacher != null) {
dto.setTeacherId(teacher.getTeacherId());
count = teacherOpenCourseChatLogDao.getStudentAskUnReadCountByTeacher(dto);
}
} else if (user != null && user.isStudent()) {
Student student = studentDao.getByUserId(user.getId());
if (student != null) {
dto.setStudentId(student.getStudentId());
count = teacherOpenCourseChatLogDao.getStudentAskUnReadCountByStudent(dto);
}
}
return count;
}
} }

@ -1,5 +1,6 @@
package com.ibeetl.jlw.service; package com.ibeetl.jlw.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.jlw.util.ToolUtils; import cn.jlw.util.ToolUtils;
import cn.jlw.validate.ValidateConfig; import cn.jlw.validate.ValidateConfig;
@ -30,6 +31,7 @@ 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 static cn.hutool.core.util.ObjectUtil.defaultIfNull; import static cn.hutool.core.util.ObjectUtil.defaultIfNull;
import static com.ibeetl.admin.core.util.StreamUtils.listJoin; import static com.ibeetl.admin.core.util.StreamUtils.listJoin;
@ -45,39 +47,48 @@ import static com.ibeetl.jlw.enums.OpenCourseMergeJoinTypeEnum.student_join;
@Transactional @Transactional
@Validated @Validated
@Slf4j @Slf4j
public class TeacherOpenCourseMergeStudentService extends CoreBaseService<TeacherOpenCourseMergeStudent> implements DeleteResourcesBy{ public class TeacherOpenCourseMergeStudentService extends CoreBaseService<TeacherOpenCourseMergeStudent> implements DeleteResourcesBy {
@Autowired private UserConsoleService userConsoleService; @Autowired
@Autowired private TeacherOpenCourseMergeStudentDao teacherOpenCourseMergeStudentDao; private UserConsoleService userConsoleService;
@Autowired private TeacherOpenCourseMergeTeacherDao teacherOpenCourseMergeTeacherDao; @Autowired
@Autowired private TeacherOpenCourseMergeSchoolClassDao teacherOpenCourseMergeSchoolClassDao; private TeacherOpenCourseMergeStudentDao teacherOpenCourseMergeStudentDao;
@Autowired private StudentDao studentDao; @Autowired
@Autowired private TeacherDao teacherDao; private TeacherOpenCourseMergeTeacherDao teacherOpenCourseMergeTeacherDao;
@Autowired
private TeacherOpenCourseMergeSchoolClassDao teacherOpenCourseMergeSchoolClassDao;
@Autowired
private StudentDao studentDao;
public PageQuery<TeacherOpenCourseMergeStudent>queryByCondition(PageQuery query){
PageQuery ret = teacherOpenCourseMergeStudentDao.queryByCondition(query); @Autowired
private TeacherService teacherService;
public PageQuery<TeacherOpenCourseMergeStudent> queryByCondition(PageQuery query) {
PageQuery ret = teacherOpenCourseMergeStudentDao.queryByCondition(query);
queryListAfter(ret.getList()); queryListAfter(ret.getList());
return ret; return ret;
} }
public PageQuery<TeacherOpenCourseMergeStudent>queryByConditionQuery(PageQuery query){ public PageQuery<TeacherOpenCourseMergeStudent> queryByConditionQuery(PageQuery query) {
PageQuery ret = teacherOpenCourseMergeStudentDao.queryByConditionQuery(query); PageQuery ret = teacherOpenCourseMergeStudentDao.queryByConditionQuery(query);
queryListAfter(ret.getList()); queryListAfter(ret.getList());
return ret; return ret;
} }
public void deleteByList(List list){ 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)) {
teacherOpenCourseMergeStudentDao.deleteByIds(ids); teacherOpenCourseMergeStudentDao.deleteByIds(ids);
} }
} }
public void deleteTeacherOpenCourseMergeStudent(String ids){ public void deleteTeacherOpenCourseMergeStudent(String ids) {
try { try {
teacherOpenCourseMergeStudentDao.deleteTeacherOpenCourseMergeStudentByIds(ids); teacherOpenCourseMergeStudentDao.deleteTeacherOpenCourseMergeStudentByIds(ids);
} catch (Exception e) { } catch (Exception e) {
@ -85,7 +96,7 @@ public class TeacherOpenCourseMergeStudentService extends CoreBaseService<Teache
} }
} }
public String addAll(TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery){ public String addAll(TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery) {
String msg = ""; String msg = "";
List<TeacherOpenCourseMergeStudent> teacherOpenCourseMergeStudentList = new ArrayList<>(); List<TeacherOpenCourseMergeStudent> teacherOpenCourseMergeStudentList = new ArrayList<>();
try { try {
@ -93,10 +104,11 @@ public class TeacherOpenCourseMergeStudentService extends CoreBaseService<Teache
} catch (Exception e) { } catch (Exception e) {
try { try {
teacherOpenCourseMergeStudentList.add(JSONObject.parseObject(teacherOpenCourseMergeStudentQuery.getTeacherOpenCourseMergeStudentJsonStr(), TeacherOpenCourseMergeStudent.class)); teacherOpenCourseMergeStudentList.add(JSONObject.parseObject(teacherOpenCourseMergeStudentQuery.getTeacherOpenCourseMergeStudentJsonStr(), TeacherOpenCourseMergeStudent.class));
} catch (Exception e1) {} } catch (Exception e1) {
}
} }
String studentIdsAsString = listJoin(teacherOpenCourseMergeStudentList, TeacherOpenCourseMergeStudent::getStudentId); String studentIdsAsString = listJoin(teacherOpenCourseMergeStudentList, TeacherOpenCourseMergeStudent::getStudentId);
String teacherOpenCourseIdsAsString = listJoin(teacherOpenCourseMergeStudentList, TeacherOpenCourseMergeStudent::getTeacherOpenCourseId); String teacherOpenCourseIdsAsString = listJoin(teacherOpenCourseMergeStudentList, TeacherOpenCourseMergeStudent::getTeacherOpenCourseId);
TeacherOpenCourseMergeStudentQuery existsStudentQuery = new TeacherOpenCourseMergeStudentQuery(); TeacherOpenCourseMergeStudentQuery existsStudentQuery = new TeacherOpenCourseMergeStudentQuery();
@ -109,8 +121,8 @@ public class TeacherOpenCourseMergeStudentService extends CoreBaseService<Teache
teacherOpenCourseMergeStudentDao.deleteByIds(idsDelAdString); teacherOpenCourseMergeStudentDao.deleteByIds(idsDelAdString);
ToolUtils.deleteNullList(teacherOpenCourseMergeStudentList); ToolUtils.deleteNullList(teacherOpenCourseMergeStudentList);
if(null != teacherOpenCourseMergeStudentList && teacherOpenCourseMergeStudentList.size()>0){ if (null != teacherOpenCourseMergeStudentList && teacherOpenCourseMergeStudentList.size() > 0) {
for(int i=0;i<teacherOpenCourseMergeStudentList.size();i++){ for (int i = 0; i < teacherOpenCourseMergeStudentList.size(); i++) {
TeacherOpenCourseMergeStudent teacherOpenCourseMergeStudent = teacherOpenCourseMergeStudentList.get(i); TeacherOpenCourseMergeStudent teacherOpenCourseMergeStudent = teacherOpenCourseMergeStudentList.get(i);
teacherOpenCourseMergeStudent.setOrgId(teacherOpenCourseMergeStudentQuery.getOrgId()); teacherOpenCourseMergeStudent.setOrgId(teacherOpenCourseMergeStudentQuery.getOrgId());
teacherOpenCourseMergeStudent.setTeacherOpenCourseSchoolClassMergeStudentAddTime(new Date()); teacherOpenCourseMergeStudent.setTeacherOpenCourseSchoolClassMergeStudentAddTime(new Date());
@ -129,7 +141,7 @@ public class TeacherOpenCourseMergeStudentService extends CoreBaseService<Teache
* @param teacherOpenCourseMergeStudentQuery * @param teacherOpenCourseMergeStudentQuery
* @return * @return
*/ */
public JsonResult add(TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery){ public JsonResult add(TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery) {
String msg = ""; String msg = "";
TeacherOpenCourseMergeStudent teacherOpenCourseMergeStudent = teacherOpenCourseMergeStudentQuery.pojo(); TeacherOpenCourseMergeStudent teacherOpenCourseMergeStudent = teacherOpenCourseMergeStudentQuery.pojo();
@ -153,59 +165,59 @@ public class TeacherOpenCourseMergeStudentService extends CoreBaseService<Teache
return jsonResult; return jsonResult;
} }
public String edit(TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery){ public String edit(TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery) {
String msg = ""; String msg = "";
TeacherOpenCourseMergeStudent teacherOpenCourseMergeStudent = teacherOpenCourseMergeStudentQuery.pojo(); TeacherOpenCourseMergeStudent teacherOpenCourseMergeStudent = teacherOpenCourseMergeStudentQuery.pojo();
teacherOpenCourseMergeStudentDao.updateTemplateById(teacherOpenCourseMergeStudent); teacherOpenCourseMergeStudentDao.updateTemplateById(teacherOpenCourseMergeStudent);
return msg; return msg;
} }
public String updateGivenByIds(TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery){ public String updateGivenByIds(TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery) {
String msg = ""; String msg = "";
if(StringUtils.isNotBlank(teacherOpenCourseMergeStudentQuery.get_given())){ if (StringUtils.isNotBlank(teacherOpenCourseMergeStudentQuery.get_given())) {
boolean flag = teacherOpenCourseMergeStudentDao.updateGivenByIds(teacherOpenCourseMergeStudentQuery) > 0; boolean flag = teacherOpenCourseMergeStudentDao.updateGivenByIds(teacherOpenCourseMergeStudentQuery) > 0;
if(!flag){ if (!flag) {
msg = "更新指定参数失败"; msg = "更新指定参数失败";
} }
}else{ } else {
msg = "指定参数为空"; msg = "指定参数为空";
} }
return msg; return msg;
} }
public List<TeacherOpenCourseMergeStudent> getValues (Object paras){ public List<TeacherOpenCourseMergeStudent> getValues(Object paras) {
return sqlManager.select(SqlId.of("jlw.teacherOpenCourseMergeStudent.getTeacherOpenCourseMergeStudentValues"), TeacherOpenCourseMergeStudent.class, paras); return sqlManager.select(SqlId.of("jlw.teacherOpenCourseMergeStudent.getTeacherOpenCourseMergeStudentValues"), TeacherOpenCourseMergeStudent.class, paras);
} }
public List<TeacherOpenCourseMergeStudent> getValuesByQuery (TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery){ public List<TeacherOpenCourseMergeStudent> getValuesByQuery(TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery) {
List<TeacherOpenCourseMergeStudent> valuesByQuery = teacherOpenCourseMergeStudentDao.getValuesByQuery(teacherOpenCourseMergeStudentQuery); List<TeacherOpenCourseMergeStudent> valuesByQuery = teacherOpenCourseMergeStudentDao.getValuesByQuery(teacherOpenCourseMergeStudentQuery);
queryListAfter(valuesByQuery); queryListAfter(valuesByQuery);
return valuesByQuery; return valuesByQuery;
} }
public List<TeacherOpenCourseMergeStudent> getValuesByQueryNotWithPermission (TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery){ public List<TeacherOpenCourseMergeStudent> getValuesByQueryNotWithPermission(TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery) {
List<TeacherOpenCourseMergeStudent> valuesByQueryNotWithPermission = teacherOpenCourseMergeStudentDao.getValuesByQueryNotWithPermission(teacherOpenCourseMergeStudentQuery); List<TeacherOpenCourseMergeStudent> valuesByQueryNotWithPermission = teacherOpenCourseMergeStudentDao.getValuesByQueryNotWithPermission(teacherOpenCourseMergeStudentQuery);
queryListAfter(valuesByQueryNotWithPermission); queryListAfter(valuesByQueryNotWithPermission);
return valuesByQueryNotWithPermission; return valuesByQueryNotWithPermission;
} }
public TeacherOpenCourseMergeStudent getInfo (Long teacherOpenCourseSchoolClassMergeStudentId){ public TeacherOpenCourseMergeStudent getInfo(Long teacherOpenCourseSchoolClassMergeStudentId) {
TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery = new TeacherOpenCourseMergeStudentQuery(); TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery = new TeacherOpenCourseMergeStudentQuery();
teacherOpenCourseMergeStudentQuery.setTeacherOpenCourseSchoolClassMergeStudentId(teacherOpenCourseSchoolClassMergeStudentId); teacherOpenCourseMergeStudentQuery.setTeacherOpenCourseSchoolClassMergeStudentId(teacherOpenCourseSchoolClassMergeStudentId);
teacherOpenCourseMergeStudentQuery.setTeacherOpenCourseSchoolClassMergeStudentStatusPlural("1,2");//需要根据实际情况来 teacherOpenCourseMergeStudentQuery.setTeacherOpenCourseSchoolClassMergeStudentStatusPlural("1,2");//需要根据实际情况来
List<TeacherOpenCourseMergeStudent> list = teacherOpenCourseMergeStudentDao.getValuesByQuery(teacherOpenCourseMergeStudentQuery); List<TeacherOpenCourseMergeStudent> list = teacherOpenCourseMergeStudentDao.getValuesByQuery(teacherOpenCourseMergeStudentQuery);
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 TeacherOpenCourseMergeStudent getInfo (TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery){ public TeacherOpenCourseMergeStudent getInfo(TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery) {
List<TeacherOpenCourseMergeStudent> list = teacherOpenCourseMergeStudentDao.getValuesByQuery(teacherOpenCourseMergeStudentQuery); List<TeacherOpenCourseMergeStudent> list = teacherOpenCourseMergeStudentDao.getValuesByQuery(teacherOpenCourseMergeStudentQuery);
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;
} }
} }
@ -215,7 +227,7 @@ public class TeacherOpenCourseMergeStudentService extends CoreBaseService<Teache
* *
* @param teacherOpenCourseMergeStudentQuery * @param teacherOpenCourseMergeStudentQuery
* @param student * @param student
* @param teacherOpenCourseMergeTeacherAuthCode * @param teacherOpenCourseMergeTeacherAuthCode
* @return * @return
*/ */
public JsonResult joinCourse(@Validated(ValidateConfig.ADD.class) TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery, public JsonResult joinCourse(@Validated(ValidateConfig.ADD.class) TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery,
@ -237,13 +249,33 @@ public class TeacherOpenCourseMergeStudentService extends CoreBaseService<Teache
.andEq(TeacherOpenCourseMergeSchoolClass::getSchoolClassId, student.getClassId()) .andEq(TeacherOpenCourseMergeSchoolClass::getSchoolClassId, student.getClassId())
.andEq(TeacherOpenCourseMergeSchoolClass::getTeacherOpenCourseMergeSchoolClassStatus, 1) .andEq(TeacherOpenCourseMergeSchoolClass::getTeacherOpenCourseMergeSchoolClassStatus, 1)
.select(); .select();
Long teacherId = teacherOpenCourseMergeTeacher.getTeacherId();
Assert.notEmpty(mergeSchoolClassList, "您所在的班级未分配课程!"); Teacher teacher = teacherService.queryById(teacherId);
if (teacher == null) {
throw new PlatformException("教师不存在");
}
if (!Objects.equals(teacher.getOrgId(),student.getOrgId())) {
return JsonResult.failMessage("该开课课程不属于本学校");
}
// 如果为空,则表示班级没有关联,给他关联上
if (CollectionUtil.isEmpty(mergeSchoolClassList)) {
//还是用老师的orgId和userid
TeacherOpenCourseMergeSchoolClass teacherOpenCourseMergeSchoolClass = new TeacherOpenCourseMergeSchoolClass();
teacherOpenCourseMergeSchoolClass.setTeacherOpenCourseMergeSchoolClassAddTime(new Date());
teacherOpenCourseMergeSchoolClass.setTeacherOpenCourseMergeSchoolClassStatus(1);
teacherOpenCourseMergeSchoolClass.setOrgId(teacher.getOrgId());
teacherOpenCourseMergeSchoolClass.setOrgId(teacher.getId());
teacherOpenCourseMergeSchoolClass.setTeacherOpenCourseId(teacherOpenCourseId);
teacherOpenCourseMergeSchoolClass.setSchoolClassId(student.getClassId());
teacherOpenCourseMergeSchoolClassDao.insert(teacherOpenCourseMergeSchoolClass);
}
teacherOpenCourseMergeStudentQuery.setUserId(student.getUserId()); teacherOpenCourseMergeStudentQuery.setUserId(student.getUserId());
teacherOpenCourseMergeStudentQuery.setOrgId(student.getOrgId()); teacherOpenCourseMergeStudentQuery.setOrgId(student.getOrgId());
teacherOpenCourseMergeStudentQuery.setStudentId(student.getStudentId()); teacherOpenCourseMergeStudentQuery.setStudentId(student.getStudentId());
teacherOpenCourseMergeStudentQuery.setTeacherOpenCourseId(teacherOpenCourseId); teacherOpenCourseMergeStudentQuery.setTeacherOpenCourseId(teacherOpenCourseId);
teacherOpenCourseMergeStudentQuery.setTeacherOpenCourseSchoolClassMergeStudentJoinType(OpenCourseMergeJoinTypeEnum.code_join);
// 为空则给默认值 // 为空则给默认值
teacherOpenCourseMergeStudentQuery.setTeacherOpenCourseSchoolClassMergeStudentStatus( teacherOpenCourseMergeStudentQuery.setTeacherOpenCourseSchoolClassMergeStudentStatus(
defaultIfNull(teacherOpenCourseMergeStudentQuery.getTeacherOpenCourseSchoolClassMergeStudentStatus(), 1)); defaultIfNull(teacherOpenCourseMergeStudentQuery.getTeacherOpenCourseSchoolClassMergeStudentStatus(), 1));
@ -269,14 +301,14 @@ public class TeacherOpenCourseMergeStudentService extends CoreBaseService<Teache
/** /**
* *
* *
* @param studentId ID * @param studentId ID
*/ */
public void resetPassword(@NotNull(message = "学生ID不能为空") Long studentId) { public void resetPassword(@NotNull(message = "学生ID不能为空") Long studentId) {
Student student = studentDao.getById(studentId); Student student = studentDao.getById(studentId);
Assert.notNull(student.getUserId(), "学生信息异常,请联系管理员!"); Assert.notNull(student.getUserId(), "学生信息异常,请联系管理员!");
CoreUser user = getUser(); CoreUser user = getUser();
Teacher teacher = teacherDao.getByUserId(user.getId()); Teacher teacher = teacherService.getByUserId(user.getId());
//查询这个老师下面,所有的学生 //查询这个老师下面,所有的学生
List<Long> studentIdList = teacherOpenCourseMergeStudentDao.selectStudentIdListByTeacherId(teacher.getTeacherId()); List<Long> studentIdList = teacherOpenCourseMergeStudentDao.selectStudentIdListByTeacherId(teacher.getTeacherId());

@ -125,17 +125,7 @@ public class CourseLabelController{
if(result.hasErrors()){ if(result.hasErrors()){
return JsonResult.failMessage(result); return JsonResult.failMessage(result);
}else { }else {
Assert.isTrue(coreUser.isUniAdmin() || coreUser.isAdmin(), "只允许学校管理员和超管访问该接口!"); return courseLabelService.delCourseLabelHandler(courseLabel,coreUser);
CourseLabel cl = courseLabelService.queryById(courseLabel.getCourseLabelId());
// 只有超管才能修改系统分配的数据
Assert.isFalse(ADMIN_ADD.equals(cl.getAddType()) && coreUser.isUniAdmin(), "用户无法修改系统分配的数据!");
boolean success = courseLabelService.updateTemplate(courseLabel);
if (success) {
return JsonResult.success();
} else {
return JsonResult.failMessage("更新失败");
}
} }
} }

@ -294,11 +294,21 @@ public class ResourcesQuestionController{
BigDecimal questionScore = resourcesQuestion.getQuestionScore(); BigDecimal questionScore = resourcesQuestion.getQuestionScore();
String questionStem = resourcesQuestion.getQuestionStem(); String questionStem = resourcesQuestion.getQuestionStem();
String questionOptionA = resourcesQuestion.getQuestionOptionA(); String questionOptionA = resourcesQuestionService.formatQuestion(resourcesQuestion.getQuestionOptionA());
String questionOptionB = resourcesQuestion.getQuestionOptionB(); resourcesQuestion.setQuestionOptionA(questionOptionA);
String questionOptionC = resourcesQuestion.getQuestionOptionC();
String questionOptionD = resourcesQuestion.getQuestionOptionD(); String questionOptionB = resourcesQuestionService.formatQuestion(resourcesQuestion.getQuestionOptionB());
String questionOptionE = resourcesQuestion.getQuestionOptionE(); resourcesQuestion.setQuestionOptionB(questionOptionB);
String questionOptionC = resourcesQuestionService.formatQuestion(resourcesQuestion.getQuestionOptionC());
resourcesQuestion.setQuestionOptionC(questionOptionC);
String questionOptionD = resourcesQuestionService.formatQuestion(resourcesQuestion.getQuestionOptionD());
resourcesQuestion.setQuestionOptionD(questionOptionD);
String questionOptionE = resourcesQuestionService.formatQuestion(resourcesQuestion.getQuestionOptionE());
resourcesQuestion.setQuestionOptionE(questionOptionE);
String questionAnswer = resourcesQuestion.getQuestionAnswer(); String questionAnswer = resourcesQuestion.getQuestionAnswer();
questionAnswer = resourcesQuestionService.answerFormat(questionType,questionAnswer);//格式化 questionAnswer = resourcesQuestionService.answerFormat(questionType,questionAnswer);//格式化

@ -1,6 +1,7 @@
package com.ibeetl.jlw.web; package com.ibeetl.jlw.web;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
@ -40,6 +41,7 @@ import java.math.BigDecimal;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.ibeetl.admin.core.util.ExcelUtil.convertData; import static com.ibeetl.admin.core.util.ExcelUtil.convertData;
@ -74,9 +76,7 @@ public class TeacherOpenCourseChatLogController extends BaseController {
if (null == coreUser) { if (null == coreUser) {
return JsonResult.failMessage("请登录后再操作"); return JsonResult.failMessage("请登录后再操作");
} else { } else {
PageQuery page = condition.getPageQuery(); return JsonResult.success(teacherOpenCourseChatLogService.queryByConditionQueryWithChangStatus(condition));
teacherOpenCourseChatLogService.queryByConditionQuery(page);
return JsonResult.success(page);
} }
} }
@ -134,7 +134,6 @@ public class TeacherOpenCourseChatLogController extends BaseController {
if (result.hasErrors()) { if (result.hasErrors()) {
return JsonResult.failMessage(result); return JsonResult.failMessage(result);
} else { } else {
teacherOpenCourseChatLogQuery.setUserId(coreUser.getId()); teacherOpenCourseChatLogQuery.setUserId(coreUser.getId());
teacherOpenCourseChatLogQuery.setOrgId(coreUser.getOrgId()); teacherOpenCourseChatLogQuery.setOrgId(coreUser.getOrgId());
if (ObjectUtil.isNotEmpty(teacher)) { if (ObjectUtil.isNotEmpty(teacher)) {
@ -143,6 +142,8 @@ public class TeacherOpenCourseChatLogController extends BaseController {
if (ObjectUtil.isNotEmpty(student)) { if (ObjectUtil.isNotEmpty(student)) {
teacherOpenCourseChatLogQuery.setStudentId(student.getStudentId()); teacherOpenCourseChatLogQuery.setStudentId(student.getStudentId());
} }
teacherOpenCourseChatLogQuery.setTeacherReadStatus(0);
teacherOpenCourseChatLogQuery.setStudentReadStatus(0);
return teacherOpenCourseChatLogService.add(teacherOpenCourseChatLogQuery); return teacherOpenCourseChatLogService.add(teacherOpenCourseChatLogQuery);
} }
} }
@ -228,7 +229,16 @@ public class TeacherOpenCourseChatLogController extends BaseController {
teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogId(teacherOpenCourseChatLogId); teacherOpenCourseChatLogQuery.setTeacherOpenCourseChatLogId(teacherOpenCourseChatLogId);
teacherOpenCourseChatLogQuery.setStudentScore(studentScore); teacherOpenCourseChatLogQuery.setStudentScore(studentScore);
String msg = teacherOpenCourseChatLogService.edit(teacherOpenCourseChatLogQuery); String msg = teacherOpenCourseChatLogService.edit(teacherOpenCourseChatLogQuery);
if (StringUtils.isBlank(msg)) { if (StringUtils.isBlank(msg)) {
TeacherOpenCourseChatLog teacherOpenCourseChatLog = new TeacherOpenCourseChatLog();
teacherOpenCourseChatLog.setTeacherOpenCourseChatLogParentId(teacherOpenCourseChatLogId);
//获取所有子评论
List<TeacherOpenCourseChatLog> values = teacherOpenCourseChatLogService.getValues(teacherOpenCourseChatLog);
if (CollUtil.isNotEmpty(values)){
List<Long> idList = values.stream().filter(e-> Objects.equals(e.getTeacherReadStatus(),0)).map(TeacherOpenCourseChatLog::getTeacherOpenCourseChatLogId).collect(Collectors.toList());
teacherOpenCourseChatLogService.readChatLogByIds(idList,2);
}
return JsonResult.success(); return JsonResult.success();
} else { } else {
return JsonResult.failMessage("更新失败," + msg); return JsonResult.failMessage("更新失败," + msg);
@ -551,12 +561,11 @@ public class TeacherOpenCourseChatLogController extends BaseController {
* *
* *
* @param teacherOpenCourseId ID * @param teacherOpenCourseId ID
* @param coreUser
* @return * @return
*/ */
@SneakyThrows @SneakyThrows
@GetMapping(API + "/getUnReadNum.do") @GetMapping(API + "/getUnReadNum.do")
public JsonResult getUnReadNum(@NotNull(message = "开课ID不能为空") Long teacherOpenCourseId, @SCoreUser CoreUser coreUser) { public JsonResult getUnReadNum(@NotNull(message = "开课ID不能为空") Long teacherOpenCourseId) {
ChatLogUnReadNumDTO dto = new ChatLogUnReadNumDTO(); ChatLogUnReadNumDTO dto = new ChatLogUnReadNumDTO();
dto.setTeacherOpenCourseId(teacherOpenCourseId); dto.setTeacherOpenCourseId(teacherOpenCourseId);
return JsonResult.success(teacherOpenCourseChatLogService.getUnReadNum(dto)); return JsonResult.success(teacherOpenCourseChatLogService.getUnReadNum(dto));
@ -574,4 +583,34 @@ public class TeacherOpenCourseChatLogController extends BaseController {
public JsonResult chatLogAnalysis(TeacherOpenCourseChatLogAnalysisDTO dto, @SCoreUser CoreUser coreUser) { public JsonResult chatLogAnalysis(TeacherOpenCourseChatLogAnalysisDTO dto, @SCoreUser CoreUser coreUser) {
return JsonResult.success(teacherOpenCourseChatLogService.chatLogAnalysis(dto)); return JsonResult.success(teacherOpenCourseChatLogService.chatLogAnalysis(dto));
} }
/**
*
*
* @param teacherOpenCourseId id
* @author zhouzhao
* @date 2023/05/06 02:05:07
*/
@GetMapping(API+"/getTeacherAskUnReadCount.do")
public JsonResult getTeacherAskUnReadCount(@NotNull(message = "开课ID不能为空") Long teacherOpenCourseId){
ChatLogUnReadNumDTO dto = new ChatLogUnReadNumDTO();
dto.setTeacherOpenCourseId(teacherOpenCourseId);
return JsonResult.success(teacherOpenCourseChatLogService.getTeacherAskUnReadCount(dto));
}
/**
*
*
* @param teacherOpenCourseId id
* @author zhouzhao
* @date 2023/05/06 02:05:07
*/
@GetMapping(API+"/getStudentAskUnReadCount.do")
public JsonResult getStudentAskUnReadCount(@NotNull(message = "开课ID不能为空") Long teacherOpenCourseId){
ChatLogUnReadNumDTO dto = new ChatLogUnReadNumDTO();
dto.setTeacherOpenCourseId(teacherOpenCourseId);
return JsonResult.success(teacherOpenCourseChatLogService.getStudentAskUnReadCount(dto));
}
} }

@ -2,6 +2,7 @@ package com.ibeetl.jlw.web;
import cn.jlw.Interceptor.SCoreUser; import cn.jlw.Interceptor.SCoreUser;
import cn.jlw.Interceptor.TStudent; import cn.jlw.Interceptor.TStudent;
import cn.jlw.Interceptor.TTeacher;
import cn.jlw.validate.ValidateConfig; import cn.jlw.validate.ValidateConfig;
import com.ibeetl.admin.core.annotation.Function; import com.ibeetl.admin.core.annotation.Function;
import com.ibeetl.admin.core.entity.CoreUser; import com.ibeetl.admin.core.entity.CoreUser;
@ -277,6 +278,16 @@ public class TeacherOpenCourseController{
} }
@GetMapping(MODEL + "/getMyselfValues.json")
@Function("teacherOpenCourse.query")
@ResponseBody
public JsonResult<List<TeacherOpenCourse>> getMyselfValues(TeacherOpenCourseQuery param, @TTeacher Teacher teacher) {
param.setTeacherId(teacher.getTeacherId());
List<TeacherOpenCourse>list = teacherOpenCourseService.getValuesByQuery(param);
return JsonResult.success(list);
}
@PostMapping(MODEL + "/delete.json") @PostMapping(MODEL + "/delete.json")
@Function("teacherOpenCourse.delete") @Function("teacherOpenCourse.delete")
@ResponseBody @ResponseBody

@ -82,6 +82,9 @@ public class TeacherOpenCourseChatLogQuery extends PageParam {
@Query(name = "回复状态 1 待回复 2已回复", display = false) @Query(name = "回复状态 1 待回复 2已回复", display = false)
private Integer replyStatus; private Integer replyStatus;
private Integer teacherReadStatus;
private Integer studentReadStatus;
private String teacherOpenCourseChatLogIdPlural; private String teacherOpenCourseChatLogIdPlural;
private String teacherOpenCourseChatLogParentIdPlural; private String teacherOpenCourseChatLogParentIdPlural;
private String teacherOpenCourseIdPlural; private String teacherOpenCourseIdPlural;
@ -198,6 +201,8 @@ public class TeacherOpenCourseChatLogQuery extends PageParam {
pojo.setChatLogSendType(ObjectUtil.defaultIfNull(this.getChatLogSendType(), normal)); pojo.setChatLogSendType(ObjectUtil.defaultIfNull(this.getChatLogSendType(), normal));
pojo.setOrgId(this.getOrgId()); pojo.setOrgId(this.getOrgId());
pojo.setUserId(this.getUserId()); pojo.setUserId(this.getUserId());
pojo.setTeacherReadStatus(this.getTeacherReadStatus());
pojo.setStudentReadStatus(this.getStudentReadStatus());
return pojo; return pojo;
} }
@ -292,4 +297,20 @@ public class TeacherOpenCourseChatLogQuery extends PageParam {
public void setChatLogSendTypePlural(String chatLogSendTypePlural) { public void setChatLogSendTypePlural(String chatLogSendTypePlural) {
this.chatLogSendTypePlural = chatLogSendTypePlural; this.chatLogSendTypePlural = chatLogSendTypePlural;
} }
public Integer getTeacherReadStatus() {
return teacherReadStatus;
}
public void setTeacherReadStatus(Integer teacherReadStatus) {
this.teacherReadStatus = teacherReadStatus;
}
public Integer getStudentReadStatus() {
return studentReadStatus;
}
public void setStudentReadStatus(Integer studentReadStatus) {
this.studentReadStatus = studentReadStatus;
}
} }

@ -385,6 +385,6 @@ getValuesByQueryNotWithPermission
@if(!isEmpty(orgIdPlural)){ @if(!isEmpty(orgIdPlural)){
and find_in_set(t.org_id,#orgIdPlural#) and find_in_set(t.org_id,#orgIdPlural#)
@} @}
order by t.student_client_link_order asc

@ -132,6 +132,10 @@ queryByConditionQuery
@pageTag(){ @pageTag(){
t.*, t.*,
tc.class_name, tc.class_name,
ifnull((select count(1) from teacher_open_course_chat_log a
where a.teacher_open_course_chat_log_status = 1
and a.teacher_open_course_chat_log_parent_id = t.teacher_open_course_chat_log_id
), 0) as comment_count,
@// 指定提问,随机提问类型,查询学生回答的数据。只查询一级 @// 指定提问,随机提问类型,查询学生回答的数据。只查询一级
(case when find_in_set(t.chat_log_send_type, 'specify_ask,random_ask') then (case when find_in_set(t.chat_log_send_type, 'specify_ask,random_ask') then
(select chat_content (select chat_content
@ -686,4 +690,80 @@ chatLogAnalysis
@if(isNotEmpty(teacherOpenCourseId)) { @if(isNotEmpty(teacherOpenCourseId)) {
AND t.teacher_open_course_id = #teacherOpenCourseId# AND t.teacher_open_course_id = #teacherOpenCourseId#
@} @}
AND t.teacher_open_course_chat_log_status = 1 AND t.teacher_open_course_chat_log_status = 1
getTeacherAskUnReadCountByTeacher
===
* 获取老师提问模块未读数量,对于老师来说
SELECT IFNULL(sum(
IF((select count(*)
from teacher_open_course_chat_log t2
where t2.teacher_open_course_chat_log_parent_id = t.teacher_open_course_chat_log_id
and t2.teacher_read_status = 0)>0,1,0)
),0)
FROM teacher_open_course_chat_log t
WHERE 1
AND t.teacher_open_course_id = #teacherOpenCourseId#
AND t.teacher_id = #teacherId#
AND t.chat_log_send_type in ('specify_ask', 'random_ask')
getTeacherAskUnReadCountByStudent
===
* 获取老师提问模块未读数量,对于学生来说
SELECT count(*)
FROM teacher_open_course_chat_log t
WHERE 1
AND t.teacher_open_course_id = #teacherOpenCourseId#
AND t.student_id = #studentId#
AND t.chat_log_send_type in ('specify_ask','random_ask')
@//这里的未读我们可以认为就是不存在回复
AND NOT EXISTS(
SELECT 1
FROM teacher_open_course_chat_log ta
WHERE 1
and ta.student_id = #studentId#
AND ta.teacher_open_course_id = #teacherOpenCourseId#
AND ta.teacher_open_course_chat_log_parent_id = t.teacher_open_course_chat_log_id
)
getStudentAskUnReadCountByTeacher
===
* 获取学生提问模块未读数量,对于老师来说
SELECT count(*)
FROM teacher_open_course_chat_log t
WHERE 1
AND t.teacher_open_course_id = #teacherOpenCourseId#
AND t.chat_log_send_type = 'student_ask'
AND NOT EXISTS(
SELECT 1
FROM teacher_open_course_chat_log ta
WHERE 1
and ta.teacher_id = #teacherId#
AND ta.teacher_open_course_id = #teacherOpenCourseId#
AND ta.teacher_open_course_chat_log_parent_id = t.teacher_open_course_chat_log_id
)
getStudentAskUnReadCountByStudent
===
* 获取学生提问模块未读数量,对于学生来说
SELECT IFNULL(sum(
(select count(*)
from teacher_open_course_chat_log t2
where t2.teacher_open_course_chat_log_parent_id = t.teacher_open_course_chat_log_id
and t2.student_read_status = 0)
),0)
FROM teacher_open_course_chat_log t
WHERE 1
AND t.student_id = #studentId#
AND t.teacher_open_course_id = #teacherOpenCourseId#
AND t.chat_log_send_type = 'student_ask'

@ -11,6 +11,8 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
window.classList = Common.postAjax('/jlw/teacherOpenCourseScheduleSessionClass/levelList.json').data; window.classList = Common.postAjax('/jlw/teacherOpenCourseScheduleSessionClass/levelList.json').data;
var teacherOpenCourseScheduleSessionId = $("input[name='teacherOpenCourseScheduleSessionId']").val();//排课id var teacherOpenCourseScheduleSessionId = $("input[name='teacherOpenCourseScheduleSessionId']").val();//排课id
//?universitySystemId=TODO姚丹,这里要获取教师所在的专业ID //?universitySystemId=TODO姚丹,这里要获取教师所在的专业ID
var classData = Common.getAjax('/jlw/schoolClass/getValues.json').data;//上课班级多选框data var classData = Common.getAjax('/jlw/schoolClass/getValues.json').data;//上课班级多选框data
@ -57,12 +59,14 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
item.teacherOpenCourseScheduleSessionClassId = ''; item.teacherOpenCourseScheduleSessionClassId = '';
}); });
var kkJieciTableValue = $('#kkJieciTable').data('value'); var kkJieciTableValue = $('#kkJieciTable').data('value');
if (!$.isEmpty(kkJieciTableValue)) { if (!$.isEmpty(kkJieciTableValue)) {
if (Object.keys(kkJieciTableValue).length > 1) { if (Object.keys(kkJieciTableValue).length > 1) {
$("#moreRoom").attr('checked', 'true'); $("#moreRoom").attr('checked', 'true');
} else { } else {
$("#oneRoom").attr('checked', 'true'); $("#oneRoom").attr('checked', 'true');
} }
var teacherOpenCourseScheduleSessionClassIdValue='';
var data = Object.values(kkJieciTableValue); var data = Object.values(kkJieciTableValue);
kkJieciTableData.forEach(function (item, index) { kkJieciTableData.forEach(function (item, index) {
data.forEach(function (t, i) { data.forEach(function (t, i) {
@ -70,11 +74,15 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
if (item.teacherOpenCourseScheduleSessionTagName == e.teacherOpenCourseScheduleSessionTagName) { if (item.teacherOpenCourseScheduleSessionTagName == e.teacherOpenCourseScheduleSessionTagName) {
item.teacherOpenCourseScheduleSessionTagStartTime = e.teacherOpenCourseScheduleSessionTagStartTime; item.teacherOpenCourseScheduleSessionTagStartTime = e.teacherOpenCourseScheduleSessionTagStartTime;
item.teacherOpenCourseScheduleSessionTagEndTime = e.teacherOpenCourseScheduleSessionTagEndTime; item.teacherOpenCourseScheduleSessionTagEndTime = e.teacherOpenCourseScheduleSessionTagEndTime;
item.teacherOpenCourseScheduleSessionClassId = Object.keys(kkJieciTableValue)[i] item.teacherOpenCourseScheduleSessionClassId = Object.keys(kkJieciTableValue)[i];
item.LAY_CHECKED = true; item.LAY_CHECKED = true;
} }
if(Object.keys(kkJieciTableValue).length == 1){
item.teacherOpenCourseScheduleSessionClassId = Object.keys(kkJieciTableValue)[0]
}
}); });
}); });
}); });
if (Object.keys(kkJieciTableValue).length === 0) { if (Object.keys(kkJieciTableValue).length === 0) {
merge(kkJieciTableData) merge(kkJieciTableData)
@ -110,13 +118,15 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
field: 'teacherOpenCourseScheduleSessionTagStartTime', field: 'teacherOpenCourseScheduleSessionTagStartTime',
title: '开始时间', title: '开始时间',
align: "center", align: "center",
edit: 'text' templet: StartTime,
event: "startTime"
}, },
{ {
field: 'teacherOpenCourseScheduleSessionTagEndTime', field: 'teacherOpenCourseScheduleSessionTagEndTime',
title: '结束时间', title: '结束时间',
align: "center", align: "center",
edit: 'text' templet: EndTime,
event: "endTime"
}, },
{ {
field: 'teacherOpenCourseScheduleSessionClassId', field: 'teacherOpenCourseScheduleSessionClassId',
@ -163,6 +173,7 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
} }
}; };
/*教师关联班级下拉选项*/
form.on('select(select_teacherId)', function (obj) { form.on('select(select_teacherId)', function (obj) {
classData = Common.getAjax('/jlw/schoolClass/getValues.json', {teacherId: obj.value}).data;//上课班级多选框data classData = Common.getAjax('/jlw/schoolClass/getValues.json', {teacherId: obj.value}).data;//上课班级多选框data
demo1.update({ demo1.update({
@ -221,7 +232,7 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
offset: 'auto', offset: 'auto',
title: '设置时间', title: '设置时间',
shadeClose: 'true', shadeClose: 'true',
area: ['700px', '260px'], area: ['700px', '280px'],
scrollbar: 'false', scrollbar: 'false',
btnAlign: 'c', btnAlign: 'c',
content: $("#setTime_demo"), content: $("#setTime_demo"),
@ -310,16 +321,83 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
}); });
}); });
/*表单编辑*/
function StartTime(obj) {
var teacherOpenCourseScheduleSessionTagStartTime = obj.teacherOpenCourseScheduleSessionTagStartTime;
var id = "startTime" + obj.LAY_INDEX;
return '<input type="text" class="layui-input" id=' + id + ' value=' + teacherOpenCourseScheduleSessionTagStartTime + '>';
}
function EndTime(obj) {
var teacherOpenCourseScheduleSessionTagEndTime = obj.teacherOpenCourseScheduleSessionTagEndTime;
var id = "endTime" + obj.LAY_INDEX;
return '<input type="text" class="layui-input" id=' + id + ' value=' + teacherOpenCourseScheduleSessionTagEndTime + '>';
}
/*表格编辑*/ /*表格编辑*/
/*table.on('edit(kkJieciTable)', function (obj) { //edit是固定事件名test是table原始容器的属性 lay-filter="对应的值" table.on('tool(kkJieciTable)', function (obj) { //注edit是固定事件名test是table原始容器的属性 lay-filter="对应的值"
(obj.value); //得到修改后的值 /* (obj.value); //得到修改后的值
(obj.field); //当前编辑的字段名 (obj.field); //当前编辑的字段名
(obj.data); //所在行的所有相关数据 (obj.data); //所在行的所有相关数据
(table.cache["kkJieciTable"]) (table.cache["kkJieciTable"])
(kkJieciTableData) (kkJieciTableData)
kkJieciTableData.forEach(function (item, index) { kkJieciTableData.forEach(function (item, index) {
}); });*/
});*/ var data = obj.data;
var index = Number($(obj.tr[0]).attr('data-index'));
if (obj.event === 'startTime') {
var id = '#startTime' + (index + 1);
laydate.render({
elem: id
, type: 'time'
, trigger: 'click'
, format: 'HH:mm'
, done: function (value, date, endDate) {
kkJieciTableData[index].teacherOpenCourseScheduleSessionTagStartTime = value;
var endTime = data.teacherOpenCourseScheduleSessionTagEndTime;
var eHh = 0;
var eMm = 0;
if (!$.isEmpty(endTime)) {
eHh = Number(endTime.split(":")[0]);
eMm = Number(endTime.split(":")[1]);
}
var starDate = new Date(date.year, date.month, date.date, date.hours, date.minutes, 0); //开始时间
var endDate = new Date(date.year, date.month, date.date, eHh, eMm, 0); //结束时间
var resultDate = endDate.getTime() - starDate.getTime() //时间差的毫秒数
var minutes = Math.floor(resultDate / (60 * 1000));
kkJieciTableData[index].teacherOpenCourseScheduleSessionTagDuration = minutes;
table.reload('kkJieciTable', {data: kkJieciTableData});
}
});
} else if (obj.event == 'endTime') {
var id = '#endTime' + (index + 1);
laydate.render({
elem: id
, type: 'time'
, trigger: 'click'
, format: 'HH:mm'
, min: data.teacherOpenCourseScheduleSessionTagStartTime
, show: true
, done: function (value, date, endDate) {
kkJieciTableData[index].teacherOpenCourseScheduleSessionTagEndTime = value;
var starTime = data.teacherOpenCourseScheduleSessionTagStartTime;
var starHh = 0;
var starMm = 0;
if (!$.isEmpty(starTime)) {
starHh = Number(starTime.split(":")[0]);
starMm = Number(starTime.split(":")[1]);
}
var endDate = new Date(date.year, date.month, date.date, date.hours, date.minutes, 0); //开始时间
var starDate = new Date(date.year, date.month, date.date, starHh, starMm, 0); //结束时间
var resultDate = endDate.getTime() - starDate.getTime() //时间差的毫秒数
var minutes = Math.floor(resultDate / (60 * 1000));
kkJieciTableData[index].teacherOpenCourseScheduleSessionTagDuration = minutes;
table.reload('kkJieciTable', {data: kkJieciTableData});
}
});
}
});
/*课程时间增加*/ /*课程时间增加*/
$("#add").click(function () { $("#add").click(function () {
@ -392,7 +470,7 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
$("#teacherId option[value='" + data.teacherId + "']").attr("selected", "selected"); $("#teacherId option[value='" + data.teacherId + "']").attr("selected", "selected");
var xmSeValue = data.schoolClassIds; var xmSeValue = data.schoolClassIds;
if(!$.isEmpty(xmSeValue)){ if (!$.isEmpty(xmSeValue)) {
demo1.setValue(xmSeValue.split(","))//xmselect多选下拉 取值 回显 demo1.setValue(xmSeValue.split(","))//xmselect多选下拉 取值 回显
} }
@ -413,7 +491,7 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
//课程来源0教师开课课程1授权课程 //课程来源0教师开课课程1授权课程
var courseType = $("#addForm select[name='teacherOpenCourseId']").find("option:selected").attr("status"); var courseType = $("#addForm select[name='teacherOpenCourseId']").find("option:selected").attr("status");
var teacherOpenCourseId = $("#addForm select[name='teacherOpenCourseId']").val(); var teacherOpenCourseId = $("#addForm select[name='teacherOpenCourseId']").val();
if(!$.isEmpty(teacherOpenCourseId_default)){ if (!$.isEmpty(teacherOpenCourseId_default)) {
teacherOpenCourseId = teacherOpenCourseId_default; teacherOpenCourseId = teacherOpenCourseId_default;
courseType = '0'; courseType = '0';
} }
@ -493,7 +571,6 @@ layui.define(['form', 'laydate', 'table', 'xmSelect', 'teacherOpenCourseSchedule
return; return;
} }
var param = { var param = {
scheduleSessionTitle: scheduleSessionTitle, scheduleSessionTitle: scheduleSessionTitle,
teacherOpenCourseScheduleSessionId: teacherOpenCourseScheduleSessionId, teacherOpenCourseScheduleSessionId: teacherOpenCourseScheduleSessionId,

@ -286,8 +286,7 @@ layui.define(['laydate', 'layer', 'form', 'table', 'treetable', 'element'], func
submitTag(teacherOpenCourseScheduleSessionTagId, data);//修改课次 submitTag(teacherOpenCourseScheduleSessionTagId, data);//修改课次
} }
}); });
} }else if (obj.event == 'endTime') {
if (obj.event == 'endTime') {
var id = '#endTime' + (Number($(obj.tr[0]).attr('data-index')) + 1); var id = '#endTime' + (Number($(obj.tr[0]).attr('data-index')) + 1);
laydate.render({ laydate.render({
elem: id elem: id

@ -255,6 +255,7 @@
//删除相应的分类 //删除相应的分类
function classDel() { function classDel() {
var this_ = $(this); var this_ = $(this);
var value = $(this).val();
layer.confirm('是否确定删除该分类?', function (index) { layer.confirm('是否确定删除该分类?', function (index) {
var ret = Common.postAjax("/jlw/courseLabel/edit.json", { var ret = Common.postAjax("/jlw/courseLabel/edit.json", {
courseLabelId: this_.parents(".layui-form-item").attr("courseLabelId"), courseLabelId: this_.parents(".layui-form-item").attr("courseLabelId"),
@ -267,10 +268,11 @@
}, function () { }, function () {
if (ret.code == 0) { if (ret.code == 0) {
this_.parent().prev().text(value); this_.parent().prev().text(value);
this_.parents(".layui-form-item").remove();
layer.close(index); layer.close(index);
} }
}); });
this_.parents(".layui-form-item").remove();
layer.close(index); layer.close(index);
}); });
} }

@ -169,7 +169,7 @@
hide: "${isSignRole.get()!''}" != 2 ? false : true, hide: "${isSignRole.get()!''}" != 2 ? false : true,
}, },
{ {
field: 'loginCount', title: '登录人', align: "center" field: 'loginCount', title: '登录人', align: "center"
}, },
{ {
field: 'onLineCount', title: '实时在线人数', align: "center" field: 'onLineCount', title: '实时在线人数', align: "center"
@ -196,10 +196,10 @@
type: 'numbers', title: '序号', align: "center", type: 'numbers', title: '序号', align: "center",
}, },
{ {
field: 'secondName', title: '子系统名称', align: "center", field: 'secondName', title: '子系统名称', align: "center",hide:'false'
}, },
{ {
field: 'firstName', title: '归属模块', align: "center", field: 'firstName', title: '模块名称', align: "center",
}, },
{ {
field: 'universitiesCollegesName', title: '使用院校', align: "center", field: 'universitiesCollegesName', title: '使用院校', align: "center",

@ -135,13 +135,13 @@
hide: "${isSignRole.get()!''}" != 2 ? true: false hide: "${isSignRole.get()!''}" != 2 ? true: false
}, },
{ {
field: 'platform', title: '使用子系统名称', align: "center", field: 'platform', title: '使用模块名称', align: "center",
}, },
{ {
field: 'loginTime', title: '登入子系统时间', align: "center", field: 'loginTime', title: '登入时间', align: "center",
}, },
{ {
field: 'logoutTime', title: '登出子系统时间', align: "center", field: 'logoutTime', title: '登出时间', align: "center",
}, },
{ {
field: 'onlineDuration', title: '使用时长', align: "center", field: 'onlineDuration', title: '使用时长', align: "center",

@ -238,10 +238,9 @@
<option value="">请选择</option> <option value="">请选择</option>
{{# layui.each(window.classList, function(index, item){ }} {{# layui.each(window.classList, function(index, item){ }}
{{# layui.each(item.children, function(i, e){ }} {{# layui.each(item.children, function(i, e){ }}
<option value="{{e.teacherOpenCourseScheduleSessionClassId}}" {{ e.teacherOpenCourseScheduleSessionClassId== <option value="{{e.teacherOpenCourseScheduleSessionClassId}}"
d.teacherOpenCourseScheduleSessionClassId ? {{ e.teacherOpenCourseScheduleSessionClassId==d.teacherOpenCourseScheduleSessionClassId ?'selected' : ''}}>
'selected' : '' {{item.teacherOpenCourseScheduleSessionClassName}}/{{e.teacherOpenCourseScheduleSessionClassName}}</option>
}}>{{item.teacherOpenCourseScheduleSessionClassName}}/{{e.teacherOpenCourseScheduleSessionClassName}}</option>
{{# }); }} {{# }); }}
{{# }); }} {{# }); }}
</select> </select>

Loading…
Cancel
Save