新版仿ok交易所-后端
zyy
2025-09-02 786a26049ccb950bbfc6d0b74c3d2590afd017f5
trading-order-service/src/main/java/com/yami/trading/service/ico/IcoService.java
@@ -53,7 +53,6 @@
     * 新币申购
     */
    public Result<String> subscribe(UserSubscription model) {
        try {
            if (model == null || model.getIcoProjectId() == null) {
                throw new YamiShopBindException("参数异常");
            }
@@ -65,13 +64,10 @@
            User party = userService.getById(partyId);
            if (!party.isEnabled()) {
                return Result.succeed("User is locked");
            throw new YamiShopBindException("User is locked");
            }
            if (Constants.SECURITY_ROLE_TEST.equals(party.getRoleName())) {
                throw new YamiShopBindException("无权限");
            }
            if (!C2cLock.add(partyId)) {
                throw new YamiShopBindException("Please try again later");
            }
            if (model.getSubscribeNums() == null || model.getSubscribeNums() == 0) {
@@ -122,9 +118,6 @@
            }
            userSubscriptionService.save(model);
            return Result.ok("申请成功" );
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
@@ -146,7 +139,7 @@
            if(userSubscription.getStatus() == 3){
                throw new YamiShopBindException("不能更改申购状态");
            }
            Ico ico = this.getById(model.getIcoProjectId());
            Ico ico = this.getById(userSubscription.getIcoProjectId());
            String userId = userSubscription.getUserId();
            if (model.getStatus() == 3 || model.getStatus() == 5) {
                if(model.getBallotNumber() == null || model.getBallotNumber() == 0){
@@ -216,7 +209,7 @@
                WalletExtend walletExtend = walletService.saveExtendByPara(userId, ico.getSymbol());
                walletService.updateExtend(userId, walletExtend.getWallettype(), model.getBallotNumber());
            }
            userSubscriptionService.save(userSubscription);
            userSubscriptionService.saveOrUpdate(userSubscription);
            return Result.ok ( "操作成功" );
        } catch (Exception e) {
            throw new RuntimeException(e);
@@ -242,7 +235,7 @@
        item.setShowStatus("1");
        item.setTradeStatus("1");
        item.setQuoteCurrency(ico.getCurrency());
        item.setCurrencyType(0);
        item.setCurrencyType(1);  //新币
        item.setStatus(0);
        item.setTradeType(ico.getIsContractTrading().toString());
        return item;