ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 组件源码 ``` /** * <b>方法描述:</b> 数字检查(大小区间) <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2018-05-08 18:19:59 <br/> * * @param innum * 入参|输入数字|{@link Object} * @param minlim * 入参|最小值限制|{@link double} * @param maxlim * 入参|最大值限制|{@link double} * @return -1 异常<br/> * 0 失败<br/> * 1 成功<br/> */ @Component(label = "数字检查(大小区间)", style = "判断型", type = "同步组件", comment = "检查数字区间包含左右边界", version = "1.0.0", deprecated = false, author = "admin", date = "2018-05-08 06:19:59") @InParams(param = { @Param(name = "innum", comment = "输入数字", type = Object.class), @Param(name = "minlim", comment = "最小值限制", type = double.class), @Param(name = "maxlim", comment = "最大值限制", type = double.class) }) @Returns(returns = { @Return(id = "-1", desp = "异常"), @Return(id = "0", desp = "失败"), @Return(id = "1", desp = "成功") }) public static ResultBase P_numCheck(Object innum, double minlim, double maxlim) { if (minlim > maxlim) return ResultBase.newFailureResult("TPTV0006", "最小值大于最大值,maxlim=" + maxlim + ",minlim=" + minlim); try { if (innum != null) { double val = Double.valueOf(innum.toString()); if (val >= minlim && val <= maxlim) { return ResultBase.newSuccessResult(); } } return ResultBase.newFailureResult("TPTV0007", "不在指定范围"); } catch (Throwable e) { AppLog.error(e); return ResultBase.newExceptionResult("TPTV0007", "检查异常:数据不是数字:输入=" + innum); } } ``` # 交易中组件使用方式 ![](https://img.kancloud.cn/e5/d0/e5d057394fa05ac15a4dc7198a491070_1867x893.png) # 参数说明及示例 ## 入口参数 输入数字:输入要检测的数字,示例: `5` 最小值限制:设置最小值,示例: `Double.valueOf("2")` 最大值限制:设置最大值,示例: `Double.valueOf("7")`