20200424-lc-1
增加教师管理关联用户显示和修改功能
This commit is contained in:
@ -36,7 +36,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5" v-show="false">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@ -79,29 +79,21 @@
|
|||||||
<el-table v-loading="loading" :data="teacherList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="teacherList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="用户名称" align="center" prop="user.nickName" />
|
<el-table-column label="用户名称" align="center" prop="user.nickName" />
|
||||||
<!--<el-table-column label="标识" align="center" prop="id" />
|
<el-table-column label="出生日期" align="center" prop="csrq" width="180"></el-table-column>
|
||||||
<el-table-column label="证件号码" align="center" prop="zjhm" />
|
|
||||||
<el-table-column label="出生日期" align="center" prop="csrq" width="180">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ parseTime(scope.row.csrq) }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="毕业院校" align="center" prop="byyx" />
|
<el-table-column label="毕业院校" align="center" prop="byyx" />
|
||||||
<el-table-column label="专业" align="center" prop="zy" />-->
|
<el-table-column label="专业" align="center" prop="zy" />
|
||||||
<el-table-column label="学历" align="center" prop="xl" :formatter="xlFormat" />
|
<el-table-column label="参加工作日期" align="center" prop="cjgzrq" width="180"></el-table-column>
|
||||||
<el-table-column label="学位" align="center" prop="xw" :formatter="xwFormat" />
|
|
||||||
<!--<el-table-column label="参加工作日期" align="center" prop="cjgzrq" width="180">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ parseTime(scope.row.cjgzrq) }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="资格证书" align="center" prop="zgzs" :formatter="zgzsFormat" />
|
|
||||||
<el-table-column label="创建人" align="center" prop="createuserid" />-->
|
|
||||||
<el-table-column label="创建时间" align="center" prop="createtime" width="180">
|
<el-table-column label="创建时间" align="center" prop="createtime" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createtime) }}</span>
|
<span>{{ parseTime(scope.row.createtime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<!--<el-table-column label="标识" align="center" prop="id" />
|
||||||
|
<el-table-column label="证件号码" align="center" prop="zjhm" />
|
||||||
|
<el-table-column label="学历" align="center" prop="xl" :formatter="xlFormat" />
|
||||||
|
<el-table-column label="学位" align="center" prop="xw" :formatter="xwFormat" />
|
||||||
|
<el-table-column label="资格证书" align="center" prop="zgzs" :formatter="zgzsFormat" />
|
||||||
|
<el-table-column label="创建人" align="center" prop="createuserid" />-->
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@ -133,8 +125,11 @@
|
|||||||
<!-- 添加或修改教师基本信息对话框 -->
|
<!-- 添加或修改教师基本信息对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px">
|
<el-dialog :title="title" :visible.sync="open" width="500px">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="用户id" prop="userid">
|
<el-form-item label="id" prop="id" v-show="false">
|
||||||
<el-input v-model="form.userid" placeholder="请输入用户id" />
|
<el-input v-model="form.id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户id" prop="userid" v-show="false">
|
||||||
|
<el-input v-model="form.userid" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="证件号码" prop="zjhm">
|
<el-form-item label="证件号码" prop="zjhm">
|
||||||
<el-input v-model="form.zjhm" placeholder="请输入证件号码" />
|
<el-input v-model="form.zjhm" placeholder="请输入证件号码" />
|
||||||
@ -357,7 +352,7 @@ export default {
|
|||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
} else {
|
} else {
|
||||||
this.msgError(response.msg);
|
// this.msgError(response.msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -367,7 +362,7 @@ export default {
|
|||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
} else {
|
} else {
|
||||||
this.msgError(response.msg);
|
//this.msgError(response.msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
package com.ruoyi.project.system.controller;
|
package com.ruoyi.project.system.controller;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.ruoyi.project.common.SchoolCommon;
|
import com.ruoyi.project.common.SchoolCommon;
|
||||||
|
import com.ruoyi.project.system.domain.ByTeacherJbxx;
|
||||||
|
import com.ruoyi.project.system.service.*;
|
||||||
|
import com.ruoyi.project.system.service.impl.ByTeacherJbxxServiceImpl;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -28,9 +32,6 @@ import com.ruoyi.framework.web.controller.BaseController;
|
|||||||
import com.ruoyi.framework.web.domain.AjaxResult;
|
import com.ruoyi.framework.web.domain.AjaxResult;
|
||||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||||
import com.ruoyi.project.system.domain.SysUser;
|
import com.ruoyi.project.system.domain.SysUser;
|
||||||
import com.ruoyi.project.system.service.ISysPostService;
|
|
||||||
import com.ruoyi.project.system.service.ISysRoleService;
|
|
||||||
import com.ruoyi.project.system.service.ISysUserService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户信息
|
* 用户信息
|
||||||
@ -47,6 +48,9 @@ public class SysUserController extends BaseController
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISysRoleService roleService;
|
private ISysRoleService roleService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IByTeacherJbxxService byTeacherJbxxService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysPostService postService;
|
private ISysPostService postService;
|
||||||
|
|
||||||
@ -56,6 +60,11 @@ public class SysUserController extends BaseController
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SchoolCommon schoolCommon;
|
private SchoolCommon schoolCommon;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户列表
|
* 获取用户列表
|
||||||
*/
|
*/
|
||||||
@ -106,8 +115,10 @@ public class SysUserController extends BaseController
|
|||||||
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
|
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
|
||||||
{
|
{
|
||||||
AjaxResult ajax = AjaxResult.success();
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
//在添加用户时判断是否为幼儿园平台
|
||||||
if(schoolCommon.isSchool()==true)
|
if(schoolCommon.isSchool()==true)
|
||||||
{
|
{
|
||||||
|
//只显示幼儿园相关的岗位和角色
|
||||||
ajax.put("roles", roleService.selectYeyRoleAll());
|
ajax.put("roles", roleService.selectYeyRoleAll());
|
||||||
ajax.put("posts", postService.selectYeyPostAll());
|
ajax.put("posts", postService.selectYeyPostAll());
|
||||||
}else {
|
}else {
|
||||||
@ -115,6 +126,7 @@ public class SysUserController extends BaseController
|
|||||||
ajax.put("posts", postService.selectPostAll());
|
ajax.put("posts", postService.selectPostAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//在修改用户时判断是否为幼儿园平台
|
||||||
if (StringUtils.isNotNull(userId))
|
if (StringUtils.isNotNull(userId))
|
||||||
{
|
{
|
||||||
if (schoolCommon.isSchool()==true)
|
if (schoolCommon.isSchool()==true)
|
||||||
@ -156,7 +168,18 @@ public class SysUserController extends BaseController
|
|||||||
user.setEmail(user.getUserName()+"@benyi.com");
|
user.setEmail(user.getUserName()+"@benyi.com");
|
||||||
user.setCreateBy(SecurityUtils.getUsername());
|
user.setCreateBy(SecurityUtils.getUsername());
|
||||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||||
return toAjax(userService.insertUser(user));
|
int bl = userService.insertUser(user);
|
||||||
|
if (bl>0)
|
||||||
|
{
|
||||||
|
ByTeacherJbxx byTeacherJbxx = new ByTeacherJbxx();
|
||||||
|
//并赋值给教师userid
|
||||||
|
byTeacherJbxx.setUserid(user.getUserId());
|
||||||
|
byTeacherJbxx.setCreatetime(new Date());
|
||||||
|
//插入数据到教师表
|
||||||
|
byTeacherJbxxService.insertByTeacherJbxx(byTeacherJbxx);
|
||||||
|
}
|
||||||
|
return toAjax(bl);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
package com.ruoyi.project.system.domain;
|
package com.ruoyi.project.system.domain;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
||||||
import com.ruoyi.framework.web.domain.BaseEntity;
|
import com.ruoyi.framework.web.domain.BaseEntity;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 教师基本信息对象 by_teacher_jbxx
|
* 教师基本信息对象 by_teacher_jbxx
|
||||||
*
|
*
|
||||||
@ -30,6 +32,7 @@ public class ByTeacherJbxx extends BaseEntity
|
|||||||
|
|
||||||
/** 出生日期 */
|
/** 出生日期 */
|
||||||
@Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date csrq;
|
private Date csrq;
|
||||||
|
|
||||||
/** 毕业院校 */
|
/** 毕业院校 */
|
||||||
@ -50,6 +53,7 @@ public class ByTeacherJbxx extends BaseEntity
|
|||||||
|
|
||||||
/** 参加工作日期 */
|
/** 参加工作日期 */
|
||||||
@Excel(name = "参加工作日期", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "参加工作日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date cjgzrq;
|
private Date cjgzrq;
|
||||||
|
|
||||||
/** 资格证书 */
|
/** 资格证书 */
|
||||||
@ -62,6 +66,7 @@ public class ByTeacherJbxx extends BaseEntity
|
|||||||
|
|
||||||
//创建时间
|
//创建时间
|
||||||
@Excel(name = "创建时间")
|
@Excel(name = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date createtime;
|
private Date createtime;
|
||||||
|
|
||||||
/** user对象 */
|
/** user对象 */
|
||||||
|
@ -91,6 +91,9 @@ public class SysUser extends BaseEntity
|
|||||||
/** 岗位组 */
|
/** 岗位组 */
|
||||||
private Long[] postIds;
|
private Long[] postIds;
|
||||||
|
|
||||||
|
/**教师对象*/
|
||||||
|
private ByTeacherJbxx byTeacherJbxx;
|
||||||
|
|
||||||
public SysUser()
|
public SysUser()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -321,6 +324,15 @@ public class SysUser extends BaseEntity
|
|||||||
.append("updateTime", getUpdateTime())
|
.append("updateTime", getUpdateTime())
|
||||||
.append("remark", getRemark())
|
.append("remark", getRemark())
|
||||||
.append("dept", getDept())
|
.append("dept", getDept())
|
||||||
|
.append("byTeacherJbxx", getByTeacherJbxx())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ByTeacherJbxx getByTeacherJbxx() {
|
||||||
|
return byTeacherJbxx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setByTeacherJbxx(ByTeacherJbxx byTeacherJbxx) {
|
||||||
|
this.byTeacherJbxx = byTeacherJbxx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,9 +43,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<sql id="selectByTeacherJbxxVo">
|
<sql id="selectByTeacherJbxxVo">
|
||||||
select t.id, t.userid, t.zjhm, t.csrq, t.byyx, t.zy, t.xl, t.xw, t.cjgzrq, t.zgzs, t.createuserid, t.createtime,
|
select t.id, t.userid, t.zjhm, t.csrq, t.byyx, t.zy, t.xl, t.xw, t.cjgzrq, t.zgzs, t.createuserid, t.createtime,
|
||||||
u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.sex, u.status as user_status
|
u.user_id, u.nick_name, u.status as user_status
|
||||||
from by_teacher_jbxx t
|
from by_teacher_jbxx t
|
||||||
left join sys_user u on t.userid = u.user_id
|
right join sys_user u on t.userid = u.user_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectByTeacherJbxxList" parameterType="ByTeacherJbxx" resultMap="ByTeacherJbxxResult">
|
<select id="selectByTeacherJbxxList" parameterType="ByTeacherJbxx" resultMap="ByTeacherJbxxResult">
|
||||||
|
@ -58,11 +58,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="selectRoleAll" resultMap="SysRoleResult">
|
<select id="selectRoleAll" resultMap="SysRoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
|
WHERE r.del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectYeyRoleAll" resultMap="SysRoleResult">
|
<select id="selectYeyRoleAll" resultMap="SysRoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
where r.purpose = '1'
|
where r.purpose = '1' and r.del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRoleListByUserId" parameterType="Long" resultType="Integer">
|
<select id="selectRoleListByUserId" parameterType="Long" resultType="Integer">
|
||||||
@ -70,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
from sys_role r
|
from sys_role r
|
||||||
left join sys_user_role ur on ur.role_id = r.role_id
|
left join sys_user_role ur on ur.role_id = r.role_id
|
||||||
left join sys_user u on u.user_id = ur.user_id
|
left join sys_user u on u.user_id = ur.user_id
|
||||||
where u.user_id = #{userId}
|
where u.user_id = #{userId} and r.del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectYeyRoleListByUserId" parameterType="Long" resultType="Integer">
|
<select id="selectYeyRoleListByUserId" parameterType="Long" resultType="Integer">
|
||||||
@ -78,12 +79,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
from sys_role r
|
from sys_role r
|
||||||
left join sys_user_role ur on ur.role_id = r.role_id
|
left join sys_user_role ur on ur.role_id = r.role_id
|
||||||
left join sys_user u on u.user_id = ur.user_id
|
left join sys_user u on u.user_id = ur.user_id
|
||||||
where r.purpose = '1' and u.user_id = #{userId}
|
where r.purpose = '1' and u.user_id = #{userId} and r.del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult">
|
<select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
where r.role_id = #{roleId}
|
where r.role_id = #{roleId} and r.del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult">
|
<select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult">
|
||||||
|
Reference in New Issue
Block a user