This commit is contained in:
dzc committed 2025-09-20 10:24:35 +08:00
1 parent 63ebf825a8
commit bfc233244b
3 files changed
+27 -3

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
-- ----------------------------
-- Table structure for act_cancel_item
-- ----------------------------
DROP TABLE IF EXISTS act_cancel_item;
CREATE TABLE act_cancel_item
(
id bigint NOT NULL AUTO_INCREMENT COMMENT '活动项id',
act_id bigint NOT NULL COMMENT '活动id',
mch_id bigint NOT NULL COMMENT '活动商户id',
receiver_user_id bigint NOT NULL COMMENT '领取人用户id',
receiver_time datetime NOT NULL COMMENT '领取时间',
act_status char(32) NOT NULL COMMENT '活动状态(1:未核销 2:已核销)',
cancel_user_id bigint DEFAULT NULL COMMENT '核销人用户id',
cancel_time datetime DEFAULT NULL COMMENT '核销时间',
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
create_time datetime DEFAULT NULL COMMENT '创建时间',
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
update_time datetime DEFAULT NULL COMMENT '修改时间',
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
PRIMARY KEY (id)
) ENGINE = InnoDB COMMENT ='核销活动项';
@@ -2,6 +2,7 @@ package com.bsd.pjcloud.common.data.datascope;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONUtil;
@@ -58,7 +59,7 @@ public class DataScopeInnerInterceptor implements DataScopeInterceptor {
dataScope.getFunc().getType(), originalSql);
}
// 2.如果为本人权限 + 部门权限控制
else if (StrUtil.isNotBlank(dataScope.getUsername()) && CollUtil.isNotEmpty(deptIds)) {
else if (StrUtil.isNotBlank(dataScope.getUsername()) && ObjectUtil.isNotEmpty(dataScope.getScopeUserName()) && CollUtil.isNotEmpty(deptIds)) {
String join = CollectionUtil.join(deptIds, ",");
originalSql = String.format("SELECT %s FROM (%s) temp_data_scope WHERE temp_data_scope.%s = '%s' OR temp_data_scope.%s IN (%s)",
dataScope.getFunc().getType(), originalSql, dataScope.getScopeUserName(), dataScope.getUsername(), dataScope.getScopeDeptName(), join);
@@ -257,7 +257,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
*/
@Override
public IPage<UserVO> getUsersWithRolePage(Page page, UserDTO userDTO) {
IPage<UserVO> list = baseMapper.getUserVosPage(page, userDTO, DataScope.of());
DataScope dataScope = DataScope.of();
dataScope.setScopeUserName(null);
IPage<UserVO> list = baseMapper.getUserVosPage(page, userDTO, dataScope);
if (ObjectUtil.isNotEmpty(list.getRecords())) {
List<Long> userIds = list.getRecords().stream().map(UserVO::getUserId).distinct().toList();
if (ObjectUtil.isNotEmpty(userIds)) {
@@ -939,7 +941,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
}
public List<SimpleUserListVO> listUserIdByDeptId(Long deptId, String name) {
List<SysUser> sysUsers = baseMapper.selectList(Wrappers.<SysUser>lambdaQuery()
.eq(SysUser::getDeptId, deptId)