From 26780c533f2c2af6b9216306f649c1bcede94e4a Mon Sep 17 00:00:00 2001 From: yn147 <2270338776@qq.com> Date: 星期五, 24 十一月 2023 16:43:37 +0800 Subject: [PATCH] 学生、课程 --- src/main/java/com/qxueyou/scc/teach/subject/service/impl/SubjectService.java | 23 ++++++++++++++++------- 1 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/qxueyou/scc/teach/subject/service/impl/SubjectService.java b/src/main/java/com/qxueyou/scc/teach/subject/service/impl/SubjectService.java index b387087..bd4ffc1 100644 --- a/src/main/java/com/qxueyou/scc/teach/subject/service/impl/SubjectService.java +++ b/src/main/java/com/qxueyou/scc/teach/subject/service/impl/SubjectService.java @@ -2,10 +2,7 @@ import java.lang.reflect.InvocationTargetException; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; import com.qxueyou.scc.base.model.UserInfoWrapper; @@ -107,7 +104,7 @@ @Override - public Result add(String subjectName, String coverPageFileId, String contentFileId, int type) { + public Result add(String subjectName, String coverPageFileId, String contentFileId, int type, Date startTime, Date endTime) { Subject subject = new Subject(); if (StringUtils.isNotEmpty(coverPageFileId)) { @@ -122,6 +119,9 @@ subject.setStatus(Subject.STATUS_DRAFT); subject.setLectureCount(0); subject.setType(type); + //绛惧埌鏃堕棿 + subject.setStartTime(startTime); + subject.setEndTime(endTime); subject.setOrgId(ClientUtils.getOrgId()); save(subject); @@ -493,7 +493,8 @@ // newSubject.setStatus(origSubject.getStatus()); newSubject.setOrigSubjectId(origSubjectId); newSubject.setOrigCopySubjectId(origSubjectId); - newSubject.setType(Subject.TYPE_CLS_SUBJECT); +// newSubject.setType(Subject.TYPE_CLS_SUBJECT); + newSubject.setType(Subject.TYPE_ORG_SUBJECT); newSubject.setTeacherName(teacher.getName()); newSubject.setOrgId(ClientUtils.getOrgId()); save(newSubject); @@ -849,7 +850,9 @@ } else { if (StringUtils.isNotEmpty(teacherId)) { result = this.findListWithMapByHql( - "select distinct origSubjectId as subjectId ,name as subjectName from Subject where deleteFlag is false and type=" + Subject.TYPE_CLS_SUBJECT + " and teacherId='" + teacherId + "'", null); +// "select distinct origSubjectId as subjectId ,name as subjectName from Subject where deleteFlag is false and type=" + Subject.TYPE_CLS_SUBJECT + " and teacherId='" + teacherId + "'", null); + "select distinct origSubjectId as subjectId ,name as subjectName from Subject where deleteFlag is false and type=" + Subject.TYPE_ORG_SUBJECT + " and teacherId='" + teacherId + "'", null); + } else { result = this.findListWithMapByHql( "select subjectId as subjectId ,name as subjectName from Subject where deleteFlag is false and type=" + Subject.TYPE_ORG_SUBJECT + " and orgId='" + ClientUtils.getOrgId() + "'", null); @@ -1097,6 +1100,12 @@ } } + @Override + public String findSubjectName(String subjectId) { + Subject subject = findUnique("from Subject where subjectId = ? ",CollectionUtils.newList(subjectId),Subject.class); + return subject.getName(); + } + /** * 鎴戠殑鍏紑璇惧垪琛� -- Gitblit v1.8.0