From fec1341c1cb8e11cfbe3fa7dfabe447edb72b630 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 27 十月 2026 15:12:43 +0800
Subject: [PATCH] refactor(auth): 移除多个模块中的权限校验注解
---
yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/controller/admin/item/MdmItemController.java | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/controller/admin/item/MdmItemController.java b/yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/controller/admin/item/MdmItemController.java
index 4495e23..e0b5d50 100644
--- a/yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/controller/admin/item/MdmItemController.java
+++ b/yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/controller/admin/item/MdmItemController.java
@@ -122,7 +122,6 @@
@GetMapping("/get")
@Operation(summary = "鑾峰緱鐗╂枡")
@Parameter(name = "id", description = "缂栧彿", required = true, example = "1")
- @PreAuthorize("@ss.hasPermission('mdm:item:query')")
public CommonResult<MdmItemRespVO> getItem(@RequestParam("id") Long id) {
MdmItemDO item = itemService.getItem(id);
MdmItemRespVO resp = BeanUtils.toBean(item, MdmItemRespVO.class);
@@ -138,7 +137,6 @@
@GetMapping("/page")
@Operation(summary = "鑾峰緱鐗╂枡鍒嗛〉")
- @PreAuthorize("@ss.hasPermission('mdm:item:query')")
public CommonResult<PageResult<MdmItemRespVO>> getItemPage(@Valid MdmItemPageReqVO pageReqVO) {
PageResult<MdmItemDO> pageResult = itemService.getItemPage(pageReqVO);
// 杞崲骞惰ˉ榻愬叧鑱斿悕绉�
@@ -234,7 +232,6 @@
@GetMapping("/list-by-ids")
@Operation(summary = "鑾峰緱鐗╂枡鍒楄〃")
@Parameter(name = "ids", description = "缂栧彿鍒楄〃", required = true, example = "1,2,3")
- @PreAuthorize("@ss.hasPermission('mdm:item:query')")
public CommonResult<List<MdmItemRespVO>> getItemList(@RequestParam("ids") List<Long> ids) {
List<MdmItemDO> list = itemService.getItemList(ids);
return success(BeanUtils.toBean(list, MdmItemRespVO.class));
@@ -333,7 +330,19 @@
@PreAuthorize("@ss.hasPermission('mdm:item:import')")
public CommonResult<MdmItemImportRespVO> importExcel(@RequestParam("file") MultipartFile file,
@RequestParam(value = "updateSupport", required = false, defaultValue = "false") Boolean updateSupport) throws Exception {
- List<MdmItemImportExcelVO> list = ExcelUtils.read(file, MdmItemImportExcelVO.class);
+ List<MdmItemImportExcelVO> list;
+ try {
+ list = ExcelUtils.read(file, MdmItemImportExcelVO.class);
+ } catch (cn.idev.excel.exception.ExcelDataConvertException e) {
+ int row = e.getRowIndex() == null ? 0 : e.getRowIndex() + 1;
+ int col = e.getColumnIndex() == null ? 0 : e.getColumnIndex() + 1;
+ String cellVal = e.getCellData() == null ? "" : String.valueOf(e.getCellData().getStringValue());
+ throw new cn.iocoder.yudao.framework.common.exception.ServiceException(400,
+ "Excel 绗� " + row + " 琛岀 " + col + " 鍒楁暟鎹��" + cellVal + "銆忔牸寮忎笉姝g‘锛岃妫�鏌ヨ鍒楀唴瀹癸紙渚嬪鈥滅姸鎬佲�濊濉� 0/1 鎴� 鍚敤/鍋滅敤锛�");
+ } catch (Exception e) {
+ throw new cn.iocoder.yudao.framework.common.exception.ServiceException(400,
+ "Excel 瑙f瀽澶辫触锛�" + e.getMessage() + "锛岃浣跨敤绯荤粺鈥滀笅杞藉鍏ユā鏉库�濆苟鎸夋ā鏉垮~鍐欍��");
+ }
return success(itemService.importItemList(list, updateSupport));
}
--
Gitblit v1.9.3