...
|
...
|
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.example.client.domain.*;
|
|
|
import com.example.client.domain.bo.CBasicInformationStudentBo;
|
|
|
import com.example.client.domain.bo.CPersonalInformationBo;
|
|
|
import com.example.client.domain.bo.CRelationshipStudentSgcBo;
|
|
|
import com.example.client.domain.vo.*;
|
|
|
import com.example.client.domin.UserContext;
|
|
|
import com.example.client.mapper.*;
|
...
|
...
|
@@ -62,6 +63,9 @@ public class MineServiceImpl implements MineService { |
|
|
@Autowired
|
|
|
private CRelationshipStudentSgcMapper cRelationshipStudentSgcMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private CRegisterSchoolMapper cRegisterSchoolMapper;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 打开我的
|
...
|
...
|
@@ -646,33 +650,50 @@ public class MineServiceImpl implements MineService { |
|
|
|
|
|
/**
|
|
|
* 打开我的学校
|
|
|
* @param type
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
public AjaxResult openMySchool(Integer type) {
|
|
|
public AjaxResult openMySchool() {
|
|
|
|
|
|
//根据登录人Id查询用户信息
|
|
|
Long uId = UserContext.currentUserId();
|
|
|
CUser cUser = cUserMapper.selectById(uId);
|
|
|
|
|
|
//判断 等于3 身份为家长
|
|
|
if (cUser.getIdentityType()==3){
|
|
|
if (cUser.getIdentityType() == 3) {
|
|
|
Long userId = cUser.getAtPresent();
|
|
|
if(userId ==null){
|
|
|
return AjaxResult.error("你还没有绑定孩子");
|
|
|
}
|
|
|
return getMySchool(userId);
|
|
|
|
|
|
//通过当前绑定的学生Id查询
|
|
|
List<MySchoolVo> schoolVos = cRelationshipStudentSgcMapper.getSchool(cUser.getAtPresent(), type);
|
|
|
|
|
|
return AjaxResult.success(schoolVos);
|
|
|
|
|
|
//不等于
|
|
|
}else {
|
|
|
|
|
|
//根据登录人的ID查询
|
|
|
List<MySchoolVo> schoolVos = cRelationshipStudentSgcMapper.getSchool(uId, type);
|
|
|
|
|
|
return AjaxResult.success(schoolVos);
|
|
|
}
|
|
|
//学生
|
|
|
if(cUser.getIdentityType() == 2){
|
|
|
return getMySchool(uId);
|
|
|
}
|
|
|
//老师的
|
|
|
if(cUser.getIdentityType() == 1){
|
|
|
CRelationshipStudentSgcBo cRelationshipStudentSgcBo = new CRelationshipStudentSgcBo();
|
|
|
cRelationshipStudentSgcBo.setUserId(uId);
|
|
|
return AjaxResult.success(cRegisterSchoolMapper.getSchoolByTeacher(cRelationshipStudentSgcBo)) ;
|
|
|
|
|
|
}
|
|
|
return AjaxResult.error("身份不对") ;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 学生查看我的学校
|
|
|
* @param userId
|
|
|
* @return
|
|
|
*/
|
|
|
private AjaxResult getMySchool(Long userId) {
|
|
|
CRelationshipStudentSgcBo cRelationshipStudentSgcBo = new CRelationshipStudentSgcBo();
|
|
|
cRelationshipStudentSgcBo.setUserId(userId);
|
|
|
List<MySchoolVo> school = cRegisterSchoolMapper.getSchool(cRelationshipStudentSgcBo);
|
|
|
return AjaxResult.success(school);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|