feat(delivery): 添加发货管理的数据权限控制功能

- 在发货清单查询中集成数据权限注解支持
- 为发货服务类添加 DataScope 注解配置
- 更新 MyBatis 映射文件以支持数据权限 SQL 注入
- 添加用户职责关联查询以支持权限判断
- 修改前端组件移除不必要的自动加载逻辑
- 在用户控制器中增加角色授权接口实现
dev_1.0.0
chenhao 2026-01-27 13:40:43 +08:00
parent 330f2f7d54
commit 6bed84cf3e
5 changed files with 24 additions and 4 deletions

View File

@ -186,7 +186,7 @@
<!-- 发货清单对话框 -->
<delivery-items ref="items"></delivery-items>
<!-- 合同详情抽屉 -->
<order-detail ref="orderDetail"></order-detail>
<!-- <order-detail ref="orderDetail"></order-detail>-->
</div>
</template>

View File

@ -70,9 +70,9 @@ export default {
}
},
},
created() {
this.getList();
},
// created() {
// this.getList();
// },
methods: {
/** 查询进货商列表 */
getList() {

View File

@ -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();
}
// ----------------------新增的个人信息 业务处理---------------------------
// /**
// * 个人信息

View File

@ -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<InventoryDelivery> selectInventoryDeliveryList(InventoryDelivery inventoryDelivery) {
return inventoryDeliveryMapper.selectInventoryDeliveryList(inventoryDelivery);
}

View File

@ -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
</sql>
<select id="selectInventoryDeliveryList" parameterType="InventoryDelivery" resultMap="InventoryDeliveryResult">
@ -62,7 +63,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="projectName != null and projectName != ''">and t5.project_name like
concat('%',#{projectName},'%')
</if>
${params.authSql}
${params.dataScope}
</where>
</select>
<select id="selectInventoryDeliveryById" parameterType="Long" resultMap="InventoryDeliveryResult">