| | |
| | | }) |
| | | @GetMapping(value = "/findHoldOrderList") |
| | | public Result findHoldOrderList(@ApiParam(name = "symbol", value = "币种", example = "BTC/USDT") @RequestParam(value = "symbol", required = false) String symbol) { |
| | | return contractHoldOrderService.findHoldOrderList(symbol); |
| | | return contractHoldOrderService.findHoldOrderList(symbol, 1); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询当前持仓跟单订单列表 -- 轮询") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 0, message = "success", response = HoldOrderListVo.class) |
| | | }) |
| | | @GetMapping(value = "/findHoldFollowOrderList") |
| | | public Result findHoldFollowOrderList(@ApiParam(name = "symbol", value = "币种", example = "BTC/USDT") @RequestParam(value = "symbol", required = false) String symbol) { |
| | | return contractHoldOrderService.findHoldOrderList(symbol, 2); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据Id查询持仓订单详情") |
| | |
| | | |
| | | public List<ContractHoldOrderEntity> selectHoldOrderListByMemberId(@Param("memberId") Long memberId); |
| | | |
| | | public List<ContractHoldOrderEntity> selectHoldOrderListByMemberIdAndSymbol(@Param("memberId") Long memberId, @Param("symbol") String symbol); |
| | | public List<ContractHoldOrderEntity> selectHoldOrderListByMemberIdAndSymbol(@Param("memberId") Long memberId, @Param("symbol") String symbol, @Param("type") Integer type); |
| | | |
| | | public ContractHoldOrderEntity selectHoldOrderByMemberIdAndId(@Param("memberId") Long memberId, @Param("id") Long id); |
| | | |
| | |
| | | |
| | | public void updateOrderIsCanClosingAndBatchNoById(Long id); |
| | | |
| | | public Result findHoldOrderList(String symbol); |
| | | public Result findHoldOrderList(String symbol, int type); |
| | | |
| | | public Result cancelHoldOrder(Long id); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Result findHoldOrderList(String symbol) { |
| | | public Result findHoldOrderList(String symbol, int type) { |
| | | MemberEntity memberEntity = LoginUserUtils.getAppLoginUser(); |
| | | |
| | | List<ContractHoldOrderEntity> list = contractHoldOrderDao.selectHoldOrderListByMemberIdAndSymbol(memberEntity.getId(), symbol); |
| | | List<ContractHoldOrderEntity> list = contractHoldOrderDao.selectHoldOrderListByMemberIdAndSymbol(memberEntity.getId(), symbol, type); |
| | | MemberWalletContractEntity walletContractEntity = memberWalletContractDao.findWalletContractByMemberIdAndSymbol(memberEntity.getId(), CoinTypeEnum.USDT.name()); |
| | | if (CollUtil.isNotEmpty(list)) { |
| | | BigDecimal totalProfitOrLoss = BigDecimal.ZERO; |
| | |
| | | @Override |
| | | public Result cancelHoldOrderBatch(SymbolDto symbolDto) { |
| | | MemberEntity memberEntity = LoginUserUtils.getAppLoginUser(); |
| | | List<ContractHoldOrderEntity> holdOrderEntities = contractHoldOrderDao.selectHoldOrderListByMemberIdAndSymbol(memberEntity.getId(), symbolDto.getSymbol()); |
| | | List<ContractHoldOrderEntity> holdOrderEntities = contractHoldOrderDao.selectHoldOrderListByMemberIdAndSymbol(memberEntity.getId(), symbolDto.getSymbol(), 1); |
| | | if (CollUtil.isEmpty(holdOrderEntities)) { |
| | | return Result.fail("订单不存在"); |
| | | } |
| | |
| | | <if test="symbol!=null and symbol!=''"> |
| | | and symbol=#{symbol} |
| | | </if> |
| | | <if test="type!=null and type!=0"> |
| | | and contract_type=#{type} |
| | | </if> |
| | | and is_can_closing=1 |
| | | order by create_time desc |
| | | </select> |