| | |
| | | order.setOrderPriceType(openAction.getPrice_type()); |
| | | order.setState(ContractApplyOrder.STATE_SUBMITTED); |
| | | order.setMoney(openAction.getAmount()); |
| | | //order.setLocationType(openAction.getLocationType()); |
| | | order.setLocationType(0); |
| | | order.setLocationType(openAction.getLocationType()); |
| | | contractApplyOrderService.saveCreate(order); |
| | | } |
| | | |
| | |
| | | public Result<String> addDepositOpen(@RequestParam @NotBlank String orderNo, @RequestParam @NotBlank BigDecimal addDepositOpen) { |
| | | try { |
| | | ContractOrder order = this.contractOrderService.findByOrderNo(orderNo); |
| | | if (order != null && order.getState().equals(ContractOrder.STATE_SUBMITTED)) { |
| | | if (order != null && order.getState().equals(ContractOrder.STATE_SUBMITTED) && order.getLocationType() == 0) { |
| | | contractOrderService.addDepositOpen(order, addDepositOpen); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | |
| | | Wallet wallet = walletService.findByUserId(order.getPartyId()); |
| | | if (wallet.getMoney().add(profit).compareTo(BigDecimal.ZERO) < 0) { |
| | | // 如果结果是负数,就归零 |
| | | /*// 如果结果是负数,就归零 |
| | | if (wallet.getMoney().compareTo(BigDecimal.ZERO) < 0) { |
| | | profit = BigDecimal.ZERO; |
| | | } |
| | | }*/ |
| | | profit = wallet.getMoney().negate(); |
| | | } |
| | | |
| | | walletService.updateMoney(order.getSymbol(), partyId, profit, BigDecimal.ZERO, |