feat:通用权限配置模块;报告类型增加权限配置参数

This commit is contained in:
FCL
2025-11-07 11:24:22 +08:00
parent c7bcf07f72
commit 9ffc32d964
13 changed files with 199 additions and 9 deletions

View File

@@ -97,8 +97,7 @@ public class ConfigPermissionController implements BusinessControllerMarker {
@Operation(summary = "导出权限配置,通用权限配置 Excel")
@PreAuthorize("@ss.hasPermission('qms:config-permission:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportConfigPermissionExcel(@Valid ConfigPermissionPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
public void exportConfigPermissionExcel(@Valid ConfigPermissionPageReqVO pageReqVO, HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ConfigPermissionDO> list = configPermissionService.getConfigPermissionPage(pageReqVO).getList();
// 导出 Excel

View File

@@ -21,6 +21,9 @@ public class ConfigPermissionPageReqVO extends PageParam {
@Schema(description = "关联id", example = "20071")
private Long targetId;
@Schema(description = "关联name", example = "1")
private String targetName;
@Schema(description = "关联数据类型", example = "1")
private String targetType;

View File

@@ -27,6 +27,10 @@ public class ConfigPermissionRespVO {
@ExcelProperty("关联id")
private Long targetId;
@Schema(description = "关联name", example = "1")
@ExcelProperty("关联name")
private String targetName;
@Schema(description = "关联数据类型", example = "1")
@ExcelProperty("关联数据类型")
private String targetType;

View File

@@ -19,6 +19,9 @@ public class ConfigPermissionSaveReqVO {
@Schema(description = "关联id", example = "20071")
private Long targetId;
@Schema(description = "关联name", example = "1")
private String targetName;
@Schema(description = "关联数据类型", example = "1")
private String targetType;

View File

@@ -43,6 +43,9 @@ public class ConfigPermissionDO extends BusinessBaseDO {
*/
@TableField("TGT_ID")
private Long targetId;
@TableField("TGT_NAME")
private String targetName;
/**
* 关联数据类型
*/

View File

@@ -16,6 +16,19 @@ import com.zt.plat.framework.common.pojo.PageResult;
*/
public interface ConfigPermissionService {
void savePermissionListWithAutoDelete(List<ConfigPermissionSaveReqVO> list);
void savePermission(List<ConfigPermissionDO> insertList, List<ConfigPermissionDO> updateList, List<Long> deleteList);
void insertPermission(List<ConfigPermissionDO> insertList);
void updatePermission(List<ConfigPermissionDO> updateList);
void deletePermission(List<Long> deleteList);
List<ConfigPermissionDO> getPermissionList(Long sourceId, String sourceType, String permissionType);
/**
* 创建权限配置,通用权限配置
*

View File

@@ -8,9 +8,13 @@ import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionRespVO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigPermissionDO;
import com.zt.plat.module.qms.business.config.service.ConfigPermissionService;
import com.zt.plat.module.qms.business.reportdoc.controller.vo.*;
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO;
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentTypeService;
import com.zt.plat.module.qms.enums.QmsPermissionConstant;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -34,8 +38,8 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
public class ReportDocumentTypeController implements BusinessControllerMarker {
@Resource
private ReportDocumentTypeService reportDocumentTypeService;
@Resource private ReportDocumentTypeService reportDocumentTypeService;
@Resource private ConfigPermissionService configPermissionService;
@PostMapping("/save")
@Operation(summary = "更新报告类型配置")
@@ -67,8 +71,13 @@ public class ReportDocumentTypeController implements BusinessControllerMarker {
@Parameter(name = "id", description = "编号", required = true, example = "1024")
//@PreAuthorize("@ss.hasPermission('qms:report-document-type:query')")
public CommonResult<ReportDocumentTypeRespVO> getReportDocumentType(@RequestParam("id") Long id) {
ReportDocumentTypeDO reportDocumentType = reportDocumentTypeService.getReportDocumentType(id);
return success(BeanUtils.toBean(reportDocumentType, ReportDocumentTypeRespVO.class));
ReportDocumentTypeDO reportDocumentTypeDO = reportDocumentTypeService.getReportDocumentType(id);
Long mainId = reportDocumentTypeDO.getMainId();
List<ConfigPermissionDO> permissionList = configPermissionService.getPermissionList(mainId, QmsPermissionConstant.REPORT_DOCUMENT_TYPE_START, "");
List<ConfigPermissionRespVO> permissionRespVOList= BeanUtils.toBean(permissionList, ConfigPermissionRespVO.class);
ReportDocumentTypeRespVO reportDocumentTypeRespVO = BeanUtils.toBean(reportDocumentTypeDO, ReportDocumentTypeRespVO.class);
reportDocumentTypeRespVO.setPermissionList(permissionRespVOList);
return success(reportDocumentTypeRespVO);
}
@GetMapping("/page")

View File

@@ -2,11 +2,14 @@ package com.zt.plat.module.qms.business.reportdoc.controller.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionRespVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionSaveReqVO;
import com.zt.plat.module.qms.core.aspect.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "管理后台 - 报告类型配置 Response VO")
@Data
@@ -89,4 +92,8 @@ public class ReportDocumentTypeRespVO {
@Schema(description = "前端组件(移动端)")
@ExcelProperty("前端组件(移动端)")
private String pageComponentMobile;
//===========扩展字段=======================
@Schema(description = "权限列表")
List<ConfigPermissionRespVO> permissionList;
}

View File

@@ -1,11 +1,14 @@
package com.zt.plat.module.qms.business.reportdoc.controller.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionSaveReqVO;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.util.List;
@Schema(description = "管理后台 - 报告类型配置新增/修改 Request VO")
@Data
public class ReportDocumentTypeSaveReqVO {
@@ -72,4 +75,9 @@ public class ReportDocumentTypeSaveReqVO {
@Schema(description = "前端组件(移动端)")
private String pageComponentMobile;
//===========扩展字段=======================
@Schema(description = "权限列表")
List<ConfigPermissionSaveReqVO> permissionList;
}

Some files were not shown because too many files have changed in this diff Show More