增加流程节点和权限关系表

This commit is contained in:
wulin 2020-10-14 09:50:43 +08:00
parent b348106652
commit 4fcc47e9fe
13 changed files with 610 additions and 107 deletions

View File

@ -0,0 +1,33 @@
package com.lz.modules.flow.dao;
/**
* <p>
* 流程节点权限对应关系表 服务类
* </p>
*
* @author quyixiao
* @since 2020-10-14
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.modules.flow.entity.FlowChartRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface FlowChartRoleMapper extends BaseMapper<FlowChartRole> {
FlowChartRole selectFlowChartRoleById(@Param("id")Long id);
Long insertFlowChartRole(FlowChartRole flowChartRole);
int updateFlowChartRoleById(FlowChartRole flowChartRole);
int updateCoverFlowChartRoleById(FlowChartRole flowChartRole);
int deleteFlowChartRoleById(@Param("id")Long id);
}

View File

@ -11,7 +11,7 @@ import java.util.Date;
* 菜单权限表
* </p>*流程图lz_flow的父
* @author quyixiao
* @since 2020-10-13
* @since 2020-10-14
*/
@Data
@ -36,12 +36,6 @@ public class FlowChart implements java.io.Serializable {
//flow_manager表中id
@ApiModelProperty(value = "flow_manager表中id", name = "processId")
private Long processId;
//必须授权角色id
@ApiModelProperty(value = "必须授权角色id", name = "roleId")
private Long roleId;
//可授权角色id
@ApiModelProperty(value = "可授权角色id", name = "canRoleId")
private Long canRoleId;
//0启用1不启用
@ApiModelProperty(value = "0启用1不启用", name = "status")
private Integer status;
@ -141,36 +135,6 @@ public class FlowChart implements java.io.Serializable {
this.processId = processId;
}
/**
* 必须授权角色id
* @return
*/
public Long getRoleId() {
return roleId;
}
/**
* 必须授权角色id
* @param roleId
*/
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
/**
* 可授权角色id
* @return
*/
public Long getCanRoleId() {
return canRoleId;
}
/**
* 可授权角色id
* @param canRoleId
*/
public void setCanRoleId(Long canRoleId) {
this.canRoleId = canRoleId;
}
/**
* 0启用1不启用
* @return
@ -225,8 +189,6 @@ public class FlowChart implements java.io.Serializable {
",gmtModified=" + gmtModified +
",name=" + name +
",processId=" + processId +
",roleId=" + roleId +
",canRoleId=" + canRoleId +
",status=" + status +
",type=" + type +
",stepIndex=" + stepIndex +

View File

@ -0,0 +1,159 @@
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-10-14
*/
@Data
@TableName("lz_flow_chart_role")
@ApiModel(value = "流程节点权限对应关系表")
public class FlowChartRole implements java.io.Serializable {
//
@TableId(value = "id", type = IdType.AUTO)
private Long id;
//
@ApiModelProperty(value = "", name = "isDelete")
private Integer isDelete;
//
@ApiModelProperty(value = "", name = "gmtCreate")
private Date gmtCreate;
//
@ApiModelProperty(value = "", name = "gmtModified")
private Date gmtModified;
//flow_chart表中id
@ApiModelProperty(value = "flow_chart表中id", name = "chartId")
private Long chartId;
//必须授权角色id
@ApiModelProperty(value = "必须授权角色id", name = "roleId")
private Long roleId;
//1默认权限必带权限0可选权限
@ApiModelProperty(value = "1默认权限必带权限0可选权限", name = "type")
private Integer type;
/**
*
* @return
*/
public Long getId() {
return id;
}
/**
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
*
* @return
*/
public Integer getIsDelete() {
return isDelete;
}
/**
*
* @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;
}
/**
* flow_chart表中id
* @return
*/
public Long getChartId() {
return chartId;
}
/**
* flow_chart表中id
* @param chartId
*/
public void setChartId(Long chartId) {
this.chartId = chartId;
}
/**
* 必须授权角色id
* @return
*/
public Long getRoleId() {
return roleId;
}
/**
* 必须授权角色id
* @param roleId
*/
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
/**
* 1默认权限必带权限0可选权限
* @return
*/
public Integer getType() {
return type;
}
/**
* 1默认权限必带权限0可选权限
* @param type
*/
public void setType(Integer type) {
this.type = type;
}
@Override
public String toString() {
return "FlowChartRole{" +
",id=" + id +
",isDelete=" + isDelete +
",gmtCreate=" + gmtCreate +
",gmtModified=" + gmtModified +
",chartId=" + chartId +
",roleId=" + roleId +
",type=" + type +
"}";
}
}

View File

@ -11,7 +11,7 @@ import java.util.Date;
* 菜单权限表
* </p>*流程图lz_flow的父
* @author quyixiao
* @since 2020-10-13
* @since 2020-10-14
*/
@ -40,12 +40,6 @@ public class FlowChartReq implements java.io.Serializable {
//flow_manager表中id
@ApiModelProperty(value = "flow_manager表中id", name = "processId")
private Long processId;
//必须授权角色id
@ApiModelProperty(value = "必须授权角色id", name = "roleId")
private Long roleId;
//可授权角色id
@ApiModelProperty(value = "可授权角色id", name = "canRoleId")
private Long canRoleId;
//0启用1不启用
@ApiModelProperty(value = "0启用1不启用", name = "status")
private Integer status;
@ -145,36 +139,6 @@ public class FlowChartReq implements java.io.Serializable {
this.processId = processId;
}
/**
* 必须授权角色id
* @return
*/
public Long getRoleId() {
return roleId;
}
/**
* 必须授权角色id
* @param roleId
*/
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
/**
* 可授权角色id
* @return
*/
public Long getCanRoleId() {
return canRoleId;
}
/**
* 可授权角色id
* @param canRoleId
*/
public void setCanRoleId(Long canRoleId) {
this.canRoleId = canRoleId;
}
/**
* 0启用1不启用
* @return
@ -229,8 +193,6 @@ public class FlowChartReq implements java.io.Serializable {
",gmtModified=" + gmtModified +
",name=" + name +
",processId=" + processId +
",roleId=" + roleId +
",canRoleId=" + canRoleId +
",status=" + status +
",type=" + type +
",stepIndex=" + stepIndex +

View File

@ -0,0 +1,163 @@
package com.lz.modules.flow.req;
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-10-14
*/
@Data
@ApiModel(value = "流程节点权限对应关系表")
public class FlowChartRoleReq implements java.io.Serializable {
private int page = 1;
private int rows = 10;
private String sort;
private String order;
//
private Long id;
//
@ApiModelProperty(value = "", name = "isDelete")
private Integer isDelete;
//
@ApiModelProperty(value = "", name = "gmtCreate")
private Date gmtCreate;
//
@ApiModelProperty(value = "", name = "gmtModified")
private Date gmtModified;
//flow_chart表中id
@ApiModelProperty(value = "flow_chart表中id", name = "chartId")
private Long chartId;
//必须授权角色id
@ApiModelProperty(value = "必须授权角色id", name = "roleId")
private Long roleId;
//1默认权限必带权限0可选权限
@ApiModelProperty(value = "1默认权限必带权限0可选权限", name = "type")
private Integer type;
/**
*
* @return
*/
public Long getId() {
return id;
}
/**
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
*
* @return
*/
public Integer getIsDelete() {
return isDelete;
}
/**
*
* @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;
}
/**
* flow_chart表中id
* @return
*/
public Long getChartId() {
return chartId;
}
/**
* flow_chart表中id
* @param chartId
*/
public void setChartId(Long chartId) {
this.chartId = chartId;
}
/**
* 必须授权角色id
* @return
*/
public Long getRoleId() {
return roleId;
}
/**
* 必须授权角色id
* @param roleId
*/
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
/**
* 1默认权限必带权限0可选权限
* @return
*/
public Integer getType() {
return type;
}
/**
* 1默认权限必带权限0可选权限
* @param type
*/
public void setType(Integer type) {
this.type = type;
}
@Override
public String toString() {
return "FlowChartRole{" +
",id=" + id +
",isDelete=" + isDelete +
",gmtCreate=" + gmtCreate +
",gmtModified=" + gmtModified +
",chartId=" + chartId +
",roleId=" + roleId +
",type=" + type +
"}";
}
}

View File

@ -0,0 +1,33 @@
package com.lz.modules.flow.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.modules.flow.entity.FlowChartRole;
/**
* <p>
* 流程节点权限对应关系表 服务类
* </p>
*
* @author quyixiao
* @since 2020-10-14
*/
public interface FlowChartRoleService extends IService<FlowChartRole> {
FlowChartRole selectFlowChartRoleById(Long id);
Long insertFlowChartRole(FlowChartRole flowChartRole);
int updateFlowChartRoleById(FlowChartRole flowChartRole);
int updateCoverFlowChartRoleById(FlowChartRole flowChartRole);
int deleteFlowChartRoleById(Long id);
}

View File

@ -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.FlowChartRoleMapper;
import com.lz.modules.flow.entity.FlowChartRole;
import com.lz.modules.flow.service.FlowChartRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 流程节点权限对应关系表 服务类
* </p>
*
* @author quyixiao
* @since 2020-10-14
*/
@Service
public class FlowChartRoleServiceImpl extends ServiceImpl<FlowChartRoleMapper, FlowChartRole> implements FlowChartRoleService {
@Autowired
private FlowChartRoleMapper flowChartRoleMapper;
@Override
public FlowChartRole selectFlowChartRoleById(Long id){
return flowChartRoleMapper.selectFlowChartRoleById(id);
}
@Override
public Long insertFlowChartRole(FlowChartRole flowChartRole){
return flowChartRoleMapper.insertFlowChartRole(flowChartRole);
}
@Override
public int updateFlowChartRoleById(FlowChartRole flowChartRole){
return flowChartRoleMapper.updateFlowChartRoleById(flowChartRole);
}
@Override
public int updateCoverFlowChartRoleById(FlowChartRole flowChartRole){
return flowChartRoleMapper.updateCoverFlowChartRoleById(flowChartRole);
}
@Override
public int deleteFlowChartRoleById(Long id){
return flowChartRoleMapper.deleteFlowChartRoleById(id);
}
}

View File

@ -10,11 +10,11 @@ import com.lz.modules.flow.entity.FlowManager;
import com.lz.modules.flow.req.EvaluationGroupReq;
import com.lz.modules.flow.service.EvaluationGroupService;
import com.lz.modules.flow.service.FlowManagerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
@ -22,6 +22,7 @@ import java.util.Map;
@RestController
@RequestMapping("/evaluationGroup")
@Api(tags="考核组")
public class EvaluationGroupController {
@ -49,8 +50,9 @@ public class EvaluationGroupController {
}
@RequestMapping("/save")
public R save(@RequestBody EvaluationGroup evaluationGroup) {
@PostMapping("/save")
@ApiOperation("新增考核组")
public R save(@RequestBody @ApiParam EvaluationGroup evaluationGroup) {
evaluationGroupService.insertEvaluationGroup(evaluationGroup);
return R.ok();
}

View File

@ -5,13 +5,13 @@ import com.alibaba.fastjson.JSONObject;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
import com.lz.modules.equipment.entity.model.FindEmployeeResModel;
import com.lz.modules.flow.entity.EvaluationGroup;
import com.lz.modules.flow.entity.FlowChart;
import com.lz.modules.flow.entity.FlowManager;
import com.lz.modules.flow.service.FlowChartService;
import com.lz.modules.flow.service.FlowManagerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -33,6 +33,8 @@ public class FlowChartController {
@GetMapping("/getByFlowManagerId")
@ApiOperation("根据Manager Id获取大流程")
@ApiImplicitParam(name = "id",value = "流程id", required = true, dataType = "String",paramType = "query")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = FlowChart.class)})
public R getByFlowManagerId(@RequestParam Long id) {
FlowManager flowManager = flowManagerService.selectFlowManagerById(id);
if(flowManager != null){
@ -40,12 +42,13 @@ public class FlowChartController {
return R.ok().put("list",flowCharts);
}
return R.error("无相关流程");
}
@RequestMapping("/getById")
public R getById(@RequestBody FlowChart flowChart) {
@PostMapping("/getById")
@ApiOperation("获取流程节点")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = FlowChart.class)})
public R getById(@RequestBody @ApiParam FlowChart flowChart) {
flowChart = flowChartService.selectFlowChartById(flowChart.getId());
return R.ok().put("flowChart",flowChart);
}

View File

@ -0,0 +1,56 @@
package com.lz.modules.performance.controller;
import com.alibaba.fastjson.JSONObject;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
import com.lz.modules.flow.entity.FlowChartRole;
import com.lz.modules.flow.service.FlowChartRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("/flowChartRole")
public class FlowChartRoleController {
@Autowired
private FlowChartRoleService flowChartRoleService;
@RequestMapping("/getById")
public R getById(@RequestBody FlowChartRole flowChartRole) {
flowChartRole = flowChartRoleService.selectFlowChartRoleById(flowChartRole.getId());
return R.ok().put("flowChartRole",flowChartRole);
}
@RequestMapping("/update")
public R update(@RequestBody FlowChartRole flowChartRole) {
flowChartRoleService.updateFlowChartRoleById(flowChartRole);
return R.ok();
}
@RequestMapping("/save")
public R save(@RequestBody FlowChartRole flowChartRole) {
flowChartRoleService.insertFlowChartRole(flowChartRole);
return R.ok();
}
@RequestMapping("/delete")
public R list(@RequestBody Long id) {
flowChartRoleService.deleteFlowChartRoleById(id);
return R.ok();
}
}

View File

@ -10,8 +10,6 @@
<result column="gmt_modified" property="gmtModified"/>
<result column="name" property="name"/>
<result column="process_id" property="processId"/>
<result column="role_id" property="roleId"/>
<result column="can_role_id" property="canRoleId"/>
<result column="status" property="status"/>
<result column="type" property="type"/>
<result column="step_index" property="stepIndex"/>
@ -20,7 +18,7 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, name AS name, process_id AS processId, role_id AS roleId, can_role_id AS canRoleId, status AS status, type AS type, step_index AS stepIndex
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, name AS name, process_id AS processId, status AS status, type AS type, step_index AS stepIndex
</sql>
@ -35,8 +33,6 @@
insert into lz_flow_chart(
<if test="name != null">name, </if>
<if test="processId != null">process_id, </if>
<if test="roleId != null">role_id, </if>
<if test="canRoleId != null">can_role_id, </if>
<if test="status != null">status, </if>
<if test="type != null">type, </if>
<if test="stepIndex != null">step_index, </if>
@ -46,8 +42,6 @@
)values(
<if test="name != null">#{ name}, </if>
<if test="processId != null">#{ processId}, </if>
<if test="roleId != null">#{ roleId}, </if>
<if test="canRoleId != null">#{ canRoleId}, </if>
<if test="status != null">#{ status}, </if>
<if test="type != null">#{ type}, </if>
<if test="stepIndex != null">#{ stepIndex}, </if>
@ -66,8 +60,6 @@
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="name != null">name = #{name},</if>
<if test="processId != null">process_id = #{processId},</if>
<if test="roleId != null">role_id = #{roleId},</if>
<if test="canRoleId != null">can_role_id = #{canRoleId},</if>
<if test="status != null">status = #{status},</if>
<if test="type != null">type = #{type},</if>
<if test="stepIndex != null">step_index = #{stepIndex}</if>
@ -85,8 +77,6 @@
gmt_create = #{gmtCreate},
name = #{name},
process_id = #{processId},
role_id = #{roleId},
can_role_id = #{canRoleId},
status = #{status},
type = #{type},
step_index = #{stepIndex}

View 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.FlowChartRoleMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.lz.modules.flow.entity.FlowChartRole">
<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="chart_id" property="chartId"/>
<result column="role_id" property="roleId"/>
<result column="type" property="type"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, chart_id AS chartId, role_id AS roleId, type AS type
</sql>
<select id="selectFlowChartRoleById" resultType="FlowChartRole" >
select * from lz_flow_chart_role where id=#{id} and is_delete = 0 limit 1
</select>
<insert id="insertFlowChartRole" parameterType="FlowChartRole" useGeneratedKeys="true" keyProperty="id" >
insert into lz_flow_chart_role(
<if test="chartId != null">chart_id, </if>
<if test="roleId != null">role_id, </if>
<if test="type != null">type, </if>
is_delete,
gmt_create,
gmt_modified
)values(
<if test="chartId != null">#{ chartId}, </if>
<if test="roleId != null">#{ roleId}, </if>
<if test="type != null">#{ type}, </if>
0,
now(),
now()
)
</insert>
<update id="updateFlowChartRoleById" parameterType="FlowChartRole" >
update
lz_flow_chart_role
<trim prefix="set" suffixOverrides=",">
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="chartId != null">chart_id = #{chartId},</if>
<if test="roleId != null">role_id = #{roleId},</if>
<if test="type != null">type = #{type}</if>
</trim>
,gmt_modified = now()
where id = #{id}
</update>
<update id="updateCoverFlowChartRoleById" parameterType="FlowChartRole" >
update
lz_flow_chart_role
set
is_delete = #{isDelete},
gmt_create = #{gmtCreate},
chart_id = #{chartId},
role_id = #{roleId},
type = #{type}
,gmt_modified = now()
where id = #{id}
</update>
<update id="deleteFlowChartRoleById" parameterType="java.lang.Long">
update lz_flow_chart_role set is_delete = 1 where id=#{id} limit 1
</update>
</mapper>

View File

@ -63,14 +63,8 @@ public class MysqlMain {
}
List<TablesBean> list = new ArrayList<TablesBean>();
list.add(new TablesBean("lz_evaluation_group"));
list.add(new TablesBean("lz_evaluation_start_staff"));
list.add(new TablesBean("lz_flow_approval_role"));
list.add(new TablesBean("lz_flow_change"));
list.add(new TablesBean("lz_flow_chart"));
list.add(new TablesBean("lz_flow_start"));
list.add(new TablesBean("lz_result_model"));
list.add(new TablesBean("lz_result_score"));
list.add(new TablesBean("lz_flow_chart_role"));
List<TablesBean> list2 = new ArrayList<TablesBean>();
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();