Quellcode durchsuchen

教研详情完善

tags/正式3.10.1
雍文秀 vor 1 Jahr
Ursprung
Commit
43a9dde346

+ 2
- 2
sapi/src/main/java/com/xhkjedu/sapi/controller/research/ResearchController.java Datei anzeigen

@@ -153,7 +153,7 @@ public class ResearchController {
153 153
      * @return com.xhkjedu.vo.ResultVo
154 154
      **/
155 155
     @PostMapping("ulist")
156
-    public ResultVo ulist(@RequestBody TResearch research) {
156
+    public ResultVo ulist(@RequestBody TResearchUser research) {
157 157
         Integer page = research.getPage();
158 158
         Integer pageSize = research.getPageSize();
159 159
         Integer researchid = research.getResearchid();
@@ -161,7 +161,7 @@ public class ResearchController {
161 161
         N_Utils.validation(new Object[]{page, "显示页码", 1, pageSize, "显示条数", 1,
162 162
                 researchid, "教研id", 1, schoolid, "学校id", 1});
163 163
         PageHelper.startPage(page, pageSize);
164
-        List<Map<String, String>> list = researchService.listUserByRidAndSid(researchid, schoolid);
164
+        List<Map<String, String>> list = researchService.listUserByRidAndSid(researchid, schoolid, research.getUserid());
165 165
         PageResult pageResult = PageUtil.getPageResult(new PageInfo(list));
166 166
         return new ResultVo(0, "获取学校下用户教研评价成功", pageResult);
167 167
     }

+ 2
- 1
sapi/src/main/java/com/xhkjedu/sapi/mapper/research/ResearchUserMapper.java Datei anzeigen

@@ -107,7 +107,8 @@ public interface ResearchUserMapper extends TkMapper<TResearchUser> {
107 107
     Integer noEvaluatedNum(@Param("userid") Integer userid, @Param("timestamp") int timestamp);
108 108
 
109 109
     //获取学校下用户教研评价
110
-    List<Map<String, String>> listUserByRidAndSid(@Param("researchid") Integer researchid, @Param("schoolid") Integer schoolid);
110
+    List<Map<String, String>> listUserByRidAndSid(@Param("researchid") Integer researchid
111
+            , @Param("schoolid") Integer schoolid,@Param("userid") Integer userid);
111 112
 
112 113
     //教研学校用户
113 114
     List<Map> listReaearchSchools(@Param("researchid") Integer researchid,@Param("publiced") Integer publiced, @Param("schoolid") Integer schoolid);

+ 2
- 2
sapi/src/main/java/com/xhkjedu/sapi/service/research/ResearchService.java Datei anzeigen

@@ -209,8 +209,8 @@ public class ResearchService {
209 209
      * @Date 2023/7/24 9:08
210 210
      * @return java.util.List<java.util.Map<java.lang.String,java.lang.String>>
211 211
      **/
212
-    public List<Map<String, String>> listUserByRidAndSid(Integer researchid, Integer schoolid) {
213
-        return researchUserMapper.listUserByRidAndSid(researchid,schoolid);
212
+    public List<Map<String, String>> listUserByRidAndSid(Integer researchid, Integer schoolid, Integer userid) {
213
+        return researchUserMapper.listUserByRidAndSid(researchid, schoolid, userid);
214 214
     }
215 215
 
216 216
     /*

+ 0
- 13
sapi/src/main/java/com/xhkjedu/sapi/service/research/ResearchUserService.java Datei anzeigen

@@ -78,19 +78,6 @@ public class ResearchUserService {
78 78
         // 如果教研是公开的,则获取所有已提交教研publiced:是否公开0不公开1校内公开2全部公开
79 79
         if (publiced > 0) {
80 80
             List<Map> schools = researchUserMapper.listReaearchSchools(researchid,publiced, researchUserVo.getSchoolid());
81
-            // 去除学校中未参与评价教师
82
-            for (int i = 0; i < schools.size(); i++) {
83
-                List<Map> commitRusers = new ArrayList<>();
84
-                List<Map> rusers = (List<Map>) schools.get(i).get("rusers");
85
-                for (int j = 0; j < rusers.size(); j++) {
86
-                    Map map = rusers.get(j);
87
-                    Integer rustate = Integer.parseInt(map.get("rustate").toString());
88
-                    if (rustate != null && rustate == 1) {
89
-                        commitRusers.add(map);
90
-                    }
91
-                }
92
-                schools.get(i).put("rusers", commitRusers);
93
-            }
94 81
             researchUserVo.setSchools(schools);
95 82
         }
96 83
 

+ 6
- 5
sapi/src/main/resources/mapper/research/ResearchUserMapper.xml Datei anzeigen

@@ -83,6 +83,7 @@
83 83
         select ru.ruid,ru.userid,ru.content,ru.reviewtime,ru.createtime,u.username,u.headpic
84 84
         from t_research_user ru left join t_user u on ru.userid=u.userid
85 85
         where ru.researchid=#{researchid} and ru.rustate=1 and ru.schoolid=#{schoolid}
86
+        <if test="userid!=null and userid!=0">and ru.userid=#{userid}</if>
86 87
         order by ru.reviewtime desc
87 88
     </select>
88 89
 
@@ -100,16 +101,16 @@
100 101
         </collection>
101 102
     </resultMap>
102 103
     <!--教研学校用户-->
103
-    <select id="listReaearchSchools" resultMap="researchSchoolUser">
104
-        select ru.schoolid,s.schoolname,ru.ruid,ru.userid,ru.content,ru.reviewtime,ru.rustate,
105
-        u.username createname,u.headpic
106
-        from t_research_user ru left join t_user u on ru.userid=u.userid
104
+    <select id="listReaearchSchools" resultType="java.util.Map">
105
+        select ru.schoolid,s.schoolname
106
+        from t_research_user ru
107 107
         left join t_school s on ru.schoolid=s.schoolid
108 108
         where ru.researchid=#{researchid}
109 109
         <if test="publiced!=null and publiced==1">
110 110
             and ru.schoolid=#{schoolid}
111 111
         </if>
112
-        order by ru.schoolid=#{schoolid},ru.schoolid,ru.reviewtime desc
112
+        group by ru.schoolid
113
+        order by if(ru.schoolid=#{schoolid},0,ru.schoolid),ru.reviewtime desc
113 114
     </select>
114 115
 
115 116
     <!--根据教研教师id获取教研截至时间-->

Laden…
Abbrechen
Speichern