| | |
| | | if (stopProfitPrice != null) { |
| | | if (newPrice.compareTo(openPrice) > 0) { |
| | | if (stopProfitPrice.compareTo(openPrice) > 0) { |
| | | return Result.fail("止损价必须低于开仓价"); |
| | | return Result.fail("止盈价必须低于开仓价"); |
| | | } |
| | | } else { |
| | | if (stopProfitPrice.compareTo(newPrice) > 0) { |
| | | return Result.fail("止损价必须低于当前价"); |
| | | return Result.fail("止盈价必须低于当前价"); |
| | | } |
| | | } |
| | | } |
| | |
| | | producer.sendPriceOperate(JSONObject.toJSONString(model)); |
| | | return Result.ok("设置成功"); |
| | | } |
| | | |
| | | return Result.fail("设置失败"); |
| | | } |
| | | |
| | |
| | | public Result findOrderList(OrderListDto orderListDto) { |
| | | MemberEntity memberEntity = LoginUserUtils.getAppLoginUser(); |
| | | Page<ContractOrderEntity> page = new Page<>(orderListDto.getPageNum(), orderListDto.getPageSize()); |
| | | IPage<ContractOrderEntity> list = contractOrderDao.selectContractOrderInPage(page, memberEntity.getId()); |
| | | ContractOrderEntity contractOrderEntity = new ContractOrderEntity(); |
| | | contractOrderEntity.setMemberId(memberEntity.getId()); |
| | | contractOrderEntity.setSymbol(orderListDto.getSymbol()); |
| | | IPage<ContractOrderEntity> list = contractOrderDao.selectContractOrderInPage(page, contractOrderEntity); |
| | | Page<OrderListVo> result = ContractOrderEntityMapper.INSTANCE.pageEntityToPageVo(list); |
| | | return Result.ok(result); |
| | | } |