| | |
| | | stockDz.setStockCode(item.getSymbol()); |
| | | stockDz.setStockType(item.getType()); |
| | | stockDz.setStockSpell(item.getSymbolData()); |
| | | stockDz.setIsLock(1); |
| | | stockDz.setIsLock(0); |
| | | stockDz.setIsShow(1); |
| | | stockDz.setAddTime(new Date()); |
| | | stockDz.setStockNum(Integer.valueOf(stockNum)); |
| | |
| | | throw new YamiShopBindException("股票价格0,请重试"); |
| | | } |
| | | if (stockDz.getStockNum() > num) { |
| | | throw new YamiShopBindException("最小购买数据" + stockDz.getStockNum()); |
| | | throw new YamiShopBindException("最小购买数量" + stockDz.getStockNum()); |
| | | } |
| | | |
| | | Wallet wallet = this.walletService.saveWalletByPartyId(partyId); |
| | |
| | | order.setPartyId(partyId); |
| | | order.setSymbol(stockDz.getStockCode()); |
| | | order.setSymbolValue(num); |
| | | order.setDzId(stockDz.getUuid()); |
| | | order.setVolume(buyAmt.doubleValue()); |
| | | order.setPrice(nowPrice.doubleValue()); |
| | | order.setOrderNo(com.yami.trading.common.util.DateUtil.getToday("yyMMddHHmmss") + RandomUtil.getRandomNum(8)); |
| | |
| | | return Result.succeed("购买成功"); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | | return Result.failed("操作失败:" + e.getMessage()); |
| | | } |
| | | return Result.failed("操作失败"); |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public Result dzCheck(String id, Integer checkType, double orderNum) { |
| | | public Result dzCheck(String id, Integer checkType, Double orderNum) { |
| | | try { |
| | | ExchangeApplyOrderDz order = exchangeApplyOrderDzMapper.selectById(id); |
| | | if (order == null) { |
| | |
| | | if (checkType == 2) { |
| | | order.setState(ExchangeApplyOrderDz.STATE_FAILED); |
| | | exchangeApplyOrderDzMapper.updateById(order); |
| | | throw new YamiShopBindException("审核成功"); |
| | | return Result.succeed("操作成功"); |
| | | } |
| | | if (orderNum > order.getSymbolValue()) { |
| | | throw new YamiShopBindException("输入数量大于用户买入数量"); |
| | | } |
| | | |
| | | StockDz stockDz = this.stockDzMapper.selectOne(new QueryWrapper<StockDz>().eq("id", order.getDzId())); |
| | | StockDz stockDz = this.stockDzMapper.selectOne(new QueryWrapper<StockDz>().eq("uuid", order.getDzId())); |
| | | if (stockDz == null) { |
| | | throw new YamiShopBindException("大宗不存在"); |
| | | } |
| | |
| | | return Result.succeed("审核成功,订单已转客户持仓"); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | | return Result.failed("操作失败:" + e.getMessage()); |
| | | } |
| | | return Result.failed("操作失败"); |
| | | } |
| | | |
| | | |