mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-16 14:26:49 +08:00
Compare commits
2 Commits
72ebb761f5
...
50c7cb4dba
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50c7cb4dba | ||
|
|
f3e2908b41 |
@@ -306,15 +306,16 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
* 数据维度:(单门课程、多个学生)
|
* 数据维度:(单门课程、多个学生)
|
||||||
* 25.11.20新增
|
* 25.11.20新增
|
||||||
*
|
*
|
||||||
* @param courseId 课程id
|
* @param sc 课程学习记录查询参数
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value="/export",method = {RequestMethod.GET,RequestMethod.POST})
|
@RequestMapping(value="/export",method = {RequestMethod.GET,RequestMethod.POST})
|
||||||
public void export(String courseId, HttpServletResponse response) {
|
public void export(StudyCourse sc, HttpServletResponse response) {
|
||||||
// 入参校验
|
// 入参校验
|
||||||
if (StringUtils.isBlank(courseId)) {
|
if (StringUtils.isBlank(sc.getCourseId())) {
|
||||||
log.error("【导出课程学习记录】课程id不能为空");
|
log.error("【导出课程学习记录】课程id不能为空");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
String courseId = sc.getCourseId();
|
||||||
// 定义输出流
|
// 定义输出流
|
||||||
OutputStream outputStream = null;
|
OutputStream outputStream = null;
|
||||||
try {
|
try {
|
||||||
@@ -378,9 +379,7 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 3.查询课程学习记录信息并拼接导出信息
|
// 3.查询课程学习记录信息并拼接导出信息
|
||||||
StudyCourse studyCourse = new StudyCourse();
|
List<StudyCourse> studyCourses = service.findList(sc, null, null);
|
||||||
studyCourse.setCourseId(courseId);
|
|
||||||
List<StudyCourse> studyCourses = service.findList(studyCourse, null, null);
|
|
||||||
// 通过studyCourses中的人员id集合(去重),调用用户中心接口获取人员信息,填充部门字段
|
// 通过studyCourses中的人员id集合(去重),调用用户中心接口获取人员信息,填充部门字段
|
||||||
List<String> userIds = studyCourses.stream().map(StudyCourse::getAid).filter(Objects::nonNull).collect(Collectors.toList());
|
List<String> userIds = studyCourses.stream().map(StudyCourse::getAid).filter(Objects::nonNull).collect(Collectors.toList());
|
||||||
if (!userIds.isEmpty()) {
|
if (!userIds.isEmpty()) {
|
||||||
|
|||||||
@@ -806,6 +806,36 @@ public class StudyCourseServiceImpl implements IStudyCourseService{
|
|||||||
if (StringUtils.isNotBlank(sc.getAid())) {
|
if (StringUtils.isNotBlank(sc.getAid())) {
|
||||||
query.addFilter(FieldFilters.eq("aid", sc.getAid()));
|
query.addFilter(FieldFilters.eq("aid", sc.getAid()));
|
||||||
}
|
}
|
||||||
|
// 25.11.25新增:添加基于时间的查询条件
|
||||||
|
if (sc.getQueryStartTime() != null && sc.getQueryFinishTime() != null) {
|
||||||
|
// 开始结束时间均传入的情况,实现筛选逻辑
|
||||||
|
// (startTime >= 查询开始时间 AND startTime <= 查询结束时间) OR (finishTime >= 查询开始时间 AND finishTime <= 查询结束时间)
|
||||||
|
// 这样兼容查询结束时间为空值的情况,因为学员课程未结束时没有结束时间
|
||||||
|
LocalDate startDate = LocalDate.parse(sc.getQueryStartTime());
|
||||||
|
LocalDateTime startDateTime = startDate.atStartOfDay();
|
||||||
|
LocalDate finishDate = LocalDate.parse(sc.getQueryFinishTime());
|
||||||
|
LocalDateTime finishDateTime = finishDate.atTime(LocalTime.MAX);
|
||||||
|
// 筛选开始时间
|
||||||
|
IFieldFilter startTimeInRange = FieldFilters.and(FieldFilters.ge("startTime", startDateTime), FieldFilters.le("startTime", finishDateTime));
|
||||||
|
// 筛选结束时间
|
||||||
|
IFieldFilter finishTimeInRange = FieldFilters.and(FieldFilters.ge("finishTime", startDateTime), FieldFilters.le("finishTime", finishDateTime));
|
||||||
|
// OR条件查询
|
||||||
|
query.addFilter(FieldFilters.or(startTimeInRange, finishTimeInRange));
|
||||||
|
} else {
|
||||||
|
// 只输出单个参数情况
|
||||||
|
// 筛选开始时间
|
||||||
|
if (sc.getQueryStartTime() != null) {
|
||||||
|
LocalDate startDate = LocalDate.parse(sc.getQueryStartTime());
|
||||||
|
LocalDateTime startDateTime = startDate.atStartOfDay();
|
||||||
|
query.addFilter(FieldFilters.ge("startTime", startDateTime));
|
||||||
|
}
|
||||||
|
// 筛选结束时间
|
||||||
|
if (sc.getQueryFinishTime() != null) {
|
||||||
|
LocalDate finishDate = LocalDate.parse(sc.getQueryFinishTime());
|
||||||
|
LocalDateTime finishDateTime = finishDate.atTime(LocalTime.MAX);
|
||||||
|
query.addFilter(FieldFilters.le("finishTime", finishDateTime));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (isFinish != null) {
|
if (isFinish != null) {
|
||||||
if (isFinish) {
|
if (isFinish) {
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
boe:
|
boe:
|
||||||
domain: http://192.168.0.253
|
domain: http://192.168.0.253
|
||||||
pcPageUrl: ${boe.domain}/pc/course/studyindex?id=
|
domain-name: https://u-pre.boe.com
|
||||||
h5PageUrl: ${boe.domain}/mobile/pages/study/courseStudy?id=
|
pcPageUrl: ${boe.domain-name}/pc/course/studyindex?id=
|
||||||
pcLoginUrl: ${boe.domain}/web/
|
h5PageUrl: ${boe.domain-name}/mobile/pages/study/courseStudy?id=
|
||||||
h5LoginUrl: ${boe.domain}/m/loginuser
|
pcLoginUrl: ${boe.domain-name}/web/
|
||||||
|
h5LoginUrl: ${boe.domain-name}/m/loginuser
|
||||||
spring:
|
spring:
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
|
|||||||
@@ -128,10 +128,11 @@ jasypt:
|
|||||||
|
|
||||||
boe:
|
boe:
|
||||||
domain: http://10.251.132.75
|
domain: http://10.251.132.75
|
||||||
pcPageUrl: ${boe.domain}/pc/course/studyindex?id=
|
domain-name: https://u-pre.boe.com
|
||||||
h5PageUrl: ${boe.domain}/mobile/pages/study/courseStudy?id=
|
pcPageUrl: ${boe.domain-name}/pc/course/studyindex?id=
|
||||||
pcLoginUrl: ${boe.domain}/web/
|
h5PageUrl: ${boe.domain-name}/mobile/pages/study/courseStudy?id=
|
||||||
h5LoginUrl: ${boe.domain}/m/loginuser
|
pcLoginUrl: ${boe.domain-name}/web/
|
||||||
|
h5LoginUrl: ${boe.domain-name}/m/loginuser
|
||||||
ok:
|
ok:
|
||||||
http:
|
http:
|
||||||
connect-timeout: 30
|
connect-timeout: 30
|
||||||
|
|||||||
@@ -140,3 +140,11 @@ aop-log-record:
|
|||||||
elasticsearch:
|
elasticsearch:
|
||||||
host: 10.251.88.218
|
host: 10.251.88.218
|
||||||
port: 9200
|
port: 9200
|
||||||
|
|
||||||
|
boe:
|
||||||
|
domain: http://192.168.0.253
|
||||||
|
domain-name: https://u.boe.com
|
||||||
|
pcPageUrl: ${boe.domain-name}/pc/course/studyindex?id=
|
||||||
|
h5PageUrl: ${boe.domain-name}/mobile/pages/study/courseStudy?id=
|
||||||
|
pcLoginUrl: ${boe.domain-name}/web/
|
||||||
|
h5LoginUrl: ${boe.domain-name}/m/loginuser
|
||||||
@@ -153,10 +153,11 @@ jasypt:
|
|||||||
|
|
||||||
boe:
|
boe:
|
||||||
domain: http://10.251.186.27
|
domain: http://10.251.186.27
|
||||||
pcPageUrl: ${boe.domain}/pc/course/studyindex?id=
|
domain-name: https://u-pre.boe.com
|
||||||
h5PageUrl: ${boe.domain}/mobile/pages/study/courseStudy?id=
|
pcPageUrl: ${boe.domain-name}/pc/course/studyindex?id=
|
||||||
pcLoginUrl: ${boe.domain}/web/
|
h5PageUrl: ${boe.domain-name}/mobile/pages/study/courseStudy?id=
|
||||||
h5LoginUrl: ${boe.domain}/m/loginuser
|
pcLoginUrl: ${boe.domain-name}/web/
|
||||||
|
h5LoginUrl: ${boe.domain-name}/m/loginuser
|
||||||
ok:
|
ok:
|
||||||
http:
|
http:
|
||||||
connect-timeout: 30
|
connect-timeout: 30
|
||||||
|
|||||||
@@ -52,10 +52,6 @@ ok:
|
|||||||
keep-alive-duration: 300
|
keep-alive-duration: 300
|
||||||
boe:
|
boe:
|
||||||
domain: http://127.0.0.1
|
domain: http://127.0.0.1
|
||||||
pcPageUrl: ${boe.domain}/pc/course/studyindex?id=
|
|
||||||
h5PageUrl: ${boe.domain}/mobile/pages/study/courseStudy?id=
|
|
||||||
pcLoginUrl: ${boe.domain}/web/
|
|
||||||
h5LoginUrl: ${boe.domain}/m/loginuser
|
|
||||||
orgTree:
|
orgTree:
|
||||||
orgTreeList: ${boe.domain}/userbasic/org/list
|
orgTreeList: ${boe.domain}/userbasic/org/list
|
||||||
orgChildTreeList: ${boe.domain}/userbasic/org/childOrgs
|
orgChildTreeList: ${boe.domain}/userbasic/org/childOrgs
|
||||||
|
|||||||
Reference in New Issue
Block a user