From 6bed84cf3e8ce263160ad340d7298a2abdca350b Mon Sep 17 00:00:00 2001 From: chenhao Date: Tue, 27 Jan 2026 13:40:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(delivery):=20=E6=B7=BB=E5=8A=A0=E5=8F=91?= =?UTF-8?q?=E8=B4=A7=E7=AE=A1=E7=90=86=E7=9A=84=E6=95=B0=E6=8D=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=8E=A7=E5=88=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在发货清单查询中集成数据权限注解支持 - 为发货服务类添加 DataScope 注解配置 - 更新 MyBatis 映射文件以支持数据权限 SQL 注入 - 添加用户职责关联查询以支持权限判断 - 修改前端组件移除不必要的自动加载逻辑 - 在用户控制器中增加角色授权接口实现 --- .../oms_vue/src/views/manage/delivery/index.vue | 2 +- .../src/views/system/partner/selectPartner.vue | 6 +++--- .../web/controller/system/SysUserController.java | 14 ++++++++++++++ .../service/impl/InventoryDeliveryServiceImpl.java | 2 ++ .../mapper/inventory/InventoryDeliveryMapper.xml | 4 ++++ 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/oms_web/oms_vue/src/views/manage/delivery/index.vue b/oms_web/oms_vue/src/views/manage/delivery/index.vue index 119d0f81..cd636a73 100644 --- a/oms_web/oms_vue/src/views/manage/delivery/index.vue +++ b/oms_web/oms_vue/src/views/manage/delivery/index.vue @@ -186,7 +186,7 @@ - + diff --git a/oms_web/oms_vue/src/views/system/partner/selectPartner.vue b/oms_web/oms_vue/src/views/system/partner/selectPartner.vue index 99796937..27e6bfa7 100644 --- a/oms_web/oms_vue/src/views/system/partner/selectPartner.vue +++ b/oms_web/oms_vue/src/views/system/partner/selectPartner.vue @@ -70,9 +70,9 @@ export default { } }, }, - created() { - this.getList(); - }, + // created() { + // this.getList(); + // }, methods: { /** 查询进货商列表 */ getList() { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index 76934326..a0e239c5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -465,6 +465,20 @@ public class SysUserController extends BaseController } return toAjax(userService.deleteUserByIds(ids)); } + /** + * 用户授权角色 + */ + @Log(title = "用户管理", businessType = BusinessType.GRANT) + @PutMapping("/authRole") + @ResponseBody + public AjaxResult authRole(Long userId, Long[] roleIds) + { + userService.checkUserDataScope(userId); + roleService.checkRoleDataScope(roleIds); + userService.insertUserAuth(userId, roleIds); + AuthorizationUtils.clearAllCachedAuthorizationInfo(); + return success(); + } // ----------------------新增的个人信息 业务处理--------------------------- // /** // * 个人信息 diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryDeliveryServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryDeliveryServiceImpl.java index fd039f47..11d673bd 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryDeliveryServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryDeliveryServiceImpl.java @@ -6,6 +6,7 @@ import java.util.*; import java.util.stream.Collectors; import cn.hutool.core.collection.CollUtil; +import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; @@ -84,6 +85,7 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService { * @return 产品库存 */ @Override + @DataScope(deptAlias = "t8", userAlias = "t8") public List selectInventoryDeliveryList(InventoryDelivery inventoryDelivery) { return inventoryDeliveryMapper.selectInventoryDeliveryList(inventoryDelivery); } diff --git a/ruoyi-sip/src/main/resources/mapper/inventory/InventoryDeliveryMapper.xml b/ruoyi-sip/src/main/resources/mapper/inventory/InventoryDeliveryMapper.xml index 7210e6b1..759269d5 100644 --- a/ruoyi-sip/src/main/resources/mapper/inventory/InventoryDeliveryMapper.xml +++ b/ruoyi-sip/src/main/resources/mapper/inventory/InventoryDeliveryMapper.xml @@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join project_info t5 on t4.project_id=t5.id left join sys_user t6 on t1.create_by = t6.user_id left join product_info t7 on t3.product_code = t7.product_code + left join sys_user t8 on t4.duty = t8.user_id