Browse Source

Merge remote-tracking branch 'cloud-schoolapi/ywx'

# Conflicts:
#	sapi/src/main/resources/application.properties
tags/正式3.3.0
王宁 2 years ago
parent
commit
34cf793baf

+ 1
- 1
sclass/src/main/resources/application.properties View File

61
 cron.deleteUriMap=0/3 * * * * ?
61
 cron.deleteUriMap=0/3 * * * * ?
62
 
62
 
63
 #版本号
63
 #版本号
64
-versionname=Test_v3.2.3
64
+versionname=Test_v3.2.6

+ 1
- 1
slive/src/main/resources/application.properties View File

102
 cron.updateLicenseState=0 0 0/1 * * ?
102
 cron.updateLicenseState=0 0 0/1 * * ?
103
 
103
 
104
 #版本号
104
 #版本号
105
-versionname=Test_v3.2.5
105
+versionname=Test_v3.2.6

+ 18
- 8
sstudy/src/main/java/com/xhkjedu/sstudy/controller/recite/ReciteController.java View File

18
 import org.springframework.web.bind.annotation.RestController;
18
 import org.springframework.web.bind.annotation.RestController;
19
 
19
 
20
 import java.util.List;
20
 import java.util.List;
21
+import java.util.Map;
21
 
22
 
22
 /**
23
 /**
23
  * @ClassName ReciteController
24
  * @ClassName ReciteController
97
     }
98
     }
98
 
99
 
99
     /**
100
     /**
100
-     *功能描述 背诵教师--网页--列表
101
+     * 功能描述 背诵教师--网页--列表
102
+     *
103
+     * @param * @param recite
104
+     * @return com.xhkjedu.vo.ResultVo
101
      * @author WN
105
      * @author WN
102
      * @date 2020/6/10
106
      * @date 2020/6/10
103
-     * @param  * @param recite
104
-     * @return com.xhkjedu.vo.ResultVo
105
      */
107
      */
106
     @PostMapping("list")
108
     @PostMapping("list")
107
-    public ResultVo list(@RequestBody TRecite recite){
109
+    public ResultVo list(@RequestBody TRecite recite) {
108
         N_Utils.validation(new Object[]{
110
         N_Utils.validation(new Object[]{
109
-                recite.getPage(),"显示页码",1,recite.getPageSize(),"显示条数",1,
110
-                recite.getCreateid(),"创建人",1});
111
+                recite.getPage(), "显示页码", 1, recite.getPageSize(), "显示条数", 1,
112
+                recite.getCreateid(), "创建人", 1});
111
         PageHelper.startPage(recite.getPage(), recite.getPageSize());
113
         PageHelper.startPage(recite.getPage(), recite.getPageSize());
112
-        List<ReciteVo> list = reciteService.listRecites(recite);
114
+        List<Map> list = reciteService.listRecites(recite);
113
         PageResult pageResult = PageUtil.getPageResult(new PageInfo(list));
115
         PageResult pageResult = PageUtil.getPageResult(new PageInfo(list));
114
-        return new ResultVo(0,"获取列表成功",pageResult);
116
+        return new ResultVo(0, "获取列表成功", pageResult);
117
+    }
118
+
119
+    @PostMapping("/list_class")
120
+    public ResultVo listClass(@RequestBody TRecite recite) {
121
+        Integer reciteid = recite.getReciteid();
122
+        N_Utils.validation(new Object[]{reciteid, "背诵id", 1});
123
+        List<Map> list = reciteService.listClass(reciteid);
124
+        return new ResultVo(0, "获取背诵班级成功", list);
115
     }
125
     }
116
 
126
 
117
 }
127
 }

+ 16
- 4
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/recite/ReciteMapper.java View File

7
 import org.springframework.stereotype.Repository;
7
 import org.springframework.stereotype.Repository;
8
 
8
 
9
 import java.util.List;
9
 import java.util.List;
10
+import java.util.Map;
10
 
11
 
11
 /**
12
 /**
12
  * @ClassName ReciteMapper
13
  * @ClassName ReciteMapper
26
     Integer updateRecite(@Param("recite") TRecite recite);
27
     Integer updateRecite(@Param("recite") TRecite recite);
27
 
28
 
28
     /**
29
     /**
29
-     *功能描述 列表--网页
30
+     * 功能描述 列表--网页
31
+     *
32
+     * @param * @param recite
33
+     * @return java.util.Map
30
      * @author WN
34
      * @author WN
31
      * @date 2020/6/10
35
      * @date 2020/6/10
32
-     * @param  * @param recite
33
-     * @return java.util.List<com.xhkjedu.vo.recite.ReciteVo>
34
      */
36
      */
35
-    List<ReciteVo> listRecites(@Param("recite") TRecite recite);
37
+    List<Map> listRecites(@Param("recite") TRecite recite);
38
+
39
+    /**
40
+     * 获取背诵班级
41
+     *
42
+     * @return java.util.List<java.util.Map>
43
+     * @Param [reciteid]
44
+     * @Author ywx
45
+     * @Date 2022/6/21 10:36
46
+     **/
47
+    List<Map> listClass(Integer reciteid);
36
 }
48
 }

+ 18
- 11
sstudy/src/main/java/com/xhkjedu/sstudy/service/recite/ReciteService.java View File

20
 
20
 
21
 import java.util.ArrayList;
21
 import java.util.ArrayList;
22
 import java.util.List;
22
 import java.util.List;
23
+import java.util.Map;
23
 import java.util.stream.Collectors;
24
 import java.util.stream.Collectors;
24
 
25
 
25
 /**
26
 /**
129
     }
130
     }
130
 
131
 
131
     /**
132
     /**
132
-     *功能描述 列表--网页
133
+     * 功能描述 列表--网页
134
+     *
135
+     * @param * @param recite
136
+     * @return java.util.Map
133
      * @author WN
137
      * @author WN
134
      * @date 2020/6/10
138
      * @date 2020/6/10
135
-     * @param  * @param recite
136
-     * @return java.util.List<com.xhkjedu.vo.recite.ReciteVo>
137
      */
139
      */
138
-    public List<ReciteVo> listRecites(TRecite recite){
139
-        List<ReciteVo> list = reciteMapper.listRecites(recite);
140
-        for (ReciteVo r : list) {
141
-            List<ReciteClassVo> classlist = r.getClasslist();
142
-            Integer stunum = classlist.stream().collect(Collectors.summingInt(ReciteClassVo::getStunum));
143
-            Integer commitnum = classlist.stream().collect(Collectors.summingInt(ReciteClassVo::getCommitnum));
144
-            r.setCommitrate(N_Utils.getIntegerDivideAndMulitiply(commitnum,stunum));
145
-        }
140
+    public List<Map> listRecites(TRecite recite) {
141
+        List<Map> list = reciteMapper.listRecites(recite);
146
         return list;
142
         return list;
147
     }
143
     }
148
 
144
 
145
+    /**
146
+     * 获取背诵班级
147
+     *
148
+     * @return java.util.List<java.util.Map>
149
+     * @Param [reciteid]
150
+     * @Author ywx
151
+     * @Date 2022/6/21 10:33
152
+     **/
153
+    public List<Map> listClass(Integer reciteid) {
154
+        return reciteMapper.listClass(reciteid);
155
+    }
149
 }
156
 }

+ 1
- 1
sstudy/src/main/resources/application.properties View File

107
 dbname=xhkjedu_school_test
107
 dbname=xhkjedu_school_test
108
 
108
 
109
 #版本号
109
 #版本号
110
-versionname=Test_v3.2.5
110
+versionname=Test_v3.2.6

+ 17
- 33
sstudy/src/main/resources/mapper/recite/ReciteMapper.xml View File

6
         UPDATE t_recite SET recitetitle=#{recite.recitetitle},recitecont=#{recite.recitecont}
6
         UPDATE t_recite SET recitetitle=#{recite.recitetitle},recitecont=#{recite.recitecont}
7
         WHERE reciteid=#{recite.reciteid}
7
         WHERE reciteid=#{recite.reciteid}
8
     </update>
8
     </update>
9
-
10
-    <resultMap id="reciteClass" type="com.xhkjedu.sstudy.vo.recite.ReciteVo">
11
-        <result property="reciteid" column="reciteid"></result>
12
-        <result property="recitetitle" column="recitetitle"></result>
13
-        <result property="recitecont" column="recitecont"></result>
14
-        <result property="subjectid" column="subjectid"></result>
15
-        <result property="subjectname" column="subjectname"></result>
16
-        <result property="createid" column="createid"></result>
17
-        <result property="createname" column="createname"></result>
18
-        <result property="createtime" column="createtime"></result>
19
-        <collection property="classlist" ofType="com.xhkjedu.sstudy.vo.recite.ReciteClassVo"
20
-                    javaType="java.util.List" select="listClass" column="{reciteid=reciteid}">
21
-        </collection>
22
-    </resultMap>
23
-    <resultMap id="classResult" type="com.xhkjedu.sstudy.vo.recite.ReciteClassVo">
24
-        <result property="classid" column="classid"></result>
25
-        <result property="classname" column="classname"></result>
26
-        <result property="starttime" column="starttime"></result>
27
-        <result property="stoptime" column="stoptime"></result>
28
-        <result property="stunum" column="stunum"></result>
29
-        <result property="commitnum" column="commitnum"></result>
30
-    </resultMap>
31
-    <select id="listClass" resultMap="classResult">
32
-        select rg.classid,c.classname,c.gradeid,rg.starttime,rg.stoptime,
33
-        (SELECT COUNT(*) FROM t_recite_student rs WHERE rs.reciteid=rg.reciteid AND rs.classid=rg.classid) stunum,
34
-        (SELECT COUNT(*) FROM t_recite_student rs WHERE rs.reciteid=rg.reciteid AND rs.classid=rg.classid AND rs.rsstate>0) commitnum
35
-        from t_recite_group rg LEFT JOIN t_class c ON rg.classid = c.classid
36
-        where rg.reciteid=#{reciteid} order by c.gradeid,c.classtype,c.classorder
9
+    <!--获取背诵班级-->
10
+    <select id="listClass" resultType="java.util.Map">
11
+        select rs.classid,c.classname,c.gradeid,count(distinct rs.rsid)stunum
12
+        ,count(distinct case when rs.rsstate>0 then rs.rsid else null end)commitnum
13
+        from t_recite_student rs left join t_class c on rs.classid = c.classid
14
+        where rs.reciteid=#{reciteid} group by rs.classid order by c.classtype,c.classorder
37
     </select>
15
     </select>
38
 
16
 
39
     <!-- 背诵分页列表 网页 -->
17
     <!-- 背诵分页列表 网页 -->
40
-    <select id="listRecites" resultMap="reciteClass">
41
-        SELECT r.reciteid,r.recitetitle,r.recitecont,r.subjectid,s.subjectname,
42
-        r.createid,u.username AS createname,r.createtime,rg.starttime,rg.stoptime
43
-        FROM t_recite r LEFT JOIN t_subject s ON r.subjectid = s.subjectid
44
-        LEFT JOIN t_user u ON r.createid=u.userid
18
+    <select id="listRecites" resultType="java.util.Map">
19
+        SELECT r.reciteid,r.recitetitle,r.recitecont
20
+        ,(select s.subjectname from t_subject s where s.subjectid=r.subjectid)subjectname
21
+        ,COUNT(DISTINCT CASE WHEN rs.reciteid=r.reciteid THEN rs.rsid ELSE NULL END)stunum
22
+        ,COUNT(DISTINCT CASE WHEN rs.reciteid=r.reciteid AND rs.rsstate>0 THEN rs.rsid ELSE NULL END)commitnum
23
+        ,r.createid,u.username AS createname,r.createtime,rg.starttime,rg.stoptime
24
+        FROM t_recite r LEFT JOIN t_user u ON r.createid=u.userid
45
         LEFT JOIN t_recite_group rg ON rg.reciteid = r.reciteid
25
         LEFT JOIN t_recite_group rg ON rg.reciteid = r.reciteid
26
+        LEFT JOIN t_recite_student rs ON r.reciteid=rg.reciteid
46
         where r.createid=#{recite.createid}
27
         where r.createid=#{recite.createid}
47
         <if test="recite.recitestate==1">
28
         <if test="recite.recitestate==1">
48
             AND rg.stoptime<![CDATA[ >= ]]>UNIX_TIMESTAMP()
29
             AND rg.stoptime<![CDATA[ >= ]]>UNIX_TIMESTAMP()
50
         <if test="recite.recitestate==2">
31
         <if test="recite.recitestate==2">
51
             AND rg.stoptime<![CDATA[ < ]]>UNIX_TIMESTAMP()
32
             AND rg.stoptime<![CDATA[ < ]]>UNIX_TIMESTAMP()
52
         </if>
33
         </if>
34
+        <if test="recite.recitetitle!=null and recite.recitetitle!=''">
35
+            AND r.recitetitle like '%${recite.recitetitle}%'
36
+        </if>
53
         GROUP BY r.reciteid ORDER BY r.createtime desc
37
         GROUP BY r.reciteid ORDER BY r.createtime desc
54
     </select>
38
     </select>
55
 </mapper>
39
 </mapper>

+ 2
- 1
suser/src/main/java/com/xhkjedu/suser/service/system/RoleService.java View File

17
 
17
 
18
 import java.util.ArrayList;
18
 import java.util.ArrayList;
19
 import java.util.List;
19
 import java.util.List;
20
+import java.util.stream.Collectors;
20
 
21
 
21
 /**
22
 /**
22
  * @ClassName RoleService
23
  * @ClassName RoleService
168
                 }
169
                 }
169
             }
170
             }
170
         }
171
         }
171
-        return lst;
172
+        return lst.stream().filter(m -> m.getModulechilds() != null && m.getModulechilds().size() > 0).collect(Collectors.toList());
172
     }
173
     }
173
 
174
 
174
     //判断集合中是否存在模块
175
     //判断集合中是否存在模块

+ 1
- 1
suser/src/main/resources/application.properties View File

57
 #郑州管城大数据SSO认证鉴权接口
57
 #郑州管城大数据SSO认证鉴权接口
58
 ssourl=http://gcdsj.zzgcjy.cn/portal/sso/api/agent
58
 ssourl=http://gcdsj.zzgcjy.cn/portal/sso/api/agent
59
 #版本号
59
 #版本号
60
-versionname=Test_v3.2.9
60
+versionname=Test_v3.2.10

Loading…
Cancel
Save