1
zyy
2025-10-31 9dd29e5b9460b82c9348f9974d24f654c82004d9
1
3 files modified
40 ■■■■ changed files
trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiIndexController.java 4 ●●●● patch | view | raw | blame | history
trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiUserController.java 28 ●●●●● patch | view | raw | blame | history
trading-order-service/src/main/java/com/yami/trading/service/dz/impl/StockDzServiceImpl.java 8 ●●●● patch | view | raw | blame | history
trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiIndexController.java
@@ -680,8 +680,8 @@
        tokenInfoVO.setToken(tokenInfoVO.getAccessToken());
        user.setUserLastip(IPHelper.getIpAddr());
        user.setUserLasttime(new Date());
        user.setUserMobile(username);
        user.setUserMobileBind(Boolean.TRUE);
        //user.setUserMobile(username);
        //user.setUserMobileBind(Boolean.TRUE);
        userService.updateById(user);
        return Result.succeed(tokenInfoVO);
    }
trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiUserController.java
@@ -762,6 +762,34 @@
        return Result.succeed(null);
    }
    @PostMapping("updateOldAndNewSafePsw")
    @ApiOperation("修改资金密码 用旧资金密码")
    public Result updateOldAndNewSafePsw(String old_password, String password, String re_password) {
        if (StringUtils.isEmptyString(old_password)) {
            throw new YamiShopBindException("旧资金密码不能为空");
        }
        if (StringUtils.isEmptyString(password)) {
            throw new YamiShopBindException("新资金密码不能为空");
        }
        if (StringUtils.isEmptyString(re_password)) {
            throw new YamiShopBindException("新资金密码确认不能为空");
        }
        if (old_password.length() < 6 || old_password.length() > 12 || password.length() < 6 || password.length() > 12) {
            throw new YamiShopBindException("密码必须6-12位");
        }
        User secUser = userService.getById(SecurityUtils.getUser().getUserId());
        if (!passwordEncoder.matches(old_password, secUser.getSafePassword())) {
            throw new YamiShopBindException("旧密码不正确!");
        }
        if (!password.equals(re_password)) {
            throw new YamiShopBindException("新密码不一致");
        }
        secUser.setSafePassword(passwordEncoder.encode(re_password));
        userService.updateById(secUser);
        return Result.succeed(null);
    }
    /**
     * 修改资金密码 用验证码
     */
trading-order-service/src/main/java/com/yami/trading/service/dz/impl/StockDzServiceImpl.java
@@ -275,7 +275,7 @@
            BigDecimal orderFree = buyAmt.multiply(BigDecimal.valueOf(feeRate));
            BigDecimal orderAmt = buyAmt.add(orderFree);
            if (wallet.getMoney().compareTo(orderAmt) < 0) {
                throw new YamiShopBindException("订单失败,资金不足");
                return Result.failed("余额不足");
            }
            BigDecimal amountBefore = wallet.getMoney();
@@ -324,7 +324,7 @@
            return Result.succeed("购买成功");
        } catch (Exception e) {
            log.error(e.getMessage());
            return Result.failed("操作失败:" + e.getMessage());
            return Result.failed("失败");
        }
    }
@@ -496,7 +496,7 @@
            //结算金额
            double closeAmt = closePrice * num - orderFree.doubleValue();
            if (closeAmt < 0) {
                throw new YamiShopBindException("手续费资金不足");
                return Result.failed("余额不足");
            }
            //拆分订单
@@ -544,7 +544,7 @@
            return Result.succeed("平仓成功");
        } catch (Exception e) {
            log.error(e.getMessage());
            return Result.failed(e.getMessage());
            return Result.failed("失败");
        }
    }