From 9177eab432544ca78e4a0a4d6f6ae12267cf9af9 Mon Sep 17 00:00:00 2001 From: quyixiao <2621048238@qq.com> Date: Wed, 21 Oct 2020 11:12:12 +0800 Subject: [PATCH] rjuq whnt --- .../app/controller/StaffRoleController.java | 6 +++ .../lz/modules/flow/dao/StaffRoleMapper.java | 2 + .../com/lz/modules/flow/entity/StaffRole.java | 52 +++++++++++++++++-- .../flow/service/StaffRoleService.java | 2 + .../service/impl/StaffRoleServiceImpl.java | 6 +++ .../resources/mapper/flow/StaffRoleMapper.xml | 21 ++++++-- src/test/java/com/lz/mysql/MysqlMain.java | 2 +- 7 files changed, 84 insertions(+), 7 deletions(-) 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 29d3f5b3..b9a685c6 100644 --- a/src/main/java/com/lz/modules/app/controller/StaffRoleController.java +++ b/src/main/java/com/lz/modules/app/controller/StaffRoleController.java @@ -63,6 +63,12 @@ public class StaffRoleController { } + @RequestMapping("/listByGroupId") + public R listByGroupId(Long id ) { + List staffRoles = staffRoleService.selectByGroupId(id); + return R.ok().put("staffRoles", staffRoles); + } + /** * 信息 */ 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 b236701a..9a93afca 100644 --- a/src/main/java/com/lz/modules/flow/dao/StaffRoleMapper.java +++ b/src/main/java/com/lz/modules/flow/dao/StaffRoleMapper.java @@ -40,4 +40,6 @@ public interface StaffRoleMapper extends BaseMapper { List selectByRole(@Param("departmentLevel") String departmentLevel); List selectByCondition(@Param("page") IPage page, @Param("params") Map params); + + List selectByGroupId(@Param("id") Long id); } \ 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 d306d7c6..6c69ce93 100644 --- a/src/main/java/com/lz/modules/flow/entity/StaffRole.java +++ b/src/main/java/com/lz/modules/flow/entity/StaffRole.java @@ -1,35 +1,49 @@ package com.lz.modules.flow.entity; -import com.baomidou.mybatisplus.annotation.IdType; 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-08-23 +* @since 2020-10-21 */ @Data @TableName("lz_staff_role") +@ApiModel(value = "流转关系表") public class StaffRole 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 = "staffId") private Long staffId; //角色 + @ApiModelProperty(value = "角色", name = "departmentLevel") private String departmentLevel; //角色 id + @ApiModelProperty(value = "角色 id", name = "typeRoleIds") private String typeRoleIds; + //员工名称 + @ApiModelProperty(value = "员工名称", name = "staffName") + private String staffName; + //组id + @ApiModelProperty(value = "组id", name = "evaluationGroupId") + private Long evaluationGroupId; /** * * @return @@ -135,6 +149,36 @@ public class StaffRole implements java.io.Serializable { this.typeRoleIds = typeRoleIds; } + /** + * 员工名称 + * @return + */ + public String getStaffName() { + return staffName; + } + /** + * 员工名称 + * @param staffName + */ + public void setStaffName(String staffName) { + this.staffName = staffName; + } + + /** + * 组id + * @return + */ + public Long getEvaluationGroupId() { + return evaluationGroupId; + } + /** + * 组id + * @param evaluationGroupId + */ + public void setEvaluationGroupId(Long evaluationGroupId) { + this.evaluationGroupId = evaluationGroupId; + } + @Override public String toString() { return "StaffRole{" + @@ -145,6 +189,8 @@ public class StaffRole implements java.io.Serializable { ",staffId=" + staffId + ",departmentLevel=" + departmentLevel + ",typeRoleIds=" + typeRoleIds + + ",staffName=" + staffName + + ",evaluationGroupId=" + evaluationGroupId + "}"; } } \ 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 5399afd3..fe116ab3 100644 --- a/src/main/java/com/lz/modules/flow/service/StaffRoleService.java +++ b/src/main/java/com/lz/modules/flow/service/StaffRoleService.java @@ -47,4 +47,6 @@ public interface StaffRoleService extends IService { SysRoleEntity getRole(Long id); List selectMenuList(); + + List selectByGroupId(Long id); } \ No newline at end of file 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 eb434264..1d3702c8 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 @@ -229,6 +229,12 @@ public class StaffRoleServiceImpl extends ServiceImpl selectByGroupId(Long id) { + + return staffRoleMapper.selectByGroupId(id); + } + public String getSuffix(Map departmentsStaffRelateEntityMap, Map staffMap, String departmentId, Map singleDepartmentsStaffRelate) { DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateEntityMap.get(departmentId); diff --git a/src/main/resources/mapper/flow/StaffRoleMapper.xml b/src/main/resources/mapper/flow/StaffRoleMapper.xml index 69a78b03..f0f10ec4 100644 --- a/src/main/resources/mapper/flow/StaffRoleMapper.xml +++ b/src/main/resources/mapper/flow/StaffRoleMapper.xml @@ -11,12 +11,14 @@ + + - 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 + 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 @@ -32,6 +34,8 @@ staff_id, department_level, type_role_ids, + staff_name, + evaluation_group_id, is_delete, gmt_create, gmt_modified @@ -39,6 +43,8 @@ #{ staffId}, #{ departmentLevel}, #{ typeRoleIds}, + #{ staffName}, + #{ evaluationGroupId}, 0, now(), now() @@ -54,7 +60,9 @@ gmt_create = #{gmtCreate}, staff_id = #{staffId}, department_level = #{departmentLevel}, - type_role_ids = #{typeRoleIds} + type_role_ids = #{typeRoleIds}, + staff_name = #{staffName}, + evaluation_group_id = #{evaluationGroupId} ,gmt_modified = now() where id = #{id} @@ -69,7 +77,9 @@ gmt_create = #{gmtCreate}, staff_id = #{staffId}, department_level = #{departmentLevel}, - type_role_ids = #{typeRoleIds} + type_role_ids = #{typeRoleIds}, + staff_name = #{staffName}, + evaluation_group_id = #{evaluationGroupId} ,gmt_modified = now() where id = #{id} @@ -79,6 +89,8 @@ update lz_staff_role set is_delete = 1 where id=#{id} limit 1 + + @@ -94,6 +106,9 @@ order by id desc + diff --git a/src/test/java/com/lz/mysql/MysqlMain.java b/src/test/java/com/lz/mysql/MysqlMain.java index 7d298621..6f770727 100644 --- a/src/test/java/com/lz/mysql/MysqlMain.java +++ b/src/test/java/com/lz/mysql/MysqlMain.java @@ -78,7 +78,7 @@ public class MysqlMain { //list.add(new TablesBean("lz_result_model")); //list.add(new TablesBean("lz_result_score")); //list.add(new TablesBean("lz_result_taget_lib")); - list.add(new TablesBean("lz_flow_chart_detail_record")); + list.add(new TablesBean("lz_staff_role")); List list2 = new ArrayList(); Map map = MysqlUtil2ShowCreateTable.getComments();