1
zj
2024-07-10 c0750bad4e7ab9acdef951d50f67cb488639b4de
src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
@@ -1201,8 +1201,10 @@
            userPosition.setStockCode(stock.getStockCode());
            userPosition.setStockSpell(stock.getStockSpell());
            userPosition.setStockName(userStockSubscribe.getNewName());
            userPosition.setStockGid(stockSubscribe.getStockType() + userStockSubscribe.getNewCode());
            StringBuffer gid = new StringBuffer();
            gid.append(stockSubscribe.getStockType()!=null?stockSubscribe.getStockType():"");
            gid.append(userStockSubscribe.getNewCode()!=null?userStockSubscribe.getNewCode():"stock code invaild");
            userPosition.setStockGid(gid.toString());
            userPosition.setBuyOrderId(GeneratePosition.getPositionId());
            userPosition.setBuyOrderTime(new Date());
            userPosition.setBuyOrderPrice(userStockSubscribe.getBuyPrice());
@@ -1258,6 +1260,7 @@
                return ServerResponse.createByErrorMsg("新股转持仓失败");
            }
            userAssets.setFreezeMoney(userAssets.getFreezeMoney().add(userPosition.getOrderTotalPrice()));
            userAssets.setFreezeMoney(userAssets.getFreezeMoney()!=null?userAssets.getFreezeMoney().setScale(2,BigDecimal.ROUND_UP):null);
            userAssetsMapper.updateById(userAssets);
            if (ret > 0) {
                userStockSubscribe.setStatus(5);
@@ -1618,7 +1621,7 @@
        userPosition.setOrderSpread(BigDecimal.ZERO);
        userPositionMapper.insert(userPosition);
        userAssetsServices.availablebalanceChange(EStockType.IN.getCode(), user.getId(), EUserAssets.BUY, buyAmt.negate(),"","");
        userAssetsServices.availablebalanceChange(EStockType.JP.getCode(), user.getId(), EUserAssets.BUY, buyAmt.negate(),"","");
        return ServerResponse.createBySuccess("购买成功", request);
    }