Commit dd949e4d by baochunxin

优化后端接口,提交家校通讯录更新

parent c7646baf
......@@ -27,6 +27,7 @@ public interface ISysRoleService
* @return 角色列表
*/
public List<SysRole> selectRolesByUserId(Long userId);
public List<SysRole> selectRolesByUserIdDdApp(Long userId);
/**
* 根据用户ID查询角色权限
......
......@@ -83,6 +83,25 @@ public class SysRoleServiceImpl implements ISysRoleService
return roles;
}
public List<SysRole> selectRolesByUserIdDdApp(Long userId)
{
List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(userId);
List<SysRole> roles = roleMapper.selectRoleList(new SysRole());
for (SysRole role : roles)
{
for (SysRole userRole : userRoles)
{
if (role.getRoleId().longValue() == userRole.getRoleId().longValue())
{
role.setFlag(true);
break;
}
}
}
return roles;
}
/**
* 根据用户ID查询权限
*
......
......@@ -43,6 +43,9 @@ public interface SchoolClassMapper extends BaseMapper<SchoolClass> {
* @return
*/
List<SchoolClassVo> getUserClassByTeacher(Long teacherId);
List<SchoolClassVo> selectSchoolClassSchoolYear(String schoolYear);
List<SchoolClassVo> getTeacherClass(@Param("teacherId") Long teacherId,
@Param("schoolYear") int schoolYear);
......
......@@ -151,6 +151,12 @@ public class SchoolClassImpl extends ServiceImpl<SchoolClassMapper, SchoolClass>
return schoolClassMapper.getTeacherClass(teacherId,schoolYear);
}
@Override
public List<SchoolClassVo> selectSchoolClassSchoolYear(String schoolYear) {
return schoolClassMapper.selectSchoolClassSchoolYear(schoolYear);
}
@Override
public void checkImport(List<SchoolClassDrVo> list) {
//是否为空
......
......@@ -20,6 +20,7 @@ import yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherExperimentApplyMapper;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoollTeacherExperimentApplyLabsMapper;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherExperimentApplyService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoollTeacherExperimentApplyLabsService;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherExperimentApplyVo;
/**
......@@ -33,7 +34,8 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT
{
@Autowired
private SchoolTeacherExperimentApplyMapper schoolTeacherExperimentApplyMapper;
@Autowired
private ISchoollTeacherExperimentApplyLabsService schoollTeacherExperimentApplyLabsService;
/**
* 查询教师个人实验申请
*
......@@ -43,7 +45,12 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT
@Override
public SchoolTeacherExperimentApplyVo selectSchoolTeacherExperimentApplyById(Long id)
{
return schoolTeacherExperimentApplyMapper.selectSchoolTeacherExperimentApplyById(id);
SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo = schoolTeacherExperimentApplyMapper.selectSchoolTeacherExperimentApplyById(id);
LambdaQueryWrapper<SchoolTeacherExperimentApplyLabs> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolTeacherExperimentApplyLabs::getTeacherExperimentApplyId,schoolTeacherExperimentApplyVo.getId());
List<SchoolTeacherExperimentApplyLabs> schoolTeacherExperimentApplyLabs = schoollTeacherExperimentApplyLabsService.list(wrapper);
schoolTeacherExperimentApplyVo.setSchoolTeacherExperimentApplyLabsList(schoolTeacherExperimentApplyLabs);
return schoolTeacherExperimentApplyVo;
}
/**
......@@ -55,7 +62,14 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT
@Override
public List<SchoolTeacherExperimentApplyVo> selectSchoolTeacherExperimentApplyList(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo)
{
return schoolTeacherExperimentApplyMapper.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApplyVo);
List<SchoolTeacherExperimentApplyVo> schoolTeacherExperimentApplyVos = schoolTeacherExperimentApplyMapper.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApplyVo);
for ( SchoolTeacherExperimentApplyVo date : schoolTeacherExperimentApplyVos){
LambdaQueryWrapper<SchoolTeacherExperimentApplyLabs> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolTeacherExperimentApplyLabs::getTeacherExperimentApplyId,date.getId());
List<SchoolTeacherExperimentApplyLabs> schoolTeacherExperimentApplyLabs = schoollTeacherExperimentApplyLabsService.list(wrapper);
date.setSchoolTeacherExperimentApplyLabsList(schoolTeacherExperimentApplyLabs);
}
return schoolTeacherExperimentApplyVos;
}
@Override
......
......@@ -39,6 +39,9 @@ public interface ISchoolClassService extends IService<SchoolClass> {
List<SchoolClassVo> getTeacherClass(Long teacherId);
List<SchoolClassVo> selectSchoolClassSchoolYear(String schoolYear);
// /**
// * 校验
// * @param list
......
......@@ -78,7 +78,6 @@ public class DdAppLoginController {
OapiUserGetuserinfoResponse response;
try {
response = client.execute(request, access_token);
System.out.println("-------------"+request);
} catch (ApiException e) {
// TODO Auto-generated catch block
e.printStackTrace();
......
......@@ -97,6 +97,11 @@ public class DingJiaXiaoVo {
*/
String studentNo;
/**
* 手机号
*/
String mobile;
}
......
......@@ -113,7 +113,7 @@ public class ExperimentLevelController extends BaseController {
public AjaxResult getGrade(SchoolLabClassYearVo schoolLabClassYearVo)
{ //获取最新学年
int schoolYear = gradeService.isNewSchoolYear();
return AjaxResult.success(schoolExperimentPlanService.getGrade(schoolYear,schoolLabClassYearVo.getUserId()));
return AjaxResult.success(schoolExperimentPlanService.getGrade(schoolYear,schoolLabClassYearVo.getUserId()));
}
/**
......
......@@ -3,14 +3,19 @@ package yangtz.cs.liu.wechat.controller.experiment;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.MpLoginUser;
import com.ruoyi.framework.util.UserInfoUtil;
import com.ruoyi.system.service.ISysDictDataService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply;
import yangtz.cs.liu.campus.service.schoolClass.ISchoolClassService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherExperimentApplyService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherLabApplyService;
......@@ -38,6 +43,10 @@ public class TeacherExperimentController extends BaseController {
@Autowired
ISchoolLabClassYearService schoolLabClassYearService;
//学校班级
@Autowired
ISchoolClassService iSchoolClassService;
/**
* 个人申请记录
*/
......@@ -89,6 +98,11 @@ public class TeacherExperimentController extends BaseController {
@Autowired
ISysUserService userService;
@Autowired
ISysRoleService roleService;
@Autowired
ISysDictDataService dictDataService;
/**
* 获取班级
*/
......@@ -139,6 +153,28 @@ public class TeacherExperimentController extends BaseController {
}
/**
* 获取当前登录角色学科
*/
@GetMapping("/getSubject")
public AjaxResult getSubject(){
Long userId = userInfoUtil.getMpLoginUser().getUserId();
List<SysRole> sysRoles = roleService.selectRolesByUserIdDdApp(userId);
for (SysRole role : sysRoles) {
if (role.getRoleKey().equals("phy_lab_admin")){
return AjaxResult.success(dictDataService.selectDictLabel("lab_sub","1"));
}else if (role.getRoleKey().equals("che_lab_admin")){
return AjaxResult.success(dictDataService.selectDictLabel("lab_sub","2"));
}else if (role.getRoleKey().equals("bio_lab_admin")){
return AjaxResult.success(dictDataService.selectDictLabel("lab_sub","3"));
}
}
return AjaxResult.success("当前用户未分配学科角色");
}
/**
*新增申请
*/
@PostMapping("/apply/add")
......@@ -170,7 +206,7 @@ public class TeacherExperimentController extends BaseController {
/**
* 删除教师个人实验申请
*/
@PostMapping("/apply/{ids}")
@DeleteMapping("/apply/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(schoolTeacherExperimentApplyService.deleteSchoolTeacherExperimentApplyByIds(ids));
......
......@@ -38,6 +38,16 @@
order by g.grade_value, g.class_value
</select>
<select id="selectSchoolClassSchoolYear" resultMap="SchoolClassResult">
select g.grade_value, g.grade_name, g.class_value, g.class_name, g.school_year, g.id
from school_class g
where g.del_flag = '0'
and g.school_year = #{schoolYear}
order by g.grade_value, g.class_value
</select>
<select id="getUserClassByParent" resultType="SchoolClass">
SELECT sg.pic_url,
sg.class_value,
......
......@@ -70,6 +70,9 @@
<if test="applyName != null and applyName != ''"> and tla.apply_name like concat('%', #{applyName}, '%')</if>
<if test="applyTime != null "> and tla.apply_time = #{applyTime}</if>
<if test="state != null "> and tla.state = #{state}</if>
<if test="querText != null ">
and concat(tla.experiment_name,tla.grade) like concat('%', #{querText}, '%')
</if>
<if test="subs != null ">
and tla.sub in
<foreach item="sub" collection="subs" open="(" separator="," close=")">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment