企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 组件源码 ``` /** * <b>方法描述:</b> 减 <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2018-05-11 11:49:58 <br/> * * @param amt1 * 入参|被减数|{@link Object} * @param amt2 * 入参|减数|{@link Object} * @param amt3 * 出参|差|{@link java.lang.String} * @return 0 失败<br/> * 1 成功<br/> */ @Component(label = "减", style = "判断型", type = "同步组件", comment = "两个金额数据相减,支持千分符输入", version = "1.0.0", deprecated = false, author = "admin", date = "2018-05-11 11:49:58") @InParams(param = {@Param(name = "amt1", comment = "被减数", type = Object.class), @Param(name = "amt2", comment = "减数", type = Object.class)}) @OutParams(param = {@Param(name = "amt3", comment = "差", type = java.lang.String.class)}) @Returns(returns = {@Return(id = "0", desp = "失败"), @Return(id = "1", desp = "成功")}) public static ResultBase P_subtract(Object amt1, Object amt2) { BigDecimal d1 = transform(amt1); BigDecimal d2 = transform(amt2); if (d1 != null && d2 != null) { return ResultBase.newSuccessResult(d1.subtract(d2).toString()); } return ResultBase.newFailureResult("TPTA0010", "输入计算金额数据不是合法数据,输入值1=" + amt1 + ",值2=" + amt2); } ``` # 交易中组件使用方式 ![](https://img.kancloud.cn/53/44/5344d0fabcaa572164cd5b6453fccbc8_1867x889.png) # 参数说明及示例 ## 入口参数 被减数:输入一个数值型参数,示例: `100` 减数:输入一个数值型参数,示例: `50.36` ## 出口参数 差:两个金额数据相减,示例: `__INNER__["result"]`