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

beetlsql3-dev
姚丹ab 2 years ago
commit 5e5627f79b

@ -124,7 +124,7 @@ public class FunctionConsoleService extends CoreBaseService<CoreFunction> {
* @param userId
* @return
*/
@Cacheable(value=USER_FUNCTION_TREE_CACHE, key="userId")
@Cacheable(value=USER_FUNCTION_TREE_CACHE, key="#userId", unless = "#result == null || #result.size() == 0", cacheManager = "cacheManager1Day")
public String getFunctionIdByUser(Long userId){
return this.roleFunctionConsoleDao.getFunctionIdByUser(userId);
}

@ -81,14 +81,14 @@ public class MenuConsoleService extends CoreBaseService<CoreMenu> {
}
public String getMenuIdsByRoleId(Long roleId){
String menuIds = "";
StringBuffer stringBuffer = new StringBuffer();
CoreRoleMenu roleMenu = new CoreRoleMenu();
roleMenu.setRoleId(roleId);
List<CoreRoleMenu> coreRoleMenuList = roleMenuDao.template(roleMenu);
for(int i=0;null != coreRoleMenuList && i<coreRoleMenuList.size();i++){
menuIds += coreRoleMenuList.get(i).getMenuId()+",";
stringBuffer.append(coreRoleMenuList.get(i).getMenuId()+",");
}
return menuIds;
return stringBuffer.toString();
}
public void updateMenu(CoreMenu menu) {

@ -26,6 +26,8 @@ import org.springframework.web.servlet.ModelAndView;
import java.util.*;
import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
/**
* :
*
@ -189,6 +191,11 @@ public class FunctionController {
return JsonResult.success(tree);
}
/**
* ID
*/
private static final ThreadLocal<String> currentUserRoleIds = ThreadLocal.withInitial(() -> null);
private List<FunctionNodeView> buildFunctionTree(FunctionItem node){
List<FunctionItem> list = node.getChildren();
@ -196,8 +203,14 @@ public class FunctionController {
return Collections.EMPTY_LIST;
}
CoreUser currentUser = platformService.getCurrentUser();
String ids = functionConsoleService.getFunctionIdByUser(currentUser.getId());
if(currentUserRoleIds.get() == null) {
CoreUser user = getUser();
// 非管理员才查询权限ID.避免数据量过大,数据库压力大
if(!user.isAdmin()) {
currentUserRoleIds.set(functionConsoleService.getFunctionIdByUser(user.getId()));
}
}
String ids = currentUserRoleIds.get();
List<FunctionNodeView> views = new ArrayList<FunctionNodeView>(list.size());
for(FunctionItem item :list){

@ -201,6 +201,14 @@
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</dependency>
</dependencies>
</project>

@ -5,6 +5,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cache.Cache;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.data.redis.cache.RedisCache;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheManager;
@ -20,12 +21,13 @@ import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer
import org.springframework.data.redis.serializer.RedisSerializationContext.SerializationPair;
import java.io.UnsupportedEncodingException;
import java.time.Duration;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
/**
* 使.
*
*
* @author TLT
*
*/
@ -37,14 +39,42 @@ public class CacheConfig {
// 定义一个redis 的频道默认叫cache用于pub/sub
@Value("${springext.cache.redis.topic:cache}")
String topicName;
@Value("${springext.cache.redis.ttl:60}")
Long ttl;
@Bean
@Primary
public RedisCacheManager cacheManager(RedisTemplate redisTemplate) {
return create(redisTemplate, ttl);
}
/**
*
*
* @Cacheable(value = {"product"},key = "#root.args[0]",cacheManager = "cacheManager1Day") // 一天后过期
* @param redisTemplate
* @return
*/
@Bean
public TowLevelCacheManager cacheManager(RedisTemplate redisTemplate) {
public RedisCacheManager cacheManager1Day(RedisTemplate redisTemplate) {
return create(redisTemplate, 3600 * 24L);
}
/**
*
* @param redisTemplate
* @return
*/
@Bean
public RedisCacheManager cacheManager1Hour(RedisTemplate redisTemplate) {
return create(redisTemplate, 3600L);
}
private RedisCacheManager create(RedisTemplate redisTemplate, Long ttl) {
RedisCacheWriter writer = RedisCacheWriter.lockingRedisCacheWriter(redisTemplate.getConnectionFactory());
SerializationPair pair = SerializationPair
.fromSerializer(new JdkSerializationRedisSerializer(this.getClass().getClassLoader()));
RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig().serializeValuesWith(pair);
RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig().entryTtl(Duration.ofSeconds(ttl)).serializeValuesWith(pair);
TowLevelCacheManager cacheManager = new TowLevelCacheManager(redisTemplate, writer, config);
@ -53,7 +83,7 @@ public class CacheConfig {
@Bean
RedisMessageListenerContainer container(RedisConnectionFactory connectionFactory,
MessageListenerAdapter listenerAdapter) {
MessageListenerAdapter listenerAdapter) {
RedisMessageListenerContainer container = new RedisMessageListenerContainer();
container.setConnectionFactory(connectionFactory);
@ -85,7 +115,7 @@ public class CacheConfig {
RedisTemplate redisTemplate;
public TowLevelCacheManager(RedisTemplate redisTemplate, RedisCacheWriter cacheWriter,
RedisCacheConfiguration defaultCacheConfiguration) {
RedisCacheConfiguration defaultCacheConfiguration) {
super(cacheWriter, defaultCacheConfiguration);
this.redisTemplate = redisTemplate;
}

@ -0,0 +1,34 @@
package com.ibeetl.admin.core.convert;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import com.alibaba.excel.util.DateUtils;
import com.alibaba.excel.util.WorkBookUtil;
import java.sql.Timestamp;
/**
* Timestamp and date converter
*
* @author mlx
*/
public class TimestampConverter implements Converter<Timestamp> {
@Override
public Class<Timestamp> supportJavaTypeKey() {
return Timestamp.class;
}
@Override
public WriteCellData<?> convertToExcelData(Timestamp value, ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) throws Exception {
WriteCellData<?> cellData = new WriteCellData<>(value.toLocalDateTime());
String format = null;
if (contentProperty != null && contentProperty.getDateTimeFormatProperty() != null) {
format = contentProperty.getDateTimeFormatProperty().getFormat();
}
WorkBookUtil.fillDataFormat(cellData, format, DateUtils.defaultDateFormat);
return cellData;
}
}

@ -41,7 +41,8 @@ public class CoreUserService {
query.setPassword(passwordEncryptService.password(password));
query.setState(ENABLE.getValue());
CoreUser user =userDao.createLambdaQuery().andEq(CoreUser::getCode,userName).
andEq(CoreUser::getPassword, passwordEncryptService.password(password)).single();
andEq(CoreUser::getPassword, passwordEncryptService.password(password))
.andEq(CoreUser::getState, ENABLE.getValue()).single();
if(user==null) {
throw new PlatformException("用户"+userName+"不存在或者密码错误");
}

@ -0,0 +1,185 @@
package com.ibeetl.admin.core.util;
import com.ibeetl.admin.core.entity.BaseEntity;
import org.springframework.beans.BeanUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StopWatch;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import static org.apache.commons.beanutils.MethodUtils.invokeMethod;
/**
* Bean
*
* @author mlx
* @date 2022/5/29
* @modified
*/
public class BeanCopyUtil extends BeanUtils {
public interface ThConsumer<T, U, O> {
void accept(T t, U u, O o);
}
/**
*
* @param sources:
* @param target: ::new(eg: UserVO::new)
* @return
*/
public static <S, T> List<T> copyListProperties(List<S> sources, Supplier<T> target) {
return copyListProperties(sources, target, ArrayList::new,null);
}
/**
*
* @param sources:
* @param target: ::new(eg: UserVO::new)
* @return
*/
public static <S, T> List<T> copyListProperties(List<S> sources, Supplier<T> target, BeanCopyUtilCallBack<S, T> callBack) {
return copyListProperties(sources, target, ArrayList::new,callBack);
}
/**
*
* @param sources:
* @param target: ::new(eg: UserVO::new)
* @param callBack:
* @return
*/
public static <S, T> List<T> copyListProperties(List<S> sources, Supplier<T> target, Supplier<List<T>> supplier, BeanCopyUtilCallBack<S, T> callBack) {
List<T> list = supplier.get();
for (S source : sources) {
T t = target.get();
copyProperties(source, t);
list.add(t);
if (callBack != null) {
// 回调
callBack.callBack(source, t);
}
}
return list;
}
/**
* 线 BaseEntityMap
* @param target
* @param <T>
* @return
*/
public static <T extends BaseEntity> List<Map<String, Object>> BaseEntity2Map(List<T> target) {
StopWatch sw = new StopWatch();
sw.start();
List<Map<String, Object>> res = new ArrayList<>();
if (ObjectUtils.isEmpty(target)) {
return res;
}
Field[] fields = target.get(0).getClass().getDeclaredFields();
for (T baseEntity : target) {
for (Field declaredField : fields) {
baseEntity.set(getFiledName(declaredField), getFieldValue(baseEntity, "get" + getFirstUpperCaseFiledName(declaredField)));
}
res.add(baseEntity.getTails());
}
sw.stop();
System.out.println("BaseEntity2MapWithParallel" + sw.getTotalTimeSeconds() + "秒, 集合长度:" + res.size());
return res;
}
/**
* BaseEntityMap
* @param target
* @param <T>
* @return
*/
public static <T extends BaseEntity> List<Map<String, Object>> BaseEntity2MapWithParallel(List<T> target) {
return BaseEntity2MapWithParallel(target, (k, v, o) -> {});
}
/**
* BaseEntityMap
* @param target
* @param <T>
* @return
*/
public static <T extends BaseEntity> List<Map<String, Object>> BaseEntity2MapWithParallel(List<T> target, ThConsumer<String, Object, T> consumer) {
StopWatch sw = new StopWatch();
sw.start();
List<Map<String, Object>> res = new ArrayList<>();
if (ObjectUtils.isEmpty(target)) {
return res;
}
final Field[] fields = target.get(0).getClass().getDeclaredFields();
List<Map<String, Object>> collect = target.parallelStream().map(baseEntity -> {
for (Field declaredField : fields) {
String filedName = getFiledName(declaredField);
String fieldValue = getFieldValue(baseEntity, "get" + getFirstUpperCaseFiledName(declaredField));
baseEntity.set(filedName, fieldValue);
}
baseEntity.getTails().forEach((k,v) -> consumer.accept(k,v, baseEntity));
return baseEntity.getTails();
}).collect(Collectors.toCollection(CopyOnWriteArrayList::new));
sw.stop();
System.out.println("BaseEntity2MapWithParallel" + sw.getTotalTimeSeconds() + "秒, 集合长度:" + collect.size());
return collect;
}
/**
*
*
* @author ghj
* @return
* @throws Throwable
*/
public static String getFieldValue(Object owner, String fieldName) {
try {
if(invokeMethod(owner, fieldName, null)!=null){
return invokeMethod(owner, fieldName, null).toString();
}else{
return "null";
}
} catch (NoSuchMethodException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
}
}
/**
*
* @param f
* @return
*/
public static String getFirstUpperCaseFiledName(Field f) {
String str = f.toString().substring(f.toString().lastIndexOf('.') + 1);
return str.substring(0, 1).toUpperCase() + str.replaceFirst("\\w", "");
}
/**
*
* @param f
* @return
*/
public static String getFiledName(Field f) {
return f.toString().substring(f.toString().lastIndexOf('.') + 1);
}
}

@ -0,0 +1,17 @@
package com.ibeetl.admin.core.util;
/**
* <p>
* Bean
* </p>
*
* @author mlx
* @date 2022/5/29
* @modified
*/
@FunctionalInterface
public interface BeanCopyUtilCallBack<S, T> {
void callBack(S source, T t);
}

@ -336,6 +336,35 @@ public class ExcelUtil {
}
sheet.doWrite(data);
}
/**
* Excel
*
* @param response
* @param filename
* @param sheetName Excel sheet
* @param head Excel head
* @param data
* @param <T> head data
* @throws IOException
*/
public static <T> void write(HttpServletResponse response, String filename, String sheetName,
Class<T> head, List<T> data) throws IOException {
response.setCharacterEncoding("utf-8");
// 设置 header 和 contentType。写在最后的原因是避免报错时响应 contentType 已经被修改了
response.addHeader("Content-Disposition", "attachment;filename*=utf-8''" + URLEncoder.encode(filename, "UTF-8"));
// response.setContentType("application/vnd.ms-excel;charset=UTF-8"); xls
// xlsx
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
// 输出 Excel
ExcelWriterSheetBuilder sheet = EasyExcel.write(response.getOutputStream(), head)
.autoCloseStream(false) // 不要自动关闭,交给 Servlet 自己处理
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) // 基于 column 长度,自动适配。最大 255 宽度
.sheet(sheetName);
// 冻结首行
sheet.registerWriteHandler(new FreezeAndFilter());
sheet.doWrite(data);
}
public static <T> List<T> read(MultipartFile file, Class<T> head) throws IOException {
return EasyExcel.read(file.getInputStream(), head, null)

@ -321,3 +321,6 @@ create table teacher_open_course_merge_schedule_session
COLLATE = utf8_general_ci;
alter table teacher_open_course_merge_schedule_session comment '课程开课-关联-排课配置';
ALTER TABLE teacher_open_course_chat_log ADD COLUMN chat_log_send_type varchar(50) COMMENT '发送类型 枚举(ChatLogSendTypeEnum)';

@ -11,6 +11,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.boot.version>2.5.2</spring.boot.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<poi.version>4.1.2</poi.version>
</properties>
<modules>
<module>admin-core</module>
@ -94,6 +95,17 @@
<artifactId>java-jwt</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>

@ -73,15 +73,15 @@ public class InterceptorConfig implements WebMvcConfigurer, InitializingBean {
public void addResourceHandlers(ResourceHandlerRegistry registry){
log.info("路径1 "+p);
if(p.contains("file:")){
registry.addResourceHandler(u+"/filesystem/courseInfo/**").addResourceLocations(p+"/filesystem/courseInfo/");
registry.addResourceHandler(u+"/filesystem/temp/**").addResourceLocations(p+"/filesystem/temp/");
registry.addResourceHandler(u+"/filesystem/zip/**").addResourceLocations(p+"/filesystem/zip/");
registry.addResourceHandler(u+"/images/**").addResourceLocations(p+"/filesystem/product/images/");
registry.addResourceHandler("/filesystem/courseInfo/**").addResourceLocations(p+"/filesystem/courseInfo/");
registry.addResourceHandler("/filesystem/temp/**").addResourceLocations(p+"/filesystem/temp/");
registry.addResourceHandler("/filesystem/zip/**").addResourceLocations(p+"/filesystem/zip/");
registry.addResourceHandler("/images/**").addResourceLocations(p+"/filesystem/product/images/");
}else {
registry.addResourceHandler(u+"/filesystem/courseInfo/**").addResourceLocations("file:/"+p+"/filesystem/courseInfo/");
registry.addResourceHandler(u+"/filesystem/temp/**").addResourceLocations("file:/"+p+"/filesystem/temp/");
registry.addResourceHandler(u+"/filesystem/zip/**").addResourceLocations("file:/"+p+"/filesystem/zip/");
registry.addResourceHandler(u+"/images/**").addResourceLocations("file:/"+p+"/filesystem/product/images/");
registry.addResourceHandler("/filesystem/courseInfo/**").addResourceLocations("file:/"+p+"/filesystem/courseInfo/");
registry.addResourceHandler("/filesystem/temp/**").addResourceLocations("file:/"+p+"/filesystem/temp/");
registry.addResourceHandler("/filesystem/zip/**").addResourceLocations("file:/"+p+"/filesystem/zip/");
registry.addResourceHandler("/images/**").addResourceLocations("file:/"+p+"/filesystem/product/images/");
}
}

@ -50,7 +50,7 @@ public class TeacherOpenCourse extends BaseEntity{
private Integer teacherOpenCourseStatus ;
@FetchSql("select t.teacher_id, ta.teacher_name, teacher_open_course_merge_teacher_auth_code from teacher_open_course_merge_teacher t " +
@FetchSql("select t.teacher_id, ta.teacher_name, ta.teacher_sn, teacher_open_course_merge_teacher_auth_code from teacher_open_course_merge_teacher t " +
"left join teacher ta on ta.teacher_id = t.teacher_id " +
"where t.teacher_open_course_id = #teacherOpenCourseId# and t.teacher_open_course_merge_teacher_status = 1 " +
"order by teacher_id limit 1 ")
@ -71,6 +71,7 @@ public class TeacherOpenCourse extends BaseEntity{
public static class MergeTeacherInfo {
private Long teacherId;
private String teacherName;
private String teacherSn;
private String teacherOpenCourseMergeTeacherAuthCode;
}
@Setter

@ -3,6 +3,7 @@ package com.ibeetl.jlw.entity;
import com.ibeetl.admin.core.annotation.Dict;
import com.ibeetl.admin.core.entity.BaseEntity;
import com.ibeetl.admin.core.util.ValidateConfig;
import com.ibeetl.jlw.enums.ChatLogSendTypeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.beetl.sql.annotation.entity.AssignID;
@ -75,6 +76,10 @@ public class TeacherOpenCourseChatLog extends BaseEntity{
//学生得分
private BigDecimal studentScore ;
// 提问方式
private ChatLogSendTypeEnum chatLogSendType;
//附件上传(仅支持图片,多个逗号隔开)

@ -3,6 +3,7 @@ package com.ibeetl.jlw.entity;
import javax.validation.constraints.NotNull;
import com.ibeetl.admin.core.entity.BaseEntity;
import com.ibeetl.jlw.entity.vo.HandsOnTaskProblemVo;
import org.beetl.sql.annotation.entity.*;
import com.ibeetl.admin.core.util.ValidateConfig;
@ -84,7 +85,17 @@ public class TeacherOpenCourseHandsOnSimulationTasks extends BaseEntity{
//添加时间
private Date addTime ;
private HandsOnTaskProblemVo handsOnTaskProblemVo;
public HandsOnTaskProblemVo getHandsOnTaskProblemVo() {
return handsOnTaskProblemVo;
}
public void setHandsOnTaskProblemVo(HandsOnTaskProblemVo handsOnTaskProblemVo) {
this.handsOnTaskProblemVo = handsOnTaskProblemVo;
}
public TeacherOpenCourseHandsOnSimulationTasks(){
}

@ -26,12 +26,12 @@ public class TeacherOpenCourseMergeResourcesQuestion extends BaseEntity{
private Long teacherOpenCourseId ;
//课程ID
//课程章节ID
@Dict(type="teacher_open_course_merge_course_info.course_info_name.course_info_status=1")
private Long teacherOpenCourseMergeCourseInfoId ;
//题型(1单选 2多选 3判断)
//题型(1单选 2多选 3判断 4填空 5分析)
private Integer questionType ;

@ -1,5 +1,7 @@
package com.ibeetl.jlw.entity;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.ibeetl.admin.core.annotation.Dict;
import com.ibeetl.admin.core.annotation.DictEnum;
import com.ibeetl.admin.core.entity.BaseEntity;
@ -10,6 +12,7 @@ import org.beetl.sql.annotation.entity.InsertIgnore;
import org.beetl.sql.annotation.entity.UpdateIgnore;
import org.beetl.sql.fetch.annotation.Fetch;
import org.beetl.sql.fetch.annotation.FetchOne;
import org.beetl.sql.fetch.annotation.FetchSql;
import javax.validation.constraints.NotNull;
import java.util.Date;
@ -34,26 +37,49 @@ public class TeacherOpenCourseStudentSigninLog extends BaseEntity{
// 签到场次(时间)
private Date teacherOpenCourseStudentSigninSettingSessionTime;
private DateTime teacherOpenCourseStudentSigninSettingSessionTime;
//学生ID
@Dict(type="student.student_name.student_status=1")
// @Dict(type="student.student_name.student_status=1")
private Long studentId ;
@FetchSql("select t.student_name from student t where t.student_id = #studentId# ")
@UpdateIgnore
@InsertIgnore
private String studentIdText;
@FetchSql("select t.student_sn from student t where t.student_id = #studentId# ")
@UpdateIgnore
@InsertIgnore
private String studentSn;
//开课ID
@Dict(type="teacher_open_course.teacher_open_course_title.teacher_open_course_status=1")
// @Dict(type="teacher_open_course.teacher_open_course_title.teacher_open_course_status=1")
private Long teacherOpenCourseId ;
@FetchSql("select t.teacher_open_course_title from teacher_open_course t " +
"where t.teacher_open_course_id = #teacherOpenCourseId# and t.teacher_open_course_status=1 ")
@UpdateIgnore
@InsertIgnore
private String teacherOpenCourseIdText;
//班级ID
@Dict(type="school_class.class_name.class_status=1")
// @Dict(type="school_class.class_name.class_status=1")
private Long schoolClassId ;
@FetchSql("select t.class_name from school_class t " +
"where t.class_id = #schoolClassId# and t.class_status=1 ")
@UpdateIgnore
@InsertIgnore
private String schoolClassIdText;
//签到日期
private Date teacherOpenCourseStudentSigninLogAddTime ;
private DateTime teacherOpenCourseStudentSigninLogAddTime ;
//签到方式 (数据字典 student_signin_type)
@Dict(type="student_signin_type")
@ -61,7 +87,6 @@ public class TeacherOpenCourseStudentSigninLog extends BaseEntity{
private String teacherOpenCourseStudentSigninLogType ;
//备注(缺勤理由)
private String teacherOpenCourseStudentSigninLogRemark ;
//签到的IP
@ -69,7 +94,6 @@ public class TeacherOpenCourseStudentSigninLog extends BaseEntity{
private String teacherOpenCourseStudentSigninLogIp ;
// 签到标签 10 签到20 缺勤
@DictEnum("desc")
private TeacherOpenCourseStudentSigninLogQuery.SignInTypeEnum teacherOpenCourseStudentSigninLogTag;
@ -153,7 +177,7 @@ public class TeacherOpenCourseStudentSigninLog extends BaseEntity{
*@param teacherOpenCourseStudentSigninLogAddTime
*/
public void setTeacherOpenCourseStudentSigninLogAddTime(Date teacherOpenCourseStudentSigninLogAddTime){
this.teacherOpenCourseStudentSigninLogAddTime = teacherOpenCourseStudentSigninLogAddTime;
this.teacherOpenCourseStudentSigninLogAddTime = DateUtil.date(teacherOpenCourseStudentSigninLogAddTime);
}
/** ( student_signin_type)
@ -242,7 +266,7 @@ public class TeacherOpenCourseStudentSigninLog extends BaseEntity{
}
public void setTeacherOpenCourseStudentSigninSettingSessionTime(Date teacherOpenCourseStudentSigninSettingSessionTime) {
this.teacherOpenCourseStudentSigninSettingSessionTime = teacherOpenCourseStudentSigninSettingSessionTime;
this.teacherOpenCourseStudentSigninSettingSessionTime = DateUtil.date(teacherOpenCourseStudentSigninSettingSessionTime);
}
public Student getStudent() {
@ -252,4 +276,36 @@ public class TeacherOpenCourseStudentSigninLog extends BaseEntity{
public void setStudent(Student student) {
this.student = student;
}
public String getStudentIdText() {
return studentIdText;
}
public void setStudentIdText(String studentIdText) {
this.studentIdText = studentIdText;
}
public String getTeacherOpenCourseIdText() {
return teacherOpenCourseIdText;
}
public void setTeacherOpenCourseIdText(String teacherOpenCourseIdText) {
this.teacherOpenCourseIdText = teacherOpenCourseIdText;
}
public String getSchoolClassIdText() {
return schoolClassIdText;
}
public void setSchoolClassIdText(String schoolClassIdText) {
this.schoolClassIdText = schoolClassIdText;
}
public String getStudentSn() {
return studentSn;
}
public void setStudentSn(String studentSn) {
this.studentSn = studentSn;
}
}

@ -0,0 +1,67 @@
package com.ibeetl.jlw.entity.vo;
import lombok.Data;
/**
*
*
* @Version 0.0.1
* @Author
* @Date 2022/11/1 21:51
*/
@Data
public class HandsOnTaskProblemVo {
/**
*
*/
private Integer singleNum;
/**
*
*/
private Double singleScore;
/**
*
*/
private Double singleSumScore;
/**
*
*/
private Integer multipleNum;
/**
*
*/
private Double multipleScore;
/**
*
*/
private Double multipleSumScore;
/**
*
*/
private Integer judgeNum;
/**
*
*/
private Double judgeScore;
/**
*
*/
private Double judgeSumScore;
/**
*
*/
private Double totalScore;
}

@ -0,0 +1,17 @@
package com.ibeetl.jlw.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.beetl.sql.annotation.entity.EnumMapping;
@Getter
@AllArgsConstructor
@EnumMapping("name")
public enum ChatLogSendTypeEnum {
normal("普通回复"),
student_ask("学生提问"),
teacher_ask("教师提问");
private String text;
}

@ -188,11 +188,11 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService<ResourcesQ
* -
*
*
* @param questionSettingId ID
* @param teacherOpenCourseQuestionSettingId ID
* @return
*/
public TeacherOpenCourseQuestionLogScoreInfo getScoreInfo(
@NotNull(message = "开课题目配置ID不能为空") final Long questionSettingId) {
@NotNull(message = "开课题目配置ID不能为空") final Long teacherOpenCourseQuestionSettingId) {
// 查询学生身份
Student student = studentDao.getByUserId(getUserId());
@ -203,7 +203,7 @@ public class ResourcesQuestionSnapshotService extends CoreBaseService<ResourcesQ
new SQLReady("SELECT " +
"? as teacher_open_course_question_setting_id, " +
"? as student_id ",
questionSettingId, student.getStudentId()
teacherOpenCourseQuestionSettingId, student.getStudentId()
),
TeacherOpenCourseQuestionLogScoreInfo.class
);

@ -8,9 +8,11 @@ import com.ibeetl.admin.core.util.PlatformException;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.admin.core.web.JsonReturnCode;
import com.ibeetl.jlw.dao.TeacherOpenCourseHandsOnSimulationTasksDao;
import com.ibeetl.jlw.entity.ResourcesQuestion;
import com.ibeetl.jlw.entity.TaskTypeParam;
import com.ibeetl.jlw.entity.TeacherOpenCourseHandsOnSimulationTasks;
import com.ibeetl.jlw.entity.TeacherOpenCourseHandsOnSimulationTasksFile;
import com.ibeetl.jlw.entity.vo.HandsOnTaskProblemVo;
import com.ibeetl.jlw.web.query.TeacherOpenCourseHandsOnSimulationTasksFileQuery;
import com.ibeetl.jlw.web.query.TeacherOpenCourseHandsOnSimulationTasksQuery;
import org.apache.commons.collections4.CollectionUtils;
@ -24,6 +26,7 @@ import org.springframework.validation.annotation.Validated;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* - Service
@ -39,6 +42,8 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
@Autowired private TeacherOpenCourseHandsOnSimulationTasksFileService teacherOpenCourseHandsOnSimulationTasksFileService;
@Autowired private ResourcesQuestionService resourcesQuestionService;
public PageQuery<TeacherOpenCourseHandsOnSimulationTasks>queryByCondition(PageQuery query){
PageQuery ret = teacherOpenCourseHandsOnSimulationTasksDao.queryByCondition(query);
queryListAfter(ret.getList());
@ -150,6 +155,10 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
teacherOpenCourseHandsOnSimulationTasksQuery.setTaskId(taskId);
List<TeacherOpenCourseHandsOnSimulationTasks> list = teacherOpenCourseHandsOnSimulationTasksDao.getValuesByQuery(teacherOpenCourseHandsOnSimulationTasksQuery);
if(null != list && list.size()>0){
for (TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks : list) {
HandsOnTaskProblemVo objectiveProblem = getObjectiveProblem(teacherOpenCourseHandsOnSimulationTasks.getTaskList());
teacherOpenCourseHandsOnSimulationTasks.setHandsOnTaskProblemVo(objectiveProblem);
}
return list.get(0);
}else{
return null;
@ -159,6 +168,12 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
public TeacherOpenCourseHandsOnSimulationTasks getInfo (TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery){
List<TeacherOpenCourseHandsOnSimulationTasks> list = teacherOpenCourseHandsOnSimulationTasksDao.getValuesByQuery(teacherOpenCourseHandsOnSimulationTasksQuery);
if(null != list && list.size()>0){
for (TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks : list) {
HandsOnTaskProblemVo objectiveProblem = getObjectiveProblem(teacherOpenCourseHandsOnSimulationTasks.getTaskList());
teacherOpenCourseHandsOnSimulationTasks.setHandsOnTaskProblemVo(objectiveProblem);
}
return list.get(0);
}else{
return null;
@ -169,4 +184,27 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
return null;
}
public HandsOnTaskProblemVo getObjectiveProblem(String problemIds) {
List<ResourcesQuestion> resourcesQuestions = resourcesQuestionService.getByIds(problemIds);
//单选题
List<ResourcesQuestion> collect1 = resourcesQuestions.stream().filter(v -> 1 == v.getQuestionType()).collect(Collectors.toList());
//多选题
List<ResourcesQuestion> collect2 = resourcesQuestions.stream().filter(v -> 2 == v.getQuestionType()).collect(Collectors.toList());
//判断题
List<ResourcesQuestion> collect3 = resourcesQuestions.stream().filter(v -> 3 == v.getQuestionType()).collect(Collectors.toList());
HandsOnTaskProblemVo handsOnTaskProblemVo = new HandsOnTaskProblemVo();
handsOnTaskProblemVo.setSingleNum(collect1.size());
handsOnTaskProblemVo.setSingleScore(collect1.stream().mapToDouble(v -> v.getQuestionScore().doubleValue()).average().orElse(0));
handsOnTaskProblemVo.setSingleSumScore(collect1.stream().mapToDouble(v -> v.getQuestionScore().doubleValue()).sum());
handsOnTaskProblemVo.setMultipleNum(collect2.size());
handsOnTaskProblemVo.setMultipleScore(collect2.stream().mapToDouble(v -> v.getQuestionScore().doubleValue()).average().orElse(0));
handsOnTaskProblemVo.setMultipleSumScore(collect2.stream().mapToDouble(v -> v.getQuestionScore().doubleValue()).sum());
handsOnTaskProblemVo.setJudgeNum(collect3.size());
handsOnTaskProblemVo.setJudgeScore(collect3.stream().mapToDouble(v -> v.getQuestionScore().doubleValue()).average().orElse(0));
handsOnTaskProblemVo.setJudgeSumScore(collect3.stream().mapToDouble(v -> v.getQuestionScore().doubleValue()).sum());
handsOnTaskProblemVo.setTotalScore(resourcesQuestions.stream().mapToDouble(v -> v.getQuestionScore().doubleValue()).sum());
return handsOnTaskProblemVo;
}
}

@ -173,7 +173,9 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
}
public List<TeacherOpenCourseStudentSigninLog> getValuesByQueryNotWithPermission (TeacherOpenCourseStudentSigninLogQuery teacherOpenCourseStudentSigninLogQuery){
return teacherOpenCourseStudentSigninLogDao.getValuesByQueryNotWithPermission(teacherOpenCourseStudentSigninLogQuery);
List<TeacherOpenCourseStudentSigninLog> values = teacherOpenCourseStudentSigninLogDao.getValuesByQueryNotWithPermission(teacherOpenCourseStudentSigninLogQuery);
queryListAfter(values);
return values;
}
public TeacherOpenCourseStudentSigninLog getInfo (Long teacherOpenCourseStudentSigninLogId){

@ -234,11 +234,10 @@ public class ResourcesQuestionSnapshotController{
@Function("teacherOpenCourseQuestionLog.query")
@ResponseBody
public JsonResult<TeacherOpenCourseQuestionLogScoreInfo> getScoreInfo(
Long questionSettingId,
Long teacherOpenCourseQuestionSettingId,
@SCoreUser
CoreUser coreUser) {
Assert.isTrue(coreUser.isStudent(), "非学生身份,无法提交!");
return JsonResult.success(resourcesQuestionSnapshotService.getScoreInfo(questionSettingId));
return JsonResult.success(resourcesQuestionSnapshotService.getScoreInfo(teacherOpenCourseQuestionSettingId));
}

@ -464,6 +464,7 @@ public class TeacherOpenCourseHandsOnController{
/**
*
* id
* @param teacherOpenCourseId id
* @return
*/

@ -8,6 +8,7 @@ import com.ibeetl.admin.core.file.FileService;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.jlw.entity.TaskTypeParam;
import com.ibeetl.jlw.entity.TeacherOpenCourseHandsOnSimulationTasks;
import com.ibeetl.jlw.entity.vo.HandsOnTaskProblemVo;
import com.ibeetl.jlw.service.TeacherOpenCourseHandsOnSimulationTasksService;
import com.ibeetl.jlw.web.query.TeacherOpenCourseHandsOnSimulationTasksQuery;
import org.apache.commons.lang3.StringUtils;
@ -91,6 +92,8 @@ public class TeacherOpenCourseHandsOnSimulationTasksController{
public ModelAndView edit(Long taskId) {
ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseHandsOnSimulationTasks/edit.html");
TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks = teacherOpenCourseHandsOnSimulationTasksService.queryById(taskId);
HandsOnTaskProblemVo objectiveProblem = getObjectiveProblem(teacherOpenCourseHandsOnSimulationTasks.getTaskList());
teacherOpenCourseHandsOnSimulationTasks.setHandsOnTaskProblemVo(objectiveProblem);
view.addObject("teacherOpenCourseHandsOnSimulationTasks", teacherOpenCourseHandsOnSimulationTasks);
return view;
}
@ -101,6 +104,8 @@ public class TeacherOpenCourseHandsOnSimulationTasksController{
ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseHandsOnSimulationTasks/add.html");
if(null != taskId){
TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks = teacherOpenCourseHandsOnSimulationTasksService.queryById(taskId);
HandsOnTaskProblemVo objectiveProblem = getObjectiveProblem(teacherOpenCourseHandsOnSimulationTasks.getTaskList());
teacherOpenCourseHandsOnSimulationTasks.setHandsOnTaskProblemVo(objectiveProblem);
view.addObject("teacherOpenCourseHandsOnSimulationTasks", teacherOpenCourseHandsOnSimulationTasks);
}else {
view.addObject("teacherOpenCourseHandsOnSimulationTasks", new TeacherOpenCourseHandsOnSimulationTasks());
@ -171,6 +176,8 @@ public class TeacherOpenCourseHandsOnSimulationTasksController{
@Function("teacherOpenCourseHandsOnSimulationTasks.query")
public JsonResult<TeacherOpenCourseHandsOnSimulationTasks>queryInfo(Long taskId) {
TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks = teacherOpenCourseHandsOnSimulationTasksService.queryById( taskId);
HandsOnTaskProblemVo objectiveProblem = getObjectiveProblem(teacherOpenCourseHandsOnSimulationTasks.getTaskList());
teacherOpenCourseHandsOnSimulationTasks.setHandsOnTaskProblemVo(objectiveProblem);
return JsonResult.success(teacherOpenCourseHandsOnSimulationTasks);
}
@ -228,6 +235,16 @@ public class TeacherOpenCourseHandsOnSimulationTasksController{
}
/**
*
* @param problemIds
* @return
*/
@GetMapping(MODEL + "/getObjectiveProblem.do")
public HandsOnTaskProblemVo getObjectiveProblem(String problemIds) {
return teacherOpenCourseHandsOnSimulationTasksService.getObjectiveProblem(problemIds);
}
}

@ -1,5 +1,7 @@
package com.ibeetl.jlw.web;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.jlw.Interceptor.GetFile;
import cn.jlw.Interceptor.RFile;
import cn.jlw.Interceptor.SCoreUser;
@ -8,6 +10,7 @@ import cn.jlw.validate.ValidateConfig;
import com.ibeetl.admin.core.annotation.Function;
import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.file.FileService;
import com.ibeetl.admin.core.util.PlatformException;
import com.ibeetl.admin.core.util.TimeTool;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.jlw.entity.FileEntity;
@ -16,6 +19,7 @@ import com.ibeetl.jlw.entity.dto.TeacherOpenCourseStudentSigninLogManualMergeDTO
import com.ibeetl.jlw.entity.dto.TeacherOpenCourseStudentSigninLogSigninDTO;
import com.ibeetl.jlw.service.TeacherOpenCourseStudentSigninLogService;
import com.ibeetl.jlw.web.query.TeacherOpenCourseStudentSigninLogQuery;
import lombok.SneakyThrows;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -37,9 +41,14 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import static com.ibeetl.admin.core.util.BeanCopyUtil.BaseEntity2MapWithParallel;
import static com.ibeetl.admin.core.util.ExcelUtil.convertData;
import static com.ibeetl.admin.core.util.ExcelUtil.write;
/**
* ---
* 线
@ -126,6 +135,45 @@ public class TeacherOpenCourseStudentSigninLogController{
}
}
/**
* -
* @param condition
* @param coreUser
* @return
*/
@SneakyThrows
@GetMapping(API + "/export.do")
public void easyExcelExport(HttpServletResponse resp, TeacherOpenCourseStudentSigninLogQuery condition, @SCoreUser CoreUser coreUser) {
if(null == coreUser){
throw new PlatformException("请登录后再操作");
}else{
Assert.notNull(condition.getTeacherOpenCourseId(), "teacherOpenCourseId 开课ID不能为空");
/** 构建表头 */
Map<String, String> header = new LinkedHashMap<>(11);
header.put("studentIdText", "学生姓名");
header.put("studentSn", "学号");
header.put("teacherOpenCourseIdText", "开课名称");
header.put("schoolClassIdText", "班级名称");
header.put("teacherOpenCourseStudentSigninSettingSessionTime", "签到场次");
header.put("teacherOpenCourseStudentSigninLogTypeText", "签到类型");
header.put("teacherOpenCourseStudentSigninLogTagText", "签到标签");
header.put("teacherOpenCourseStudentSigninLogAddTime", "签到时间");
header.put("teacherOpenCourseStudentSigninLogRemark", "备注");
List<TeacherOpenCourseStudentSigninLog> datas =
teacherOpenCourseStudentSigninLogService.getValuesByQueryNotWithPermission(condition);
List<Map<String, Object>> maps = BaseEntity2MapWithParallel(datas);
String filename = StrUtil.format("签到日志导出-{}.xlsx", DateUtil.formatDate(DateUtil.date()));
write(resp, filename,"Sheet1", header.values(), convertData(header.keySet(), maps));
}
}
/* 后台页面 */

@ -4,6 +4,7 @@ import cn.jlw.validate.ValidateConfig;
import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.web.query.PageParam;
import com.ibeetl.jlw.entity.TeacherOpenCourseChatLog;
import com.ibeetl.jlw.enums.ChatLogSendTypeEnum;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
@ -49,6 +50,9 @@ public class TeacherOpenCourseChatLogQuery extends PageParam {
private String keywords;
@Query(name = "学生得分", display = false)
private BigDecimal studentScore;
@Query(name = "提问方式", display = false)
private ChatLogSendTypeEnum chatLogSendType;
@Query(name = "附件上传(仅支持图片,多个逗号隔开)", display = false)
private String chatFiles;
@Query(name = "状态 1正常 2删除", display = true,type=Query.TYPE_DICT,dict="global_status")
@ -60,6 +64,9 @@ public class TeacherOpenCourseChatLogQuery extends PageParam {
@Query(name = "用户ID", display = false)
private Long userId;
@Query(name = "回复状态 1 待回复 2已回复", display = false)
private Integer replyStatus;
private String teacherOpenCourseChatLogIdPlural;
private String teacherOpenCourseChatLogParentIdPlural;
private String teacherOpenCourseIdPlural;
@ -237,4 +244,20 @@ public class TeacherOpenCourseChatLogQuery extends PageParam {
public void set_given(String _given) {
this._given = _given;
}
public ChatLogSendTypeEnum getChatLogSendType() {
return chatLogSendType;
}
public void setChatLogSendType(ChatLogSendTypeEnum chatLogSendType) {
this.chatLogSendType = chatLogSendType;
}
public Integer getReplyStatus() {
return replyStatus;
}
public void setReplyStatus(Integer replyStatus) {
this.replyStatus = replyStatus;
}
}

@ -47,6 +47,8 @@ public class TeacherOpenCourseQuestionSettingQuery extends PageParam {
@NotNull(message = "题目结束时间不能为空", groups =ValidateConfig.ADD.class)
@Query(name = "题目结束时间", display = false)
private Date teacherOpenCourseQuestionEndTime;
@Query(name = "作业要求", display = false)
private String teacherOpenCourseQuestionSettingRequire;
@Query(name = "类型", display = false)
// 枚举ResourcesQuestionSnapshotFromTypeEnum
private ResourcesQuestionSnapshotFromTypeEnum teacherOpenCourseQuestionSettingType;
@ -98,6 +100,7 @@ public class TeacherOpenCourseQuestionSettingQuery extends PageParam {
pojo.setTeacherOpenCourseQuestionSettingPushStatus(this.getTeacherOpenCourseQuestionSettingPushStatus());
pojo.setTeacherOpenCourseQuestionSettingStatus(this.getTeacherOpenCourseQuestionSettingStatus());
pojo.setTeacherOpenCourseQuestionSettingAddTime(this.getTeacherOpenCourseQuestionSettingAddTime());
pojo.setTeacherOpenCourseQuestionSettingRequire(this.getTeacherOpenCourseQuestionSettingRequire());
pojo.setOrgId(this.getOrgId());
pojo.setUserId(this.getUserId());
return pojo;

@ -1,5 +1,6 @@
package com.ibeetl.jlw.web.query;
import cn.hutool.core.date.DateTime;
import cn.jlw.validate.ValidateConfig;
import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.web.query.PageParam;
@ -119,7 +120,7 @@ public class TeacherOpenCourseStudentSigninLogQuery extends PageParam {
public Date getTeacherOpenCourseStudentSigninLogAddTime(){
return teacherOpenCourseStudentSigninLogAddTime;
}
public void setTeacherOpenCourseStudentSigninLogAddTime(Date teacherOpenCourseStudentSigninLogAddTime ){
public void setTeacherOpenCourseStudentSigninLogAddTime(DateTime teacherOpenCourseStudentSigninLogAddTime ){
this.teacherOpenCourseStudentSigninLogAddTime = teacherOpenCourseStudentSigninLogAddTime;
}
public String getTeacherOpenCourseStudentSigninLogType(){
@ -235,6 +236,6 @@ public class TeacherOpenCourseStudentSigninLogQuery extends PageParam {
}
public void setTeacherOpenCourseStudentSigninSettingSessionTime(Date teacherOpenCourseStudentSigninSettingSessionTime) {
this.teacherOpenCourseStudentSigninSettingSessionTime = teacherOpenCourseStudentSigninSettingSessionTime;
this.teacherOpenCourseStudentSigninSettingSessionTime = (teacherOpenCourseStudentSigninSettingSessionTime);
}
}

@ -2,7 +2,9 @@
admin.isOnline=true
# \u9006\u5929\u7F13\u5B58\u5F00\u542F
springext.cache.enabled=false
springext.cache.enabled=true
#
springext.cache.redis.ttl=300
logging.level.root=INFO
#logging.level.root=DEBUG

@ -3,6 +3,7 @@ admin.isOnline=false
# \u9006\u5929\u7F13\u5B58\u5F00\u542F
springext.cache.enabled=true
springext.cache.redis.ttl=300
logging.level.root=INFO
#logging.level.root=DEBUG

@ -3,6 +3,7 @@ admin.isOnline=true
# \u9006\u5929\u7F13\u5B58\u5F00\u542F
springext.cache.enabled=true
springext.cache.redis.ttl=300
logging.level.root=ERROR
#logging.level.root=DEBUG

@ -7,7 +7,6 @@ queryByCondition
t.*
@}
from resources_application t
left
left join teacher_merge_application ta on ta.resources_application_id = t.resources_application_id
where 1=1
@//数据权限该sql语句功能点,如果不考虑数据权限,可以删除此行

@ -53,7 +53,7 @@ queryByCondition
and t.chat_content =#chatContent#
@}
@if(!isEmpty(keywords)){
and t.keywords =#keywords#
and t.keywords like #"%"+keywords+"%"#
@}
@if(!isEmpty(studentScore)){
and t.student_score =#studentScore#
@ -61,6 +61,9 @@ queryByCondition
@if(!isEmpty(chatFiles)){
and t.chat_files =#chatFiles#
@}
@if(!isEmpty(chatLogSendType)){
and t.chat_log_send_type =#chatLogSendType#
@}
@if(isEmpty(teacherOpenCourseChatLogStatus) && isEmpty(teacherOpenCourseChatLogStatusPlural)){
and t.teacher_open_course_chat_log_status != 2
@}else{
@ -90,6 +93,26 @@ queryByCondition
order by teacher_open_course_chat_log_add_time desc
@}
@}
@if(!isEmpty(replyStatus)){
and
@// 待回复的消息
@if(replyStatus == 1) {
NOT
@}
@if(replyStatus == 1) {
@// 这里留空,代表查询已回复的消息
@}
EXISTS (
SELECT
1
FROM
teacher_open_course_chat_log ta
WHERE
ta.teacher_open_course_chat_log_parent_id = t.teacher_open_course_chat_log_id
AND ta.teacher_open_course_chat_log_status = 1
)
@}
queryByConditionQuery
@ -139,7 +162,7 @@ queryByConditionQuery
and t.chat_content =#chatContent#
@}
@if(!isEmpty(keywords)){
and t.keywords =#keywords#
and t.keywords like #"%"+keywords+"%"#
@}
@if(!isEmpty(studentScore)){
and t.student_score =#studentScore#
@ -147,6 +170,9 @@ queryByConditionQuery
@if(!isEmpty(chatFiles)){
and t.chat_files =#chatFiles#
@}
@if(!isEmpty(chatLogSendType)){
and t.chat_log_send_type =#chatLogSendType#
@}
@if(isEmpty(teacherOpenCourseChatLogStatus) && isEmpty(teacherOpenCourseChatLogStatusPlural)){
and t.teacher_open_course_chat_log_status != 2
@}else{
@ -268,6 +294,13 @@ updateGivenByIds
chat_files = #chatFiles# ,
@}
@}
@if(contain("chatLogSendType",_given)){
@if(isEmpty(chatLogSendType)){
chat_log_send_type = null ,
@}else{
chat_log_send_type = #chatLogSendType# ,
@}
@}
@if(contain("teacherOpenCourseChatLogStatus",_given)){
@if(isEmpty(teacherOpenCourseChatLogStatus)){
teacher_open_course_chat_log_status = null ,
@ -331,7 +364,7 @@ getTeacherOpenCourseChatLogValues
and t.chat_content =#chatContent#
@}
@if(!isEmpty(keywords)){
and t.keywords =#keywords#
and t.keywords like #"%"+keywords+"%"#
@}
@if(!isEmpty(studentScore)){
and t.student_score =#studentScore#
@ -339,6 +372,9 @@ getTeacherOpenCourseChatLogValues
@if(!isEmpty(chatFiles)){
and t.chat_files =#chatFiles#
@}
@if(!isEmpty(chatLogSendType)){
and t.chat_log_send_type =#chatLogSendType#
@}
@if(!isEmpty(teacherOpenCourseChatLogStatus)){
and t.teacher_open_course_chat_log_status =#teacherOpenCourseChatLogStatus#
@}else{
@ -400,7 +436,7 @@ getValuesByQuery
and t.chat_content =#chatContent#
@}
@if(!isEmpty(keywords)){
and t.keywords =#keywords#
and t.keywords like #"%"+keywords+"%"#
@}
@if(!isEmpty(studentScore)){
and t.student_score =#studentScore#
@ -408,6 +444,9 @@ getValuesByQuery
@if(!isEmpty(chatFiles)){
and t.chat_files =#chatFiles#
@}
@if(!isEmpty(chatLogSendType)){
and t.chat_log_send_type =#chatLogSendType#
@}
@if(isEmpty(teacherOpenCourseChatLogStatus) && isEmpty(teacherOpenCourseChatLogStatusPlural)){
and t.teacher_open_course_chat_log_status != 2
@}else{
@ -478,7 +517,7 @@ getValuesByQueryNotWithPermission
and t.chat_content =#chatContent#
@}
@if(!isEmpty(keywords)){
and t.keywords =#keywords#
and t.keywords like #"%"+keywords+"%"#
@}
@if(!isEmpty(studentScore)){
and t.student_score =#studentScore#
@ -486,6 +525,9 @@ getValuesByQueryNotWithPermission
@if(!isEmpty(chatFiles)){
and t.chat_files =#chatFiles#
@}
@if(!isEmpty(chatLogSendType)){
and t.chat_log_send_type =#chatLogSendType#
@}
@if(isEmpty(teacherOpenCourseChatLogStatus) && isEmpty(teacherOpenCourseChatLogStatusPlural)){
and t.teacher_open_course_chat_log_status != 2
@}else{

@ -70,6 +70,9 @@ queryByCondition
@if(!isEmpty(teacherOpenCourseQuestionSettingAddTime)){
and t.teacher_open_course_question_setting_add_time =#teacherOpenCourseQuestionSettingAddTime#
@}
@if(!isEmpty(teacherOpenCourseQuestionSettingRequire)){
and t.teacher_open_course_question_setting_require =#teacherOpenCourseQuestionSettingRequire#
@}
@if(!isEmpty(orgId)){
and t.org_id =#orgId#
@}
@ -154,6 +157,9 @@ queryByConditionQuery
@if(!isEmpty(teacherOpenCourseQuestionSettingAddTime)){
and t.teacher_open_course_question_setting_add_time =#teacherOpenCourseQuestionSettingAddTime#
@}
@if(!isEmpty(teacherOpenCourseQuestionSettingRequire)){
and t.teacher_open_course_question_setting_require =#teacherOpenCourseQuestionSettingRequire#
@}
@if(!isEmpty(orgId)){
and t.org_id =#orgId#
@}
@ -305,6 +311,13 @@ updateGivenByIds
teacher_open_course_question_setting_add_time = #teacherOpenCourseQuestionSettingAddTime# ,
@}
@}
@if(contain("teacherOpenCourseQuestionSettingRequire",_given)){
@if(isEmpty(teacherOpenCourseQuestionSettingRequire)){
teacher_open_course_question_setting_require = null ,
@}else{
teacher_open_course_question_setting_require = #teacherOpenCourseQuestionSettingRequire# ,
@}
@}
@if(contain("orgId",_given)){
@if(isEmpty(orgId)){
org_id = null ,
@ -382,6 +395,9 @@ getTeacherOpenCourseQuestionSettingValues
@if(!isEmpty(teacherOpenCourseQuestionSettingAddTime)){
and t.teacher_open_course_question_setting_add_time =#teacherOpenCourseQuestionSettingAddTime#
@}
@if(!isEmpty(teacherOpenCourseQuestionSettingRequire)){
and t.teacher_open_course_question_setting_require =#teacherOpenCourseQuestionSettingRequire#
@}
@if(!isEmpty(orgId)){
and t.org_id =#orgId#
@}
@ -458,6 +474,9 @@ getValuesByQuery
@if(!isEmpty(teacherOpenCourseQuestionSettingAddTime)){
and t.teacher_open_course_question_setting_add_time =#teacherOpenCourseQuestionSettingAddTime#
@}
@if(!isEmpty(teacherOpenCourseQuestionSettingRequire)){
and t.teacher_open_course_question_setting_require =#teacherOpenCourseQuestionSettingRequire#
@}
@if(!isEmpty(orgId)){
and t.org_id =#orgId#
@}

Loading…
Cancel
Save