教师端首页

beetlsql3-dev
Mlxa0324 2 years ago
parent a8500f95a7
commit a32738d481

@ -1,6 +1,9 @@
package com.ibeetl.jlw.entity.api.teacher; package com.ibeetl.jlw.entity.api.teacher;
import com.ibeetl.jlw.entity.*; import com.ibeetl.jlw.entity.ResourcesApplication;
import com.ibeetl.jlw.entity.StudentHandsOnTaskReport;
import com.ibeetl.jlw.entity.TeacherOpenCourseMergeTeacher;
import com.ibeetl.jlw.entity.TeacherOpenCourseNotice;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
@ -35,7 +38,7 @@ public class TeacherIndexData {
/** /**
* *
*/ */
private List<TeacherMergeApplication> myApplicationList; private List<ResourcesApplication> myApplicationList;
/** /**
* *

@ -1,8 +1,10 @@
package com.ibeetl.jlw.service; package com.ibeetl.jlw.service;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
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.jlw.dao.ResourcesApplicationCourseDao; import com.ibeetl.jlw.dao.ResourcesApplicationCourseDao;
@ -173,6 +175,10 @@ public class ResourcesApplicationService extends CoreBaseService<ResourcesApplic
List<Long> resourcesApplicationIdList = systemList.stream() List<Long> resourcesApplicationIdList = systemList.stream()
.map(UniversitiesCollegesJurisdictionExperimentalSystem::getTypeId).collect(Collectors.toList()); .map(UniversitiesCollegesJurisdictionExperimentalSystem::getTypeId).collect(Collectors.toList());
if(ObjectUtil.isEmpty(resourcesApplicationIdList)) {
return ListUtil.empty();
}
// 根据应用ID查询应用信息 // 根据应用ID查询应用信息
return resourcesApplicationDao.selectByIds(resourcesApplicationIdList); return resourcesApplicationDao.selectByIds(resourcesApplicationIdList);
} }

@ -1,43 +1,28 @@
package com.ibeetl.jlw.service; package com.ibeetl.jlw.service;
import java.io.*; import cn.hutool.core.collection.ListUtil;
import java.text.DateFormat; import cn.hutool.core.util.ObjectUtil;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.math.BigDecimal;
import cn.jlw.util.ToolUtils; import cn.jlw.util.ToolUtils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ibeetl.admin.core.entity.CoreUser; import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.admin.core.util.TimeTool; import com.ibeetl.admin.core.util.PlatformException;
import com.ibeetl.admin.core.web.JsonResult; import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.admin.core.web.JsonReturnCode; import com.ibeetl.admin.core.web.JsonReturnCode;
import com.ibeetl.jlw.dao.StudentHandsOnTaskReportDao; import com.ibeetl.jlw.dao.StudentHandsOnTaskReportDao;
import com.ibeetl.jlw.entity.StudentHandsOnTaskReport; import com.ibeetl.jlw.entity.StudentHandsOnTaskReport;
import com.ibeetl.jlw.web.query.StudentHandsOnTaskReportQuery; import com.ibeetl.jlw.web.query.StudentHandsOnTaskReportQuery;
import com.ibeetl.jlw.entity.FileEntity;
import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.admin.core.util.PlatformException;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.beetl.sql.core.engine.PageQuery;
import org.beetl.sql.core.SqlId; import org.beetl.sql.core.SqlId;
import javax.annotation.Resource; import org.beetl.sql.core.engine.PageQuery;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import static com.ibeetl.admin.core.util.ExcelUtil.getCellFormatValue; import java.util.List;
import java.util.Map;
/** /**
* -- Service * -- Service
@ -169,6 +154,9 @@ public class StudentHandsOnTaskReportService extends CoreBaseService<StudentHand
} }
public List<StudentHandsOnTaskReport> getReportList(List<Long> collect) { public List<StudentHandsOnTaskReport> getReportList(List<Long> collect) {
if(ObjectUtil.isEmpty(collect)) {
return ListUtil.empty();
}
return studentHandsOnTaskReportDao.getReportList(collect); return studentHandsOnTaskReportDao.getReportList(collect);
} }

@ -5,14 +5,11 @@ import com.ibeetl.jlw.dao.TeacherMergeApplicationDao;
import com.ibeetl.jlw.entity.*; import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.entity.api.CurrentUserInfo; import com.ibeetl.jlw.entity.api.CurrentUserInfo;
import com.ibeetl.jlw.entity.api.teacher.TeacherIndexData; import com.ibeetl.jlw.entity.api.teacher.TeacherIndexData;
import com.ibeetl.jlw.service.IndexBaseService; import com.ibeetl.jlw.service.*;
import com.ibeetl.jlw.service.StudentHandsOnTaskReportService;
import com.ibeetl.jlw.service.TeacherOpenCourseMergeTeacherService;
import com.ibeetl.jlw.service.TeacherOpenCourseNoticeService;
import com.ibeetl.jlw.web.query.TeacherMergeApplicationQuery; import com.ibeetl.jlw.web.query.TeacherMergeApplicationQuery;
import com.ibeetl.jlw.web.query.TeacherOpenCourseMergeTeacherQuery; import com.ibeetl.jlw.web.query.TeacherOpenCourseMergeTeacherQuery;
import com.ibeetl.jlw.web.query.TeacherOpenCourseNoticeQuery; import com.ibeetl.jlw.web.query.TeacherOpenCourseNoticeQuery;
import org.assertj.core.util.Lists; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -39,6 +36,11 @@ public class ApiTeacherService {
@Resource private StudentHandsOnTaskReportService studentHandsOnTaskReportService; @Resource private StudentHandsOnTaskReportService studentHandsOnTaskReportService;
@Autowired
private ResourcesApplicationService resourcesApplicationService;
@Autowired
private TeacherService teacherService;
/** /**
* - * -
* @return * @return
@ -53,22 +55,26 @@ public class ApiTeacherService {
// 教师ID // 教师ID
final Long teacherId = ((Teacher) identityInfo).getTeacherId(); final Long teacherId = ((Teacher) identityInfo).getTeacherId();
TeacherExtendSchoolInfo teacherExtendSchoolInfo = teacherService.getTeacherExtendSchoolInfo(teacherId.toString());
// 我的通知 // 我的通知
TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery = new TeacherOpenCourseNoticeQuery(); TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery = new TeacherOpenCourseNoticeQuery();
teacherOpenCourseNoticeQuery.setCreateByTeacherId(teacherId); teacherOpenCourseNoticeQuery.setCreateByTeacherId(teacherId);
List<TeacherOpenCourseNotice> noticeList = teacherOpenCourseNoticeService.getValuesByQuery(teacherOpenCourseNoticeQuery); List<TeacherOpenCourseNotice> noticeList = teacherOpenCourseNoticeService.getValues(teacherOpenCourseNoticeQuery);
// 教师应用信息 // 教师应用信息
TeacherMergeApplicationQuery teacherMergeApplicationQuery = new TeacherMergeApplicationQuery(); TeacherMergeApplicationQuery teacherMergeApplicationQuery = new TeacherMergeApplicationQuery();
teacherMergeApplicationQuery.setTeacherId(teacherId); teacherMergeApplicationQuery.setTeacherId(teacherId);
List<TeacherMergeApplication> applicationList = teacherMergeApplicationDao.getValuesByQueryOrderByIndex(teacherMergeApplicationQuery); List<TeacherMergeApplication> applicationList = teacherMergeApplicationDao.getValuesByQueryOrderByIndex(teacherMergeApplicationQuery);
// 我的应用由来:教师所在的院校,查询关联到的应用
List<ResourcesApplication> resourcesApplicationList = resourcesApplicationService
.getResourcesApplicationListByUniversitiesCollegesId(teacherExtendSchoolInfo.getUniversitiesCollegesId());
// 我的开课信息 // 我的开课信息
TeacherOpenCourseMergeTeacherQuery teacherOpenCourseMergeTeacherQuery = new TeacherOpenCourseMergeTeacherQuery(); TeacherOpenCourseMergeTeacherQuery teacherOpenCourseMergeTeacherQuery = new TeacherOpenCourseMergeTeacherQuery();
teacherOpenCourseMergeTeacherQuery.setTeacherId(teacherId); teacherOpenCourseMergeTeacherQuery.setTeacherId(teacherId);
List<TeacherOpenCourseMergeTeacher> openCourseList = teacherOpenCourseMergeTeacherService.getValuesByQuery(teacherOpenCourseMergeTeacherQuery); List<TeacherOpenCourseMergeTeacher> openCourseList = teacherOpenCourseMergeTeacherService.getValues(teacherOpenCourseMergeTeacherQuery);
// 实训评阅列表查询 // 实训评阅列表查询
List<Long> collect = openCourseList.stream().map(TeacherOpenCourseMergeTeacher::getTeacherOpenCourseId).collect(Collectors.toList()); List<Long> collect = openCourseList.stream().map(TeacherOpenCourseMergeTeacher::getTeacherOpenCourseId).collect(Collectors.toList());
@ -78,7 +84,7 @@ public class ApiTeacherService {
return TeacherIndexData.builder() return TeacherIndexData.builder()
.toDoList(reportList) .toDoList(reportList)
.noticeList(noticeList) .noticeList(noticeList)
.myApplicationList(applicationList) .myApplicationList(resourcesApplicationList)
.myOpenCourseList(openCourseList) .myOpenCourseList(openCourseList)
.build(); .build();
} }

@ -45,6 +45,16 @@ public class ResourcesApplicationQuery extends PageParam {
private String courseInfoIds; private String courseInfoIds;
/**
* ID
*/
private Long teacherId;
/**
* ID
*/
private Long studentId;
public Long getResourcesApplicationId(){ public Long getResourcesApplicationId(){
return resourcesApplicationId; return resourcesApplicationId;
} }
@ -181,4 +191,19 @@ public class ResourcesApplicationQuery extends PageParam {
} }
public Long getTeacherId() {
return teacherId;
}
public void setTeacherId(Long teacherId) {
this.teacherId = teacherId;
}
public Long getStudentId() {
return studentId;
}
public void setStudentId(Long studentId) {
this.studentId = studentId;
}
} }

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

@ -250,7 +250,7 @@ getValuesByQueryOrderByIndex
select t.* select t.*
from teacher_merge_application t from teacher_merge_application t
where 1=1 and #function("teacherMergeApplication.query")# where 1=1
@if(!isEmpty(teacherMergeApplicationId)){ @if(!isEmpty(teacherMergeApplicationId)){
and t.teacher_merge_application_id =#teacherMergeApplicationId# and t.teacher_merge_application_id =#teacherMergeApplicationId#
@} @}

Loading…
Cancel
Save