| | |
| | | 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) |
| | |
| | | BigDecimal currentValue = AdjustmentValueCache.getCurrentValue().get(symbol); |
| | | if (currentValue != null) { |
| | | data.forEach(kline -> { |
| | | /*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); |
| | | } |
| | | }); |
| | | } |
| | | return Result.succeed(this.build(data, line, symbol)); |
| | |
| | | return 0; |
| | | } |
| | | |
| | | @TableField(exist = false) |
| | | private boolean adjusted = false; //新增标记 |
| | | |
| | | @Override |
| | | public Object clone() throws CloneNotSupportedException { |
| | | return super.clone(); |
| | |
| | | @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; |
| | |
| | | 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)); |