fix: 类更名CustomTitleSetting->TitleSetting

This commit is contained in:
LesanOuO 2025-01-24 10:28:49 +08:00
parent 846d0605d8
commit bcfa08f8ef
3 changed files with 6 additions and 7 deletions

View File

@ -75,7 +75,7 @@ public class BpmModelMetaInfoVO {
private Integer autoApprovalType; private Integer autoApprovalType;
@Schema(description = "标题设置", example = "{}") @Schema(description = "标题设置", example = "{}")
private CustomTitleSetting customTitleSetting; private TitleSetting titleSetting;
@Schema(description = "流程 ID 规则") @Schema(description = "流程 ID 规则")
@Data @Data
@ -101,11 +101,10 @@ public class BpmModelMetaInfoVO {
} }
// TODO @lesanTitleSetting 会不会更好因为 Custom Setting 有点重叠
@Schema(description = "标题设置") @Schema(description = "标题设置")
@Data @Data
@Valid @Valid
public static class CustomTitleSetting { public static class TitleSetting {
@Schema(description = "是否自定义", example = "false") @Schema(description = "是否自定义", example = "false")
@NotNull(message = "是否自定义不能为空") @NotNull(message = "是否自定义不能为空")

View File

@ -174,6 +174,6 @@ public class BpmProcessDefinitionInfoDO extends BaseDO {
* 标题设置 * 标题设置
*/ */
@TableField(typeHandler = JacksonTypeHandler.class) @TableField(typeHandler = JacksonTypeHandler.class)
private BpmModelMetaInfoVO.CustomTitleSetting customTitleSetting; private BpmModelMetaInfoVO.TitleSetting titleSetting;
} }

View File

@ -618,15 +618,15 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
processInstanceBuilder.predefineProcessInstanceId(processIdRedisDAO.generate(processIdRule)); processInstanceBuilder.predefineProcessInstanceId(processIdRedisDAO.generate(processIdRule));
} }
// 3.2 流程名称 // 3.2 流程名称
BpmModelMetaInfoVO.CustomTitleSetting customTitleSetting = processDefinitionInfo.getCustomTitleSetting(); BpmModelMetaInfoVO.TitleSetting titleSetting = processDefinitionInfo.getTitleSetting();
if (customTitleSetting != null && Boolean.TRUE.equals(customTitleSetting.getEnable())) { if (titleSetting != null && Boolean.TRUE.equals(titleSetting.getEnable())) {
AdminUserRespDTO user = adminUserApi.getUser(userId); AdminUserRespDTO user = adminUserApi.getUser(userId);
// TODO @lesannew HashMap 会更好哈clone 感觉反射不一定合适 // TODO @lesannew HashMap 会更好哈clone 感觉反射不一定合适
Map<String, Object> cloneVariables = ObjectUtil.clone(variables); Map<String, Object> cloneVariables = ObjectUtil.clone(variables);
cloneVariables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_START_USER_ID, user.getNickname()); cloneVariables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_START_USER_ID, user.getNickname());
cloneVariables.put(BpmnVariableConstants.PROCESS_START_TIME, DateUtil.now()); cloneVariables.put(BpmnVariableConstants.PROCESS_START_TIME, DateUtil.now());
cloneVariables.put(BpmnVariableConstants.PROCESS_DEFINITION_NAME, definition.getName().trim()); cloneVariables.put(BpmnVariableConstants.PROCESS_DEFINITION_NAME, definition.getName().trim());
processInstanceBuilder.name(StrUtil.format(customTitleSetting.getTitle(), cloneVariables)); processInstanceBuilder.name(StrUtil.format(titleSetting.getTitle(), cloneVariables));
} else { } else {
processInstanceBuilder.name(definition.getName().trim()); processInstanceBuilder.name(definition.getName().trim());
} }