1
zj
2025-05-07 ad35d23bdd072d7179eb4bfcb588975f37a68f53
src/main/java/com/nq/service/impl/UserPendingorderServiceImpl.java
@@ -134,6 +134,8 @@
                userPendingorder.setStopTargetPrice(stopTarget);
            }
            userPendingorder.setPositionType(1);
            userPendingorder.setHangingOrderType(1);
            userPendingorder.setStockType(stock.getStockType());
            userPendingorder.setPositionSn(KeyUtils.getUniqueKey());
            userPendingorder.setUserId(user.getId());
            userPendingorder.setNickName(user.getRealName());
@@ -164,6 +166,7 @@
            userPendingorder.setOrderStayDays(Integer.valueOf(0));
            userPendingorder.setOrderStayFee(BigDecimal.ZERO);
            userPendingorderMapper.insert(userPendingorder);
            iUserAssetsServices.availablebalanceChange(stock.getStockType(), user.getId(), EUserAssets.BUY, buyAmt.negate(), "", "");
            return ServerResponse.createBySuccessMsg("挂单成功", request);
        }
    }
@@ -186,7 +189,7 @@
            BigDecimal price = new BigDecimal(targetPrice);
            UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId("USDT", user.getId());
            UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId("USD", user.getId());
            if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){
                return ServerResponse.createByErrorMsg("挂单失败,请先缴清待补资金", request);
@@ -206,6 +209,8 @@
            }
            UserPendingorder userPendingorder = new UserPendingorder();
            userPendingorder.setPositionType(1);
            userPendingorder.setHangingOrderType(1);
            userPendingorder.setStockType("HJYY");
            userPendingorder.setPositionSn(KeyUtils.getUniqueKey());
            userPendingorder.setUserId(user.getId());
            userPendingorder.setNickName(user.getRealName());
@@ -232,7 +237,7 @@
            userPendingorder.setOrderStayDays(Integer.valueOf(0));
            userPendingorder.setOrderStayFee(BigDecimal.ZERO);
            userPendingorderMapper.insert(userPendingorder);
            iUserAssetsServices.availablebalanceChange("USDT", user.getId(), EUserAssets.BUY, buyAmt.negate(), "", "");
            iUserAssetsServices.availablebalanceChange("USD", user.getId(), EUserAssets.BUY, buyAmt.negate(), "", "");
            return ServerResponse.createBySuccessMsg("下单成功", request);
        }
    }