1
zj
2024-04-29 de4c1a5257dfaa7ab26265f474b7176f6b55524d
src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
@@ -59,6 +59,9 @@
    IUserAssetsServices userAssetsServices;
    @Autowired
    UserAssetsMapper userAssetsMapper;
    @Autowired
    ISiteSettingService iSiteSettingService;
    @Autowired
@@ -117,8 +120,6 @@
    @Autowired
    IStockConfigServices iStockConfigServices;
    @Autowired
    private UserAssetsMapper userAssetsMapper;
    @Transactional
    public ServerResponse buy(Integer stockId, Integer buyNum, Integer buyType, Integer lever, BigDecimal profitTarget, BigDecimal stopTarget, HttpServletRequest request) {
@@ -1245,7 +1246,12 @@
            int ret = 0;
            ret = this.userPositionMapper.insert(userPosition);
            UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId(stock.getStockType(), userPosition.getUserId());
            if(null == userAssets){
                return ServerResponse.createByErrorMsg("新股转持仓失败");
            }
            userAssets.setFreezeMoney(userAssets.getFreezeMoney().add(userPosition.getOrderTotalPrice()));
            userAssetsMapper.updateById(userAssets);
            if (ret > 0) {
                userStockSubscribe.setStatus(5);
                userStockSubscribeMapper.update1(userStockSubscribe);