| | |
| | | package project.project.web.api; |
| | | package project.web.api; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | |
| | | String stop_price_loss = request.getParameter("stop_price_loss"); |
| | | String price_type = request.getParameter("price_type"); |
| | | |
| | | |
| | | ResultObject resultObject = new ResultObject(); |
| | | resultObject = this.readSecurityContextFromSession(resultObject); |
| | | if (!"0".equals(resultObject.getCode())) { |
| | |
| | | throw new BusinessException("请稍后再试"); |
| | | } |
| | | List<Map<String, Object>> list = this.contractOrderService.findSubmittedRedis(partyId, symbol); |
| | | if(ObjectUtils.isNotEmpty(list)) { |
| | | for(Map<String, Object> map :list) { |
| | | if(!direction.equals(map.get("direction"))) { |
| | | throw new BusinessException("同一币种不允许多空双开"); |
| | | } |
| | | } |
| | | } |
| | | // if(ObjectUtils.isNotEmpty(list)) { |
| | | // for(Map<String, Object> map :list) { |
| | | // if(!direction.equals(map.get("direction"))) { |
| | | // throw new BusinessException("同一币种不允许多空双开"); |
| | | // } |
| | | // } |
| | | // } |
| | | if (StringUtils.isNullOrEmpty(lever_rate)) { |
| | | lever_rate = "1"; |
| | | } |
| | |
| | | throw new BusinessException(error); |
| | | } |
| | | |
| | | double amount_double = Double.valueOf(request.getParameter("amount")).doubleValue(); |
| | | // double amount_double = Double.valueOf(request.getParameter("amount")).doubleValue(); |
| | | //只有航天这一套需要这样子,部署其他的时候吧这个注释 |
| | | double amount_double = Double.valueOf(amount) / Double.valueOf(lever_rate); |
| | | double lever_rate_double = Double.valueOf(lever_rate).doubleValue(); |
| | | double price_double = Double.valueOf(request.getParameter("price")).doubleValue(); |
| | | double stop_price_profit_double = Double.valueOf(stop_price_profit).doubleValue(); |
| | |
| | | // if (amount_double > contract_open_limit_max) { |
| | | // throw new BusinessException("开仓金额不得大于开仓最大限额"); |
| | | // } |
| | | |
| | | int amountInt = (int) amount_double; |
| | | amount_double = amountInt; |
| | | ContractApplyOrder order = new ContractApplyOrder(); |
| | | order.setPartyId(partyId); |
| | | order.setSymbol(symbol); |