Commit fbda1f39 by tangzhaoqian

切换企业、员工角色类型 优化

parent 4052883e
......@@ -12,19 +12,19 @@ import lombok.Getter;
public enum CommonEnum {
/**
* 0 超管理员
* 1 超管理员
*/
U_TYPE_ADMIN(0, "超管理员"),
U_TYPE_ADMIN(1, "超管理员"),
/**
* 1 子管理
* 2 子管理
*/
U_TYPE_C_ADMIN(1, "子管理"),
U_TYPE_C_ADMIN(2, "子管理"),
/**
* 2 普通员工
* 3 普通员工
*/
U_TYPE_EMP(2, "普通员工"),
U_TYPE_EMP(3, "普通员工"),
/**
* 0 关闭
......
......@@ -283,7 +283,7 @@ public class QyzxController {
* @return
*/
@GetMapping(value = "/entlist")
@ApiOperation(value = "企业列表", httpMethod = "GET", notes = "接口发布说明", position = 98)
@ApiOperation(value = "企业列表", httpMethod = "GET", notes = "接口发布说明")
public Result<List<QyzxEntInfoM>> entlist1(@CurrentUser UserBean userBean) {
Integer empNum = userBean.getEmpNum();
QueryWrapper<QyzxEmpEntAsso> queryWrapper = new QueryWrapper<>();
......@@ -301,7 +301,7 @@ public class QyzxController {
* @return
*/
@GetMapping(value = "/changeent/{orgCode}")
@ApiOperation(value = "切换企业", httpMethod = "GET", notes = "接口发布说明", position = 97)
@ApiOperation(value = "切换企业", httpMethod = "GET", notes = "接口发布说明")
public Result<List<String>> changeent(@CurrentUser UserBean userBean, @PathVariable Integer orgCode) {
// 查询该员工加入的企业id列表
QyzxEmpLogin emp = userBean.getQyzxEmpLogin();
......@@ -309,7 +309,11 @@ public class QyzxController {
// 判断 切换目标企业id 是否包含在 企业id列表 内
if (s != null) {
List<String> menus = new ArrayList<>();
QysDto ctrl = s.findFirst().get();
QysDto ctrl = s.findFirst().orElse(null);
if (ctrl == null) {
return ResultUtil.data(menus, "你不是该企业的用户!");
}
if (CommonEnum.U_TYPE_ADMIN.getType().equals(ctrl.getUserType())
|| CommonEnum.U_TYPE_C_ADMIN.getType().equals(ctrl.getUserType())) {
} else {
......
......@@ -425,7 +425,7 @@ public class YgglController {
QyzxEmpEntAsso.builder()
.empNum(login.getId())
.orgCode(orgCode)
.userType(2)
.userType(CommonEnum.U_TYPE_EMP.getType())
.status(1)
.build()
.insert();// usertype2普通员工
......@@ -611,7 +611,7 @@ public class YgglController {
}
// 员工权限表(未定)
// 员工企业关联表和员工档案,员工成长表(未定)
QyzxEmpEntAsso.builder().empNum(qyzxEmpLogin.getId()).orgCode(userBean.getOrgCode()).userType(2)
QyzxEmpEntAsso.builder().empNum(qyzxEmpLogin.getId()).orgCode(userBean.getOrgCode()).userType(CommonEnum.U_TYPE_EMP.getType())
.status(1).build().insert();// userType2普通员工,status1正常
YgglMainEmp emp = YgglMainEmp.builder().name(e.getName()).phone(e.getPhone()).zjType(0).zjNum(e.getZj())
.jobType(jobType).rzTime(rzdate).updateTime(new Date()).updateMan(userBean.getEmpNum()).syq(syq)
......@@ -630,7 +630,7 @@ public class YgglController {
.eq("phone", e.getPhone()).eq("org_code", userBean.getOrgCode()));
if (ishad == null) {
// 员工权限表(未定)
QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(userBean.getOrgCode()).userType(2).status(1)
QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(userBean.getOrgCode()).userType(CommonEnum.U_TYPE_EMP.getType()).status(1)
.build().insert();// userType2普通员工,status1正常
YgglMainEmp emp = YgglMainEmp.builder().name(e.getName()).phone(e.getPhone()).zjType(0)
.zjNum(e.getZj()).jobType(jobType).rzTime(rzdate).updateTime(new Date())
......
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