Commit dd949e4d by baochunxin

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

parent c7646baf
...@@ -27,6 +27,7 @@ public interface ISysRoleService ...@@ -27,6 +27,7 @@ public interface ISysRoleService
* @return 角色列表 * @return 角色列表
*/ */
public List<SysRole> selectRolesByUserId(Long userId); public List<SysRole> selectRolesByUserId(Long userId);
public List<SysRole> selectRolesByUserIdDdApp(Long userId);
/** /**
* 根据用户ID查询角色权限 * 根据用户ID查询角色权限
......
...@@ -83,6 +83,25 @@ public class SysRoleServiceImpl implements ISysRoleService ...@@ -83,6 +83,25 @@ public class SysRoleServiceImpl implements ISysRoleService
return roles; 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查询权限 * 根据用户ID查询权限
* *
......
...@@ -43,6 +43,9 @@ public interface SchoolClassMapper extends BaseMapper<SchoolClass> { ...@@ -43,6 +43,9 @@ public interface SchoolClassMapper extends BaseMapper<SchoolClass> {
* @return * @return
*/ */
List<SchoolClassVo> getUserClassByTeacher(Long teacherId); List<SchoolClassVo> getUserClassByTeacher(Long teacherId);
List<SchoolClassVo> selectSchoolClassSchoolYear(String schoolYear);
List<SchoolClassVo> getTeacherClass(@Param("teacherId") Long teacherId, List<SchoolClassVo> getTeacherClass(@Param("teacherId") Long teacherId,
@Param("schoolYear") int schoolYear); @Param("schoolYear") int schoolYear);
......
...@@ -151,6 +151,12 @@ public class SchoolClassImpl extends ServiceImpl<SchoolClassMapper, SchoolClass> ...@@ -151,6 +151,12 @@ public class SchoolClassImpl extends ServiceImpl<SchoolClassMapper, SchoolClass>
return schoolClassMapper.getTeacherClass(teacherId,schoolYear); return schoolClassMapper.getTeacherClass(teacherId,schoolYear);
} }
@Override
public List<SchoolClassVo> selectSchoolClassSchoolYear(String schoolYear) {
return schoolClassMapper.selectSchoolClassSchoolYear(schoolYear);
}
@Override @Override
public void checkImport(List<SchoolClassDrVo> list) { public void checkImport(List<SchoolClassDrVo> list) {
//是否为空 //是否为空
......
...@@ -20,6 +20,7 @@ import yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherExperimentApplyMapper; ...@@ -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.domain.schoolLab.SchoolTeacherExperimentApply;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoollTeacherExperimentApplyLabsMapper; import yangtz.cs.liu.campus.mapper.schoolLab.SchoollTeacherExperimentApplyLabsMapper;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherExperimentApplyService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherExperimentApplyService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoollTeacherExperimentApplyLabsService;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherExperimentApplyVo; import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherExperimentApplyVo;
/** /**
...@@ -33,7 +34,8 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT ...@@ -33,7 +34,8 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT
{ {
@Autowired @Autowired
private SchoolTeacherExperimentApplyMapper schoolTeacherExperimentApplyMapper; private SchoolTeacherExperimentApplyMapper schoolTeacherExperimentApplyMapper;
@Autowired
private ISchoollTeacherExperimentApplyLabsService schoollTeacherExperimentApplyLabsService;
/** /**
* 查询教师个人实验申请 * 查询教师个人实验申请
* *
...@@ -43,7 +45,12 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT ...@@ -43,7 +45,12 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT
@Override @Override
public SchoolTeacherExperimentApplyVo selectSchoolTeacherExperimentApplyById(Long id) 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 ...@@ -55,7 +62,14 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT
@Override @Override
public List<SchoolTeacherExperimentApplyVo> selectSchoolTeacherExperimentApplyList(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo) 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 @Override
......
...@@ -39,6 +39,9 @@ public interface ISchoolClassService extends IService<SchoolClass> { ...@@ -39,6 +39,9 @@ public interface ISchoolClassService extends IService<SchoolClass> {
List<SchoolClassVo> getTeacherClass(Long teacherId); List<SchoolClassVo> getTeacherClass(Long teacherId);
List<SchoolClassVo> selectSchoolClassSchoolYear(String schoolYear);
// /** // /**
// * 校验 // * 校验
// * @param list // * @param list
......
...@@ -78,7 +78,6 @@ public class DdAppLoginController { ...@@ -78,7 +78,6 @@ public class DdAppLoginController {
OapiUserGetuserinfoResponse response; OapiUserGetuserinfoResponse response;
try { try {
response = client.execute(request, access_token); response = client.execute(request, access_token);
System.out.println("-------------"+request);
} catch (ApiException e) { } catch (ApiException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
......
...@@ -97,6 +97,11 @@ public class DingJiaXiaoVo { ...@@ -97,6 +97,11 @@ public class DingJiaXiaoVo {
*/ */
String studentNo; String studentNo;
/**
* 手机号
*/
String mobile;
} }
......
...@@ -3,14 +3,19 @@ package yangtz.cs.liu.wechat.controller.experiment; ...@@ -3,14 +3,19 @@ package yangtz.cs.liu.wechat.controller.experiment;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; 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.entity.SysUser;
import com.ruoyi.common.core.domain.model.MpLoginUser;
import com.ruoyi.framework.util.UserInfoUtil; 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 com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear; import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply; import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply; 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.ISchoolLabClassYearService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherExperimentApplyService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherExperimentApplyService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherLabApplyService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherLabApplyService;
...@@ -38,6 +43,10 @@ public class TeacherExperimentController extends BaseController { ...@@ -38,6 +43,10 @@ public class TeacherExperimentController extends BaseController {
@Autowired @Autowired
ISchoolLabClassYearService schoolLabClassYearService; ISchoolLabClassYearService schoolLabClassYearService;
//学校班级
@Autowired
ISchoolClassService iSchoolClassService;
/** /**
* 个人申请记录 * 个人申请记录
*/ */
...@@ -89,6 +98,11 @@ public class TeacherExperimentController extends BaseController { ...@@ -89,6 +98,11 @@ public class TeacherExperimentController extends BaseController {
@Autowired @Autowired
ISysUserService userService; ISysUserService userService;
@Autowired
ISysRoleService roleService;
@Autowired
ISysDictDataService dictDataService;
/** /**
* 获取班级 * 获取班级
*/ */
...@@ -139,6 +153,28 @@ public class TeacherExperimentController extends BaseController { ...@@ -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") @PostMapping("/apply/add")
...@@ -170,7 +206,7 @@ public class TeacherExperimentController extends BaseController { ...@@ -170,7 +206,7 @@ public class TeacherExperimentController extends BaseController {
/** /**
* 删除教师个人实验申请 * 删除教师个人实验申请
*/ */
@PostMapping("/apply/{ids}") @DeleteMapping("/apply/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)
{ {
return toAjax(schoolTeacherExperimentApplyService.deleteSchoolTeacherExperimentApplyByIds(ids)); return toAjax(schoolTeacherExperimentApplyService.deleteSchoolTeacherExperimentApplyByIds(ids));
......
...@@ -38,6 +38,16 @@ ...@@ -38,6 +38,16 @@
order by g.grade_value, g.class_value order by g.grade_value, g.class_value
</select> </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 id="getUserClassByParent" resultType="SchoolClass">
SELECT sg.pic_url, SELECT sg.pic_url,
sg.class_value, sg.class_value,
......
...@@ -70,6 +70,9 @@ ...@@ -70,6 +70,9 @@
<if test="applyName != null and applyName != ''"> and tla.apply_name like concat('%', #{applyName}, '%')</if> <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="applyTime != null "> and tla.apply_time = #{applyTime}</if>
<if test="state != null "> and tla.state = #{state}</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 "> <if test="subs != null ">
and tla.sub in and tla.sub in
<foreach item="sub" collection="subs" open="(" separator="," close=")"> <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