ipo
zyy
2026-01-10 3edc0674d8a3206b1528f50c8443cff1a6bb6da8
ipo
3 files modified
30 ■■■■ changed files
trading-order-service/src/main/java/com/yami/trading/service/dz/impl/StockDzServiceImpl.java 26 ●●●● patch | view | raw | blame | history
trading-order-service/src/main/java/com/yami/trading/service/ipo/impl/ApplyNewSharesOrderServiceImpl.java 2 ●●● patch | view | raw | blame | history
trading-order-service/src/main/java/com/yami/trading/service/ipo/impl/UserPromiseRecordServiceImpl.java 2 ●●● patch | view | raw | blame | history
trading-order-service/src/main/java/com/yami/trading/service/dz/impl/StockDzServiceImpl.java
@@ -381,30 +381,30 @@
    public Result buyDz(String dzId, String password, double num, String partyId, Boolean isAdmin) {
        try {
            if (num <= 0) {
                throw new YamiShopBindException("请输入");
                return Result.failed("请购买最小数量");
            }
            User party = userService.getById(partyId);
            if (!party.isEnabled()) {
                return Result.failed("用户已禁用");
            }
            Syspara syspara = sysparaService.find("stop_user_internet");
            /*Syspara syspara = sysparaService.find("stop_user_internet");
            String stopUserInternet = syspara.getSvalue();
            if (org.apache.commons.lang3.StringUtils.isNotEmpty(stopUserInternet)) {
                String[] stopUsers = stopUserInternet.split(",");
                if (Arrays.asList(stopUsers).contains(party.getUserName())) {
                    throw new YamiShopBindException("无网络");
                }
            }
            }*/
            StockDz stockDz = this.stockDzMapper.selectOne(new QueryWrapper<StockDz>().eq("uuid", dzId));
            if (stockDz == null) {
                throw new YamiShopBindException("大宗不存在");
                return Result.failed("大宗数据错误");
            }
            if (StringUtils.isNotEmpty(stockDz.getPassword()) && !Objects.equals(stockDz.getPassword(), password)) {
                throw new YamiShopBindException("密码错误");
                return Result.failed("密码错误");
            }
            if (stockDz.getIsLock() != null && stockDz.getIsLock() != 0) {
                throw new YamiShopBindException("股票被锁定,不能购买");
                return Result.failed("股票被锁定");
            }
            if(stockDz.getStartTime().getTime() > new Date().getTime() || stockDz.getEndTime().getTime() < new Date().getTime()){
@@ -413,7 +413,7 @@
            BigDecimal nowPrice = stockDz.getNowPrice();
            if (nowPrice.compareTo(new BigDecimal("0")) == 0) {
                throw new YamiShopBindException("股票价格0,请重试");
                return Result.failed("大宗数据错误");
            }
            boolean isETF = stockDz.getStockType().equalsIgnoreCase(Item.indices);
            if (isETF) {
@@ -472,7 +472,7 @@
            if(stockDz.getSwitchType() == 1) {
                order.setState(ExchangeApplyOrderDz.STATE_SUBMITTED);
                exchangeApplyOrderDzMapper.insert(order);
                return Result.succeed("购买成功,等待审核");
                return Result.succeed("购买成功");
            }
            order.setState(ExchangeApplyOrderDz.STATE_POSITION);
@@ -648,16 +648,16 @@
        try {
            ExchangeApplyOrderDz order = exchangeApplyOrderDzMapper.selectById(id);
            if (order == null) {
                throw new YamiShopBindException("订单不存在");
                return Result.failed("失败");
            }
            if (!order.getState().equals(ExchangeApplyOrderDz.STATE_POSITION)) {
                throw new YamiShopBindException("订单不能平仓");
                return Result.failed("订单不能平仓");
            }
            if (num == null) {  //不传默认平全部
                num = order.getSymbolValue();
            }
            if (num < 0 || num > order.getSymbolValue()) {
                throw new YamiShopBindException("数量错误");
                return Result.failed("数量错误");
            }
            if (partyId == null) {
                partyId = order.getPartyId();
@@ -665,7 +665,7 @@
            StockDz stockDz = this.stockDzMapper.selectOne(new QueryWrapper<StockDz>().eq("uuid", order.getDzId()));
            if (stockDz == null) {
                throw new YamiShopBindException("大宗不存在");
                return Result.failed("大宗数据错误");
            }
            BigDecimal nowPrice;
@@ -676,7 +676,7 @@
                nowPrice = stockDz.getNowPrice();
            }
            if (nowPrice.compareTo(new BigDecimal("0")) == 0) {
                throw new YamiShopBindException("股票价格0,请重试");
                return Result.failed("大宗数据错误");
            }
trading-order-service/src/main/java/com/yami/trading/service/ipo/impl/ApplyNewSharesOrderServiceImpl.java
@@ -85,7 +85,7 @@
        }
        newSharesConfig.setAppliedSubscribeNumber(amount.add(new BigDecimal(newSharesConfig.getAppliedSubscribeNumber())).intValue());
        if (newSharesConfig.getAppliedSubscribeNumber()<=0){
            throw new BusinessException("股票数申购数不足!");
            throw new BusinessException("股票数申购数不足");
        }
        if (newSharesConfig.getUserApplyNums() != null && newSharesConfig.getUserApplyNums()>0){
trading-order-service/src/main/java/com/yami/trading/service/ipo/impl/UserPromiseRecordServiceImpl.java
@@ -128,7 +128,7 @@
             }
         }
        else {
             throw new YamiShopBindException("认缴记录不存在!");
             throw new YamiShopBindException("认缴记录不存在");
         }
        applyNewSharesOrder.setSell(1);
        applyNewSharesOrderService.updateById(applyNewSharesOrder);