From 784d643c8d073dc31652b03b7f1bd82a9d1c627f Mon Sep 17 00:00:00 2001
From: EricsHu <hrr145632>
Date: 星期四, 23 十一月 2023 20:21:26 +0800
Subject: [PATCH] 优化班级课程

---
 src/main/java/com/qxueyou/scc/teach/subject/service/impl/SubjectService.java |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 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 4627751..b387087 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
@@ -207,8 +207,8 @@
 
     @Override
     public List<Subject> list(String text, String teacherId, String status, Integer type, Integer pageSize, Integer pageNum) {
-
-        StringBuffer hql = new StringBuffer("from Subject where name like ? and orgId=? and deleteFlag is false and origSubjectId is null ");
+        //and origSubjectId is null
+        StringBuffer hql = new StringBuffer("from Subject where name like ? and orgId=? and deleteFlag is false  ");
 
         List<Object> args = CollectionUtils.newList(text + "%", ClientUtils.getOrgId());
 
@@ -222,8 +222,12 @@
             args.add(status);
         }
 
+//        if (!StringUtils.isEmpty(teacherId)) {
+//            hql.append(" and createId=?");
+//            args.add(teacherId);
+//        }
         if (!StringUtils.isEmpty(teacherId)) {
-            hql.append(" and createId=?");
+            hql.append(" and teacherId=?");
             args.add(teacherId);
         }
         hql.append(" order by createTime desc");
@@ -476,17 +480,17 @@
     @Override
     public Result addClsSubject(String classId, String origSubjectId, String teacherId, Integer schoolYear, Integer term) throws IllegalAccessException, InvocationTargetException {
         //鏂板鑰佸笀璇剧▼
-        Subject newSubject = new Subject();
-        Subject origSubject = this.read(origSubjectId);
+//        Subject newSubject = new Subject();
+        Subject newSubject = this.read(origSubjectId);
         UserTeacher teacher = this.read(UserTeacher.class, teacherId);
-        BeanUtils.copyProperties(newSubject, origSubject);
+//        BeanUtils.copyProperties(newSubject, origSubject);
 
         TraceUtils.setCreateTrace(newSubject);
-        newSubject.setSubjectId(null);
+//        newSubject.setSubjectId(null);
         newSubject.setTeacherId(teacherId);
         newSubject.setSchoolYear(schoolYear);
         newSubject.setTerm(term);
-        newSubject.setStatus(origSubject.getStatus());
+//        newSubject.setStatus(origSubject.getStatus());
         newSubject.setOrigSubjectId(origSubjectId);
         newSubject.setOrigCopySubjectId(origSubjectId);
         newSubject.setType(Subject.TYPE_CLS_SUBJECT);
@@ -644,7 +648,7 @@
             String className = "鍏紑璇�";
             subjectMap.put("subjectName",subject.getSubjectName());
             subjectMap.put("subjectId",subject.getSubjectId());
-
+            subjectMap.put("coverPageUrl",subject.getCoverPageUrl());
             subjectMap.put("percent", new BigDecimal(percentAvg));
             subjectMap.put("progressValue", new BigDecimal(progressValue));
             subjectMap.put("className",className);

--
Gitblit v1.8.0