...
|
...
|
@@ -83,6 +83,12 @@ public class ActivityServiceImpl extends ServicePlusImpl<CActivityMapper,CActivi |
|
|
@Autowired
|
|
|
private CMycollectMapper cMycollectMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private CRelationshipStudentSgcMapper cRelationshipStudentSgcMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private CActivityTypesMapper cActivityTypesMapper;
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("发布动态的初始化界面")
|
...
|
...
|
@@ -552,6 +558,99 @@ public class ActivityServiceImpl extends ServicePlusImpl<CActivityMapper,CActivi |
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取所有学校
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
public AjaxResult getSchool() {
|
|
|
|
|
|
Long uId = UserContext.currentUserId();
|
|
|
CUser cUser = cUserMapper.selectById(uId);
|
|
|
|
|
|
//老师
|
|
|
if (cUser.getIdentityType().equals(Identity.TEACHWE)){
|
|
|
|
|
|
//根据登录人ID查询老师的信息
|
|
|
LambdaQueryWrapper<CTeacher> teacherWrapper = new LambdaQueryWrapper<>();
|
|
|
teacherWrapper.eq(CTeacher::getUserId,uId);
|
|
|
CTeacher cTeacher = cTeacherMapper.selectOne(teacherWrapper);
|
|
|
log.info("<<<<<<cTeacher::"+cTeacher);
|
|
|
|
|
|
//根据老师信息的GradeID查询年级表
|
|
|
LambdaQueryWrapper<CGrade> cGradeWrapper = new LambdaQueryWrapper<>();
|
|
|
cGradeWrapper.eq(CGrade::getId,cTeacher.getGradeId());
|
|
|
CGrade cGrade = cGradeMapper.selectOne(cGradeWrapper);
|
|
|
|
|
|
LambdaQueryWrapper<CRegisterSchool> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.eq(CRegisterSchool::getSchoolId,cGrade.getSchoolId());
|
|
|
List<CRegisterSchool> schools = cSchoolMapper.selectList(wrapper);
|
|
|
|
|
|
List<MySchoolVo> schoolVos = new ArrayList<>();
|
|
|
|
|
|
for (CRegisterSchool school : schools) {
|
|
|
|
|
|
MySchoolVo mySchoolVo = new MySchoolVo();
|
|
|
mySchoolVo.setSchoolName(school.getSchoolName());
|
|
|
mySchoolVo.setId(school.getSchoolId());
|
|
|
|
|
|
schoolVos.add(mySchoolVo);
|
|
|
|
|
|
}
|
|
|
|
|
|
return AjaxResult.success(schoolVos);
|
|
|
|
|
|
}else if(cUser.getIdentityType().equals(Identity.STUDENT)){
|
|
|
|
|
|
List<MySchoolVo> schoolVos = cRelationshipStudentSgcMapper.getSchool(uId, 1);
|
|
|
|
|
|
return AjaxResult.success(schoolVos);
|
|
|
|
|
|
}else if (cUser.getIdentityType().equals(Identity.PATRIARCH)){
|
|
|
|
|
|
List<MySchoolVo> schoolVos = cRelationshipStudentSgcMapper.getSchool(cUser.getAtPresent(), 1);
|
|
|
|
|
|
return AjaxResult.success(schoolVos);
|
|
|
|
|
|
}else if (cUser.getIdentityType().equals(Identity.SCHOOL)){
|
|
|
|
|
|
CRegisterSchool cRegisterSchool = cSchoolMapper.selectById(cUser.getSchoolCurrent());
|
|
|
|
|
|
List<MySchoolVo> schoolVos = new ArrayList<>();
|
|
|
MySchoolVo mySchoolVo = new MySchoolVo();
|
|
|
mySchoolVo.setId(cRegisterSchool.getSchoolId());
|
|
|
mySchoolVo.setSchoolName(cRegisterSchool.getSchoolName());
|
|
|
schoolVos.add(mySchoolVo);
|
|
|
return AjaxResult.success(schoolVos);
|
|
|
}else {
|
|
|
|
|
|
return AjaxResult.error();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 动态的所以种类
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
public AjaxResult getActivityType() {
|
|
|
|
|
|
LambdaQueryWrapper<CActivityTypes> wrapper = new LambdaQueryWrapper<>();
|
|
|
List<CActivityTypes> types = cActivityTypesMapper.selectList(wrapper);
|
|
|
|
|
|
List<CActivityTypesVo> vos = new ArrayList<CActivityTypesVo>();
|
|
|
|
|
|
for (CActivityTypes type : types) {
|
|
|
|
|
|
CActivityTypesVo vo = new CActivityTypesVo();
|
|
|
BeanUtils.copyProperties(type,vo);
|
|
|
|
|
|
vos.add(vo);
|
|
|
}
|
|
|
|
|
|
return AjaxResult.success(vos);
|
|
|
}
|
|
|
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "cActivity",value = "动态信息",dataType = "CActivity",required = true,paramType = "query"),
|
|
|
@ApiImplicitParam(name = "uId",value = "查看人Id",dataType = "Long",required = true,paramType = "query")
|
...
|
...
|
|