基于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、效果图

相关推荐
hrrrrb43 分钟前
【Spring Security】Spring Security 概念
java·数据库·spring
小信丶43 分钟前
Spring 中解决 “Could not autowire. There is more than one bean of type“ 错误
java·spring
周杰伦_Jay2 小时前
【Java虚拟机(JVM)全面解析】从原理到面试实战、JVM故障处理、类加载、内存区域、垃圾回收
java·jvm
程序员小凯5 小时前
Spring Boot测试框架详解
java·spring boot·后端
豐儀麟阁贵5 小时前
基本数据类型
java·算法
_extraordinary_6 小时前
Java SpringMVC(二) --- 响应,综合性练习
java·开发语言
程序员 Harry6 小时前
深度解析:使用ZIP流式读取大型PPTX文件的最佳实践
java
wxweven7 小时前
校招面试官揭秘:我们到底在寻找什么样的技术人才?
java·面试·校招
陈陈爱java7 小时前
新知识点背诵
java
失散137 小时前
分布式专题——39 RocketMQ客户端编程模型
java·分布式·架构·rocketmq