diff --git a/src/main/java/com/lz/modules/app/controller/StaffController.java b/src/main/java/com/lz/modules/app/controller/StaffController.java index fdc043e9..5d978c0c 100644 --- a/src/main/java/com/lz/modules/app/controller/StaffController.java +++ b/src/main/java/com/lz/modules/app/controller/StaffController.java @@ -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(); } + + } diff --git a/src/main/java/com/lz/modules/app/controller/StaffRoleController.java b/src/main/java/com/lz/modules/app/controller/StaffRoleController.java index c33121ea..e498a7ed 100644 --- a/src/main/java/com/lz/modules/app/controller/StaffRoleController.java +++ b/src/main/java/com/lz/modules/app/controller/StaffRoleController.java @@ -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 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); + } + + } diff --git a/src/main/java/com/lz/modules/app/dto/StaffRoleInfo.java b/src/main/java/com/lz/modules/app/dto/StaffRoleInfo.java new file mode 100644 index 00000000..bd7e7c9d --- /dev/null +++ b/src/main/java/com/lz/modules/app/dto/StaffRoleInfo.java @@ -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 menuNames; + private String departmentLevel; +} diff --git a/src/main/java/com/lz/modules/app/enums/RoleEnums.java b/src/main/java/com/lz/modules/app/enums/RoleEnums.java new file mode 100644 index 00000000..1e0c11d9 --- /dev/null +++ b/src/main/java/com/lz/modules/app/enums/RoleEnums.java @@ -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; + } + +} diff --git a/src/main/java/com/lz/modules/app/model/RoleModel.java b/src/main/java/com/lz/modules/app/model/RoleModel.java new file mode 100644 index 00000000..6c53abcd --- /dev/null +++ b/src/main/java/com/lz/modules/app/model/RoleModel.java @@ -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; + +} diff --git a/src/main/java/com/lz/modules/flow/dao/StaffMenuMapper.java b/src/main/java/com/lz/modules/flow/dao/StaffMenuMapper.java new file mode 100644 index 00000000..b6d87ae7 --- /dev/null +++ b/src/main/java/com/lz/modules/flow/dao/StaffMenuMapper.java @@ -0,0 +1,33 @@ +package com.lz.modules.flow.dao; +/** +*

+* 绩效管理菜单表 服务类 +*

+* +* @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 selectStaffMenuById(@Param("id") Long id); + + + Long insertStaffMenu(StaffMenu staffMenu); + + + int updateStaffMenuById(StaffMenu staffMenu); + + + int updateCoverStaffMenuById(StaffMenu staffMenu); + + + int deleteStaffMenuById(@Param("id") Long id); + + +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/dao/StaffRoleEvaluationGroupMapper.java b/src/main/java/com/lz/modules/flow/dao/StaffRoleEvaluationGroupMapper.java new file mode 100644 index 00000000..c10c2862 --- /dev/null +++ b/src/main/java/com/lz/modules/flow/dao/StaffRoleEvaluationGroupMapper.java @@ -0,0 +1,33 @@ +package com.lz.modules.flow.dao; +/** +*

+* 绩效管理菜单表 服务类 +*

+* +* @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 selectStaffRoleEvaluationGroupById(@Param("id") Long id); + + + Long insertStaffRoleEvaluationGroup(StaffRoleEvaluationGroup staffRoleEvaluationGroup); + + + int updateStaffRoleEvaluationGroupById(StaffRoleEvaluationGroup staffRoleEvaluationGroup); + + + int updateCoverStaffRoleEvaluationGroupById(StaffRoleEvaluationGroup staffRoleEvaluationGroup); + + + int deleteStaffRoleEvaluationGroupById(@Param("id") Long id); + + +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/dao/StaffRoleMapper.java b/src/main/java/com/lz/modules/flow/dao/StaffRoleMapper.java index 94302f52..a79f3bb1 100644 --- a/src/main/java/com/lz/modules/flow/dao/StaffRoleMapper.java +++ b/src/main/java/com/lz/modules/flow/dao/StaffRoleMapper.java @@ -44,4 +44,10 @@ public interface StaffRoleMapper extends BaseMapper { List selectByGroupId(@Param("id") Long id); List selectStaffRolesByStaffId(@Param("list") List mIds); + + List selectByEvaluationGroupId(@Param("id") Long id); + + List selectByRoleLevel(@Param("name") String name); + + List selectPageByRoleLevel(@Param("page") IPage page, @Param("name") String name); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/dao/StaffRoleMenuMapper.java b/src/main/java/com/lz/modules/flow/dao/StaffRoleMenuMapper.java new file mode 100644 index 00000000..53de0415 --- /dev/null +++ b/src/main/java/com/lz/modules/flow/dao/StaffRoleMenuMapper.java @@ -0,0 +1,38 @@ +package com.lz.modules.flow.dao; +/** +*

+* 绩效管理菜单表 服务类 +*

+* +* @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 selectStaffRoleMenuById(@Param("id") Long id); + + + Long insertStaffRoleMenu(StaffRoleMenu staffRoleMenu); + + + int updateStaffRoleMenuById(StaffRoleMenu staffRoleMenu); + + + int updateCoverStaffRoleMenuById(StaffRoleMenu staffRoleMenu); + + + int deleteStaffRoleMenuById(@Param("id") Long id); + + + List selectByRoleId(@Param("roleId") Long roleId); +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/entity/StaffMenu.java b/src/main/java/com/lz/modules/flow/entity/StaffMenu.java new file mode 100644 index 00000000..bb8b3269 --- /dev/null +++ b/src/main/java/com/lz/modules/flow/entity/StaffMenu.java @@ -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; +/** +*

+*

*绩效管理菜单表 +* @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 + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/entity/StaffRole.java b/src/main/java/com/lz/modules/flow/entity/StaffRole.java index d768e61a..7632d901 100644 --- a/src/main/java/com/lz/modules/flow/entity/StaffRole.java +++ b/src/main/java/com/lz/modules/flow/entity/StaffRole.java @@ -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; *

*

*流转关系表 * @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 + "}"; } } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/entity/StaffRoleEvaluationGroup.java b/src/main/java/com/lz/modules/flow/entity/StaffRoleEvaluationGroup.java new file mode 100644 index 00000000..01049f2d --- /dev/null +++ b/src/main/java/com/lz/modules/flow/entity/StaffRoleEvaluationGroup.java @@ -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; +/** +*

+*

*绩效管理菜单表 +* @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 + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/entity/StaffRoleMenu.java b/src/main/java/com/lz/modules/flow/entity/StaffRoleMenu.java new file mode 100644 index 00000000..9a229298 --- /dev/null +++ b/src/main/java/com/lz/modules/flow/entity/StaffRoleMenu.java @@ -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; +/** +*

+*

*绩效管理菜单表 +* @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 + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/service/StaffMenuService.java b/src/main/java/com/lz/modules/flow/service/StaffMenuService.java new file mode 100644 index 00000000..521a8ba1 --- /dev/null +++ b/src/main/java/com/lz/modules/flow/service/StaffMenuService.java @@ -0,0 +1,33 @@ +package com.lz.modules.flow.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.lz.modules.flow.entity.StaffMenu; + +/** +*

+* 绩效管理菜单表 服务类 +*

+* +* @author quyixiao +* @since 2020-11-02 +*/ +public interface StaffMenuService extends IService { + + + + StaffMenu selectStaffMenuById(Long id); + + + Long insertStaffMenu(StaffMenu staffMenu); + + + int updateStaffMenuById(StaffMenu staffMenu); + + + int updateCoverStaffMenuById(StaffMenu staffMenu); + + + int deleteStaffMenuById(Long id); + + +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/service/StaffRoleEvaluationGroupService.java b/src/main/java/com/lz/modules/flow/service/StaffRoleEvaluationGroupService.java new file mode 100644 index 00000000..9370ed1e --- /dev/null +++ b/src/main/java/com/lz/modules/flow/service/StaffRoleEvaluationGroupService.java @@ -0,0 +1,33 @@ +package com.lz.modules.flow.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.lz.modules.flow.entity.StaffRoleEvaluationGroup; + +/** +*

+* 绩效管理菜单表 服务类 +*

+* +* @author quyixiao +* @since 2020-11-02 +*/ +public interface StaffRoleEvaluationGroupService extends IService { + + + + StaffRoleEvaluationGroup selectStaffRoleEvaluationGroupById(Long id); + + + Long insertStaffRoleEvaluationGroup(StaffRoleEvaluationGroup staffRoleEvaluationGroup); + + + int updateStaffRoleEvaluationGroupById(StaffRoleEvaluationGroup staffRoleEvaluationGroup); + + + int updateCoverStaffRoleEvaluationGroupById(StaffRoleEvaluationGroup staffRoleEvaluationGroup); + + + int deleteStaffRoleEvaluationGroupById(Long id); + + +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/service/StaffRoleMenuService.java b/src/main/java/com/lz/modules/flow/service/StaffRoleMenuService.java new file mode 100644 index 00000000..b0e81cf7 --- /dev/null +++ b/src/main/java/com/lz/modules/flow/service/StaffRoleMenuService.java @@ -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; + +/** +*

+* 绩效管理菜单表 服务类 +*

+* +* @author quyixiao +* @since 2020-11-02 +*/ +public interface StaffRoleMenuService extends IService { + + + + StaffRoleMenu selectStaffRoleMenuById(Long id); + + + Long insertStaffRoleMenu(StaffRoleMenu staffRoleMenu); + + + int updateStaffRoleMenuById(StaffRoleMenu staffRoleMenu); + + + int updateCoverStaffRoleMenuById(StaffRoleMenu staffRoleMenu); + + + int deleteStaffRoleMenuById(Long id); + + + List selectByRoleId(Long id); +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/service/StaffRoleService.java b/src/main/java/com/lz/modules/flow/service/StaffRoleService.java index 25c5d639..3d1fd67a 100644 --- a/src/main/java/com/lz/modules/flow/service/StaffRoleService.java +++ b/src/main/java/com/lz/modules/flow/service/StaffRoleService.java @@ -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 { List selectByGroupId(Long id); List selectStaffRolesByStaffId(List mIds); + + R selectRoleInfoBy(RoleModel roleModel); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/service/impl/StaffMenuServiceImpl.java b/src/main/java/com/lz/modules/flow/service/impl/StaffMenuServiceImpl.java new file mode 100644 index 00000000..765d3816 --- /dev/null +++ b/src/main/java/com/lz/modules/flow/service/impl/StaffMenuServiceImpl.java @@ -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; + +/** +*

+* 绩效管理菜单表 服务类 +*

+* +* @author quyixiao +* @since 2020-11-02 +*/ + +@Service +public class StaffMenuServiceImpl extends ServiceImpl 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); + } + + + +} diff --git a/src/main/java/com/lz/modules/flow/service/impl/StaffRoleEvaluationGroupServiceImpl.java b/src/main/java/com/lz/modules/flow/service/impl/StaffRoleEvaluationGroupServiceImpl.java new file mode 100644 index 00000000..e8fe5029 --- /dev/null +++ b/src/main/java/com/lz/modules/flow/service/impl/StaffRoleEvaluationGroupServiceImpl.java @@ -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; + +/** +*

+* 绩效管理菜单表 服务类 +*

+* +* @author quyixiao +* @since 2020-11-02 +*/ + +@Service +public class StaffRoleEvaluationGroupServiceImpl extends ServiceImpl 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); + } + + + +} diff --git a/src/main/java/com/lz/modules/flow/service/impl/StaffRoleMenuServiceImpl.java b/src/main/java/com/lz/modules/flow/service/impl/StaffRoleMenuServiceImpl.java new file mode 100644 index 00000000..106586a9 --- /dev/null +++ b/src/main/java/com/lz/modules/flow/service/impl/StaffRoleMenuServiceImpl.java @@ -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; + +/** +*

+* 绩效管理菜单表 服务类 +*

+* +* @author quyixiao +* @since 2020-11-02 +*/ + +@Service +public class StaffRoleMenuServiceImpl extends ServiceImpl 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 selectByRoleId(Long roleId) { + return staffRoleMenuMapper.selectByRoleId(roleId); + } + + +} diff --git a/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java b/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java index fd493e9e..23871fd2 100644 --- a/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java +++ b/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java @@ -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.selectByCondition(page, params) - ); - List staffRoles = pageUtils.getList(); - List list = new ArrayList<>(); - Map 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 staffRoles = pageUtils.getList(); + List list = new ArrayList<>(); + Map 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 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 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 menuIdList= new ArrayList<>(); - List menuIdList1= new ArrayList<>(); - if(staffRole!=null){ + List menuIdList = new ArrayList<>(); + List menuIdList1 = new ArrayList<>(); + if (staffRole != null) { List staffRoleDepartments = staffRoleDepartmentMapper.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId()); List departmentsEntities = departmentsDao.selectAll(); - Map> map= resultRecordService.getStringListMap(departmentsEntities); + Map> map = resultRecordService.getStringListMap(departmentsEntities); role.setRoleId(staffRole.getId()); role.setRoleName(staffRole.getDepartmentLevel()); - for(StaffRoleDepartment staffRoleDepartment: staffRoleDepartments){ + for (StaffRoleDepartment staffRoleDepartment : staffRoleDepartments) { List list = map.get(staffRoleDepartment.getDepartmentId()); List departments = departmentsService.selectAllChildDepartmentIds(staffRoleDepartment.getDepartmentId()); List departments1 = staffRoleDepartmentMapper.selectStaffRoleDepartmentByStaffRoleIdDepartments(staffRole.getId(), departments); @@ -206,24 +215,24 @@ public class StaffRoleServiceImpl extends ServiceImpl s.getDepartmentParentId().equals("1")) .collect(Collectors.toList()); List departmentsStaffRelateEntities = departmentsStaffRelateService.selectAll(); - Map departmentsStaffRelateEntityMap = new HashMap<>(); - Map 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 departmentsStaffRelateEntityMap = new HashMap<>(); + Map 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 staffEntities = staffDao.selectAll(); - Map staffMap = new HashMap<>(); - for(StaffEntity staffEntity : staffEntities){ - staffMap.put(staffEntity.getId(),staffEntity); + Map staffMap = new HashMap<>(); + for (StaffEntity staffEntity : staffEntities) { + staffMap.put(staffEntity.getId(), staffEntity); } List 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 selectByGroupId(Long id) { - return staffRoleMapper.selectByGroupId(id); + return staffRoleMapper.selectByEvaluationGroupId(id); } public String getSuffix(Map departmentsStaffRelateEntityMap, Map staffMap, String departmentId, @@ -256,23 +265,73 @@ public class StaffRoleServiceImpl extends ServiceImpl tDepartments,SysMenuEntity sysMenuEntity,List list, - Map departmentsStaffRelateEntityMap, Map staffMap, - Map 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 tDepartments, SysMenuEntity sysMenuEntity, List list, + Map departmentsStaffRelateEntityMap, Map staffMap, + Map 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 selectStaffRolesByStaffId(List mIds){ + public List selectStaffRolesByStaffId(List mIds) { return staffRoleMapper.selectStaffRolesByStaffId(mIds); } + @Override + public R selectRoleInfoBy(RoleModel roleModel) { + List masterPMList = staffRoleMapper.selectByRoleLevel(RoleEnums.MASTER_PM.getName()); + List 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 childPMList = pageUtils.getList(); + List 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 staffMenus = staffRoleMenuService.selectByRoleId(staffRole.getId()); + List menuNames = new ArrayList<>(); + for (StaffMenu staffMenu : staffMenus) { + menuNames.add(staffMenu.getName()); + } + staffRoleInfo.setMenuNames(menuNames); + childPm.add(staffRoleInfo); + } + pageUtils.setList(childPm); + List bossList = staffRoleMapper.selectByRoleLevel(RoleEnums.BOSS.getName()); + List 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 map = new HashMap<>(); + map.put("masterPM", masterPM); + map.put("childPm", pageUtils); + map.put("boss", boss); + return R.ok().put("data", map); + } + } diff --git a/src/main/resources/mapper/flow/StaffMenuMapper.xml b/src/main/resources/mapper/flow/StaffMenuMapper.xml new file mode 100644 index 00000000..c4e6a40f --- /dev/null +++ b/src/main/resources/mapper/flow/StaffMenuMapper.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + insert into lz_staff_menu( + name, + parent_id, + auth_ids, + is_delete, + gmt_create, + gmt_modified + )values( + #{ name}, + #{ parentId}, + #{ authIds}, + 0, + now(), + now() + ) + + + + + update + lz_staff_menu + + is_delete = #{isDelete}, + gmt_create = #{gmtCreate}, + name = #{name}, + parent_id = #{parentId}, + auth_ids = #{authIds} + + ,gmt_modified = now() + where id = #{id} + + + + + 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 lz_staff_menu set is_delete = 1 where id=#{id} limit 1 + + + + diff --git a/src/main/resources/mapper/flow/StaffRoleEvaluationGroupMapper.xml b/src/main/resources/mapper/flow/StaffRoleEvaluationGroupMapper.xml new file mode 100644 index 00000000..2ff1e439 --- /dev/null +++ b/src/main/resources/mapper/flow/StaffRoleEvaluationGroupMapper.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + insert into lz_staff_role_evaluation_group( + role_id, + evaluation_group_id, + is_select, + is_delete, + gmt_create, + gmt_modified + )values( + #{ roleId}, + #{ evaluationGroupId}, + #{ isSelect}, + 0, + now(), + now() + ) + + + + + update + lz_staff_role_evaluation_group + + is_delete = #{isDelete}, + gmt_create = #{gmtCreate}, + role_id = #{roleId}, + evaluation_group_id = #{evaluationGroupId}, + is_select = #{isSelect} + + ,gmt_modified = now() + where id = #{id} + + + + + 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 lz_staff_role_evaluation_group set is_delete = 1 where id=#{id} limit 1 + + + + diff --git a/src/main/resources/mapper/flow/StaffRoleMapper.xml b/src/main/resources/mapper/flow/StaffRoleMapper.xml index 05692e43..e9916087 100644 --- a/src/main/resources/mapper/flow/StaffRoleMapper.xml +++ b/src/main/resources/mapper/flow/StaffRoleMapper.xml @@ -13,13 +13,13 @@ - + - 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 @@ -37,7 +37,7 @@ type_role_ids, staff_name, evaluation_group_id, - is_select, + department_id, is_delete, gmt_create, gmt_modified @@ -47,7 +47,7 @@ #{ typeRoleIds}, #{ staffName}, #{ evaluationGroupId}, - #{ isSelect}, + #{ departmentId}, 0, now(), now() @@ -66,7 +66,7 @@ type_role_ids = #{typeRoleIds}, staff_name = #{staffName}, evaluation_group_id = #{evaluationGroupId}, - is_select = #{isSelect} + department_id = #{departmentId} ,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} @@ -96,6 +96,8 @@ + + @@ -111,6 +113,9 @@ order by id desc + + + @@ -124,5 +129,31 @@ + + + + + + + + + diff --git a/src/main/resources/mapper/flow/StaffRoleMenuMapper.xml b/src/main/resources/mapper/flow/StaffRoleMenuMapper.xml new file mode 100644 index 00000000..5cb5b001 --- /dev/null +++ b/src/main/resources/mapper/flow/StaffRoleMenuMapper.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, role_id AS roleId, menu_id AS menuId + + + + + + + + + + + insert into lz_staff_role_menu( + role_id, + menu_id, + is_delete, + gmt_create, + gmt_modified + )values( + #{ roleId}, + #{ menuId}, + 0, + now(), + now() + ) + + + + + update + lz_staff_role_menu + + is_delete = #{isDelete}, + gmt_create = #{gmtCreate}, + role_id = #{roleId}, + menu_id = #{menuId} + + ,gmt_modified = now() + where id = #{id} + + + + + 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 lz_staff_role_menu set is_delete = 1 where id=#{id} limit 1 + + + + + + + + diff --git a/src/test/java/com/lz/mysql/MysqlMain.java b/src/test/java/com/lz/mysql/MysqlMain.java index 0214f0a1..cfcf9bf7 100644 --- a/src/test/java/com/lz/mysql/MysqlMain.java +++ b/src/test/java/com/lz/mysql/MysqlMain.java @@ -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 list2 = new ArrayList(); Map map = MysqlUtil2ShowCreateTable.getComments();