Compare commits

..

No commits in common. "74e3d232f5a31f5d7cbe6c1a9796be424c99d696" and "7e4f0d73f4ef21578586a4d1b857a94b3fbebdf5" have entirely different histories.

6 changed files with 9 additions and 24 deletions

View File

@ -4,7 +4,6 @@ import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Map;
/**
* 流程任务监听
@ -57,9 +56,4 @@ public class ProcessTaskEvent implements Serializable {
*/
private String status;
/**
* 办理参数
*/
private Map<String, Object> params;
}

View File

@ -3,7 +3,6 @@ package org.dromara.monitor.admin.config;
import de.codecentric.boot.admin.server.config.AdminServerProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
@ -11,8 +10,7 @@ import org.springframework.security.config.annotation.web.configurers.AbstractHt
import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
import org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher;
import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
/**
* admin 监控 安全配置
@ -30,7 +28,7 @@ public class SecurityConfig {
}
@Bean
public SecurityFilterChain filterChain(HttpSecurity httpSecurity, MvcRequestMatcher.Builder mvc) throws Exception {
public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception {
SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
successHandler.setTargetUrlParameter("redirectTo");
successHandler.setDefaultTargetUrl(adminContextPath + "/");
@ -40,8 +38,8 @@ public class SecurityConfig {
header.frameOptions(HeadersConfigurer.FrameOptionsConfig::disable))
.authorizeHttpRequests((authorize) ->
authorize.requestMatchers(
mvc.pattern(adminContextPath + "/assets/**"),
mvc.pattern(adminContextPath + "/login")
new AntPathRequestMatcher(adminContextPath + "/assets/**"),
new AntPathRequestMatcher(adminContextPath + "/login")
).permitAll()
.anyRequest().authenticated())
.formLogin((formLogin) ->
@ -53,10 +51,4 @@ public class SecurityConfig {
.build();
}
@Scope("prototype")
@Bean
public MvcRequestMatcher.Builder mvc(HandlerMappingIntrospector introspector) {
return new MvcRequestMatcher.Builder(introspector);
}
}

View File

@ -302,7 +302,7 @@ public class GenTableServiceImpl implements IGenTableService {
tableColumn.setColumnComment(column.getComment());
tableColumn.setColumnType(column.getOriginType().toLowerCase());
tableColumn.setSort(column.getPosition());
tableColumn.setIsRequired(column.isNullable() ? "0" : "1");
tableColumn.setIsRequired(column.isNullable() ? "1" : "0");
tableColumn.setIsIncrement(column.isAutoIncrement() ? "1" : "0");
tableColumns.add(tableColumn);
});

View File

@ -56,7 +56,7 @@ public class FlowProcessEventHandler {
* @param instance 实例数据
* @param taskId 任务id
*/
public void processTaskHandler(String flowCode, Instance instance, Long taskId, Map<String, Object> params) {
public void processTaskHandler(String flowCode, Instance instance, Long taskId) {
String tenantId = TenantHelper.getTenantId();
log.info("【流程任务事件发布】租户ID: {}, 流程编码: {}, 业务ID: {}, 节点类型: {}, 节点编码: {}, 节点名称: {}, 任务ID: {}",
tenantId, flowCode, instance.getBusinessId(), instance.getNodeType(), instance.getNodeCode(), instance.getNodeName(), taskId);
@ -69,7 +69,6 @@ public class FlowProcessEventHandler {
processTaskEvent.setNodeName(instance.getNodeName());
processTaskEvent.setTaskId(taskId);
processTaskEvent.setStatus(instance.getFlowStatus());
processTaskEvent.setParams(params);
SpringUtils.context().publishEvent(processTaskEvent);
}

View File

@ -130,7 +130,7 @@ public class WorkflowGlobalListener implements GlobalListener {
}
//发布任务事件
if (task != null) {
flowProcessEventHandler.processTaskHandler(definition.getFlowCode(), instance, task.getId(), params);
flowProcessEventHandler.processTaskHandler(definition.getFlowCode(), instance, task.getId());
}
if (ObjectUtil.isNull(flowParams)) {
return;

View File

@ -136,7 +136,7 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
}
/**
* 总体流程监听(例如: 草稿撤销退回作废终止已完成)
* 总体流程监听(例如: 草稿撤销退回作废终止已完成单任务完成)
* 正常使用只需#processEvent.flowCode=='leave1'
* 示例为了方便则使用startsWith匹配了全部示例key
*
@ -164,7 +164,7 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
}
/**
* 执行任务创建监听(也代表上一条任务完成事件)
* 执行任务创建监听
* 示例也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
* 在方法中判断流程节点key
* if ("xxx".equals(processTaskEvent.getNodeCode())) {