学生端首页-部分数据;

通过院校ID获取应用;
beetlsql3-dev
Mlxa0324 2 years ago
parent 85a44e1826
commit 9c23b7f796

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -28547,7 +28547,33 @@ ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_general_ci;
alter table teacher_merge_application comment '教师-关联-我的应用';
alter table teacher_merge_application comment '教师-关联-应用-排序';
drop table if exists student_merge_application;
/*==============================================================*/
/* Table: student_merge_application */
/*==============================================================*/
create table student_merge_application
(
student_merge_application_id bigint not null comment '教师-应用关联ID',
student_id bigint comment '学生ID',
resources_application_id bigint comment '应用ID',
student_merge_application_order_index int(2) comment '排序',
student_merge_application_add_time datetime comment '创建时间',
org_id bigint comment '组织ID',
user_id bigint comment '用户ID',
primary key (student_merge_application_id)
)
auto_increment = 1
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_general_ci;
alter table student_merge_application comment '学生-关联-应用-排序';
-- ----------------------------

@ -3,6 +3,7 @@ package com.ibeetl.jlw.dao;
import cn.hutool.core.util.ObjectUtil;
import com.ibeetl.jlw.entity.CourseInfo;
import com.ibeetl.jlw.entity.Student;
import com.ibeetl.jlw.entity.StudentExtendSchoolInfo;
import com.ibeetl.jlw.web.query.StudentQuery;
import org.beetl.sql.core.engine.PageQuery;
import org.beetl.sql.mapper.BaseMapper;
@ -42,4 +43,13 @@ public interface StudentDao extends BaseMapper<Student>{
public List<Student> getPracticePerformanceStatisticInfo (StudentQuery studentQuery);
public List<Student> getPracticeProgress (StudentQuery studentQuery);
public PageQuery<CourseInfo> getErrorStatistics (PageQuery query);
/**
*
* ---
*
* @param studentIds
* @return
*/
StudentExtendSchoolInfo getStudentExtendSchoolInfo(String studentIds);
}

@ -1,12 +1,12 @@
package com.ibeetl.jlw.dao;
import com.ibeetl.jlw.entity.Teacher;
import com.ibeetl.jlw.entity.TeacherExtendSchoolInfo;
import com.ibeetl.jlw.web.query.TeacherQuery;
import org.beetl.sql.core.engine.PageQuery;
import org.beetl.sql.mapper.BaseMapper;
import org.beetl.sql.mapper.annotation.SqlResource;
import org.beetl.sql.mapper.annotation.Update;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
@ -29,4 +29,13 @@ public interface TeacherDao extends BaseMapper<Teacher>{
public String getIdsByQuery(TeacherQuery teacherQuery);
public List<Teacher> getTeacherLog (TeacherQuery teacherQuery);
public List<Map<String,Object>>getStatisticsLog();
/**
*
* ---
*
* @param teacherIds ID
* @return
*/
TeacherExtendSchoolInfo getTeacherExtendSchoolInfo(String teacherIds);
}

@ -0,0 +1,56 @@
package com.ibeetl.jlw.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* -
*
* @author mlx
*/
@Data
@EqualsAndHashCode(callSuper=false)
public class StudentExtendSchoolInfo extends Student {
/**
* ID
*/
private Long classId;
/**
*
*/
private String className;
/**
* ID
*/
private Long universitySystemId;
/**
*
*/
private String universitySystemName;
/**
* ID
*/
private Long universityFacultyId;
/**
*
*/
private String universityFacultyName;
/**
* ID
*/
private Long universitiesCollegesId;
/**
*
*/
private String universitiesCollegesName;
}

@ -0,0 +1,44 @@
package com.ibeetl.jlw.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* -
*
* @author mlx
*/
@Data
@EqualsAndHashCode(callSuper=false)
public class TeacherExtendSchoolInfo extends Teacher {
/**
* ID
*/
private Long universitySystemId;
/**
*
*/
private String universitySystemName;
/**
* ID
*/
private Long universityFacultyId;
/**
*
*/
private String universityFacultyName;
/**
* ID
*/
private Long universitiesCollegesId;
/**
*
*/
private String universitiesCollegesName;
}

@ -1,7 +1,7 @@
package com.ibeetl.jlw.entity.api.student;
import com.ibeetl.jlw.entity.TeacherMergeApplication;
import com.ibeetl.jlw.entity.TeacherOpenCourseMergeTeacher;
import com.ibeetl.jlw.entity.ResourcesApplication;
import com.ibeetl.jlw.entity.TeacherOpenCourseMergeStudent;
import com.ibeetl.jlw.entity.TeacherOpenCourseNotice;
import lombok.AllArgsConstructor;
import lombok.Builder;
@ -31,11 +31,11 @@ public class StudentIndexData {
/**
*
*/
private List<TeacherMergeApplication> myApplicationList;
private List<ResourcesApplication> myApplicationList;
/**
*
*/
private List<TeacherOpenCourseMergeTeacher> myOpenCourseList;
private List<TeacherOpenCourseMergeStudent> myOpenCourseList;
}

@ -1,12 +1,15 @@
package com.ibeetl.jlw.service;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.admin.core.util.PlatformException;
import com.ibeetl.jlw.dao.ResourcesApplicationCourseDao;
import com.ibeetl.jlw.dao.ResourcesApplicationDao;
import com.ibeetl.jlw.dao.UniversitiesCollegesJurisdictionExperimentalSystemDao;
import com.ibeetl.jlw.entity.ResourcesApplication;
import com.ibeetl.jlw.entity.Teacher;
import com.ibeetl.jlw.entity.UniversitiesCollegesJurisdictionExperimentalSystem;
import com.ibeetl.jlw.web.query.ResourcesApplicationQuery;
import org.beetl.sql.core.SqlId;
import org.beetl.sql.core.engine.PageQuery;
@ -14,13 +17,12 @@ import org.beetl.sql.core.query.LambdaQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
@ -28,6 +30,7 @@ import java.util.List;
*/
@Service
@Validated
@Transactional
public class ResourcesApplicationService extends CoreBaseService<ResourcesApplication>{
@ -35,6 +38,7 @@ public class ResourcesApplicationService extends CoreBaseService<ResourcesApplic
@Autowired private ResourcesApplicationCourseService resourcesApplicationCourseService;
@Autowired private ResourcesApplicationCourseDao resourcesApplicationCourseDao;
@Autowired private UniversitiesCollegesJurisdictionExperimentalSystemDao universitiesCollegesJurisdictionExperimentalSystemDao;
public PageQuery<ResourcesApplication>queryByCondition(PageQuery query){
PageQuery ret = resourcesApplicationDao.queryByCondition(query);
@ -142,4 +146,34 @@ public class ResourcesApplicationService extends CoreBaseService<ResourcesApplic
return lambdaQuery.select();
}
/**
* ID
*
* @param universitiesCollegesId
* @return null
*/
public List<ResourcesApplication> getResourcesApplicationListByUniversitiesCollegesId(
@NotNull(message = "院校ID不能为空") Long universitiesCollegesId) {
// 需要判断当前时间是否在使用的时间内
DateTime dateTime = DateUtil.date();
// 1子系统应用 院校ID当前时间要在开始使用时间和结束使用时间之间
List<UniversitiesCollegesJurisdictionExperimentalSystem> systemList =
universitiesCollegesJurisdictionExperimentalSystemDao.createLambdaQuery()
// 1子应用系统
.andEq(UniversitiesCollegesJurisdictionExperimentalSystem::getType, 1)
.andEq(UniversitiesCollegesJurisdictionExperimentalSystem::getUniversitiesCollegesId, universitiesCollegesId)
.andGreatEq(UniversitiesCollegesJurisdictionExperimentalSystem::getUseStartTime, dateTime)
.andLess(UniversitiesCollegesJurisdictionExperimentalSystem::getUseEndTime, dateTime)
.select();
// 获取关联的应用ID集合
List<Long> resourcesApplicationIdList = systemList.stream()
.map(UniversitiesCollegesJurisdictionExperimentalSystem::getTypeId).collect(Collectors.toList());
// 根据应用ID查询应用信息
return resourcesApplicationDao.selectByIds(resourcesApplicationIdList);
}
}

@ -1,7 +1,6 @@
package com.ibeetl.jlw.service;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
@ -36,7 +35,9 @@ import org.beetl.sql.core.query.LambdaQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotBlank;
import java.io.*;
import java.math.BigDecimal;
import java.text.DateFormat;
@ -58,6 +59,7 @@ import static com.ibeetl.jlw.web.IpAddressController.ipAddressMap;
*/
@Service
@Validated
@Transactional
public class StudentService extends CoreBaseService<Student>{
@ -689,6 +691,17 @@ public class StudentService extends CoreBaseService<Student>{
return valuesByQuery;
}
/**
*
* ---
*
* @param studentIds ID
* @return
*/
public StudentExtendSchoolInfo getStudentExtendSchoolInfo(@NotBlank(message = "学生ID集合不能为空") String studentIds) {
return studentDao.getStudentExtendSchoolInfo(studentIds);
}
//大赛任务一答卷
public JsonResult updateCT1QuestionAnswer(CompetitionTaskOneQuestionQuery condition,Student student){
if(null == condition.getCompetitionId()){

@ -39,7 +39,9 @@ import org.jsoup.select.Elements;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotBlank;
import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
@ -58,6 +60,7 @@ import static com.ibeetl.jlw.web.IpAddressController.ipAddressMap;
*/
@Service
@Validated
@Transactional
public class TeacherService extends CoreBaseService<Teacher> {
@ -740,9 +743,16 @@ public class TeacherService extends CoreBaseService<Teacher> {
return lambdaQuery.andBetween(Teacher::getAddTime, stime, etime).andEq(Teacher::getTeacherStatus, 1).select();
}
return lambdaQuery.andEq(Teacher::getTeacherStatus, 1).select();
}
/**
*
* ---
*
* @param teacherIds ID
* @return
*/
public TeacherExtendSchoolInfo getTeacherExtendSchoolInfo(@NotBlank(message = "教师ID集合不能为空") String teacherIds) {
return teacherDao.getTeacherExtendSchoolInfo(teacherIds);
}
}

@ -1,14 +1,15 @@
package com.ibeetl.jlw.service.api.student;
import cn.hutool.core.lang.Assert;
import com.ibeetl.jlw.dao.TeacherMergeApplicationDao;
import com.ibeetl.jlw.entity.Student;
import com.ibeetl.jlw.entity.TeacherOpenCourseNotice;
import com.ibeetl.jlw.dao.TeacherOpenCourseMergeStudentDao;
import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.entity.api.CurrentUserInfo;
import com.ibeetl.jlw.entity.api.teacher.TeacherIndexData;
import com.ibeetl.jlw.entity.api.student.StudentIndexData;
import com.ibeetl.jlw.service.IndexBaseService;
import com.ibeetl.jlw.service.TeacherOpenCourseMergeTeacherService;
import com.ibeetl.jlw.service.ResourcesApplicationService;
import com.ibeetl.jlw.service.StudentService;
import com.ibeetl.jlw.service.TeacherOpenCourseNoticeService;
import com.ibeetl.jlw.web.query.TeacherOpenCourseMergeStudentQuery;
import com.ibeetl.jlw.web.query.TeacherOpenCourseNoticeQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -29,15 +30,15 @@ public class ApiStudentService {
@Autowired private IndexBaseService indexBaseService;
@Autowired private TeacherOpenCourseNoticeService teacherOpenCourseNoticeService;
@Autowired private TeacherMergeApplicationDao teacherMergeApplicationDao;
@Autowired private TeacherOpenCourseMergeTeacherService teacherOpenCourseMergeTeacherService;
@Autowired private StudentService studentService;
@Autowired private ResourcesApplicationService resourcesApplicationService;
@Autowired private TeacherOpenCourseMergeStudentDao teacherOpenCourseMergeStudentDao;
/**
* -
* @return
*/
public TeacherIndexData index() {
public StudentIndexData index() {
// 自动根据登录的身份获取当前用户信息。
CurrentUserInfo currentUserInfo = indexBaseService.userInfo();
@ -47,15 +48,28 @@ public class ApiStudentService {
// 学生ID
final Long studentId = ((Student) identityInfo).getStudentId();
// 获取该学生的学校信息
StudentExtendSchoolInfo studentExtendSchoolInfo = studentService.getStudentExtendSchoolInfo(studentId.toString());
// 我的通知
TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery = new TeacherOpenCourseNoticeQuery();
teacherOpenCourseNoticeQuery.setStudentId(studentId);
List<TeacherOpenCourseNotice> noticeList = teacherOpenCourseNoticeService.getValuesByQuery(teacherOpenCourseNoticeQuery);
return TeacherIndexData.builder()
// 我的应用由来:学生所在的院校,查询关联到的应用
List<ResourcesApplication> resourcesApplicationList = resourcesApplicationService
.getResourcesApplicationListByUniversitiesCollegesId(studentExtendSchoolInfo.getUniversitiesCollegesId());
// 我的开课信息
TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery = new TeacherOpenCourseMergeStudentQuery();
teacherOpenCourseMergeStudentQuery.setStudentId(studentId);
List<TeacherOpenCourseMergeStudent> myOpenCourseList = teacherOpenCourseMergeStudentDao
.getValuesByQueryNotWithPermission(teacherOpenCourseMergeStudentQuery);
return StudentIndexData.builder()
.noticeList(noticeList)
.myApplicationList(null)
.myOpenCourseList(null)
.myApplicationList(resourcesApplicationList)
.myOpenCourseList(myOpenCourseList)
.build();
}
}

@ -26,7 +26,10 @@ import org.springframework.web.servlet.ModelAndView;
import java.util.List;
/**
* --
* ---
*
*
*
* 线
*/

@ -1,7 +1,7 @@
package com.ibeetl.jlw.web.api.student;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.jlw.entity.api.teacher.TeacherIndexData;
import com.ibeetl.jlw.entity.api.student.StudentIndexData;
import com.ibeetl.jlw.service.api.student.ApiStudentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -28,7 +28,7 @@ public class ApiStudentController {
* @return
*/
@PostMapping("index.do")
public JsonResult<TeacherIndexData> index() {
public JsonResult<StudentIndexData> index() {
return JsonResult.success(apiStudentService.index());
}

@ -22,7 +22,7 @@ spring.datasource.dynamic.hikari.connection-test-query=SELECT 1
spring.datasource.dynamic.datasource.master.driverClassName=com.mysql.cj.jdbc.Driver
spring.datasource.dynamic.datasource.master.url=jdbc:mysql://localhost:3306/tianze-pro?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true
spring.datasource.dynamic.datasource.master.username=tianze-pro
spring.datasource.dynamic.datasource.master.password=xYR3A4EXCWxkHmNX
spring.datasource.dynamic.datasource.master.password=xYR3A4EXCWxkHmNX
spring.datasource.dynamic.datasource.master.hikari.max-lifetime=60000
# ds2

@ -1353,4 +1353,30 @@ getErrorStatistics
getStudentExtendSchoolInfo
===
* 获取学生的学校信息 班级-专业-院系-院校
SELECT
t.*,
ta.class_id,
ta.class_name,
tb.university_system_id,
tb.university_system_name,
tc.university_faculty_id,
tc.university_faculty_name,
td.universities_colleges_id,
td.universities_colleges_name
FROM
student t
LEFT JOIN school_class ta ON ta.class_id = t.class_id
AND ta.class_status = 1
LEFT JOIN university_system tb ON tb.university_system_id = ta.university_system_id
AND tb.university_system_status = 1
LEFT JOIN university_faculty tc ON tc.university_faculty_id = tb.university_faculty_id
AND tc.university_faculty_status = 1
LEFT JOIN universities_colleges td ON td.universities_colleges_id = tc.universities_colleges_id
AND td.universities_colleges_status = 1
WHERE
1 = 1
AND FIND_IN_SET(t.student_id,#studentIds#)

@ -450,4 +450,31 @@ SELECT
WHERE a.params LIKE '%studentEnd\\_%'
)t GROUP BY t.student_id,t.platform
)t GROUP BY t.platform
)b ON b.platform = TRIM(REPLACE(t.application_name,'子应用',''))
)b ON b.platform = TRIM(REPLACE(t.application_name,'子应用',''))
getTeacherExtendSchoolInfo
===
* 获取教师的学校信息 专业-院系-院校
SELECT
t.*,
tb.university_system_id,
tb.university_system_name,
tc.university_faculty_id,
tc.university_faculty_name,
td.universities_colleges_id,
td.universities_colleges_name
FROM
teacher t
LEFT JOIN university_system tb ON tb.university_system_id = t.university_system_id
AND tb.university_system_status = 1
LEFT JOIN university_faculty tc ON tc.university_faculty_id = t.university_faculty_id
AND tc.university_faculty_status = 1
LEFT JOIN universities_colleges td ON td.universities_colleges_id = t.universities_colleges_id
AND td.universities_colleges_status = 1
WHERE
1 = 1
AND FIND_IN_SET(t.teacher_id,#teacherIds#)
Loading…
Cancel
Save