1. 新增业务流程任务表单可配置自定义路由表单选项
fix:
1. 修复 mysql 脚本部分字段未同步脚本的错误
2. 角色为空无法登录系统
3. 主子表缩写命名下代码生成器错误
(cherry picked from commit 3812611b04)
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package cn.iocoder.yudao.module.system.api.sequence;
|
||||
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
|
||||
/**
|
||||
* @author chenbowen
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "序列管理 Api")
|
||||
public interface SequenceApi {
|
||||
}
|
||||
@@ -176,4 +176,20 @@ public interface ErrorCodeConstants {
|
||||
|
||||
// ========== 用户与部门关系 1-002-029-000 ==========
|
||||
ErrorCode USER_DEPT_NOT_EXISTS = new ErrorCode(1_002_029_000, "用户与部门关系不存在");
|
||||
|
||||
// ========== 系统序列号分段明细 1-002-030-000 ==========
|
||||
ErrorCode SEQUENCE_DETAIL_NOT_EXISTS = new ErrorCode(1_002_030_000, "系统序列号分段明细不存在");
|
||||
|
||||
// ========== 系统序列号 1-002-031-000 ==========
|
||||
ErrorCode SEQUENCE_NOT_EXISTS = new ErrorCode(1_002_031_000, "系统序列号不存在");
|
||||
ErrorCode SEQUENCE_DETAIL_EMPTY = new ErrorCode(1_002_031_001, "序列号分段明细不存在");
|
||||
ErrorCode SEQUENCE_GENERATE_ERROR = new ErrorCode(1_002_031_002, "序列号生成失败:{}");
|
||||
ErrorCode SEQUENCE_LOCK_TIMEOUT = new ErrorCode(1_002_031_003, "序列号生成锁超时");
|
||||
|
||||
// ========== 系统序列号规则校验 1-002-031-010 ==========
|
||||
ErrorCode SEQUENCE_DETAIL_RULE_INVALID = new ErrorCode(1_002_031_010, "序列号分段规则无效:{}");
|
||||
|
||||
// ========== 系统序列号记录 1-002-032-000 ==========
|
||||
ErrorCode SEQUENCE_RECORD_NOT_EXISTS = new ErrorCode(1_002_032_000, "系统序列号记录不存在");
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.system.enums.sequence;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 序列号循环类型
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SequenceCycleTypeEnum {
|
||||
|
||||
// 年循环。示例: 2025
|
||||
SEQUENCE_CYCLE_YEAR("Y", "年循环。示例: 2025"),
|
||||
// 年-月循环。示例: 2025-08
|
||||
SEQUENCE_CYCLE_YEAR_MONTH("Y-M", "年-月循环。示例: 2025-08"),
|
||||
// 年月紧凑。示例: 202508
|
||||
SEQUENCE_CYCLE_YEAR_MONTH_COMPACT("YM", "年月紧凑。示例: 202508"),
|
||||
// 两位年+月。示例: 2508
|
||||
SEQUENCE_CYCLE_SHORT_YEAR_MONTH("yM", "两位年+月。示例: 2508"),
|
||||
// 年-月-日循环。示例: 2025-08-08
|
||||
SEQUENCE_CYCLE_YEAR_MONTH_DAY("Y-M-D", "年-月-日循环。示例: 2025-08-08"),
|
||||
// 年月日紧凑。示例: 20250808
|
||||
SEQUENCE_CYCLE_YEAR_MONTH_DAY_COMPACT("YMD", "年月日紧凑。示例: 20250808"),
|
||||
// 两位年+月日。示例: 250808
|
||||
SEQUENCE_CYCLE_SHORT_YEAR_MONTH_DAY("yMD", "两位年+月日。示例: 250808"),
|
||||
// 自定义循环值;若未传 circulationValue,则默认用 seqId
|
||||
SEQUENCE_CYCLE_CUSTOM("CUST", "自定义循环值;若未传 circulationValue,则默认用 seqId"),
|
||||
// 仅前缀,不需要时间循环值(不设置则不抛错)
|
||||
SEQUENCE_CYCLE_PREFIX_ONLY("PFX", "仅前缀,不需要时间循环值(不设置则不抛错)");
|
||||
|
||||
/**
|
||||
* 类型编码(精简版)
|
||||
*/
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
public static SequenceCycleTypeEnum getByCode(String code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
// 先按精简编码匹配
|
||||
for (SequenceCycleTypeEnum value : SequenceCycleTypeEnum.values()) {
|
||||
if (value.getCode().equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static SequenceCycleTypeEnum getByName(String name) {
|
||||
for (SequenceCycleTypeEnum value : SequenceCycleTypeEnum.values()) {
|
||||
if (value.getName().equals(name)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// 获取 EnumList
|
||||
public static SequenceCycleTypeEnum[] getEnumList() {
|
||||
return SequenceCycleTypeEnum.values();
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,6 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.
|
||||
import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.ROLE_CAN_NOT_UPDATE_NORMAL_TYPE_ROLE;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.ROLE_CAN_NOT_UPDATE_SYSTEM_TYPE_ROLE;
|
||||
|
||||
/**
|
||||
* 权限 Service 实现类
|
||||
@@ -335,18 +334,20 @@ public class PermissionServiceImpl implements PermissionService {
|
||||
// 获得用户的角色
|
||||
List<RoleDO> roles = getEnableUserRoleListByUserIdFromCache(userId);
|
||||
|
||||
// 如果角色为空,则只能查看自己
|
||||
DeptDataPermissionRespDTO result = new DeptDataPermissionRespDTO();
|
||||
if (CollUtil.isEmpty(roles)) {
|
||||
result.setSelf(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 获得用户的部门编号的缓存,通过 Guava 的 Suppliers 惰性求值,即有且仅有第一次发起 DB 的查询
|
||||
Supplier<Set<Long>> userDeptIds = Suppliers.memoize(() -> {
|
||||
List<UserDeptDO> validUserDeptListByUserId = userDeptService.getValidUserDeptListByUserIds(singleton(userId));
|
||||
return validUserDeptListByUserId.stream().map(UserDeptDO::getDeptId).collect(Collectors.toSet());
|
||||
});
|
||||
|
||||
// 如果角色为空,则只能查看自己,以及自己直属部门的信息
|
||||
DeptDataPermissionRespDTO result = new DeptDataPermissionRespDTO();
|
||||
if (CollUtil.isEmpty(roles)) {
|
||||
result.setSelf(true);
|
||||
result.setDeptIds(userDeptIds.get());
|
||||
return result;
|
||||
}
|
||||
|
||||
// 遍历每个角色,计算
|
||||
for (RoleDO role : roles) {
|
||||
// 为空时,跳过
|
||||
|
||||
@@ -170,6 +170,9 @@ yudao:
|
||||
- /admin-api/system/user/profile/**
|
||||
- /admin-api/system/auth/**
|
||||
ignore-tables:
|
||||
- system_seq
|
||||
- system_seq_dtl
|
||||
- system_seq_rcd
|
||||
ignore-caches:
|
||||
- user_role_ids
|
||||
- permission_menu_ids
|
||||
|
||||
Reference in New Issue
Block a user