|
@@ -14,8 +14,8 @@ import com.xhkjedu.sapi.vo.notice.NoticeVo;
|
14
|
14
|
import org.springframework.web.bind.annotation.*;
|
15
|
15
|
|
16
|
16
|
import javax.annotation.Resource;
|
17
|
|
-import java.util.List;
|
18
|
|
-import java.util.Map;
|
|
17
|
+import java.util.*;
|
|
18
|
+import java.util.stream.Collectors;
|
19
|
19
|
|
20
|
20
|
/**
|
21
|
21
|
* @author ywx
|
|
@@ -175,13 +175,51 @@ public class NoticeController {
|
175
|
175
|
Integer noticeid = nu.getNoticeid();
|
176
|
176
|
Integer page = nu.getPage();
|
177
|
177
|
Integer pageSize = nu.getPageSize();
|
178
|
|
- N_Utils.validation(new Object[]{noticeid, "通知id", 1, page, "显示页码", 1, pageSize, "显示条数"});
|
|
178
|
+ N_Utils.validation(new Object[]{noticeid, "通知id", 1, page, "显示页码", 1, pageSize, "显示条数", 1});
|
179
|
179
|
PageHelper.startPage(page, pageSize);
|
180
|
180
|
List<Map> list = noticeService.listUser(nu);
|
181
|
181
|
PageResult pageResult = PageUtil.getPageResult(new PageInfo(list));
|
|
182
|
+ List<Map> list1 = (List<Map>) pageResult.getList();
|
|
183
|
+ Map<Object, List<Map>> gMap = list1.stream().collect(Collectors.groupingBy(m -> m.get("gradeid")));
|
|
184
|
+ List<Map<String, Object>> grades = new ArrayList<>();
|
|
185
|
+ for (Map.Entry<Object, List<Map>> entry : gMap.entrySet()) {
|
|
186
|
+ Map<String, Object> g = new LinkedHashMap<>();
|
|
187
|
+ g.put("gradeid", entry.getKey());
|
|
188
|
+ //List<Map<Object, List<Map>>> subjectClass = new ArrayList<>();
|
|
189
|
+ /*List<Map> subjectClass = entry.getValue();
|
|
190
|
+ Map<String, List<Map>> collect = users.stream().collect(Collectors.groupingBy(m -> m.get("subjectid").toString() + m.get("classid")));
|
|
191
|
+ for (Map.Entry<String, List<Map>> uentry : collect.entrySet()) {
|
|
192
|
+ List<Map> value = uentry.getValue();
|
|
193
|
+ Map map = value.get(0);
|
|
194
|
+ Map sc = new LinkedHashMap();
|
|
195
|
+ sc.put("subjectid", map.get("subjectid"));
|
|
196
|
+ sc.put("classid", map.get("classid"));
|
|
197
|
+ sc.put("name", map.get("name"));
|
|
198
|
+ sc.put("users", value);
|
|
199
|
+ subjectClass.add(sc);
|
|
200
|
+ }*/
|
|
201
|
+ g.put("subjectClass", entry.getValue());
|
|
202
|
+ grades.add(g);
|
|
203
|
+ }
|
|
204
|
+ pageResult.setList(grades);
|
182
|
205
|
return new ResultVo(0, "获取通知对象成功", pageResult);
|
183
|
206
|
}
|
184
|
207
|
|
|
208
|
+ /**
|
|
209
|
+ * @Description 获取通知科目和班级
|
|
210
|
+ * @Date 2023/12/25 14:20
|
|
211
|
+ * @Author YWX
|
|
212
|
+ * @Param [nu]
|
|
213
|
+ * @Return com.xhkjedu.vo.ResultVo
|
|
214
|
+ **/
|
|
215
|
+ @PostMapping("/list_sc")
|
|
216
|
+ public ResultVo listSubjectAndClass(@RequestBody TNoticeUser nu) {
|
|
217
|
+ Integer noticeid = nu.getNoticeid();
|
|
218
|
+ N_Utils.validation(new Object[]{noticeid, "通知id", 1});
|
|
219
|
+ Map map = noticeService.listSubjectAndClass(noticeid);
|
|
220
|
+ return new ResultVo(0, "获取通知科目和班级成功", map);
|
|
221
|
+ }
|
|
222
|
+
|
185
|
223
|
/*
|
186
|
224
|
* @Description 处理班级通知到学生个人
|
187
|
225
|
* @Date 2023/12/18 17:41:09
|