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