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-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/productsales/MesWmProductSalesController.java | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/productsales/MesWmProductSalesController.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/productsales/MesWmProductSalesController.java
index cdd84a8..0853b68 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/productsales/MesWmProductSalesController.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/productsales/MesWmProductSalesController.java
@@ -8,14 +8,14 @@
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.crm.api.customer.CrmCustomerApi;
+import cn.iocoder.yudao.module.crm.api.customer.dto.CrmCustomerRespDTO;
import cn.iocoder.yudao.module.mes.controller.admin.wm.productsales.vo.MesWmProductSalesPageReqVO;
import cn.iocoder.yudao.module.mes.controller.admin.wm.productsales.vo.MesWmProductSalesRespVO;
import cn.iocoder.yudao.module.mes.controller.admin.wm.productsales.vo.MesWmProductSalesSaveReqVO;
import cn.iocoder.yudao.module.mes.controller.admin.wm.productsales.vo.MesWmProductSalesShippingReqVO;
-import cn.iocoder.yudao.module.mes.dal.dataobject.md.client.MesMdClientDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.wm.productsales.MesWmProductSalesDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.wm.salesnotice.MesWmSalesNoticeDO;
-import cn.iocoder.yudao.module.mes.service.md.client.MesMdClientService;
import cn.iocoder.yudao.module.mes.service.wm.productsales.MesWmProductSalesService;
import cn.iocoder.yudao.module.mes.service.wm.salesnotice.MesWmSalesNoticeService;
import io.swagger.v3.oas.annotations.Operation;
@@ -44,7 +44,7 @@
@Resource
private MesWmProductSalesService productSalesService;
@Resource
- private MesMdClientService clientService;
+ private CrmCustomerApi crmCustomerApi;
@Resource
private MesWmSalesNoticeService salesNoticeService;
@@ -75,7 +75,6 @@
@GetMapping("/get")
@Operation(summary = "鑾峰緱閿�鍞嚭搴撳崟")
@Parameter(name = "id", description = "缂栧彿", required = true, example = "1024")
- @PreAuthorize("@ss.hasPermission('mes:wm-product-sales:query')")
public CommonResult<MesWmProductSalesRespVO> getProductSales(@RequestParam("id") Long id) {
MesWmProductSalesDO sales = productSalesService.getProductSales(id);
if (sales == null) {
@@ -86,7 +85,6 @@
@GetMapping("/page")
@Operation(summary = "鑾峰緱閿�鍞嚭搴撳崟鍒嗛〉")
- @PreAuthorize("@ss.hasPermission('mes:wm-product-sales:query')")
public CommonResult<PageResult<MesWmProductSalesRespVO>> getProductSalesPage(
@Valid MesWmProductSalesPageReqVO pageReqVO) {
PageResult<MesWmProductSalesDO> pageResult = productSalesService.getProductSalesPage(pageReqVO);
@@ -117,7 +115,6 @@
@GetMapping("/check-quantity")
@Operation(summary = "鏍¢獙閿�鍞嚭搴撳崟鏁伴噺")
@Parameter(name = "id", description = "缂栧彿", required = true)
- @PreAuthorize("@ss.hasPermission('mes:wm-product-sales:query')")
public CommonResult<Boolean> checkProductSalesQuantity(@RequestParam("id") Long id) {
return success(productSalesService.checkProductSalesQuantity(id));
}
@@ -164,17 +161,17 @@
return Collections.emptyList();
}
// 1. 鑾峰緱鍏宠仈鏁版嵁
- Map<Long, MesMdClientDO> clientMap = clientService.getClientMap(
+ Map<Long, CrmCustomerRespDTO> customerMap = crmCustomerApi.getCustomerMap(
convertSet(list, MesWmProductSalesDO::getClientId));
Map<Long, MesWmSalesNoticeDO> noticeMap = salesNoticeService.getSalesNoticeMap(
convertSet(list, MesWmProductSalesDO::getNoticeId));
// 2. 鏋勫缓缁撴灉
return BeanUtils.toBean(list, MesWmProductSalesRespVO.class, vo -> {
- MapUtils.findAndThen(clientMap, vo.getClientId(), client ->
- vo.setClientName(client.getName()).setClientCode(client.getCode()));
+ MapUtils.findAndThen(customerMap, vo.getClientId(), customer ->
+ vo.setClientName(customer.getName()));
MapUtils.findAndThen(noticeMap, vo.getNoticeId(),
notice -> vo.setNoticeCode(notice.getCode()));
});
}
-}
+}
\ No newline at end of file
--
Gitblit v1.9.3