Browse Source

通知 学生批阅

tags/正式3.13.3
雍文秀 1 year ago
parent
commit
9f2d382aec

+ 0
- 6
sapi/src/main/java/com/xhkjedu/sapi/model/notice/TNoticeFile.java View File

@@ -28,12 +28,6 @@ public class TNoticeFile extends BaseBean {
28 28
     //封面图地址
29 29
     private String resourcecover;
30 30
 
31
-    //是否转换0未转换1已转换2转换失败3加密
32
-    private Integer converted;
33
-
34
-    //转换失败原因
35
-    private String convertmsg;
36
-
37 31
     //转换后的pdf文件地址
38 32
     private String pdfurl;
39 33
 

+ 0
- 4
sapi/src/main/java/com/xhkjedu/sapi/model/notice/TNoticeUser.java View File

@@ -39,8 +39,4 @@ public class TNoticeUser extends BaseBean {
39 39
 
40 40
     //学校id
41 41
     private Integer schoolid;
42
-
43
-    private Integer gradeid;//年级id
44
-
45
-    private Integer classid;//班级id
46 42
 }

+ 2
- 27
sapi/src/main/java/com/xhkjedu/sapi/service/notice/NoticeService.java View File

@@ -66,39 +66,14 @@ public class NoticeService {
66 66
 
67 67
     //添加通知对象
68 68
     private void saveNoticeObj(TNotice model) {
69
-        Integer noticetype = model.getNoticetype();
70
-        if (noticetype == 1) {//通知对象1班级
71
-            noticeClassMapper.batchSave(model);
72
-        } else if (noticetype == 2 || noticetype == 3) {//通知对象2老师3单个学生
73
-            model.setUsers(N_Utils.listDistinct(model.getUsers()));//通知对象去重
74
-            noticeUserMapper.batchSave(model);
75
-        }
76
-
77
-        /*if (N_Utils.isListEmpty(model.getSchools())) {//兼容以前添加单个学校模式
78
-            List<TSchool> schools = new ArrayList<>();
79
-            TSchool s = new TSchool();
80
-            s.setSchoolid(model.getSchoolid());
81
-            schools.add(s);
82
-            model.setSchools(schools);
83
-        }
84
-        noticeSchoolMapper.batchSave(model);//通知学校关联信息*/
69
+        model.setUsers(N_Utils.listDistinct(model.getUsers()));//通知对象去重
70
+        noticeUserMapper.batchSave(model);
85 71
     }
86 72
 
87 73
     //获取详情
88 74
     public TNotice findById(Integer noticeid) {
89 75
         TNotice notice = noticeMapper.findById(noticeid);
90 76
         notice.setFiles(noticeFileMapper.listByNoticeId(noticeid));
91
-        /*Integer noticetype = notice.getNoticetype();
92
-        if (noticetype == 1) {
93
-            List<ClassVo> classes = noticeMapper.listClass(noticeid);
94
-            notice.setClasses(classes);
95
-        } else if (noticetype == 2 || noticetype == 3) {
96
-            List<NoticeUserVo> users = noticeMapper.listUser(noticeid);
97
-            notice.setUsers(users);
98
-        } else {
99
-            List<TSchool> schools = noticeMapper.listSchool(noticeid);
100
-            notice.setSchools(schools);
101
-        }*/
102 77
         return notice;
103 78
     }
104 79
 

+ 2
- 3
sapi/src/main/resources/mapper/itemtool/StudentTodoMapper.xml View File

@@ -63,9 +63,8 @@
63 63
             </if>
64 64
             <if test="todo.todotype=='notice'">
65 65
                 select 'notice' as todotype,count(distinct n.noticeid)num,#{todo.subjectid} as subjectid
66
-                from t_notice n left join t_notice_class nc on n.noticeid = nc.noticeid
67
-                left join t_class_student s on nc.classid=s.classid
68
-                where s.studentid=#{todo.studentid}
66
+                from t_notice n left join t_notice_user nu on n.noticeid = nu.noticeid
67
+                where nu.userid=#{todo.studentid} and nu.readed=0
69 68
                 <if test="todo.showtime!=null and todo.showtime!=0">
70 69
                     and n.createtime>=#{todo.showtime}
71 70
                 </if>

+ 1
- 4
sapi/src/main/resources/mapper/notice/NoticeMapper.xml View File

@@ -5,12 +5,9 @@
5 5
     <select id="listAll" resultType="com.xhkjedu.sapi.vo.notice.NoticeVo">
6 6
         select n.noticeid,n.noticetitle,n.createtime,u.username createname,n.noticetype
7 7
         from t_notice n left join t_user u on n.createid=u.userid
8
-        <if test="notice.schoolid!=null">
9
-        left join t_notice_school ns on n.noticeid = ns.noticeid
10
-        </if>
11 8
         <where>
12 9
             <if test="notice.schoolid!=null">
13
-                and ns.schoolid=#{notice.schoolid}
10
+                and n.schoolid=#{notice.schoolid}
14 11
             </if>
15 12
             <if test="notice.schoolid==null">
16 13
                 and n.schoolid is null

+ 2
- 2
sapi/src/main/resources/mapper/notice/NoticeUserMapper.xml View File

@@ -25,14 +25,14 @@
25 25
             <result property="userid" column="userid"/>
26 26
             <result property="readed" column="readed"/>
27 27
             <result property="username" column="username"/>
28
+            <result property="headpic" column="headpic"/>
28 29
         </collection>
29 30
     </resultMap>
30 31
     <select id="listByNoticeId" resultMap="userResult">
31
-        select nu.userid,nu.readed,u.username,nu.gradeid,nu.classid,nu.subjectid
32
+        select nu.userid,nu.readed,u.username,u.headpic,nu.gradeid,nu.classid,nu.subjectid
32 33
         ,if(nu.classid is not null,(select c.classname from t_class c where c.classid=nu.classid)
33 34
             ,(select s.subjectname from t_subject s where s.subjectid=nu.subjectid))name
34 35
         from t_notice_user nu left join t_user u on nu.userid = u.userid
35 36
         where nu.noticeid=#{noticeid}
36
-        order by convert(u.username using gbk)
37 37
     </select>
38 38
 </mapper>

+ 15
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/controller/paperstudent/PaperStudentController.java View File

@@ -166,10 +166,24 @@ public class PaperStudentController {
166 166
         Integer pageSize = ps.getPageSize();
167 167
         N_Utils.validation(new Object[]{checkid,"批阅人id",1,page,"显示页码",1,pageSize,"显示条数",1});
168 168
         ps.setPage((page - 1)*pageSize);
169
-        List<PaperStudentVo> list = paperStudentService.correctList(ps);
169
+        List<Map> list = paperStudentService.correctList(ps);
170 170
         return new ResultVo(0, "获取学生批阅列表成功!",list);
171 171
     }
172 172
 
173
+    /**
174
+     * @Description 批阅学生列表
175
+     * @Date 2023/12/19 16:14
176
+     * @Author YWX
177
+     * @Param [ps]
178
+     * @Return com.xhkjedu.vo.ResultVo
179
+     **/
180
+    @PostMapping("/list_stu")
181
+    public ResultVo listCorrectStu(@RequestBody TPaperStudent ps) {
182
+        N_Utils.validation(new Object[]{ps.getCheckid(), "批阅人id", 1, ps.getPaperid(), "作业id", 1, ps.getClassid(), "班级id", 1});
183
+        List<Map> list = paperStudentService.listCorrectStu(ps);
184
+        return new ResultVo(0, "获取批阅学生列表成功!", list);
185
+    }
186
+
173 187
     /**
174 188
      * 题库作业--按题批阅列表
175 189
      * @Param [ps]

+ 4
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/paperstudent/PaperStudentMapper.java View File

@@ -104,7 +104,7 @@ public interface PaperStudentMapper extends TkMapper<TPaperStudent> {
104 104
      * @Date 2020/6/18 14:35
105 105
      * @return java.util.List<com.xhkjedu.vo.paperstudent.PaperStudentVo>
106 106
      **/
107
-    List<PaperStudentVo> correctList(@Param("ps") TPaperStudent ps);
107
+    List<Map> correctList(@Param("ps") TPaperStudent ps);
108 108
 
109 109
     /**
110 110
      * 作业说明
@@ -221,4 +221,7 @@ public interface PaperStudentMapper extends TkMapper<TPaperStudent> {
221 221
 
222 222
     //获取可批阅人数
223 223
     Integer getCheckNum(@Param("paperid") Integer paperid,@Param("checkid") Integer checkid);
224
+
225
+    //批阅学生列表
226
+    List<Map> listCorrectStu(@Param("ps") TPaperStudent ps);
224 227
 }

+ 12
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/service/paperstudent/PaperStudentService.java View File

@@ -469,7 +469,7 @@ public class PaperStudentService {
469 469
      * @Date 2020/6/18 14:34
470 470
      * @return java.util.List<com.xhkjedu.vo.paperstudent.PaperStudentVo>
471 471
      **/
472
-    public List<PaperStudentVo> correctList(TPaperStudent ps) {
472
+    public List<Map> correctList(TPaperStudent ps) {
473 473
         return paperStudentMapper.correctList(ps);
474 474
     }
475 475
 
@@ -1131,4 +1131,15 @@ public class PaperStudentService {
1131 1131
     public Integer isChecker(PaperStudentQuestionVo psq) {
1132 1132
         return paperStudentMapper.isChecker(psq);
1133 1133
     }
1134
+
1135
+    /**
1136
+     * @Description 批阅学生列表
1137
+     * @Date 2023/12/19 16:14
1138
+     * @Author YWX
1139
+     * @Param [ps]
1140
+     * @Return java.util.List<java.util.Map>
1141
+     **/
1142
+    public List<Map> listCorrectStu(TPaperStudent ps) {
1143
+        return paperStudentMapper.listCorrectStu(ps);
1144
+    }
1134 1145
 }

+ 22
- 8
sstudy/src/main/resources/mapper/paperstudent/PaperStudentMapper.xml View File

@@ -40,16 +40,21 @@
40 40
         GROUP BY ps.psid ORDER BY pg.starttime DESC,p.createtime DESC LIMIT #{ps.page},#{ps.pageSize}
41 41
     </select>
42 42
     <!--批阅列表-->
43
-    <select id="correctList" resultType="com.xhkjedu.sstudy.vo.paperstudent.PaperStudentVo">
44
-        select ps.psid,p.paperid,p.papername,p.paperclass,p.schoolid,ps.psstate,ps.pschecked
45
-        ,pg.starttime,pg.stoptime,u.username createname,s.subjectname,p.papertype,pg.checked
43
+    <select id="correctList" resultType="java.util.Map">
44
+        select a.*
45
+        ,pg.starttime,pg.stoptime,u.username createname,s.subjectname,pg.checked
46
+        from (select ps.paperid,ps.classid,p.createid,p.subjectid,p.papername,p.paperclass,p.schoolid,p.papertype
47
+        ,count(if(ps.psstate in(1,2) and ps.pschecked=0,ps.psid,null)) wpynum
48
+        ,count(if(ps.psstate in(0,3) and ps.pschecked=0,ps.psid,null)) wtjnum
49
+        ,count(if(ps.pschecked=1,ps.psid,null)) ypynum
46 50
         from t_paper_student ps join t_paper p on p.paperid = ps.paperid
47
-        left join t_paper_class pg on ps.paperid = pg.paperid and ps.classid=pg.classid
48
-        left join t_user u on p.createid = u.userid
49
-        left join t_subject s on p.subjectid = s.subjectid
50 51
         left join t_director d on p.directorid=d.directorid
51
-        where p.deleted=0 and ps.checkid=#{ps.checkid} and (d.disabled=0 or p.directorid is null) and ps.psstate in (1,2) and ps.pschecked!=1
52
-        ORDER BY ps.stoptime desc LIMIT #{ps.page},#{ps.pageSize}
52
+        where p.deleted=0 and ps.checkid=#{ps.checkid} and (d.disabled=0 or p.directorid is null)
53
+        group by p.paperid,ps.classid)a
54
+        left join t_paper_class pg on a.paperid = pg.paperid and a.classid=pg.classid
55
+        left join t_user u on a.createid = u.userid
56
+        left join t_subject s on a.subjectid = s.subjectid
57
+        order by pg.starttime desc limit #{ps.page},#{ps.pageSize}
53 58
     </select>
54 59
     <!--作业说明-->
55 60
     <select id="getPaperComm" resultType="com.xhkjedu.sstudy.vo.paperstudent.PaperCommVo">
@@ -404,4 +409,13 @@
404 409
         left join t_paper_class pg on ps.paperid=pg.paperid and ps.classid=pg.classid
405 410
         where p.paperid=#{paperid} and ps.psstate in(1,2)
406 411
     </select>
412
+    <!--批阅学生列表-->
413
+    <select id="listCorrectStu" resultType="java.util.Map">
414
+        select ps.psid,ps.userscore,ps.psstate,ps.pschecked,u.username,u.headpic
415
+        from t_paper_student ps left join t_user u on ps.studentid=u.userid
416
+        where paperid=#{ps.paperid} and ps.classid=#{ps.classid} and ps.checkid=#{ps.checkid} and ps.pschecked!=1
417
+        <if test="ps.psstate!=null and ps.psstate==0">and ps.psstate in(0,3)</if>
418
+        <if test="ps.psstate!=null and ps.psstate==2">and ps.psstate in(1,2)</if>
419
+        order by field(ps.psstate,1,2,0,3)
420
+    </select>
407 421
 </mapper>

+ 5
- 9
suser/src/main/resources/mapper/gradeclass/ClassTeacherMapper.xml View File

@@ -227,16 +227,12 @@
227 227
         left join t_class_student cs on c.classid = cs.classid
228 228
         left join t_user u on cs.studentid=u.userid
229 229
         where ct.teacherid=#{role.teacherid} and c.year=#{role.year} and c.classstate=1
230
-        and c.schoolid=#{role.schoolid}
231
-        <if test="role.classtype!=null and role.classtype!=0">
232
-            <if test="role.classtype!=11">and c.classtype=#{role.classtype}</if>
233
-            <if test="role.classtype==11">and c.classtype in(1,2)</if>
234
-        </if>
235
-        <if test="role.classtype==null or role.classtype==0">
236
-            and c.classtype!=99
230
+        and c.schoolid=#{role.schoolid} and c.classnum>0
231
+        <if test="classtype!=null and classtype!=0">
232
+            and c.classtype=#{classtype}
237 233
         </if>
238
-        <if test="role.gradeid!=null and role.gradeid!=0">
239
-            and c.gradeid=#{role.gradeid}
234
+        <if test="classtype==null or classtype==0">
235
+            and c.classtype <![CDATA[ < ]]>5
240 236
         </if>
241 237
         order by c.gradeid,c.classtype,c.classorder,c.classname,convert(u.username using gbk)
242 238
     </select>

Loading…
Cancel
Save