💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 组件源码 ``` /** * <b>方法描述:</b> 金额比较 <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2018-05-11 11:49:45 <br/> * * @param amt1 * 入参|金额1|{@link Object} * @param amt2 * 入参|金额2|{@link Object} * @return 0 小于<br/> * 1 等于<br/> * 2 大于<br/> */ @Component(label = "金额比较", style = "选择型", type = "同步组件", comment = "两个金额比较0小于、1等于,2大于,组件的每个输出分支代表一种结果,从左到右依次为:小于、等于、大于。", version = "1.0.0", deprecated = false, author = "admin", date = "2018-05-11 11:49:45") @InParams(param = {@Param(name = "amt1", comment = "金额1", type = Object.class), @Param(name = "amt2", comment = "金额2", type = Object.class)}) @Returns(returns = {@Return(id = "0", desp = "小于"), @Return(id = "1", desp = "等于"), @Return(id = "2", desp = "大于")}) public static ResultBase P_compare(Object amt1, Object amt2) { BigDecimal d1 = transform(amt1); BigDecimal d2 = transform(amt2); if (d1 != null && d2 != null) { return new ResultBase(d1.compareTo(d2) + 1); } return ResultBase.newFailureResult("TPTA0008", "输入比较金额数据不是合法数据,输入值1=" + amt1 + ",值2=" + amt2); } ``` # 交易中组件使用方式 ![](https://img.kancloud.cn/6b/50/6b506e80dd357b83e0973e5ffc907d1d_1869x867.png) # 参数说明及示例 ## 入口参数 金额1:输入一个数值型的参数,示例: `26513.2` 金额2:输入一个字符串型的数字,示例: `"1,232.56"`