6 Commits

Author SHA1 Message Date
秋辞未寒
888c14615d update 优化 !781Excel 模版动态数据下拉 泛型逻辑 2025-11-11 17:02:53 +08:00
王志龙
fa6c9696f0 !785 FlwSpelController类注释补全
* FlwSpelController类注释补全
2025-11-11 05:34:06 +00:00
Angus
37038449ab !781 Excel模版动态数据下拉
* Excel模版动态数据下拉
* Excel模版动态数据下拉
2025-11-11 01:58:55 +00:00
gssong
9bff358afd fix 修复申请人提交可直接结束流程 2025-11-09 08:44:25 +08:00
疯狂的狮子Li
d2a45156a2 fix 修复 warmflow的官方sql书写不正确问题 2025-10-29 10:13:46 +08:00
Tyler Ge
9df0a8de1c !780 fix: 修复CompleteTaskDTO中getVariables()中variables == null 时的返回值问题
* fix: 修复CompleteTaskDTO中getVariables()中variables == null 时的返回值问题
2025-10-29 01:26:05 +00:00
8 changed files with 61 additions and 4 deletions

View File

@@ -67,7 +67,8 @@ public class CompleteTaskDTO implements Serializable {
public Map<String, Object> getVariables() {
if (variables == null) {
return new HashMap<>(16);
variables = new HashMap<>(16);
return variables;
}
variables.entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
return variables;

View File

@@ -0,0 +1,23 @@
package org.dromara.common.excel.annotation;
import org.dromara.common.excel.core.ExcelOptionsProvider;
import java.lang.annotation.*;
/**
* Excel动态下拉选项注解
*
* @author Angus
*/
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface ExcelDynamicOptions {
/**
* 提供者类全限定名
* <p>
* {@link org.dromara.common.excel.core.ExcelOptionsProvider} 接口实现类 class
*/
Class<? extends ExcelOptionsProvider> providerClass();
}

View File

@@ -23,6 +23,7 @@ import org.dromara.common.core.utils.SpringUtils;
import org.dromara.common.core.utils.StreamUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.annotation.ExcelDynamicOptions;
import org.dromara.common.excel.annotation.ExcelEnumFormat;
import java.lang.reflect.Field;
@@ -117,6 +118,15 @@ public class ExcelDownHandler implements SheetWriteHandler {
ExcelEnumFormat format = field.getDeclaredAnnotation(ExcelEnumFormat.class);
List<Object> values = EnumUtil.getFieldValues(format.enumClass(), format.textField());
options = StreamUtils.toList(values, Convert::toStr);
} else if (field.isAnnotationPresent(ExcelDynamicOptions.class)) {
// 处理动态下拉选项
ExcelDynamicOptions dynamicOptions = field.getDeclaredAnnotation(ExcelDynamicOptions.class);
// 获取提供者实例
ExcelOptionsProvider provider = SpringUtils.getBean(dynamicOptions.providerClass());
Set<String> providerOptions = provider.getOptions();
if (CollUtil.isNotEmpty(providerOptions)) {
options = new ArrayList<>(providerOptions);
}
}
if (ObjectUtil.isNotEmpty(options)) {
// 仅当下拉可选项不为空时执行

View File

@@ -0,0 +1,19 @@
package org.dromara.common.excel.core;
import java.util.Set;
/**
* Excel下拉选项数据提供接口
*
* @author Angus
*/
public interface ExcelOptionsProvider {
/**
* 获取下拉选项数据
*
* @return 下拉选项列表
*/
Set<String> getOptions();
}

View File

@@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 流程spel达式定义
* 流程spel达式定义
*
* @author Michelle.Chung
* @date 2025-07-04

View File

@@ -144,7 +144,8 @@ public class WorkflowGlobalListener implements GlobalListener {
//申请人提交事件
Boolean submit = MapUtil.getBool(variable, FlowConstant.SUBMIT);
if (submit != null && submit) {
flowProcessEventHandler.processHandler(definition.getFlowCode(), instance, instance.getFlowStatus(), variable, true);
String status = determineFlowStatus(instance);
flowProcessEventHandler.processHandler(definition.getFlowCode(), instance, status, variable, true);
} else {
// 判断流程状态(发布:撤销,退回,作废,终止,已完成事件)
String status = determineFlowStatus(instance);

View File

@@ -199,7 +199,10 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
testLeave.setApplyCode(businessCode);
}
testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
log.info("申请人提交");
}
String status = BusinessStatusEnum.findByStatus(processEvent.getStatus());
log.info("当前流程状态为{}", status);
baseMapper.updateById(testLeave);
}

View File

@@ -1261,7 +1261,7 @@ EXEC sp_addextendedproperty
'COLUMN', N'component_name'
GO
-- method_name 字段注释
EXEC sp_addextendedproperty
'MS_Description', N'方法名',
'SCHEMA', N'dbo',
'TABLE', N'flow_spel',