基于jeecgboot-vue3的Flowable流程仿钉钉流程设计器-排它网关里数字比较大小的处理

因为这个项目license问题无法开源,更多技术支持与服务请加入我的知识星球。

1、在仿钉钉流程中,条件的数字比较跟普通的字符串比较又不一样,同时在flowable里也是不同的表达式,所以需要特殊处理

2、后端方面

增加操作符

java 复制代码
//以下为数字操作符 add by nbacheng
        // 大于
        operatorMap.put("ngt", "%s > %s");
        // 等于
        operatorMap.put("neq", "%s = %s");
        // 不等于
        operatorMap.put("nne", "%s != %s");

同时对数字使用不同的格式处理

java 复制代码
} else if ( (e.getValue() instanceof String) && (this.isNumber(e.getValue().toString())) ) {//判断是否是数字 add by nbacheng
                    e.setValue(String.format("%d", Integer.valueOf(e.getValue().toString())));
                } else if (e.getValue() instanceof String) {
                    e.setValue(String.format("'%s'", e.getValue()));
                }
                return String.format(operator,
                    e.getField(),
                    e.getValue()
                );

3、前端方面

也是要增加数字专用的操作符

javascript 复制代码
const operatorOptions = [
  {
    value: 'eq',
    label: '等于'
  },
  {
    value: 'gt', 
    label: '大于'
  },
  {
    value: 'ne',
    label: '不等于'
  },
  {
    value: 'neq',
    label: '数字等于'
  },
  {
    value: 'ngt', 
    label: '数字大于'
  },
  {
    value: 'nne',
    label: '数字不等于'
  },
  {
    label: '包含',
    value: 'in'
  },
  {
    label: '不包含',
    value: 'ni'
  }
]

4、相应生成的xml文件如下:

5、效果图

相关推荐
路边草随风1 天前
java实现发布spark yarn作业
java·spark·yarn
为爱停留1 天前
Spring AI实现MCP(Model Context Protocol)详解与实践
java·人工智能·spring
汝生淮南吾在北1 天前
SpringBoot+Vue饭店点餐管理系统
java·vue.js·spring boot·毕业设计·毕设
冬夜戏雪1 天前
【java学习日记】【2025.12.7】【7/60】
java·开发语言·学习
CC.GG1 天前
【C++】二叉搜索树
java·c++·redis
JIngJaneIL1 天前
基于Java非遗传承文化管理系统(源码+数据库+文档)
java·开发语言·数据库·vue.js·spring boot
南部余额1 天前
踩坑与解惑:深入理解 SpringBoot 自动配置原理与配置排除机制
java·spring boot·自动配置原理·import
木鹅.1 天前
LangChain4j
java
永远都不秃头的程序员(互关)1 天前
Java核心技术精要:高效实践指南
java·开发语言·性能优化
CoderYanger1 天前
动态规划算法-子序列问题(数组中不连续的一段):28.摆动序列
java·算法·leetcode·动态规划·1024程序员节