1
zj
2025-03-17 3ed7b4b2c8cd28435e7cc2c1d3c5b091fafbf077
src/main/java/com/nq/controller/protol/UserWithdrawController.java
@@ -43,6 +43,9 @@
        ServerResponse serverResponse = null;
        User user = this.iUserService.getCurrentRefreshUser(request);
        try {
            if (!isIntegerGreaterThan100(amt)) {
                return ServerResponse.createByErrorMsg("请输入整数!",request);
            }
            serverResponse = this.iUserWithdrawService.outMoney(amt, user.getWithPwd(), accsetType,bankId,request);
        } catch (Exception e) {
            log.error("出金异常 e = {}", e);
@@ -51,6 +54,16 @@
        return serverResponse;
    }
    // 判断字符串是否是整数且大于100
    public static boolean isIntegerGreaterThan100(String str) {
        try {
            int number = Integer.parseInt(str);  // 尝试将字符串转换为整数
            return number > 100;  // 判断是否大于100
        } catch (NumberFormatException e) {
            return false;  // 如果转换失败,说明不是整数
        }
    }
    @RequestMapping({"cancel.do"})
    @ResponseBody
    public ServerResponse userCancel(Integer withId) {