增加教师管理部分判断
This commit is contained in:
parent
659f5e38d4
commit
bf1836db64
@ -51,7 +51,7 @@ public class BySchoolcalendarClassController extends BaseController
|
|||||||
String strClassId = schoolCommon.getClassId();
|
String strClassId = schoolCommon.getClassId();
|
||||||
if(!schoolCommon.isStringEmpty(strClassId)){
|
if(!schoolCommon.isStringEmpty(strClassId)){
|
||||||
startPage();
|
startPage();
|
||||||
bySchoolcalendarClass.setClassid(schoolCommon.getClassId());
|
bySchoolcalendarClass.setClassid(strClassId);
|
||||||
List<BySchoolcalendarClass> list = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass);
|
List<BySchoolcalendarClass> list = bySchoolcalendarClassService.selectBySchoolcalendarClassList(bySchoolcalendarClass);
|
||||||
System.out.println("---------------------分页"+list);
|
System.out.println("---------------------分页"+list);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
@ -105,6 +105,7 @@ public class BySchoolcalendarClassController extends BaseController
|
|||||||
public AjaxResult add(@RequestBody BySchoolcalendarClass bySchoolcalendarClass)
|
public AjaxResult add(@RequestBody BySchoolcalendarClass bySchoolcalendarClass)
|
||||||
{
|
{
|
||||||
String strClassId = schoolCommon.getClassId();
|
String strClassId = schoolCommon.getClassId();
|
||||||
|
//判断当前用户是否有班级
|
||||||
if(!schoolCommon.isStringEmpty(strClassId)) {
|
if(!schoolCommon.isStringEmpty(strClassId)) {
|
||||||
//设置创建时间为当前时间
|
//设置创建时间为当前时间
|
||||||
bySchoolcalendarClass.setCreatetime(new Date());
|
bySchoolcalendarClass.setCreatetime(new Date());
|
||||||
@ -130,7 +131,11 @@ public class BySchoolcalendarClassController extends BaseController
|
|||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody BySchoolcalendarClass bySchoolcalendarClass)
|
public AjaxResult edit(@RequestBody BySchoolcalendarClass bySchoolcalendarClass)
|
||||||
{
|
{
|
||||||
|
if(!schoolCommon.isStringEmpty(schoolCommon.getClassId())){
|
||||||
return toAjax(bySchoolcalendarClassService.updateBySchoolcalendarClass(bySchoolcalendarClass));
|
return toAjax(bySchoolcalendarClassService.updateBySchoolcalendarClass(bySchoolcalendarClass));
|
||||||
|
}else{
|
||||||
|
return AjaxResult.error("当前用户下没有班级,无法修改园历");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -141,6 +146,12 @@ public class BySchoolcalendarClassController extends BaseController
|
|||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
{
|
{
|
||||||
|
//判断当前用户下是否有班级
|
||||||
|
if(!schoolCommon.isStringEmpty(schoolCommon.getClassId())) {
|
||||||
return toAjax(bySchoolcalendarClassService.deleteBySchoolcalendarClassByIds(ids));
|
return toAjax(bySchoolcalendarClassService.deleteBySchoolcalendarClassByIds(ids));
|
||||||
|
}else {
|
||||||
|
return AjaxResult.error("当前用户下没有班级,无法删除园历");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,6 +67,7 @@ public class SchoolCommon {
|
|||||||
return sysDept;
|
return sysDept;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取用户信息
|
||||||
public SysUser getUser() {
|
public SysUser getUser() {
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
Long userId = loginUser.getUser().getUserId();
|
Long userId = loginUser.getUser().getUserId();
|
||||||
@ -101,14 +102,16 @@ public class SchoolCommon {
|
|||||||
public String getClassId() {
|
public String getClassId() {
|
||||||
SysUser sysUser = getUser();
|
SysUser sysUser = getUser();
|
||||||
ByClass byClass = new ByClass();
|
ByClass byClass = new ByClass();
|
||||||
|
//根据用户id来设置主班教师,配班教师,助理教师的教师id
|
||||||
byClass.setZbjs(sysUser.getUserId());
|
byClass.setZbjs(sysUser.getUserId());
|
||||||
byClass.setPbjs(sysUser.getUserId());
|
byClass.setPbjs(sysUser.getUserId());
|
||||||
byClass.setZljs(sysUser.getUserId());
|
byClass.setZljs(sysUser.getUserId());
|
||||||
//新的返回byclass1返回整条数据
|
//新的返回byclassNew返回整条数据
|
||||||
ByClass byClass1 = byClassService.selectByClassByUserId(byClass);
|
ByClass byClassNew = byClassService.selectByClassByUserId(byClass);
|
||||||
System.out.println("--------------------"+ byClass1);
|
System.out.println("--------------------"+ byClassNew);
|
||||||
if(byClass1 != null) {
|
if(byClassNew != null) {
|
||||||
return byClass1.getBjbh();
|
//如果实体byclassnew不为空,那么取出它的班级编号
|
||||||
|
return byClassNew.getBjbh();
|
||||||
} else {
|
} else {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
c.bjbh, c.bjmc
|
c.bjbh, c.bjmc
|
||||||
from by_schoolcalendar_class sc, by_class c
|
from by_schoolcalendar_class sc, by_class c
|
||||||
<where>
|
<where>
|
||||||
|
|
||||||
<if test="name != null and name != ''"> and sc.name like concat('%', #{name}, '%')</if>
|
<if test="name != null and name != ''"> and sc.name like concat('%', #{name}, '%')</if>
|
||||||
<if test="type != null and type != ''"> and sc.type = #{type}</if>
|
<if test="type != null and type != ''"> and sc.type = #{type}</if>
|
||||||
<if test="classid != null and classid != ''"> and sc.classid = #{classid}</if>
|
<if test="classid != null and classid != ''"> and sc.classid = #{classid}</if>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user