| | |
| | | import com.yami.trading.bean.exchange.ExchangeApplyOrder; |
| | | import com.yami.trading.bean.exchange.dto.ExchangeSymbolDto; |
| | | import com.yami.trading.bean.exchange.dto.SumEtfDto; |
| | | import com.yami.trading.bean.item.domain.Item; |
| | | import com.yami.trading.bean.model.*; |
| | | import com.yami.trading.bean.purchasing.dto.ExchangeLock; |
| | | import com.yami.trading.bean.syspara.domain.Syspara; |
| | | import com.yami.trading.common.domain.Result; |
| | | import com.yami.trading.common.exception.YamiShopBindException; |
| | | import com.yami.trading.common.util.Arith; |
| | | import com.yami.trading.common.util.DateUtils; |
| | | import com.yami.trading.common.util.StringUtils; |
| | | import com.yami.trading.common.util.ThreadUtils; |
| | | import com.yami.trading.common.util.*; |
| | | import com.yami.trading.security.common.util.SecurityUtils; |
| | | import com.yami.trading.service.CapitaltWalletService; |
| | | import com.yami.trading.service.RealNameAuthRecordService; |
| | |
| | | public Result openview() { |
| | | Map<String, Object> data = new HashMap<String, Object>(); |
| | | String partyId = SecurityUtils.getUser().getUserId(); |
| | | // Wallet wallet = walletService.saveWalletByPartyId(partyId); |
| | | CapitaltWallet userIdWallet = capitaltWalletService.getUserIdWallet(partyId); |
| | | Wallet wallet = walletService.saveWalletByPartyId(partyId); |
| | | // CapitaltWallet userIdWallet = capitaltWalletService.getUserIdWallet(partyId); |
| | | // 账户剩余资金 |
| | | DecimalFormat df = new DecimalFormat("#.##"); |
| | | df.setRoundingMode(RoundingMode.FLOOR);// 向下取整 |
| | | data.put("volume", df.format(userIdWallet.getMoney())); |
| | | data.put("volume", df.format(wallet.getMoney())); |
| | | String session_token = sessionTokenService.savePut(partyId); |
| | | data.put("session_token", session_token); |
| | | data.put("fee", sysparaService.find("exchange_apply_order_buy_fee").getSvalue()); |
| | |
| | | String volume = request.getParameter("volume"); |
| | | String session_token = request.getParameter("session_token"); |
| | | String symbol = request.getParameter("symbol"); |
| | | // Item bySymbol = itemService.findBySymbol(symbol); |
| | | // if(bySymbol == null){ |
| | | // throw new YamiShopBindException("当前币对不存在"); |
| | | // } |
| | | // boolean isOpen = MarketOpenChecker.isMarketOpenByItemCloseType(bySymbol.getOpenCloseType()); |
| | | // if(!isOpen){ |
| | | // throw new YamiShopBindException("当前已经休市"); |
| | | // } |
| | | Item bySymbol = itemService.findBySymbol(symbol); |
| | | if(bySymbol == null){ |
| | | throw new YamiShopBindException("当前币对不存在"); |
| | | } |
| | | boolean isOpen = MarketOpenChecker.isMarketOpenByItemCloseType(bySymbol.getOpenCloseType()); |
| | | if(!isOpen){ |
| | | throw new YamiShopBindException("当前已经休市"); |
| | | } |
| | | // limit order的交易价格 |
| | | String price = request.getParameter("price"); |
| | | // 计划委托 是之前火币那边拷贝学过来的一个功能 只是只有一个盘在用,暂时注释不用 |