提交测试属性流程节点权限
This commit is contained in:
parent
d4e9320d56
commit
6fb712e7b1
@ -2,6 +2,9 @@ package com.lz.modules.flow.model;
|
|||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* </p>*流程节点权限对应关系表
|
* </p>*流程节点权限对应关系表
|
||||||
@ -21,12 +24,16 @@ public class FlowChartRoleDto {
|
|||||||
//角色id
|
//角色id
|
||||||
@ApiModelProperty(value = "角色id", name = "roleId")
|
@ApiModelProperty(value = "角色id", name = "roleId")
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
@ApiModelProperty(value = "角色名称", name = "roleName")
|
||||||
|
private String roleName;
|
||||||
//1默认权限,必带权限,不可修改权限,0可选权限,2被考核人默认权限,必带权限,初始化时获取
|
//1默认权限,必带权限,不可修改权限,0可选权限,2被考核人默认权限,必带权限,初始化时获取
|
||||||
@ApiModelProperty(value = "1默认权限,必带权限,不可修改权限,0可选权限,2被考核人默认权限,必带权限,初始化时获取", name = "type")
|
@ApiModelProperty(value = "1默认权限,必带权限,不可修改权限,0可选权限,2被考核人默认权限,必带权限,初始化时获取", name = "type")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
//lz_flow_chart_role_group中的id,分组id
|
//lz_flow_chart_role_group中的id,分组id
|
||||||
@ApiModelProperty(value = "lz_flow_chart_role_group中的id,分组id", name = "roleGroupId")
|
@ApiModelProperty(value = "lz_flow_chart_role_group中的id,分组id,如果不为0那么roleDtos需要一起显示", name = "roleGroupId")
|
||||||
private Long roleGroupId;
|
private Long roleGroupId;
|
||||||
|
@ApiModelProperty(value = "节点权限列表", name = "roleDtos")
|
||||||
|
private List<FlowChartRoleDto> roleDtos;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@ -5,17 +5,11 @@ import com.lz.common.emun.ChartOptType;
|
|||||||
import com.lz.common.utils.R;
|
import com.lz.common.utils.R;
|
||||||
import com.lz.modules.app.dto.StaffSimpleDto;
|
import com.lz.modules.app.dto.StaffSimpleDto;
|
||||||
import com.lz.modules.app.service.StaffService;
|
import com.lz.modules.app.service.StaffService;
|
||||||
import com.lz.modules.flow.entity.FlowChart;
|
import com.lz.modules.flow.entity.*;
|
||||||
import com.lz.modules.flow.entity.FlowChartDetailRecord;
|
|
||||||
import com.lz.modules.flow.entity.FlowChartRole;
|
|
||||||
import com.lz.modules.flow.entity.FlowManager;
|
|
||||||
import com.lz.modules.flow.model.*;
|
import com.lz.modules.flow.model.*;
|
||||||
import com.lz.modules.flow.req.FlowChartDetailRecordListReq;
|
import com.lz.modules.flow.req.FlowChartDetailRecordListReq;
|
||||||
import com.lz.modules.flow.req.FlowChartDetailRecordSimpleReq;
|
import com.lz.modules.flow.req.FlowChartDetailRecordSimpleReq;
|
||||||
import com.lz.modules.flow.service.FlowChartDetailRecordService;
|
import com.lz.modules.flow.service.*;
|
||||||
import com.lz.modules.flow.service.FlowChartRoleService;
|
|
||||||
import com.lz.modules.flow.service.FlowChartService;
|
|
||||||
import com.lz.modules.flow.service.FlowManagerService;
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@ -50,6 +44,9 @@ public class FlowChartController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private FlowChartRoleService flowChartRoleService;
|
private FlowChartRoleService flowChartRoleService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FlowChartRoleGroupService flowChartRoleGroupService;
|
||||||
|
|
||||||
@GetMapping("/getByFlowManagerId")
|
@GetMapping("/getByFlowManagerId")
|
||||||
@ApiOperation("获取大流程节点")
|
@ApiOperation("获取大流程节点")
|
||||||
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = FlowChartDto.class)})
|
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = FlowChartDto.class)})
|
||||||
@ -57,9 +54,48 @@ public class FlowChartController {
|
|||||||
FlowManager flowManager = flowManagerService.selectFlowManagerById(id);
|
FlowManager flowManager = flowManagerService.selectFlowManagerById(id);
|
||||||
if(flowManager != null){
|
if(flowManager != null){
|
||||||
List<FlowChartDto> flowChartDtos = flowChartService.selectFlowChartDtoByFlowManagerId(flowManager.getId());
|
List<FlowChartDto> flowChartDtos = flowChartService.selectFlowChartDtoByFlowManagerId(flowManager.getId());
|
||||||
|
Map<Long, FlowChartRoleGroup> flowChartRoleGroupMap = new HashMap<>();
|
||||||
|
|
||||||
for (FlowChartDto dto:flowChartDtos
|
for (FlowChartDto dto:flowChartDtos
|
||||||
) {
|
) {
|
||||||
List<FlowChartRoleDto> flowChartRoles = flowChartService.selectCanSetChartRoleByChartId(dto.getId());
|
List<FlowChartRoleDto> flowChartRoles = flowChartService.selectCanSetChartRoleByChartId(dto.getId());
|
||||||
|
//代码层面对分组的数据做树形结构返回
|
||||||
|
Long rGroupId = 0l;
|
||||||
|
FlowChartRoleDto flowChartRoleDto = null;
|
||||||
|
for (int i = 0; i < flowChartRoles.size(); i++
|
||||||
|
) {
|
||||||
|
FlowChartRoleDto roleDto = flowChartRoles.get(i);
|
||||||
|
if(roleDto.getRoleGroupId().longValue() != 0L){
|
||||||
|
//查询考评组
|
||||||
|
FlowChartRoleGroup flowChartRoleGroup = flowChartRoleGroupMap.get(roleDto.getRoleGroupId());
|
||||||
|
if(flowChartRoleGroup == null){
|
||||||
|
flowChartRoleGroup = flowChartRoleGroupService.selectFlowChartRoleGroupById(roleDto.getRoleGroupId());
|
||||||
|
}
|
||||||
|
if(flowChartRoleGroup != null){
|
||||||
|
|
||||||
|
flowChartRoles.remove(i);
|
||||||
|
flowChartRoleGroupMap.put(flowChartRoleGroup.getId(), flowChartRoleGroup);
|
||||||
|
if(rGroupId != flowChartRoleGroup.getId()){
|
||||||
|
flowChartRoleDto = new FlowChartRoleDto();
|
||||||
|
flowChartRoleDto.setChartId(roleDto.getChartId());
|
||||||
|
flowChartRoleDto.setRoleName(flowChartRoleGroup.getName());
|
||||||
|
flowChartRoleDto.setType(0);
|
||||||
|
flowChartRoleDto.setRoleId(flowChartRoleGroup.getId());
|
||||||
|
flowChartRoleDto.setId(flowChartRoleGroup.getId());
|
||||||
|
flowChartRoleDto.setRoleGroupId(flowChartRoleGroup.getId());
|
||||||
|
flowChartRoleDto.setRoleDtos(new ArrayList<>());
|
||||||
|
flowChartRoles.add(i, flowChartRoleDto);
|
||||||
|
rGroupId = flowChartRoleGroup.getId();
|
||||||
|
}else{
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
flowChartRoleDto.getRoleDtos().add(roleDto);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
dto.setRoleDtos(flowChartRoles);
|
dto.setRoleDtos(flowChartRoles);
|
||||||
if(groupId > 0){
|
if(groupId > 0){
|
||||||
//获取节点已保存的数据
|
//获取节点已保存的数据
|
||||||
|
|||||||
@ -121,8 +121,8 @@
|
|||||||
|
|
||||||
<select id="selectCanSetChartRoleByChartId" resultType="com.lz.modules.flow.model.FlowChartRoleDto" >
|
<select id="selectCanSetChartRoleByChartId" resultType="com.lz.modules.flow.model.FlowChartRoleDto" >
|
||||||
SELECT crole.id as id, crole.chart_id as chart_id, crole.role_id as role_id, role.name as role_name,
|
SELECT crole.id as id, crole.chart_id as chart_id, crole.role_id as role_id, role.name as role_name,
|
||||||
crole.type as type FROM lz_flow_chart_role crole left join lz_record_role role on role.id=crole.role_id
|
crole.type as type, crole.role_group_id as role_group_id FROM lz_flow_chart_role crole left join lz_record_role role on role.id=crole.role_id
|
||||||
where crole.chart_id=#{id} and crole.type = 0 and crole.is_delete=0
|
where crole.chart_id=#{id} and crole.type = 0 and crole.is_delete=0 order by crole.role_group_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user