新版仿ok交易所-后端
zyy
2025-09-22 ece214d072e36875a78f7a2598495d2e2c1db021
9.17优化
4 files modified
50 ■■■■■ changed files
trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiWithdrawController.java 26 ●●●● patch | view | raw | blame | history
trading-order-admin/src/main/java/com/yami/trading/api/controller/KlineController.java 15 ●●●●● patch | view | raw | blame | history
trading-order-bean/src/main/java/com/yami/trading/bean/data/domain/Kline.java 3 ●●●●● patch | view | raw | blame | history
trading-order-service/src/main/java/com/yami/trading/service/item/ItemService.java 6 ●●●● patch | view | raw | blame | history
trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiWithdrawController.java
@@ -106,19 +106,19 @@
                throw new YamiShopBindException("系统参数错误");
            }
//        if ("true".equals(exchange_withdraw_need_safeword)) {
//
//            if (StringUtils.isEmptyString(safeword)) {
//                throw new YamiShopBindException("资金密码不能为空");
//            }
//
//            if (safeword.length() < 6 || safeword.length() > 12) {
//                throw new YamiShopBindException("资金密码必须6-12位");
//            }
//            if (!userService.checkLoginSafeword(SecurityUtils.getUser().getUserId(),safeword)){
//                throw new YamiShopBindException("资金密码错误");
//            }
//        }
        if ("true".equals(exchange_withdraw_need_safeword)) {
            if (StringUtils.isEmptyString(safeword)) {
                throw new YamiShopBindException("资金密码不能为空");
            }
            if (safeword.length() < 6 || safeword.length() > 12) {
                throw new YamiShopBindException("资金密码必须6-12位");
            }
            if (!userService.checkLoginSafeword(SecurityUtils.getUser().getUserId(),safeword)){
                throw new YamiShopBindException("资金密码错误");
            }
        }
            // 获取资金账户(capital)
            CapitaltWallet capitaltWallet = capitaltWalletService.getOne(new LambdaQueryWrapper<>(CapitaltWallet.class)
trading-order-admin/src/main/java/com/yami/trading/api/controller/KlineController.java
@@ -100,12 +100,17 @@
            BigDecimal currentValue = AdjustmentValueCache.getCurrentValue().get(symbol);
            if (currentValue != null) {
                data.forEach(kline -> {
                    if (kline.getClose().compareTo(kline.getLow()) >= 0 && kline.getClose().compareTo(kline.getHigh()) <= 0) {
                        kline.setClose(kline.getClose().add(currentValue));
                    /*logger.info("==currentValue==close:{}, low:{}, high:{}, open:{}, currentValue:{}",
                            kline.getClose(), kline.getLow(), kline.getHigh(), kline.getOpen(), currentValue);*/
                    if (!kline.isAdjusted()){
                        if (kline.getClose().compareTo(kline.getLow()) >= 0 && kline.getClose().compareTo(kline.getHigh()) <= 0) {
                            kline.setClose(kline.getClose().add(currentValue));
                        }
                        kline.setOpen(kline.getOpen().add(currentValue));
                        kline.setLow(kline.getLow().add(currentValue));
                        kline.setHigh(kline.getHigh().add(currentValue));
                        kline.setAdjusted(true);
                    }
                    kline.setOpen(kline.getOpen().add(currentValue));
                    kline.setLow(kline.getLow().add(currentValue));
                    kline.setHigh(kline.getHigh().add(currentValue));
                });
            }
            return Result.succeed(this.build(data, line, symbol));
trading-order-bean/src/main/java/com/yami/trading/bean/data/domain/Kline.java
@@ -86,6 +86,9 @@
        return 0;
    }
    @TableField(exist = false)
    private boolean adjusted = false; //新增标记
    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
trading-order-service/src/main/java/com/yami/trading/service/item/ItemService.java
@@ -43,8 +43,8 @@
@Transactional
@Slf4j
public class ItemService extends ServiceImpl<ItemMapper, Item> {
    public static final String ITEM_CACHE = "mdItemCache";
    public static final String ALL = "mdAll";
    public static final String ITEM_CACHE = "itemCache";
    public static final String ALL = "all";
    @Autowired
    private ItemLeverageService itemLeverageService;
@@ -167,7 +167,7 @@
        return baseMapper.findList(page, queryWrapper);
    }
    @Cached(name = ITEM_CACHE, key = "'itemAll'", expire = 3600)
    @Cached(name = ITEM_CACHE, key = "'all'", expire = 3600)
    @Override
    public List<Item> list() {
        List<Item> list = super.list(new LambdaQueryWrapper<>(Item.class).eq(Item::getType,Item.cryptos));