提交修改
This commit is contained in:
parent
76e4779f89
commit
387a17c62f
@ -10,8 +10,11 @@ import com.lz.modules.app.dto.*;
|
||||
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||
import com.lz.modules.app.entity.StaffEntity;
|
||||
import com.lz.modules.app.enums.ExcelStaffHeardEnum;
|
||||
import com.lz.modules.app.model.RoleModel;
|
||||
import com.lz.modules.app.req.StaffReq;
|
||||
import com.lz.modules.app.resp.StaffRoleModel;
|
||||
import com.lz.modules.app.service.*;
|
||||
import com.lz.modules.flow.service.StaffRoleService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@ -55,6 +58,9 @@ public class StaffController {
|
||||
@Autowired
|
||||
private StaffWorkTransferRecordService staffWorkTransferRecordService;
|
||||
|
||||
@Autowired
|
||||
private StaffRoleService staffRoleService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@ -351,4 +357,6 @@ public class StaffController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ import com.lz.common.utils.R;
|
||||
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||
import com.lz.modules.app.entity.StaffEntity;
|
||||
import com.lz.modules.app.model.RoleModel;
|
||||
import com.lz.modules.app.resp.StaffRoleModel;
|
||||
import com.lz.modules.app.service.DepartmentsService;
|
||||
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||
@ -76,6 +77,7 @@ public class StaffRoleController {
|
||||
|
||||
@GetMapping("/listByGroupId")
|
||||
@ApiOperation(value="根据groupId获取管理员列表")
|
||||
// http://localhost:8080/lz_management/user/lzstaffrole/listByGroupId?groupId=3
|
||||
@ApiImplicitParam(name = "groupId",value = "组id",defaultValue = "1",required = true, dataType = "Long",paramType = "query")
|
||||
public R listByGroupId( Long groupId ) {
|
||||
List<StaffRole> staffRoleList = staffRoleService.selectByGroupId(groupId);
|
||||
@ -202,4 +204,11 @@ public class StaffRoleController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
// http://localhost:8080/lz_management/user/lzstaffrole/role/set
|
||||
@RequestMapping("/role/set")
|
||||
public R roleSet(RoleModel roleModel) {
|
||||
return staffRoleService.selectRoleInfoBy(roleModel);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
19
src/main/java/com/lz/modules/app/dto/StaffRoleInfo.java
Normal file
19
src/main/java/com/lz/modules/app/dto/StaffRoleInfo.java
Normal file
@ -0,0 +1,19 @@
|
||||
package com.lz.modules.app.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class StaffRoleInfo {
|
||||
private String name;
|
||||
private String headerUrl;
|
||||
private Long staffId;
|
||||
private int functionModel = 1;
|
||||
private Long departmentId;
|
||||
private Long evaluationGroupId;
|
||||
//@ApiModelProperty(value = "0表示全部部门,1 所在部门及以下部门,2表示特定部门", name = "departmentId")
|
||||
private int canSee = 1;
|
||||
private List<String> menuNames;
|
||||
private String departmentLevel;
|
||||
}
|
||||
35
src/main/java/com/lz/modules/app/enums/RoleEnums.java
Normal file
35
src/main/java/com/lz/modules/app/enums/RoleEnums.java
Normal file
@ -0,0 +1,35 @@
|
||||
package com.lz.modules.app.enums;
|
||||
|
||||
public enum RoleEnums {
|
||||
|
||||
MASTER_PM("MASTER_PM", "主管理员"),
|
||||
CHILD_PM("CHILD_PM", "子管理员"),
|
||||
BOSS("BOSS", "企业负责人"),
|
||||
DEPARTMENT_PM("DEPARTMENT_PM", "部门主管"),
|
||||
STAFF("STAFF", "员工");
|
||||
|
||||
private String name;
|
||||
private String desc ;
|
||||
|
||||
RoleEnums(String name, String desc) {
|
||||
this.name = name;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
}
|
||||
10
src/main/java/com/lz/modules/app/model/RoleModel.java
Normal file
10
src/main/java/com/lz/modules/app/model/RoleModel.java
Normal file
@ -0,0 +1,10 @@
|
||||
package com.lz.modules.app.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RoleModel {
|
||||
private int currPage =1;
|
||||
private int pageSize = 10;
|
||||
|
||||
}
|
||||
33
src/main/java/com/lz/modules/flow/dao/StaffMenuMapper.java
Normal file
33
src/main/java/com/lz/modules/flow/dao/StaffMenuMapper.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.lz.modules.flow.dao;
|
||||
/**
|
||||
* <p>
|
||||
* 绩效管理菜单表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2020-11-02
|
||||
*/
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.lz.modules.flow.entity.StaffMenu;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface StaffMenuMapper extends BaseMapper<StaffMenu> {
|
||||
|
||||
|
||||
StaffMenu selectStaffMenuById(@Param("id") Long id);
|
||||
|
||||
|
||||
Long insertStaffMenu(StaffMenu staffMenu);
|
||||
|
||||
|
||||
int updateStaffMenuById(StaffMenu staffMenu);
|
||||
|
||||
|
||||
int updateCoverStaffMenuById(StaffMenu staffMenu);
|
||||
|
||||
|
||||
int deleteStaffMenuById(@Param("id") Long id);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.lz.modules.flow.dao;
|
||||
/**
|
||||
* <p>
|
||||
* 绩效管理菜单表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2020-11-02
|
||||
*/
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.lz.modules.flow.entity.StaffRoleEvaluationGroup;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface StaffRoleEvaluationGroupMapper extends BaseMapper<StaffRoleEvaluationGroup> {
|
||||
|
||||
|
||||
StaffRoleEvaluationGroup selectStaffRoleEvaluationGroupById(@Param("id") Long id);
|
||||
|
||||
|
||||
Long insertStaffRoleEvaluationGroup(StaffRoleEvaluationGroup staffRoleEvaluationGroup);
|
||||
|
||||
|
||||
int updateStaffRoleEvaluationGroupById(StaffRoleEvaluationGroup staffRoleEvaluationGroup);
|
||||
|
||||
|
||||
int updateCoverStaffRoleEvaluationGroupById(StaffRoleEvaluationGroup staffRoleEvaluationGroup);
|
||||
|
||||
|
||||
int deleteStaffRoleEvaluationGroupById(@Param("id") Long id);
|
||||
|
||||
|
||||
}
|
||||
@ -44,4 +44,10 @@ public interface StaffRoleMapper extends BaseMapper<StaffRole> {
|
||||
List<StaffRole> selectByGroupId(@Param("id") Long id);
|
||||
|
||||
List<StaffRole> selectStaffRolesByStaffId(@Param("list") List<Long> mIds);
|
||||
|
||||
List<StaffRole> selectByEvaluationGroupId(@Param("id") Long id);
|
||||
|
||||
List<StaffRole> selectByRoleLevel(@Param("name") String name);
|
||||
|
||||
List<StaffRole> selectPageByRoleLevel(@Param("page") IPage page, @Param("name") String name);
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package com.lz.modules.flow.dao;
|
||||
/**
|
||||
* <p>
|
||||
* 绩效管理菜单表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2020-11-02
|
||||
*/
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.lz.modules.flow.entity.StaffMenu;
|
||||
import com.lz.modules.flow.entity.StaffRoleMenu;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface StaffRoleMenuMapper extends BaseMapper<StaffRoleMenu> {
|
||||
|
||||
|
||||
StaffRoleMenu selectStaffRoleMenuById(@Param("id") Long id);
|
||||
|
||||
|
||||
Long insertStaffRoleMenu(StaffRoleMenu staffRoleMenu);
|
||||
|
||||
|
||||
int updateStaffRoleMenuById(StaffRoleMenu staffRoleMenu);
|
||||
|
||||
|
||||
int updateCoverStaffRoleMenuById(StaffRoleMenu staffRoleMenu);
|
||||
|
||||
|
||||
int deleteStaffRoleMenuById(@Param("id") Long id);
|
||||
|
||||
|
||||
List<StaffMenu> selectByRoleId(@Param("roleId") Long roleId);
|
||||
}
|
||||
158
src/main/java/com/lz/modules/flow/entity/StaffMenu.java
Normal file
158
src/main/java/com/lz/modules/flow/entity/StaffMenu.java
Normal file
@ -0,0 +1,158 @@
|
||||
package com.lz.modules.flow.entity;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
/**
|
||||
* <p>
|
||||
* </p>*绩效管理菜单表
|
||||
* @author quyixiao
|
||||
* @since 2020-11-02
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("lz_staff_menu")
|
||||
@ApiModel(value = "绩效管理菜单表")
|
||||
public class StaffMenu implements java.io.Serializable {
|
||||
//
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
//是否删除状态,1:删除,0:有效
|
||||
@ApiModelProperty(value = "是否删除状态,1:删除,0:有效", name = "isDelete")
|
||||
private Integer isDelete;
|
||||
//创建时间
|
||||
@ApiModelProperty(value = "创建时间", name = "gmtCreate")
|
||||
private Date gmtCreate;
|
||||
//最后修改时间
|
||||
@ApiModelProperty(value = "最后修改时间", name = "gmtModified")
|
||||
private Date gmtModified;
|
||||
//菜单名称
|
||||
@ApiModelProperty(value = "菜单名称", name = "name")
|
||||
private String name;
|
||||
//父亲节点 id
|
||||
@ApiModelProperty(value = "父亲节点 id", name = "parentId")
|
||||
private Long parentId;
|
||||
//授权 id
|
||||
@ApiModelProperty(value = "授权 id", name = "authIds")
|
||||
private Long authIds;
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否删除状态,1:删除,0:有效
|
||||
* @return
|
||||
*/
|
||||
public Integer getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
/**
|
||||
* 是否删除状态,1:删除,0:有效
|
||||
* @param isDelete
|
||||
*/
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
* @return
|
||||
*/
|
||||
public Date getGmtCreate() {
|
||||
return gmtCreate;
|
||||
}
|
||||
/**
|
||||
* 创建时间
|
||||
* @param gmtCreate
|
||||
*/
|
||||
public void setGmtCreate(Date gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 最后修改时间
|
||||
* @return
|
||||
*/
|
||||
public Date getGmtModified() {
|
||||
return gmtModified;
|
||||
}
|
||||
/**
|
||||
* 最后修改时间
|
||||
* @param gmtModified
|
||||
*/
|
||||
public void setGmtModified(Date gmtModified) {
|
||||
this.gmtModified = gmtModified;
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单名称
|
||||
* @return
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
/**
|
||||
* 菜单名称
|
||||
* @param name
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 父亲节点 id
|
||||
* @return
|
||||
*/
|
||||
public Long getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
/**
|
||||
* 父亲节点 id
|
||||
* @param parentId
|
||||
*/
|
||||
public void setParentId(Long parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 授权 id
|
||||
* @return
|
||||
*/
|
||||
public Long getAuthIds() {
|
||||
return authIds;
|
||||
}
|
||||
/**
|
||||
* 授权 id
|
||||
* @param authIds
|
||||
*/
|
||||
public void setAuthIds(Long authIds) {
|
||||
this.authIds = authIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StaffMenu{" +
|
||||
",id=" + id +
|
||||
",isDelete=" + isDelete +
|
||||
",gmtCreate=" + gmtCreate +
|
||||
",gmtModified=" + gmtModified +
|
||||
",name=" + name +
|
||||
",parentId=" + parentId +
|
||||
",authIds=" + authIds +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
package com.lz.modules.flow.entity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
@ -10,7 +11,7 @@ import java.util.Date;
|
||||
* <p>
|
||||
* </p>*流转关系表
|
||||
* @author quyixiao
|
||||
* @since 2020-10-21
|
||||
* @since 2020-11-02
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ -41,11 +42,14 @@ public class StaffRole implements java.io.Serializable {
|
||||
//员工名称
|
||||
@ApiModelProperty(value = "员工名称", name = "staffName")
|
||||
private String staffName;
|
||||
//组id
|
||||
@ApiModelProperty(value = "组id", name = "evaluationGroupId")
|
||||
//0表示全部组,1表示特定组
|
||||
@ApiModelProperty(value = "0表示全部组,1表示特定组", name = "evaluationGroupId")
|
||||
private Long evaluationGroupId;
|
||||
//是否是必选
|
||||
@ApiModelProperty(value = "是否是必选", name = "isSelect")
|
||||
//0表示全部部门,1 所在部门及以下部门,2表示特定部门
|
||||
@ApiModelProperty(value = "0表示全部部门,1 所在部门及以下部门,2表示特定部门", name = "departmentId")
|
||||
private Long departmentId;
|
||||
|
||||
@TableField(exist=false)
|
||||
private Integer isSelect;
|
||||
/**
|
||||
*
|
||||
@ -168,14 +172,14 @@ public class StaffRole implements java.io.Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 组id
|
||||
* 0表示全部组,1表示特定组
|
||||
* @return
|
||||
*/
|
||||
public Long getEvaluationGroupId() {
|
||||
return evaluationGroupId;
|
||||
}
|
||||
/**
|
||||
* 组id
|
||||
* 0表示全部组,1表示特定组
|
||||
* @param evaluationGroupId
|
||||
*/
|
||||
public void setEvaluationGroupId(Long evaluationGroupId) {
|
||||
@ -183,18 +187,18 @@ public class StaffRole implements java.io.Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是必选
|
||||
* 0表示全部部门,1 所在部门及以下部门,2表示特定部门
|
||||
* @return
|
||||
*/
|
||||
public Integer getIsSelect() {
|
||||
return isSelect;
|
||||
public Long getDepartmentId() {
|
||||
return departmentId;
|
||||
}
|
||||
/**
|
||||
* 是否是必选
|
||||
* @param isSelect
|
||||
* 0表示全部部门,1 所在部门及以下部门,2表示特定部门
|
||||
* @param departmentId
|
||||
*/
|
||||
public void setIsSelect(Integer isSelect) {
|
||||
this.isSelect = isSelect;
|
||||
public void setDepartmentId(Long departmentId) {
|
||||
this.departmentId = departmentId;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -209,7 +213,7 @@ public class StaffRole implements java.io.Serializable {
|
||||
",typeRoleIds=" + typeRoleIds +
|
||||
",staffName=" + staffName +
|
||||
",evaluationGroupId=" + evaluationGroupId +
|
||||
",isSelect=" + isSelect +
|
||||
",departmentId=" + departmentId +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,158 @@
|
||||
package com.lz.modules.flow.entity;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
/**
|
||||
* <p>
|
||||
* </p>*绩效管理菜单表
|
||||
* @author quyixiao
|
||||
* @since 2020-11-02
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("lz_staff_role_evaluation_group")
|
||||
@ApiModel(value = "绩效管理菜单表")
|
||||
public class StaffRoleEvaluationGroup implements java.io.Serializable {
|
||||
//
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
//是否删除状态,1:删除,0:有效
|
||||
@ApiModelProperty(value = "是否删除状态,1:删除,0:有效", name = "isDelete")
|
||||
private Integer isDelete;
|
||||
//创建时间
|
||||
@ApiModelProperty(value = "创建时间", name = "gmtCreate")
|
||||
private Date gmtCreate;
|
||||
//最后修改时间
|
||||
@ApiModelProperty(value = "最后修改时间", name = "gmtModified")
|
||||
private Date gmtModified;
|
||||
//角色id
|
||||
@ApiModelProperty(value = "角色id", name = "roleId")
|
||||
private Long roleId;
|
||||
//考评组 id
|
||||
@ApiModelProperty(value = "考评组 id", name = "evaluationGroupId")
|
||||
private Long evaluationGroupId;
|
||||
//是否选中,0表示未选中,1表示选中
|
||||
@ApiModelProperty(value = "是否选中,0表示未选中,1表示选中", name = "isSelect")
|
||||
private Integer isSelect;
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否删除状态,1:删除,0:有效
|
||||
* @return
|
||||
*/
|
||||
public Integer getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
/**
|
||||
* 是否删除状态,1:删除,0:有效
|
||||
* @param isDelete
|
||||
*/
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
* @return
|
||||
*/
|
||||
public Date getGmtCreate() {
|
||||
return gmtCreate;
|
||||
}
|
||||
/**
|
||||
* 创建时间
|
||||
* @param gmtCreate
|
||||
*/
|
||||
public void setGmtCreate(Date gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 最后修改时间
|
||||
* @return
|
||||
*/
|
||||
public Date getGmtModified() {
|
||||
return gmtModified;
|
||||
}
|
||||
/**
|
||||
* 最后修改时间
|
||||
* @param gmtModified
|
||||
*/
|
||||
public void setGmtModified(Date gmtModified) {
|
||||
this.gmtModified = gmtModified;
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
* @return
|
||||
*/
|
||||
public Long getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
/**
|
||||
* 角色id
|
||||
* @param roleId
|
||||
*/
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 考评组 id
|
||||
* @return
|
||||
*/
|
||||
public Long getEvaluationGroupId() {
|
||||
return evaluationGroupId;
|
||||
}
|
||||
/**
|
||||
* 考评组 id
|
||||
* @param evaluationGroupId
|
||||
*/
|
||||
public void setEvaluationGroupId(Long evaluationGroupId) {
|
||||
this.evaluationGroupId = evaluationGroupId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否选中,0表示未选中,1表示选中
|
||||
* @return
|
||||
*/
|
||||
public Integer getIsSelect() {
|
||||
return isSelect;
|
||||
}
|
||||
/**
|
||||
* 是否选中,0表示未选中,1表示选中
|
||||
* @param isSelect
|
||||
*/
|
||||
public void setIsSelect(Integer isSelect) {
|
||||
this.isSelect = isSelect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StaffRoleEvaluationGroup{" +
|
||||
",id=" + id +
|
||||
",isDelete=" + isDelete +
|
||||
",gmtCreate=" + gmtCreate +
|
||||
",gmtModified=" + gmtModified +
|
||||
",roleId=" + roleId +
|
||||
",evaluationGroupId=" + evaluationGroupId +
|
||||
",isSelect=" + isSelect +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
139
src/main/java/com/lz/modules/flow/entity/StaffRoleMenu.java
Normal file
139
src/main/java/com/lz/modules/flow/entity/StaffRoleMenu.java
Normal file
@ -0,0 +1,139 @@
|
||||
package com.lz.modules.flow.entity;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
/**
|
||||
* <p>
|
||||
* </p>*绩效管理菜单表
|
||||
* @author quyixiao
|
||||
* @since 2020-11-02
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("lz_staff_role_menu")
|
||||
@ApiModel(value = "绩效管理菜单表")
|
||||
public class StaffRoleMenu implements java.io.Serializable {
|
||||
//
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
//是否删除状态,1:删除,0:有效
|
||||
@ApiModelProperty(value = "是否删除状态,1:删除,0:有效", name = "isDelete")
|
||||
private Integer isDelete;
|
||||
//创建时间
|
||||
@ApiModelProperty(value = "创建时间", name = "gmtCreate")
|
||||
private Date gmtCreate;
|
||||
//最后修改时间
|
||||
@ApiModelProperty(value = "最后修改时间", name = "gmtModified")
|
||||
private Date gmtModified;
|
||||
//角色 id
|
||||
@ApiModelProperty(value = "角色 id", name = "roleId")
|
||||
private Long roleId;
|
||||
//菜单 id
|
||||
@ApiModelProperty(value = "菜单 id", name = "menuId")
|
||||
private Long menuId;
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否删除状态,1:删除,0:有效
|
||||
* @return
|
||||
*/
|
||||
public Integer getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
/**
|
||||
* 是否删除状态,1:删除,0:有效
|
||||
* @param isDelete
|
||||
*/
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
* @return
|
||||
*/
|
||||
public Date getGmtCreate() {
|
||||
return gmtCreate;
|
||||
}
|
||||
/**
|
||||
* 创建时间
|
||||
* @param gmtCreate
|
||||
*/
|
||||
public void setGmtCreate(Date gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 最后修改时间
|
||||
* @return
|
||||
*/
|
||||
public Date getGmtModified() {
|
||||
return gmtModified;
|
||||
}
|
||||
/**
|
||||
* 最后修改时间
|
||||
* @param gmtModified
|
||||
*/
|
||||
public void setGmtModified(Date gmtModified) {
|
||||
this.gmtModified = gmtModified;
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色 id
|
||||
* @return
|
||||
*/
|
||||
public Long getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
/**
|
||||
* 角色 id
|
||||
* @param roleId
|
||||
*/
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单 id
|
||||
* @return
|
||||
*/
|
||||
public Long getMenuId() {
|
||||
return menuId;
|
||||
}
|
||||
/**
|
||||
* 菜单 id
|
||||
* @param menuId
|
||||
*/
|
||||
public void setMenuId(Long menuId) {
|
||||
this.menuId = menuId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StaffRoleMenu{" +
|
||||
",id=" + id +
|
||||
",isDelete=" + isDelete +
|
||||
",gmtCreate=" + gmtCreate +
|
||||
",gmtModified=" + gmtModified +
|
||||
",roleId=" + roleId +
|
||||
",menuId=" + menuId +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.lz.modules.flow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.lz.modules.flow.entity.StaffMenu;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 绩效管理菜单表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2020-11-02
|
||||
*/
|
||||
public interface StaffMenuService extends IService<StaffMenu> {
|
||||
|
||||
|
||||
|
||||
StaffMenu selectStaffMenuById(Long id);
|
||||
|
||||
|
||||
Long insertStaffMenu(StaffMenu staffMenu);
|
||||
|
||||
|
||||
int updateStaffMenuById(StaffMenu staffMenu);
|
||||
|
||||
|
||||
int updateCoverStaffMenuById(StaffMenu staffMenu);
|
||||
|
||||
|
||||
int deleteStaffMenuById(Long id);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.lz.modules.flow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.lz.modules.flow.entity.StaffRoleEvaluationGroup;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 绩效管理菜单表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2020-11-02
|
||||
*/
|
||||
public interface StaffRoleEvaluationGroupService extends IService<StaffRoleEvaluationGroup> {
|
||||
|
||||
|
||||
|
||||
StaffRoleEvaluationGroup selectStaffRoleEvaluationGroupById(Long id);
|
||||
|
||||
|
||||
Long insertStaffRoleEvaluationGroup(StaffRoleEvaluationGroup staffRoleEvaluationGroup);
|
||||
|
||||
|
||||
int updateStaffRoleEvaluationGroupById(StaffRoleEvaluationGroup staffRoleEvaluationGroup);
|
||||
|
||||
|
||||
int updateCoverStaffRoleEvaluationGroupById(StaffRoleEvaluationGroup staffRoleEvaluationGroup);
|
||||
|
||||
|
||||
int deleteStaffRoleEvaluationGroupById(Long id);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.lz.modules.flow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.lz.modules.flow.entity.StaffMenu;
|
||||
import com.lz.modules.flow.entity.StaffRoleMenu;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 绩效管理菜单表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2020-11-02
|
||||
*/
|
||||
public interface StaffRoleMenuService extends IService<StaffRoleMenu> {
|
||||
|
||||
|
||||
|
||||
StaffRoleMenu selectStaffRoleMenuById(Long id);
|
||||
|
||||
|
||||
Long insertStaffRoleMenu(StaffRoleMenu staffRoleMenu);
|
||||
|
||||
|
||||
int updateStaffRoleMenuById(StaffRoleMenu staffRoleMenu);
|
||||
|
||||
|
||||
int updateCoverStaffRoleMenuById(StaffRoleMenu staffRoleMenu);
|
||||
|
||||
|
||||
int deleteStaffRoleMenuById(Long id);
|
||||
|
||||
|
||||
List<StaffMenu> selectByRoleId(Long id);
|
||||
}
|
||||
@ -2,6 +2,8 @@ package com.lz.modules.flow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.common.utils.R;
|
||||
import com.lz.modules.app.model.RoleModel;
|
||||
import com.lz.modules.flow.entity.StaffRole;
|
||||
import com.lz.modules.sys.entity.SysMenuEntity;
|
||||
import com.lz.modules.sys.entity.SysRoleEntity;
|
||||
@ -51,4 +53,6 @@ public interface StaffRoleService extends IService<StaffRole> {
|
||||
List<StaffRole> selectByGroupId(Long id);
|
||||
|
||||
List<StaffRole> selectStaffRolesByStaffId(List<Long> mIds);
|
||||
|
||||
R selectRoleInfoBy(RoleModel roleModel);
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.lz.modules.flow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.lz.modules.flow.dao.StaffMenuMapper;
|
||||
import com.lz.modules.flow.entity.StaffMenu;
|
||||
import com.lz.modules.flow.service.StaffMenuService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 绩效管理菜单表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2020-11-02
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class StaffMenuServiceImpl extends ServiceImpl<StaffMenuMapper, StaffMenu> implements StaffMenuService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private StaffMenuMapper staffMenuMapper;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public StaffMenu selectStaffMenuById(Long id){
|
||||
return staffMenuMapper.selectStaffMenuById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Long insertStaffMenu(StaffMenu staffMenu){
|
||||
return staffMenuMapper.insertStaffMenu(staffMenu);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int updateStaffMenuById(StaffMenu staffMenu){
|
||||
return staffMenuMapper.updateStaffMenuById(staffMenu);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int updateCoverStaffMenuById(StaffMenu staffMenu){
|
||||
return staffMenuMapper.updateCoverStaffMenuById(staffMenu);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteStaffMenuById(Long id){
|
||||
return staffMenuMapper.deleteStaffMenuById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.lz.modules.flow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.lz.modules.flow.dao.StaffRoleEvaluationGroupMapper;
|
||||
import com.lz.modules.flow.entity.StaffRoleEvaluationGroup;
|
||||
import com.lz.modules.flow.service.StaffRoleEvaluationGroupService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 绩效管理菜单表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2020-11-02
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class StaffRoleEvaluationGroupServiceImpl extends ServiceImpl<StaffRoleEvaluationGroupMapper, StaffRoleEvaluationGroup> implements StaffRoleEvaluationGroupService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private StaffRoleEvaluationGroupMapper staffRoleEvaluationGroupMapper;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public StaffRoleEvaluationGroup selectStaffRoleEvaluationGroupById(Long id){
|
||||
return staffRoleEvaluationGroupMapper.selectStaffRoleEvaluationGroupById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Long insertStaffRoleEvaluationGroup(StaffRoleEvaluationGroup staffRoleEvaluationGroup){
|
||||
return staffRoleEvaluationGroupMapper.insertStaffRoleEvaluationGroup(staffRoleEvaluationGroup);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int updateStaffRoleEvaluationGroupById(StaffRoleEvaluationGroup staffRoleEvaluationGroup){
|
||||
return staffRoleEvaluationGroupMapper.updateStaffRoleEvaluationGroupById(staffRoleEvaluationGroup);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int updateCoverStaffRoleEvaluationGroupById(StaffRoleEvaluationGroup staffRoleEvaluationGroup){
|
||||
return staffRoleEvaluationGroupMapper.updateCoverStaffRoleEvaluationGroupById(staffRoleEvaluationGroup);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteStaffRoleEvaluationGroupById(Long id){
|
||||
return staffRoleEvaluationGroupMapper.deleteStaffRoleEvaluationGroupById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.lz.modules.flow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.lz.modules.flow.dao.StaffRoleMenuMapper;
|
||||
import com.lz.modules.flow.entity.StaffMenu;
|
||||
import com.lz.modules.flow.entity.StaffRoleMenu;
|
||||
import com.lz.modules.flow.service.StaffRoleMenuService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 绩效管理菜单表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2020-11-02
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class StaffRoleMenuServiceImpl extends ServiceImpl<StaffRoleMenuMapper, StaffRoleMenu> implements StaffRoleMenuService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private StaffRoleMenuMapper staffRoleMenuMapper;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public StaffRoleMenu selectStaffRoleMenuById(Long id){
|
||||
return staffRoleMenuMapper.selectStaffRoleMenuById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Long insertStaffRoleMenu(StaffRoleMenu staffRoleMenu){
|
||||
return staffRoleMenuMapper.insertStaffRoleMenu(staffRoleMenu);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int updateStaffRoleMenuById(StaffRoleMenu staffRoleMenu){
|
||||
return staffRoleMenuMapper.updateStaffRoleMenuById(staffRoleMenu);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int updateCoverStaffRoleMenuById(StaffRoleMenu staffRoleMenu){
|
||||
return staffRoleMenuMapper.updateCoverStaffRoleMenuById(staffRoleMenu);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteStaffRoleMenuById(Long id){
|
||||
return staffRoleMenuMapper.deleteStaffRoleMenuById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StaffMenu> selectByRoleId(Long roleId) {
|
||||
return staffRoleMenuMapper.selectByRoleId(roleId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -5,21 +5,27 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.lz.common.utils.NumberUtil;
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.common.utils.R;
|
||||
import com.lz.modules.app.dao.DepartmentsDao;
|
||||
import com.lz.modules.app.dao.StaffDao;
|
||||
import com.lz.modules.app.dto.StaffRoleInfo;
|
||||
import com.lz.modules.app.dto.StaffRoleResp;
|
||||
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||
import com.lz.modules.app.entity.StaffEntity;
|
||||
import com.lz.modules.app.enums.RoleEnums;
|
||||
import com.lz.modules.app.model.RoleModel;
|
||||
import com.lz.modules.app.service.DepartmentsService;
|
||||
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||
import com.lz.modules.flow.dao.RecordRoleMapper;
|
||||
import com.lz.modules.flow.dao.StaffRoleDepartmentMapper;
|
||||
import com.lz.modules.flow.dao.StaffRoleMapper;
|
||||
import com.lz.modules.flow.entity.RecordRole;
|
||||
import com.lz.modules.flow.entity.StaffMenu;
|
||||
import com.lz.modules.flow.entity.StaffRole;
|
||||
import com.lz.modules.flow.entity.StaffRoleDepartment;
|
||||
import com.lz.modules.flow.service.RecordRoleService;
|
||||
import com.lz.modules.flow.service.StaffRoleMenuService;
|
||||
import com.lz.modules.flow.service.StaffRoleService;
|
||||
import com.lz.modules.sys.entity.SysMenuEntity;
|
||||
import com.lz.modules.sys.entity.SysRoleEntity;
|
||||
@ -68,7 +74,7 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
||||
private ResultRecordService resultRecordService;
|
||||
|
||||
@Autowired
|
||||
private RecordRoleService recordRoleService;
|
||||
private RecordRoleService recordRoleService;
|
||||
|
||||
@Autowired
|
||||
private DepartmentsService departmentsService;
|
||||
@ -76,6 +82,9 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
||||
@Autowired
|
||||
private DepartmentsStaffRelateService departmentsStaffRelateService;
|
||||
|
||||
@Autowired
|
||||
private StaffRoleMenuService staffRoleMenuService;
|
||||
|
||||
@Override
|
||||
public StaffRole selectStaffRoleById(Long id) {
|
||||
return staffRoleMapper.selectStaffRoleById(id);
|
||||
@ -123,39 +132,39 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
||||
NumberUtil.objToIntDefault(params.get("page"), 1),
|
||||
NumberUtil.objToIntDefault(params.get("limit"), 10)).doSelect(
|
||||
page -> staffRoleMapper.selectByCondition(page, params)
|
||||
);
|
||||
List<StaffRole> staffRoles = pageUtils.getList();
|
||||
List<StaffRoleResp> list = new ArrayList<>();
|
||||
Map<Long, RecordRole> map = Maps.newHashMap();
|
||||
for (StaffRole staffRole : staffRoles) {
|
||||
StaffRoleResp resp = new StaffRoleResp();
|
||||
BeanUtils.copyProperties(staffRole, resp);
|
||||
StaffEntity staffEntity = staffDao.selectStaffById(resp.getStaffId());
|
||||
if (staffEntity != null) {
|
||||
resp.setStaffName(staffEntity.getName());
|
||||
}
|
||||
);
|
||||
List<StaffRole> staffRoles = pageUtils.getList();
|
||||
List<StaffRoleResp> list = new ArrayList<>();
|
||||
Map<Long, RecordRole> map = Maps.newHashMap();
|
||||
for (StaffRole staffRole : staffRoles) {
|
||||
StaffRoleResp resp = new StaffRoleResp();
|
||||
BeanUtils.copyProperties(staffRole, resp);
|
||||
StaffEntity staffEntity = staffDao.selectStaffById(resp.getStaffId());
|
||||
if (staffEntity != null) {
|
||||
resp.setStaffName(staffEntity.getName());
|
||||
}
|
||||
|
||||
Map<String, Integer> types = JSONObject.parseObject(resp.getTypeRoleIds(), Map.class);
|
||||
Long type1 = NumberUtil.objToLongDefault(types.get("type1"),0l);
|
||||
Long type2 = NumberUtil.objToLongDefault(types.get("type2"),0l);
|
||||
RecordRole recordRoleType1 = map.get(type1);
|
||||
if (recordRoleType1 == null) {
|
||||
recordRoleType1 = recordRoleMapper.selectById(type1);
|
||||
}
|
||||
RecordRole recordRoleType2 = map.get(type2);
|
||||
if (recordRoleType2 == null) {
|
||||
recordRoleType2 = recordRoleMapper.selectById(type2);
|
||||
}
|
||||
if (recordRoleType1 != null) {
|
||||
map.put(recordRoleType1.getId(), recordRoleType1);
|
||||
resp.setTargetRole(recordRoleType1.getName());
|
||||
}
|
||||
if (recordRoleType2 != null) {
|
||||
map.put(recordRoleType2.getId(), recordRoleType2);
|
||||
resp.setResultRole(recordRoleType2.getName());
|
||||
}
|
||||
list.add(resp);
|
||||
}
|
||||
Map<String, Integer> types = JSONObject.parseObject(resp.getTypeRoleIds(), Map.class);
|
||||
Long type1 = NumberUtil.objToLongDefault(types.get("type1"), 0l);
|
||||
Long type2 = NumberUtil.objToLongDefault(types.get("type2"), 0l);
|
||||
RecordRole recordRoleType1 = map.get(type1);
|
||||
if (recordRoleType1 == null) {
|
||||
recordRoleType1 = recordRoleMapper.selectById(type1);
|
||||
}
|
||||
RecordRole recordRoleType2 = map.get(type2);
|
||||
if (recordRoleType2 == null) {
|
||||
recordRoleType2 = recordRoleMapper.selectById(type2);
|
||||
}
|
||||
if (recordRoleType1 != null) {
|
||||
map.put(recordRoleType1.getId(), recordRoleType1);
|
||||
resp.setTargetRole(recordRoleType1.getName());
|
||||
}
|
||||
if (recordRoleType2 != null) {
|
||||
map.put(recordRoleType2.getId(), recordRoleType2);
|
||||
resp.setResultRole(recordRoleType2.getName());
|
||||
}
|
||||
list.add(resp);
|
||||
}
|
||||
pageUtils.setList(list);
|
||||
return pageUtils;
|
||||
}
|
||||
@ -172,16 +181,16 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
||||
public SysRoleEntity getRole(Long id) {
|
||||
StaffRole staffRole = staffRoleMapper.selectStaffRoleById(id);
|
||||
SysRoleEntity role = new SysRoleEntity();
|
||||
List<Long> menuIdList= new ArrayList<>();
|
||||
List<Long> menuIdList1= new ArrayList<>();
|
||||
if(staffRole!=null){
|
||||
List<Long> menuIdList = new ArrayList<>();
|
||||
List<Long> menuIdList1 = new ArrayList<>();
|
||||
if (staffRole != null) {
|
||||
List<StaffRoleDepartment> staffRoleDepartments = staffRoleDepartmentMapper.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId());
|
||||
List<DepartmentsEntity> departmentsEntities = departmentsDao.selectAll();
|
||||
Map<String,List<DepartmentsEntity>> map= resultRecordService.getStringListMap(departmentsEntities);
|
||||
Map<String, List<DepartmentsEntity>> map = resultRecordService.getStringListMap(departmentsEntities);
|
||||
role.setRoleId(staffRole.getId());
|
||||
role.setRoleName(staffRole.getDepartmentLevel());
|
||||
|
||||
for(StaffRoleDepartment staffRoleDepartment: staffRoleDepartments){
|
||||
for (StaffRoleDepartment staffRoleDepartment : staffRoleDepartments) {
|
||||
List<DepartmentsEntity> list = map.get(staffRoleDepartment.getDepartmentId());
|
||||
List<String> departments = departmentsService.selectAllChildDepartmentIds(staffRoleDepartment.getDepartmentId());
|
||||
List<StaffRoleDepartment> departments1 = staffRoleDepartmentMapper.selectStaffRoleDepartmentByStaffRoleIdDepartments(staffRole.getId(), departments);
|
||||
@ -206,24 +215,24 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
||||
.filter(s -> s.getDepartmentParentId().equals("1"))
|
||||
.collect(Collectors.toList());
|
||||
List<DepartmentsStaffRelateEntity> departmentsStaffRelateEntities = departmentsStaffRelateService.selectAll();
|
||||
Map<String,DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap = new HashMap<>();
|
||||
Map<String,DepartmentsStaffRelateEntity> singleDepartmentsStaffRelate = new HashMap<>();
|
||||
for(DepartmentsStaffRelateEntity d : departmentsStaffRelateEntities){
|
||||
singleDepartmentsStaffRelate.put(d.getDepartmentId(),d);
|
||||
if(new Integer(1).equals(d.getIsLeader())){
|
||||
departmentsStaffRelateEntityMap.put(d.getDepartmentId(),d);
|
||||
Map<String, DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap = new HashMap<>();
|
||||
Map<String, DepartmentsStaffRelateEntity> singleDepartmentsStaffRelate = new HashMap<>();
|
||||
for (DepartmentsStaffRelateEntity d : departmentsStaffRelateEntities) {
|
||||
singleDepartmentsStaffRelate.put(d.getDepartmentId(), d);
|
||||
if (new Integer(1).equals(d.getIsLeader())) {
|
||||
departmentsStaffRelateEntityMap.put(d.getDepartmentId(), d);
|
||||
}
|
||||
}
|
||||
List<StaffEntity> staffEntities = staffDao.selectAll();
|
||||
Map<Long ,StaffEntity> staffMap = new HashMap<>();
|
||||
for(StaffEntity staffEntity : staffEntities){
|
||||
staffMap.put(staffEntity.getId(),staffEntity);
|
||||
Map<Long, StaffEntity> staffMap = new HashMap<>();
|
||||
for (StaffEntity staffEntity : staffEntities) {
|
||||
staffMap.put(staffEntity.getId(), staffEntity);
|
||||
}
|
||||
List<SysMenuEntity> list = new ArrayList<>();
|
||||
for (DepartmentsEntity d : parentDepartments) {
|
||||
String departmentName = d.getDepartmentName() + getSuffix(departmentsStaffRelateEntityMap,staffMap,d.getDepartmentId(),singleDepartmentsStaffRelate);
|
||||
SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(d.getDepartmentId(), 0l),departmentName , 0l, "");
|
||||
getMenuList(tDepartments, entity, list,departmentsStaffRelateEntityMap,staffMap,singleDepartmentsStaffRelate);
|
||||
String departmentName = d.getDepartmentName() + getSuffix(departmentsStaffRelateEntityMap, staffMap, d.getDepartmentId(), singleDepartmentsStaffRelate);
|
||||
SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(d.getDepartmentId(), 0l), departmentName, 0l, "");
|
||||
getMenuList(tDepartments, entity, list, departmentsStaffRelateEntityMap, staffMap, singleDepartmentsStaffRelate);
|
||||
list.add(entity);
|
||||
}
|
||||
return list;
|
||||
@ -232,7 +241,7 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
||||
@Override
|
||||
public List<StaffRole> selectByGroupId(Long id) {
|
||||
|
||||
return staffRoleMapper.selectByGroupId(id);
|
||||
return staffRoleMapper.selectByEvaluationGroupId(id);
|
||||
}
|
||||
|
||||
public String getSuffix(Map<String, DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap, Map<Long, StaffEntity> staffMap, String departmentId,
|
||||
@ -256,23 +265,73 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
||||
}
|
||||
|
||||
|
||||
public void getMenuList(List<DepartmentsEntity> tDepartments,SysMenuEntity sysMenuEntity,List<SysMenuEntity> list,
|
||||
Map<String,DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap, Map<Long ,StaffEntity> staffMap,
|
||||
Map<String,DepartmentsStaffRelateEntity> singleDepartmentsStaffRelate) {
|
||||
for(DepartmentsEntity child : tDepartments) {
|
||||
if(NumberUtil.objToLongDefault(child.getDepartmentParentId(),0l).equals(sysMenuEntity.getMenuId())){
|
||||
String departmentName = child.getDepartmentName() + getSuffix(departmentsStaffRelateEntityMap,staffMap,child.getDepartmentId(),singleDepartmentsStaffRelate);
|
||||
SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(child.getDepartmentId(),0l),
|
||||
departmentName,sysMenuEntity.getMenuId(),sysMenuEntity.getName());
|
||||
getMenuList(tDepartments,entity,list,departmentsStaffRelateEntityMap,staffMap,singleDepartmentsStaffRelate);
|
||||
public void getMenuList(List<DepartmentsEntity> tDepartments, SysMenuEntity sysMenuEntity, List<SysMenuEntity> list,
|
||||
Map<String, DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap, Map<Long, StaffEntity> staffMap,
|
||||
Map<String, DepartmentsStaffRelateEntity> singleDepartmentsStaffRelate) {
|
||||
for (DepartmentsEntity child : tDepartments) {
|
||||
if (NumberUtil.objToLongDefault(child.getDepartmentParentId(), 0l).equals(sysMenuEntity.getMenuId())) {
|
||||
String departmentName = child.getDepartmentName() + getSuffix(departmentsStaffRelateEntityMap, staffMap, child.getDepartmentId(), singleDepartmentsStaffRelate);
|
||||
SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(child.getDepartmentId(), 0l),
|
||||
departmentName, sysMenuEntity.getMenuId(), sysMenuEntity.getName());
|
||||
getMenuList(tDepartments, entity, list, departmentsStaffRelateEntityMap, staffMap, singleDepartmentsStaffRelate);
|
||||
list.add(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StaffRole> selectStaffRolesByStaffId(List<Long> mIds){
|
||||
public List<StaffRole> selectStaffRolesByStaffId(List<Long> mIds) {
|
||||
return staffRoleMapper.selectStaffRolesByStaffId(mIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R selectRoleInfoBy(RoleModel roleModel) {
|
||||
List<StaffRole> masterPMList = staffRoleMapper.selectByRoleLevel(RoleEnums.MASTER_PM.getName());
|
||||
List<StaffRoleInfo> masterPM = new ArrayList<>();
|
||||
for (StaffRole staffRole : masterPMList) {
|
||||
StaffRoleInfo staffRoleInfo = new StaffRoleInfo();
|
||||
StaffEntity staffEntity = staffDao.selectStaffById(staffRole.getStaffId());
|
||||
staffRoleInfo.setName(staffEntity.getName());
|
||||
staffRoleInfo.setDepartmentLevel(staffRole.getDepartmentLevel());
|
||||
staffRoleInfo.setHeaderUrl(staffEntity.getAvatar());
|
||||
masterPM.add(staffRoleInfo);
|
||||
}
|
||||
|
||||
PageUtils pageUtils = PageUtils.startPage(roleModel.getCurrPage(), roleModel.getPageSize()).doSelect(
|
||||
page -> staffRoleMapper.selectPageByRoleLevel(page, RoleEnums.CHILD_PM.getName())
|
||||
);
|
||||
List<StaffRole> childPMList = pageUtils.getList();
|
||||
List<StaffRoleInfo> childPm = new ArrayList<>();
|
||||
for (StaffRole staffRole : childPMList) {
|
||||
StaffRoleInfo staffRoleInfo = new StaffRoleInfo();
|
||||
StaffEntity staffEntity = staffDao.selectStaffById(staffRole.getStaffId());
|
||||
BeanUtils.copyProperties(staffRole, staffRoleInfo);
|
||||
staffRoleInfo.setName(staffEntity.getName());
|
||||
staffRoleInfo.setHeaderUrl(staffEntity.getAvatar());
|
||||
List<StaffMenu> staffMenus = staffRoleMenuService.selectByRoleId(staffRole.getId());
|
||||
List<String> menuNames = new ArrayList<>();
|
||||
for (StaffMenu staffMenu : staffMenus) {
|
||||
menuNames.add(staffMenu.getName());
|
||||
}
|
||||
staffRoleInfo.setMenuNames(menuNames);
|
||||
childPm.add(staffRoleInfo);
|
||||
}
|
||||
pageUtils.setList(childPm);
|
||||
List<StaffRole> bossList = staffRoleMapper.selectByRoleLevel(RoleEnums.BOSS.getName());
|
||||
List<StaffRoleInfo> boss = new ArrayList<>();
|
||||
for (StaffRole staffRole : bossList) {
|
||||
StaffRoleInfo staffRoleInfo = new StaffRoleInfo();
|
||||
staffRoleInfo.setDepartmentLevel(staffRole.getDepartmentLevel());
|
||||
StaffEntity staffEntity = staffDao.selectStaffById(staffRole.getStaffId());
|
||||
staffRoleInfo.setName(staffEntity.getName());
|
||||
staffRoleInfo.setHeaderUrl(staffEntity.getAvatar());
|
||||
boss.add(staffRoleInfo);
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("masterPM", masterPM);
|
||||
map.put("childPm", pageUtils);
|
||||
map.put("boss", boss);
|
||||
return R.ok().put("data", map);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
83
src/main/resources/mapper/flow/StaffMenuMapper.xml
Normal file
83
src/main/resources/mapper/flow/StaffMenuMapper.xml
Normal file
@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.lz.modules.flow.dao.StaffMenuMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.lz.modules.flow.entity.StaffMenu">
|
||||
<id column="id" property="id"/>
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
<result column="gmt_modified" property="gmtModified"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="parent_id" property="parentId"/>
|
||||
<result column="auth_ids" property="authIds"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, name AS name, parent_id AS parentId, auth_ids AS authIds
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectStaffMenuById" resultType="StaffMenu" >
|
||||
select * from lz_staff_menu where id=#{id} and is_delete = 0 limit 1
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertStaffMenu" parameterType="StaffMenu" useGeneratedKeys="true" keyProperty="id" >
|
||||
insert into lz_staff_menu(
|
||||
<if test="name != null">name, </if>
|
||||
<if test="parentId != null">parent_id, </if>
|
||||
<if test="authIds != null">auth_ids, </if>
|
||||
is_delete,
|
||||
gmt_create,
|
||||
gmt_modified
|
||||
)values(
|
||||
<if test="name != null">#{ name}, </if>
|
||||
<if test="parentId != null">#{ parentId}, </if>
|
||||
<if test="authIds != null">#{ authIds}, </if>
|
||||
0,
|
||||
now(),
|
||||
now()
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateStaffMenuById" parameterType="StaffMenu" >
|
||||
update
|
||||
lz_staff_menu
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="authIds != null">auth_ids = #{authIds}</if>
|
||||
</trim>
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateCoverStaffMenuById" parameterType="StaffMenu" >
|
||||
update
|
||||
lz_staff_menu
|
||||
set
|
||||
is_delete = #{isDelete},
|
||||
gmt_create = #{gmtCreate},
|
||||
name = #{name},
|
||||
parent_id = #{parentId},
|
||||
auth_ids = #{authIds}
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="deleteStaffMenuById" parameterType="java.lang.Long">
|
||||
update lz_staff_menu set is_delete = 1 where id=#{id} limit 1
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.lz.modules.flow.dao.StaffRoleEvaluationGroupMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.lz.modules.flow.entity.StaffRoleEvaluationGroup">
|
||||
<id column="id" property="id"/>
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
<result column="gmt_modified" property="gmtModified"/>
|
||||
<result column="role_id" property="roleId"/>
|
||||
<result column="evaluation_group_id" property="evaluationGroupId"/>
|
||||
<result column="is_select" property="isSelect"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, role_id AS roleId, evaluation_group_id AS evaluationGroupId, is_select AS isSelect
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectStaffRoleEvaluationGroupById" resultType="StaffRoleEvaluationGroup" >
|
||||
select * from lz_staff_role_evaluation_group where id=#{id} and is_delete = 0 limit 1
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertStaffRoleEvaluationGroup" parameterType="StaffRoleEvaluationGroup" useGeneratedKeys="true" keyProperty="id" >
|
||||
insert into lz_staff_role_evaluation_group(
|
||||
<if test="roleId != null">role_id, </if>
|
||||
<if test="evaluationGroupId != null">evaluation_group_id, </if>
|
||||
<if test="isSelect != null">is_select, </if>
|
||||
is_delete,
|
||||
gmt_create,
|
||||
gmt_modified
|
||||
)values(
|
||||
<if test="roleId != null">#{ roleId}, </if>
|
||||
<if test="evaluationGroupId != null">#{ evaluationGroupId}, </if>
|
||||
<if test="isSelect != null">#{ isSelect}, </if>
|
||||
0,
|
||||
now(),
|
||||
now()
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateStaffRoleEvaluationGroupById" parameterType="StaffRoleEvaluationGroup" >
|
||||
update
|
||||
lz_staff_role_evaluation_group
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
||||
<if test="roleId != null">role_id = #{roleId},</if>
|
||||
<if test="evaluationGroupId != null">evaluation_group_id = #{evaluationGroupId},</if>
|
||||
<if test="isSelect != null">is_select = #{isSelect}</if>
|
||||
</trim>
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateCoverStaffRoleEvaluationGroupById" parameterType="StaffRoleEvaluationGroup" >
|
||||
update
|
||||
lz_staff_role_evaluation_group
|
||||
set
|
||||
is_delete = #{isDelete},
|
||||
gmt_create = #{gmtCreate},
|
||||
role_id = #{roleId},
|
||||
evaluation_group_id = #{evaluationGroupId},
|
||||
is_select = #{isSelect}
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="deleteStaffRoleEvaluationGroupById" parameterType="java.lang.Long">
|
||||
update lz_staff_role_evaluation_group set is_delete = 1 where id=#{id} limit 1
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -13,13 +13,13 @@
|
||||
<result column="type_role_ids" property="typeRoleIds"/>
|
||||
<result column="staff_name" property="staffName"/>
|
||||
<result column="evaluation_group_id" property="evaluationGroupId"/>
|
||||
<result column="is_select" property="isSelect"/>
|
||||
<result column="department_id" property="departmentId"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, staff_id AS staffId, department_level AS departmentLevel, type_role_ids AS typeRoleIds, staff_name AS staffName, evaluation_group_id AS evaluationGroupId, is_select AS isSelect
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, staff_id AS staffId, department_level AS departmentLevel, type_role_ids AS typeRoleIds, staff_name AS staffName, evaluation_group_id AS evaluationGroupId, department_id AS departmentId
|
||||
</sql>
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
<if test="typeRoleIds != null">type_role_ids, </if>
|
||||
<if test="staffName != null">staff_name, </if>
|
||||
<if test="evaluationGroupId != null">evaluation_group_id, </if>
|
||||
<if test="isSelect != null">is_select, </if>
|
||||
<if test="departmentId != null">department_id, </if>
|
||||
is_delete,
|
||||
gmt_create,
|
||||
gmt_modified
|
||||
@ -47,7 +47,7 @@
|
||||
<if test="typeRoleIds != null">#{ typeRoleIds}, </if>
|
||||
<if test="staffName != null">#{ staffName}, </if>
|
||||
<if test="evaluationGroupId != null">#{ evaluationGroupId}, </if>
|
||||
<if test="isSelect != null">#{ isSelect}, </if>
|
||||
<if test="departmentId != null">#{ departmentId}, </if>
|
||||
0,
|
||||
now(),
|
||||
now()
|
||||
@ -66,7 +66,7 @@
|
||||
<if test="typeRoleIds != null">type_role_ids = #{typeRoleIds},</if>
|
||||
<if test="staffName != null">staff_name = #{staffName},</if>
|
||||
<if test="evaluationGroupId != null">evaluation_group_id = #{evaluationGroupId},</if>
|
||||
<if test="isSelect != null">is_select = #{isSelect}</if>
|
||||
<if test="departmentId != null">department_id = #{departmentId}</if>
|
||||
</trim>
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
@ -84,7 +84,7 @@
|
||||
type_role_ids = #{typeRoleIds},
|
||||
staff_name = #{staffName},
|
||||
evaluation_group_id = #{evaluationGroupId},
|
||||
is_select = #{isSelect}
|
||||
department_id = #{departmentId}
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -96,6 +96,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectByStaffId" resultType="com.lz.modules.flow.entity.StaffRole">
|
||||
select * from lz_staff_role where is_delete = 0 and staff_id = #{staffId} limit 1
|
||||
</select>
|
||||
@ -111,6 +113,9 @@
|
||||
</if>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectByGroupId" resultType="com.lz.modules.flow.entity.StaffRole">
|
||||
select * from lz_staff_role where is_delete = 0 and evaluation_group_id = #{id}
|
||||
</select>
|
||||
@ -124,5 +129,31 @@
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectByEvaluationGroupId" resultType="com.lz.modules.flow.entity.StaffRole">
|
||||
select sr.id,
|
||||
sr.is_delete,
|
||||
sr.gmt_modified,
|
||||
sr.gmt_create,
|
||||
sr.staff_id,
|
||||
sr.department_level,
|
||||
sr.type_role_ids,
|
||||
sr.staff_name,
|
||||
evg.evaluation_group_id,
|
||||
evg.is_select
|
||||
from lz_staff_role_evaluation_group evg left join lz_staff_role sr on evg.role_id = sr.id
|
||||
where evg.evaluation_group_id=#{id} and evg.is_delete = 0 and sr.is_delete = 0
|
||||
</select>
|
||||
|
||||
<select id="selectByRoleLevel" resultType="com.lz.modules.flow.entity.StaffRole">
|
||||
select * from lz_staff_role where is_delete = 0 and department_level = #{name}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectPageByRoleLevel" resultType="com.lz.modules.flow.entity.StaffRole">
|
||||
select * from lz_staff_role where is_delete = 0 and department_level = #{name}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
85
src/main/resources/mapper/flow/StaffRoleMenuMapper.xml
Normal file
85
src/main/resources/mapper/flow/StaffRoleMenuMapper.xml
Normal file
@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.lz.modules.flow.dao.StaffRoleMenuMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.lz.modules.flow.entity.StaffRoleMenu">
|
||||
<id column="id" property="id"/>
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
<result column="gmt_modified" property="gmtModified"/>
|
||||
<result column="role_id" property="roleId"/>
|
||||
<result column="menu_id" property="menuId"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, role_id AS roleId, menu_id AS menuId
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectStaffRoleMenuById" resultType="StaffRoleMenu" >
|
||||
select * from lz_staff_role_menu where id=#{id} and is_delete = 0 limit 1
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<insert id="insertStaffRoleMenu" parameterType="StaffRoleMenu" useGeneratedKeys="true" keyProperty="id" >
|
||||
insert into lz_staff_role_menu(
|
||||
<if test="roleId != null">role_id, </if>
|
||||
<if test="menuId != null">menu_id, </if>
|
||||
is_delete,
|
||||
gmt_create,
|
||||
gmt_modified
|
||||
)values(
|
||||
<if test="roleId != null">#{ roleId}, </if>
|
||||
<if test="menuId != null">#{ menuId}, </if>
|
||||
0,
|
||||
now(),
|
||||
now()
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateStaffRoleMenuById" parameterType="StaffRoleMenu" >
|
||||
update
|
||||
lz_staff_role_menu
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
||||
<if test="roleId != null">role_id = #{roleId},</if>
|
||||
<if test="menuId != null">menu_id = #{menuId}</if>
|
||||
</trim>
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateCoverStaffRoleMenuById" parameterType="StaffRoleMenu" >
|
||||
update
|
||||
lz_staff_role_menu
|
||||
set
|
||||
is_delete = #{isDelete},
|
||||
gmt_create = #{gmtCreate},
|
||||
role_id = #{roleId},
|
||||
menu_id = #{menuId}
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="deleteStaffRoleMenuById" parameterType="java.lang.Long">
|
||||
update lz_staff_role_menu set is_delete = 1 where id=#{id} limit 1
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<select id="selectByRoleId" resultType="com.lz.modules.flow.entity.StaffMenu">
|
||||
select * from lz_staff_menu where id in (select menu_id from lz_staff_role_menu where role_id = #{roleId})
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -142,7 +142,10 @@ public class MysqlMain {
|
||||
//list.add(new TablesBean("lz_flow_chart_detail_record"));
|
||||
//list.add(new TablesBean("lz_flow_approval_role"));
|
||||
|
||||
list.add(new TablesBean("lz_evaluation_start_staff"));
|
||||
list.add(new TablesBean("lz_staff_menu"));
|
||||
list.add(new TablesBean("lz_staff_role"));
|
||||
list.add(new TablesBean("lz_staff_role_evaluation_group"));
|
||||
list.add(new TablesBean("lz_staff_role_menu"));
|
||||
|
||||
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
||||
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user