| | |
| | | + "orders.DIRECTION direction,orders.UNIT_AMOUNT unit_amount," |
| | | + "orders.STATE state,orders.FEE fee,orders.PROFIT profit,orders.CREATE_TIME createTime," |
| | | + "orders.DEPOSIT deposit,orders.DEPOSIT_OPEN deposit_open,orders.CLOSE_TIME closeTime," |
| | | + "orders.VOLUME_OPEN volume_open,orders.VOLUME volume,item.NAME itemname,"); |
| | | + "orders.VOLUME_OPEN volume_open,orders.VOLUME volume,orders.LEVER_RATE as lever_rate,item.NAME itemname,"); |
| | | queryString.append(" wallet.MONEY money, "); |
| | | queryString.append(" party.USERNAME username,party.USERCODE usercode,party.ROLENAME rolename "); |
| | | |
| | |
| | | |
| | | public Map<String, Object> bulidOne(ContractOrder order) { |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss a", Locale.ENGLISH); |
| | | simpleDateFormat.setTimeZone(TimeZone.getTimeZone("America/New_York")); |
| | | DecimalFormat df = new DecimalFormat("#.##"); |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | map.put("order_no", order.getOrder_no()); |
| | |
| | | |
| | | import java.math.RoundingMode; |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | import org.apache.commons.collections.CollectionUtils; |
| | |
| | | return data; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss a", Locale.ENGLISH); |
| | | System.out.println(simpleDateFormat.format(new Date())); |
| | | } |
| | | public Map<String, Object> bulidOne(FuturesOrder order) { |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss a", Locale.ENGLISH); |
| | | simpleDateFormat.setTimeZone(TimeZone.getTimeZone("America/New_York")); |
| | | FuturesOrder order_cache = (FuturesOrder) redisHandler.get(FuturesRedisKeys.FUTURES_SUBMITTED_ORDERNO + order.getOrder_no()); |
| | | if (order_cache != null) order = order_cache; |
| | | |
| | |
| | | map.put("order_no", order.getOrder_no()); |
| | | map.put("name", item.getName()); |
| | | map.put("symbol", order.getSymbol()); |
| | | map.put("open_time", DateUtils.format(order.getCreate_time(), DateUtils.DF_yyyyMMddHHmmss)); |
| | | map.put("open_time", simpleDateFormat.format(order.getCreate_time())); |
| | | if (order.getClose_time() != null) { |
| | | map.put("close_time", DateUtils.format(order.getClose_time(), "yyyy-MM-dd hh:mm:ss")); |
| | | } else { |
| | |
| | | } |
| | | |
| | | map.put("volume", order.getVolume()); |
| | | |
| | | map.put("settlement_time", DateUtils.format(order.getSettlement_time(), "yyyy-MM-dd hh:mm:ss"));// 交割时间 |
| | | map.put("settlement_time", simpleDateFormat.format(order.getSettlement_time()));// 交割时间 |
| | | map.put("close_price", df_symbol.format(order.getClose_avg_price())); |
| | | map.put("remain_time", StringUtils.isEmptyString(order.getRemain_time()) ? "0:0:0" : order.getRemain_time()); |
| | | map.put("time_num", order.getTimeNum()); |
| | |
| | | package project.project.web.admin; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.DecimalFormat; |
| | | import java.text.MessageFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | |
| | | String roleName = map.get("rolename").toString(); |
| | | map.put("roleNameDesc", Constants.ROLE_MAP.containsKey(roleName) ? Constants.ROLE_MAP.get(roleName) : roleName); |
| | | } |
| | | double currentPrice = Double.parseDouble(map.get("trade_avg_price").toString()); |
| | | |
| | | // 计算仓位总价 |
| | | double positionValue = Double.parseDouble(map.get("deposit_open").toString()) * Double.parseDouble(map.get("lever_rate").toString()); |
| | | |
| | | // 计算数量 |
| | | double quantity = positionValue / currentPrice; |
| | | |
| | | // 得到强平价格 |
| | | double liquidationPrice = currentPrice + (110 / quantity); |
| | | DecimalFormat df = new DecimalFormat("#.#####"); |
| | | String formattedPrice = df.format(liquidationPrice); |
| | | map.put("qiangPing",formattedPrice); |
| | | } |
| | | |
| | | List<Item> items = this.itemService.cacheGetAll(); |
| | |
| | | String roleName = map.get("rolename").toString(); |
| | | map.put("roleNameDesc", Constants.ROLE_MAP.containsKey(roleName) ? Constants.ROLE_MAP.get(roleName) : roleName); |
| | | } |
| | | double currentPrice = Double.parseDouble(map.get("trade_avg_price").toString()); |
| | | |
| | | // 计算仓位总价 |
| | | double positionValue = Double.parseDouble(map.get("deposit_open").toString()) * Double.parseDouble(map.get("lever_rate").toString()); |
| | | |
| | | // 计算数量 |
| | | double quantity = positionValue / currentPrice; |
| | | |
| | | // 得到强平价格 |
| | | double liquidationPrice = currentPrice + (110 / quantity); |
| | | DecimalFormat df = new DecimalFormat("#.#####"); |
| | | String formattedPrice = df.format(liquidationPrice); |
| | | map.put("qiangPing",formattedPrice); |
| | | } |
| | | |
| | | } catch (BusinessException e) { |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div>ORBITAL/USDT |
| | | |
| | | <div class="row"> |
| | | <div class="col-md-12"> |