|
@@ -83,6 +83,12 @@ public class ActivityServiceImpl extends ServicePlusImpl<CActivityMapper,CActivi |
|
@@ -83,6 +83,12 @@ public class ActivityServiceImpl extends ServicePlusImpl<CActivityMapper,CActivi |
83
|
@Autowired
|
83
|
@Autowired
|
84
|
private CMycollectMapper cMycollectMapper;
|
84
|
private CMycollectMapper cMycollectMapper;
|
85
|
|
85
|
|
|
|
86
|
+ @Autowired
|
|
|
87
|
+ private CRelationshipStudentSgcMapper cRelationshipStudentSgcMapper;
|
|
|
88
|
+
|
|
|
89
|
+ @Autowired
|
|
|
90
|
+ private CActivityTypesMapper cActivityTypesMapper;
|
|
|
91
|
+
|
86
|
|
92
|
|
87
|
|
93
|
|
88
|
@ApiOperation("发布动态的初始化界面")
|
94
|
@ApiOperation("发布动态的初始化界面")
|
|
@@ -552,6 +558,99 @@ public class ActivityServiceImpl extends ServicePlusImpl<CActivityMapper,CActivi |
|
@@ -552,6 +558,99 @@ public class ActivityServiceImpl extends ServicePlusImpl<CActivityMapper,CActivi |
552
|
|
558
|
|
553
|
}
|
559
|
}
|
554
|
|
560
|
|
|
|
561
|
+ /**
|
|
|
562
|
+ * 获取所有学校
|
|
|
563
|
+ * @return
|
|
|
564
|
+ */
|
|
|
565
|
+ @Override
|
|
|
566
|
+ public AjaxResult getSchool() {
|
|
|
567
|
+
|
|
|
568
|
+ Long uId = UserContext.currentUserId();
|
|
|
569
|
+ CUser cUser = cUserMapper.selectById(uId);
|
|
|
570
|
+
|
|
|
571
|
+ //老师
|
|
|
572
|
+ if (cUser.getIdentityType().equals(Identity.TEACHWE)){
|
|
|
573
|
+
|
|
|
574
|
+ //根据登录人ID查询老师的信息
|
|
|
575
|
+ LambdaQueryWrapper<CTeacher> teacherWrapper = new LambdaQueryWrapper<>();
|
|
|
576
|
+ teacherWrapper.eq(CTeacher::getUserId,uId);
|
|
|
577
|
+ CTeacher cTeacher = cTeacherMapper.selectOne(teacherWrapper);
|
|
|
578
|
+ log.info("<<<<<<cTeacher::"+cTeacher);
|
|
|
579
|
+
|
|
|
580
|
+ //根据老师信息的GradeID查询年级表
|
|
|
581
|
+ LambdaQueryWrapper<CGrade> cGradeWrapper = new LambdaQueryWrapper<>();
|
|
|
582
|
+ cGradeWrapper.eq(CGrade::getId,cTeacher.getGradeId());
|
|
|
583
|
+ CGrade cGrade = cGradeMapper.selectOne(cGradeWrapper);
|
|
|
584
|
+
|
|
|
585
|
+ LambdaQueryWrapper<CRegisterSchool> wrapper = new LambdaQueryWrapper<>();
|
|
|
586
|
+ wrapper.eq(CRegisterSchool::getSchoolId,cGrade.getSchoolId());
|
|
|
587
|
+ List<CRegisterSchool> schools = cSchoolMapper.selectList(wrapper);
|
|
|
588
|
+
|
|
|
589
|
+ List<MySchoolVo> schoolVos = new ArrayList<>();
|
|
|
590
|
+
|
|
|
591
|
+ for (CRegisterSchool school : schools) {
|
|
|
592
|
+
|
|
|
593
|
+ MySchoolVo mySchoolVo = new MySchoolVo();
|
|
|
594
|
+ mySchoolVo.setSchoolName(school.getSchoolName());
|
|
|
595
|
+ mySchoolVo.setId(school.getSchoolId());
|
|
|
596
|
+
|
|
|
597
|
+ schoolVos.add(mySchoolVo);
|
|
|
598
|
+
|
|
|
599
|
+ }
|
|
|
600
|
+
|
|
|
601
|
+ return AjaxResult.success(schoolVos);
|
|
|
602
|
+
|
|
|
603
|
+ }else if(cUser.getIdentityType().equals(Identity.STUDENT)){
|
|
|
604
|
+
|
|
|
605
|
+ List<MySchoolVo> schoolVos = cRelationshipStudentSgcMapper.getSchool(uId, 1);
|
|
|
606
|
+
|
|
|
607
|
+ return AjaxResult.success(schoolVos);
|
|
|
608
|
+
|
|
|
609
|
+ }else if (cUser.getIdentityType().equals(Identity.PATRIARCH)){
|
|
|
610
|
+
|
|
|
611
|
+ List<MySchoolVo> schoolVos = cRelationshipStudentSgcMapper.getSchool(cUser.getAtPresent(), 1);
|
|
|
612
|
+
|
|
|
613
|
+ return AjaxResult.success(schoolVos);
|
|
|
614
|
+
|
|
|
615
|
+ }else if (cUser.getIdentityType().equals(Identity.SCHOOL)){
|
|
|
616
|
+
|
|
|
617
|
+ CRegisterSchool cRegisterSchool = cSchoolMapper.selectById(cUser.getSchoolCurrent());
|
|
|
618
|
+
|
|
|
619
|
+ List<MySchoolVo> schoolVos = new ArrayList<>();
|
|
|
620
|
+ MySchoolVo mySchoolVo = new MySchoolVo();
|
|
|
621
|
+ mySchoolVo.setId(cRegisterSchool.getSchoolId());
|
|
|
622
|
+ mySchoolVo.setSchoolName(cRegisterSchool.getSchoolName());
|
|
|
623
|
+ schoolVos.add(mySchoolVo);
|
|
|
624
|
+ return AjaxResult.success(schoolVos);
|
|
|
625
|
+ }else {
|
|
|
626
|
+
|
|
|
627
|
+ return AjaxResult.error();
|
|
|
628
|
+ }
|
|
|
629
|
+ }
|
|
|
630
|
+
|
|
|
631
|
+ /**
|
|
|
632
|
+ * 动态的所以种类
|
|
|
633
|
+ * @return
|
|
|
634
|
+ */
|
|
|
635
|
+ @Override
|
|
|
636
|
+ public AjaxResult getActivityType() {
|
|
|
637
|
+
|
|
|
638
|
+ LambdaQueryWrapper<CActivityTypes> wrapper = new LambdaQueryWrapper<>();
|
|
|
639
|
+ List<CActivityTypes> types = cActivityTypesMapper.selectList(wrapper);
|
|
|
640
|
+
|
|
|
641
|
+ List<CActivityTypesVo> vos = new ArrayList<CActivityTypesVo>();
|
|
|
642
|
+
|
|
|
643
|
+ for (CActivityTypes type : types) {
|
|
|
644
|
+
|
|
|
645
|
+ CActivityTypesVo vo = new CActivityTypesVo();
|
|
|
646
|
+ BeanUtils.copyProperties(type,vo);
|
|
|
647
|
+
|
|
|
648
|
+ vos.add(vo);
|
|
|
649
|
+ }
|
|
|
650
|
+
|
|
|
651
|
+ return AjaxResult.success(vos);
|
|
|
652
|
+ }
|
|
|
653
|
+
|
555
|
@ApiImplicitParams({
|
654
|
@ApiImplicitParams({
|
556
|
@ApiImplicitParam(name = "cActivity",value = "动态信息",dataType = "CActivity",required = true,paramType = "query"),
|
655
|
@ApiImplicitParam(name = "cActivity",value = "动态信息",dataType = "CActivity",required = true,paramType = "query"),
|
557
|
@ApiImplicitParam(name = "uId",value = "查看人Id",dataType = "Long",required = true,paramType = "query")
|
656
|
@ApiImplicitParam(name = "uId",value = "查看人Id",dataType = "Long",required = true,paramType = "query")
|