From 8e4eee5ad4d74e1a4e6ab4de3a9c28000700dce0 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 03 十一月 2026 13:49:04 +0800
Subject: [PATCH] 修复采购退货页面 ERP 模块已禁用报错

---
 yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/sale/ErpSaleOrderController.java |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/sale/ErpSaleOrderController.java b/yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/sale/ErpSaleOrderController.java
index d08ac09..8e94ca1 100644
--- a/yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/sale/ErpSaleOrderController.java
+++ b/yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/sale/ErpSaleOrderController.java
@@ -108,7 +108,6 @@
 
     @GetMapping("/approve-process-list")
     @Operation(summary = "鑾峰彇閿�鍞鍗曞鎵规祦绋嬪垪琛�")
-    @PreAuthorize("@ss.hasPermission('erp:sale-order:query')")
     public CommonResult<List<Map<String, Object>>> getApproveProcessList() {
         return success(saleOrderService.getSaleOrderApproveProcessDefinitionList());
     }
@@ -143,7 +142,6 @@
     @GetMapping("/item/list-by-order-id")
     @Operation(summary = "鏌ヨ閿�鍞鍗曠殑鐗╂枡鏄庣粏鍒楄〃锛堢敤浜庡彂璐ч�氱煡鍗曞垱寤猴級")
     @Parameter(name = "orderId", description = "閿�鍞鍗曠紪鍙�", required = true, example = "1")
-    @PreAuthorize("@ss.hasPermission('erp:sale-order:query')")
     public CommonResult<List<ErpSaleOrderItemRespVO>> getSaleOrderItemListByOrderId(@RequestParam("orderId") Long orderId) {
         List<ErpSaleOrderItemDO> itemList = saleOrderService.getSaleOrderItemListByOrderId(orderId);
         Map<Long, MdmItemRespDTO> itemMap = mdmItemApi.getItemMap(
@@ -157,7 +155,6 @@
     @GetMapping("/get")
     @Operation(summary = "鑾峰緱閿�鍞鍗�")
     @Parameter(name = "id", description = "缂栧彿", required = true, example = "1024")
-    @PreAuthorize("@ss.hasPermission('erp:sale-order:query')")
     public CommonResult<ErpSaleOrderRespVO> getSaleOrder(@RequestParam("id") Long id) {
         ErpSaleOrderDO saleOrder = saleOrderService.getSaleOrder(id);
         if (saleOrder == null) {
@@ -192,7 +189,6 @@
 
     @GetMapping("/page")
     @Operation(summary = "鑾峰緱閿�鍞鍗曞垎椤�")
-    @PreAuthorize("@ss.hasPermission('erp:sale-order:query')")
     public CommonResult<PageResult<ErpSaleOrderRespVO>> getSaleOrderPage(@Valid ErpSaleOrderPageReqVO pageReqVO) {
         PageResult<ErpSaleOrderDO> pageResult = saleOrderService.getSaleOrderPage(pageReqVO);
         return success(buildSaleOrderVOPageResult(pageResult));
@@ -323,15 +319,15 @@
     /**
      * 濉厖璁㈠崟椤圭殑閲戦瀛楁
      *
-     * DO 涓� totalPrice 涓轰骇鍝侀噾棰濓紙涓嶅惈绋庯級锛孯espVO 闇�瑕佽ˉ鍏細
-     * - totalProductPrice锛氫骇鍝侀噾棰�
-     * - totalPrice锛氬惈绋庨噾棰濓紙浜у搧閲戦 + 绋庨锛�
+     * DO 涓� totalPrice 涓哄惈绋庢�讳环锛堝崟浠� 脳 鏁伴噺锛夛紝RespVO 闇�瑕佽ˉ鍏細
+     * - totalProductPrice锛氫笉鍚◣閲戦锛堝惈绋庢�讳环 - 绋庨锛�
+     * - totalPrice锛氬惈绋庢�讳环锛堜繚鎸� DO 鍘熷�硷級
      */
     private void fillItemPrice(ErpSaleOrderRespVO.Item item) {
-        BigDecimal productAmount = item.getTotalPrice() != null ? item.getTotalPrice() : BigDecimal.ZERO;
+        BigDecimal totalPriceWithTax = item.getTotalPrice() != null ? item.getTotalPrice() : BigDecimal.ZERO;
         BigDecimal tax = item.getTaxPrice() != null ? item.getTaxPrice() : BigDecimal.ZERO;
-        item.setTotalProductPrice(productAmount);
-        item.setTotalPrice(productAmount.add(tax));
+        item.setTotalProductPrice(totalPriceWithTax.subtract(tax));
+        item.setTotalPrice(totalPriceWithTax);
     }
 
 }

--
Gitblit v1.9.3