Ver código fonte

通知、课堂

tags/正式3.14.0
王宁 7 meses atrás
pai
commit
9d977dbceb

+ 16
- 0
README.md Ver arquivo

@@ -44,3 +44,19 @@ resource 资源
44 44
 | 16   | 完形填空(复合)、阅读理解(复合)             | 16       | 正常 |
45 45
 | 17   | 任务型阅读(复合)                     | 17       | 正常 |
46 46
 
47
+#### 课堂保存类型
48
+
49
+| 序号 | 类型rtype              | 备注 |
50
+| ---- |----------------------|--|
51
+| 1    | startclass                  | 课堂--开始 |
52
+| 2    | stopclass                 | 课堂--结束 |
53
+| 3    | savefile     | 课堂--保存图片 |
54
+| 4    | askteacher             | 互动--发起 |
55
+| 5    | askstudent              | 互动--保存学生作答 |
56
+| 6    | sign             | 学生--签到 |
57
+| 7    | paperteacher            | 堂测--发布 | 
58
+| 8    | paperstudent            | 堂测--学生作答详情 |
59
+| 9    | voteteacher            | 投票-发布 |
60
+| 10   | votestudent | 投票--学生投票 | 
61
+| 11   | profileteacher      | 资料-发布 |
62
+| 12   | profilestudent   | 资料-学生查看 | 

+ 1
- 1
sapi/src/main/java/com/xhkjedu/sapi/controller/notice/NoticeController.java Ver arquivo

@@ -129,7 +129,7 @@ public class NoticeController {
129 129
     }
130 130
 
131 131
     /**
132
-     *功能描述 电子书学生--网页--列表
132
+     *功能描述 学生--网页--列表
133 133
      * @author WN
134 134
      * @date 2022/2/22
135 135
      * @param  * @param notice

+ 3
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/notice/NoticeMapper.java Ver arquivo

@@ -79,4 +79,7 @@ public interface NoticeMapper extends TkMapper<TNotice> {
79 79
     int deleteNotice(@Param("noticeid")Integer noticeid);
80 80
 
81 81
     Integer getNoticeid(@Param("noticeid")Integer noticeid);
82
+
83
+    //获取用户所属科目
84
+    String getUserSubjectByUserid(@Param("userid")Integer userid);
82 85
 }

+ 3
- 0
sapi/src/main/java/com/xhkjedu/sapi/model/notice/TNotice.java Ver arquivo

@@ -39,6 +39,9 @@ public class TNotice extends BaseBean {
39 39
     //通知内容纯文本
40 40
     private String noticetxt;
41 41
 
42
+    //科目id
43
+    private String subjectid;
44
+
42 45
     @Transient
43 46
     //班级id集合
44 47
     private List<ClassVo> classes;

+ 14
- 4
sapi/src/main/java/com/xhkjedu/sapi/service/notice/NoticeService.java Ver arquivo

@@ -2,16 +2,16 @@ package com.xhkjedu.sapi.service.notice;
2 2
 
3 3
 import com.xhkjedu.sapi.listener.MessageSender;
4 4
 import com.xhkjedu.sapi.mapper.notice.NoticeClassMapper;
5
+import com.xhkjedu.sapi.mapper.notice.NoticeFileMapper;
5 6
 import com.xhkjedu.sapi.mapper.notice.NoticeMapper;
6 7
 import com.xhkjedu.sapi.mapper.notice.NoticeUserMapper;
8
+import com.xhkjedu.sapi.model.notice.TNotice;
7 9
 import com.xhkjedu.sapi.model.notice.TNoticeClass;
8
-import com.xhkjedu.sapi.model.notice.TNoticeUser;
9
-import com.xhkjedu.sapi.mapper.notice.*;
10 10
 import com.xhkjedu.sapi.model.notice.TNoticeFile;
11
-import com.xhkjedu.sapi.model.notice.TNotice;
11
+import com.xhkjedu.sapi.model.notice.TNoticeUser;
12 12
 import com.xhkjedu.sapi.vo.notice.NoticeClassVo;
13
-import com.xhkjedu.utils.N_Utils;
14 13
 import com.xhkjedu.sapi.vo.notice.NoticeVo;
14
+import com.xhkjedu.utils.N_Utils;
15 15
 import org.springframework.stereotype.Service;
16 16
 import org.springframework.transaction.annotation.Transactional;
17 17
 
@@ -44,6 +44,16 @@ public class NoticeService {
44 44
         if (N_Utils.isEmptyInteger(model.getCreatetime())) {
45 45
             model.setCreatetime(N_Utils.getSecondTimestamp());
46 46
         }
47
+
48
+        //根据noticetype发布对象为学生时,获取教师科目
49
+        if(model.getNoticetype() == 3){
50
+            //获取教师任教科目
51
+            String subjectid = noticeMapper.getUserSubjectByUserid(model.getCreateid());
52
+            if(N_Utils.isNotEmpty(subjectid)){
53
+                model.setSubjectid(subjectid);
54
+            }
55
+        }
56
+
47 57
         noticeMapper.insertUseGeneratedKeys(model);
48 58
         model.setNoticeid(model.getId());
49 59
         //添加通知对象

+ 2
- 0
sapi/src/main/java/com/xhkjedu/sapi/vo/notice/NoticeVo.java Ver arquivo

@@ -27,4 +27,6 @@ public class NoticeVo {
27 27
 
28 28
     //通知对象1班级2老师3学校师生4学校教师5学校学生
29 29
     private Integer noticetype;
30
+
31
+    private String subjectname;//科目
30 32
 }

+ 16
- 3
sapi/src/main/resources/mapper/notice/NoticeMapper.xml Ver arquivo

@@ -61,9 +61,10 @@
61 61
     </select>
62 62
     <!-- 用户通知列表 -->
63 63
     <select id="listMy" resultType="com.xhkjedu.sapi.vo.notice.NoticeVo">
64
-        select n.noticeid,n.noticetitle,n.noticetxt,n.createtime,u.username createname,IFNULL(nt.readed,0) as readed
64
+        select n.noticeid,n.noticetitle,n.noticetxt,n.createtime,n.subjectname,u.username createname,IFNULL(nt.readed,0) as readed
65 65
         from t_notice n left join t_user u on n.createid=u.userid
66 66
         left join t_notice_user nt on n.noticeid = nt.noticeid
67
+        left join t_subject s on n.subjectid=s.subjectid
67 68
         where nt.userid=#{notice.createid}
68 69
         <if test="notice.readed!=null"> and nt.readed=#{notice.readed}</if>
69 70
         <if test="notice.noticetitle!=null and notice.noticetitle!=''">
@@ -76,6 +77,9 @@
76 77
         <if test="notice.stoptime!=null and notice.stoptime!=0">
77 78
             and n.createtime &lt;=#{notice.stoptime}
78 79
         </if>
80
+        <if test="notice.subjectid!=null and notice.subjectid!='' and notice.subjectid!='0'.toString()">
81
+            and n.subjectid=#{notice.subjectid}
82
+        </if>
79 83
 
80 84
         group by n.noticeid order by nt.readed,n.createtime desc
81 85
         <if test="notice.page==null">
@@ -88,7 +92,7 @@
88 92
     </select>
89 93
     <!--学生通知列表-->
90 94
     <select id="listStudent" resultType="com.xhkjedu.sapi.vo.notice.NoticeVo">
91
-        select n.noticeid,n.noticetitle,n.noticetxt,n.createtime,u.username createname
95
+        select n.noticeid,n.noticetitle,n.noticetxt,n.createtime,n.subjectid,u.username createname
92 96
         from t_notice n left join t_user u on n.createid=u.userid
93 97
         left join t_notice_class nc on n.noticeid = nc.noticeid
94 98
         left join t_class_student cs on nc.classid=cs.classid
@@ -102,10 +106,11 @@
102 106
     <!--//////////////////////////////////////////////学生WEB端//////////////////////////////////////////////-->
103 107
     <!--学生通知列表-->
104 108
     <select id="listNoticeForStuWeb" resultType="com.xhkjedu.sapi.vo.notice.NoticeVo">
105
-        select n.noticeid,n.noticetitle,n.noticecontent,n.noticetxt,n.createtime,u.username createname
109
+        select n.noticeid,n.noticetitle,n.noticecontent,n.noticetxt,s.subjectname,n.createtime,u.username createname
106 110
         from t_notice n left join t_user u on n.createid=u.userid
107 111
         left join t_notice_class nc on n.noticeid = nc.noticeid
108 112
         left join t_class_student cs on nc.classid=cs.classid
113
+        left join t_subject s on n.subjectid=s.subjectid
109 114
         where ((cs.studentid=#{notice.createid} and n.noticetype=1) or (n.noticetype=3 and nc.classid=#{notice.createid}))
110 115
         <if test="notice.noticetitle!=null and notice.noticetitle!=''">
111 116
             and (n.noticetitle like concat('%', #{notice.noticetitle}, '%')
@@ -117,6 +122,9 @@
117 122
         <if test="notice.stoptime!=null and notice.stoptime!=0">
118 123
             and n.createtime&lt;=#{notice.stoptime}
119 124
         </if>
125
+        <if test="notice.subjectid!=null and notice.subjectid!='' and notice.subjectid!='0'.toString()">
126
+            and n.subjectid=#{notice.subjectid}
127
+        </if>
120 128
         group by n.noticeid order by n.createtime desc
121 129
     </select>
122 130
     <!--根据班级删除通知-->
@@ -132,4 +140,9 @@
132 140
     <select id="getNoticeid" resultType="java.lang.Integer">
133 141
         select noticeid from t_notice where noticeid=#{noticeid}
134 142
     </select>
143
+
144
+    <!--根据用户ID获取用户所属科目-->
145
+    <select id="getUserSubjectByUserid" resultType="java.lang.String">
146
+        select subjectid from t_teacher_powersb where teacherid=#{userid} group by subjectid limit 1
147
+    </select>
135 148
 </mapper>

+ 1
- 0
sclass/src/main/java/com/xhkjedu/sclass/model/classroom/TClassroomPaperScantron.java Ver arquivo

@@ -45,4 +45,5 @@ public class TClassroomPaperScantron extends BaseBean {
45 45
 
46 46
     //选项数量
47 47
     private Integer optionnum;
48
+
48 49
 }

+ 2
- 2
sclass/src/main/resources/mapper/classroom/ClassroomMapper.xml Ver arquivo

@@ -180,8 +180,8 @@
180 180
         ,g.gradeid,g.classname,(select count(*) from t_classroom_sign s where s.userid=#{room.studentid}
181 181
         and s.roomid=r.roomid) signstate
182 182
         ,(select count(*) from t_classroom_video rv where rv.roomid=r.roomid)videonum
183
-        ,(select count(*) from t_classroom_vote vt where vt.roomid=c.roomid)votenum
184
-        ,(select count(*) from t_classroom_profile p where p.roomid=c.roomid)profilenum
183
+        ,(select count(*) from t_classroom_vote vt where vt.roomid=r.roomid)votenum
184
+        ,(select count(*) from t_classroom_profile p where p.roomid=r.roomid)profilenum
185 185
         from t_classroom r left join t_user u on r.teacherid=u.userid
186 186
         left join t_subject_book sb on r.lsbid=sb.lsbid
187 187
         left join t_class_student cs on r.classid=cs.classid

Carregando…
Cancelar
Salvar