diff --git a/sql/tools/convertor.py b/sql/tools/convertor.py index b54d1337c..d52a7a73c 100644 --- a/sql/tools/convertor.py +++ b/sql/tools/convertor.py @@ -52,6 +52,7 @@ def load_and_clean(sql_file: str) -> str: REPLACE_PAIR_LIST = ( (")\nVALUES ", ") VALUES "), (" CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ", " "), + (" CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ", " "), (" KEY `", " INDEX `"), ("UNIQUE INDEX", "UNIQUE KEY"), ("b'0'", "'0'"), @@ -61,6 +62,11 @@ def load_and_clean(sql_file: str) -> str: content = open(sql_file, encoding="utf-8").read() for replace_pair in REPLACE_PAIR_LIST: content = content.replace(*replace_pair) + # 移除索引字段的前缀长度定义,例如: `name`(32) -> `name` + # 移除索引定义上的 USING BTREE COMMENT 部分 + # 相关 issue:https://t.zsxq.com/96IFc 、https://t.zsxq.com/rC3A3 + content = re.sub(r'`([^`]+)`\(\d+\)', r'`\1`', content) + content = re.sub(r'\s+USING\s+BTREE\s+COMMENT\s+\'[^\']+\'', '', content) content = re.sub(r"ENGINE.*COMMENT", "COMMENT", content) content = re.sub(r"ENGINE.*;", ";", content) return content @@ -262,10 +268,10 @@ class Convertor(ABC): # 解析注释 for column in table_ddl["columns"]: column["comment"] = bytes(column["comment"], "utf-8").decode( - "unicode_escape" + r"unicode_escape" )[1:-1] table_ddl["comment"] = bytes(table_ddl["comment"], "utf-8").decode( - "unicode_escape" + r"unicode_escape" )[1:-1] # 为每个表生成个6个基本部分 diff --git a/yudao-module-bpm/yudao-module-bpm-server/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-server/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java index 6545d83d6..acd437b57 100644 --- a/yudao-module-bpm/yudao-module-bpm-server/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-server/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java @@ -779,8 +779,8 @@ public class BpmTaskServiceImpl implements BpmTaskService { */ private void approveDelegateTask(BpmTaskApproveReqVO reqVO, Task task) { // 1. 添加审批意见 - AdminUserRespDTO currentUser = adminUserApi.getUser(WebFrameworkUtils.getLoginUserId()).getCheckedData(); - AdminUserRespDTO ownerUser = adminUserApi.getUser(NumberUtils.parseLong(task.getOwner())).getCheckedData(); // 发起委托的用户 + AdminUserRespDTO currentUser = adminUserApi.getUser(WebFrameworkUtils.getLoginUserId()); + AdminUserRespDTO ownerUser = adminUserApi.getUser(NumberUtils.parseLong(task.getOwner())); // 发起委托的用户 Assert.notNull(ownerUser, "委派任务找不到原审批人,需要检查数据"); taskService.addComment(reqVO.getId(), task.getProcessInstanceId(), BpmCommentTypeEnum.DELEGATE_END.getType(), BpmCommentTypeEnum.DELEGATE_END.formatComment(currentUser.getNickname(), ownerUser.getNickname(), reqVO.getReason())); @@ -949,11 +949,13 @@ public class BpmTaskServiceImpl implements BpmTaskService { Set needSimulateTaskDefinitionKeys = getNeedSimulateTaskDefinitionKeys(bpmnModel, currentTask, targetElement); // 4. 执行驳回 - // 使用 moveExecutionsToSingleActivityId 替换 moveActivityIdsToSingleActivityId 原因: - // 当多实例任务回退的时候有问题。相关 issue: https://github.com/flowable/flowable-engine/issues/3944 + // ① 使用 moveExecutionsToSingleActivityId 替换 moveActivityIdsToSingleActivityId。原因:当多实例任务回退的时候有问题。 + // 相关 issue: https://github.com/flowable/flowable-engine/issues/3944 + // ② flowable 7.2.0 版本后,继续使用 moveActivityIdsToSingleActivityId 方法。原因:flowable 7.2.0 版本修复了该问题。 + // 相关 issue:https://github.com/YunaiV/ruoyi-vue-pro/issues/1018 runtimeService.createChangeActivityStateBuilder() .processInstanceId(currentTask.getProcessInstanceId()) - .moveExecutionsToSingleActivityId(runExecutionIds, reqVO.getTargetTaskDefinitionKey()) + .moveActivityIdsToSingleActivityId(runExecutionIds, reqVO.getTargetTaskDefinitionKey()) // 设置需要预测的任务 ids 的流程变量,用于辅助预测 .processVariable(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_NEED_SIMULATE_TASK_IDS, needSimulateTaskDefinitionKeys) // 设置流程变量(local)节点退回标记, 用于退回到节点,不执行 BpmUserTaskAssignStartUserHandlerTypeEnum 策略,导致自动通过 @@ -1000,13 +1002,13 @@ public class BpmTaskServiceImpl implements BpmTaskService { throw exception(TASK_DELEGATE_FAIL_USER_REPEAT); } // 1.2 校验目标用户存在 - AdminUserRespDTO delegateUser = adminUserApi.getUser(reqVO.getDelegateUserId()).getCheckedData(); + AdminUserRespDTO delegateUser = adminUserApi.getUser(reqVO.getDelegateUserId()); if (delegateUser == null) { throw exception(TASK_DELEGATE_FAIL_USER_NOT_EXISTS); } // 2. 添加委托意见 - AdminUserRespDTO currentUser = adminUserApi.getUser(userId).getCheckedData(); + AdminUserRespDTO currentUser = adminUserApi.getUser(userId); taskService.addComment(taskId, task.getProcessInstanceId(), BpmCommentTypeEnum.DELEGATE_START.getType(), BpmCommentTypeEnum.DELEGATE_START.formatComment(currentUser.getNickname(), delegateUser.getNickname(), reqVO.getReason())); @@ -1031,13 +1033,13 @@ public class BpmTaskServiceImpl implements BpmTaskService { throw exception(TASK_TRANSFER_FAIL_USER_REPEAT); } // 1.2 校验目标用户存在 - AdminUserRespDTO assigneeUser = adminUserApi.getUser(reqVO.getAssigneeUserId()).getCheckedData(); + AdminUserRespDTO assigneeUser = adminUserApi.getUser(reqVO.getAssigneeUserId()); if (assigneeUser == null) { throw exception(TASK_TRANSFER_FAIL_USER_NOT_EXISTS); } // 2. 添加委托意见 - AdminUserRespDTO currentUser = adminUserApi.getUser(userId).getCheckedData(); + AdminUserRespDTO currentUser = adminUserApi.getUser(userId); taskService.addComment(taskId, task.getProcessInstanceId(), BpmCommentTypeEnum.TRANSFER.getType(), BpmCommentTypeEnum.TRANSFER.formatComment(currentUser.getNickname(), assigneeUser.getNickname(), reqVO.getReason())); @@ -1096,7 +1098,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { public void createSignTask(Long userId, BpmTaskSignCreateReqVO reqVO) { // 1. 获取和校验任务 TaskEntityImpl taskEntity = validateTaskCanCreateSign(userId, reqVO); - List userList = adminUserApi.getUserList(reqVO.getUserIds()).getCheckedData(); + List userList = adminUserApi.getUserList(reqVO.getUserIds()); if (CollUtil.isEmpty(userList)) { throw exception(TASK_SIGN_CREATE_USER_NOT_EXIST); } @@ -1123,7 +1125,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { createSignTaskList(convertList(reqVO.getUserIds(), String::valueOf), taskEntity); // 4. 记录加签的评论到 task 任务 - AdminUserRespDTO currentUser = adminUserApi.getUser(userId).getCheckedData(); + AdminUserRespDTO currentUser = adminUserApi.getUser(userId); String comment = StrUtil.format(BpmCommentTypeEnum.ADD_SIGN.getComment(), currentUser.getNickname(), BpmTaskSignTypeEnum.nameOfType(reqVO.getType()), String.join(",", convertList(userList, AdminUserRespDTO::getNickname)), reqVO.getReason()); @@ -1155,7 +1157,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { List currentAssigneeList = convertListByFlatMap(taskList, task -> // 需要考虑 owner 的情况,因为向后加签时,它暂时没 assignee 而是 owner Stream.of(NumberUtils.parseLong(task.getAssignee()), NumberUtils.parseLong(task.getOwner()))); if (CollUtil.containsAny(currentAssigneeList, reqVO.getUserIds())) { - List userList = adminUserApi.getUserList(CollUtil.intersection(currentAssigneeList, reqVO.getUserIds())).getCheckedData(); + List userList = adminUserApi.getUserList(CollUtil.intersection(currentAssigneeList, reqVO.getUserIds())); throw exception(TASK_SIGN_CREATE_USER_REPEAT, String.join(",", convertList(userList, AdminUserRespDTO::getNickname))); } return taskEntity; @@ -1217,10 +1219,10 @@ public class BpmTaskServiceImpl implements BpmTaskService { // 1.2 校验取消人存在 AdminUserRespDTO cancelUser = null; if (StrUtil.isNotBlank(task.getAssignee())) { - cancelUser = adminUserApi.getUser(NumberUtils.parseLong(task.getAssignee())).getCheckedData(); + cancelUser = adminUserApi.getUser(NumberUtils.parseLong(task.getAssignee())); } if (cancelUser == null && StrUtil.isNotBlank(task.getOwner())) { - cancelUser = adminUserApi.getUser(NumberUtils.parseLong(task.getOwner())).getCheckedData(); + cancelUser = adminUserApi.getUser(NumberUtils.parseLong(task.getOwner())); } Assert.notNull(cancelUser, "任务中没有所有者和审批人,数据错误"); @@ -1234,7 +1236,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { taskService.deleteTasks(convertList(childTaskList, Task::getId)); // 3. 记录日志到父任务中。先记录日志是因为,通过 handleParentTask 方法之后,任务可能被完成了,并且不存在了,会报异常,所以先记录 - AdminUserRespDTO user = adminUserApi.getUser(userId).getCheckedData(); + AdminUserRespDTO user = adminUserApi.getUser(userId); taskService.addComment(task.getParentTaskId(), task.getProcessInstanceId(), BpmCommentTypeEnum.SUB_SIGN.getType(), StrUtil.format(BpmCommentTypeEnum.SUB_SIGN.getComment(), user.getNickname(), cancelUser.getNickname())); @@ -1536,9 +1538,9 @@ public class BpmTaskServiceImpl implements BpmTaskService { // 情况二:转交给部门负责人审批 if (ObjectUtils.equalsAny(assignStartUserHandlerType, BpmUserTaskAssignStartUserHandlerTypeEnum.TRANSFER_DEPT_LEADER.getType())) { - AdminUserRespDTO startUser = adminUserApi.getUser(Long.valueOf(processInstance.getStartUserId())).getCheckedData(); + AdminUserRespDTO startUser = adminUserApi.getUser(Long.valueOf(processInstance.getStartUserId())); Assert.notNull(startUser, "提交人({})信息为空", processInstance.getStartUserId()); - DeptRespDTO dept = startUser.getDeptId() != null ? deptApi.getDept(startUser.getDeptId()).getCheckedData() : null; + DeptRespDTO dept = startUser.getDeptId() != null ? deptApi.getDept(startUser.getDeptId()) : null; Assert.notNull(dept, "提交人({})部门({})信息为空", processInstance.getStartUserId(), startUser.getDeptId()); // 找不到部门负责人的情况下,自动审批通过 // noinspection DataFlowIssue @@ -1560,7 +1562,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { } // 注意:需要基于 instance 设置租户编号,避免 Flowable 内部异步时,丢失租户编号 FlowableUtils.execute(processInstance.getTenantId(), () -> { - AdminUserRespDTO startUser = adminUserApi.getUser(Long.valueOf(processInstance.getStartUserId())).getCheckedData(); + AdminUserRespDTO startUser = adminUserApi.getUser(Long.valueOf(processInstance.getStartUserId())); messageService.sendMessageWhenTaskAssigned(BpmTaskConvert.INSTANCE.convert(processInstance, startUser, task)); }); } diff --git a/yudao-module-infra/yudao-module-infra-server/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/utils/FileTypeUtils.java b/yudao-module-infra/yudao-module-infra-server/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/utils/FileTypeUtils.java index 28d6a9fa1..f8cd1c45c 100644 --- a/yudao-module-infra/yudao-module-infra-server/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/utils/FileTypeUtils.java +++ b/yudao-module-infra/yudao-module-infra-server/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/utils/FileTypeUtils.java @@ -91,9 +91,8 @@ public class FileTypeUtils { } // 针对 video 的特殊处理,解决视频地址在移动端播放的兼容性问题 if (StrUtil.containsIgnoreCase(mineType, "video")) { - response.setHeader("Content-Length", String.valueOf(content.length)); - response.setHeader("Content-Range", "bytes 0-" + (content.length - 1) + "/" + content.length); response.setHeader("Accept-Ranges", "bytes"); + response.setHeader("Content-Length", String.valueOf(content.length)); } // 输出附件 IoUtil.write(response.getOutputStream(), false, content); diff --git a/yudao-module-infra/yudao-module-infra-server/src/main/resources/codegen/vue3_vben5_antd/general/views/form.vue.vm b/yudao-module-infra/yudao-module-infra-server/src/main/resources/codegen/vue3_vben5_antd/general/views/form.vue.vm index 06dc0c86c..581eae041 100644 --- a/yudao-module-infra/yudao-module-infra-server/src/main/resources/codegen/vue3_vben5_antd/general/views/form.vue.vm +++ b/yudao-module-infra/yudao-module-infra-server/src/main/resources/codegen/vue3_vben5_antd/general/views/form.vue.vm @@ -1,6 +1,6 @@