From 30e592bd0975b41e0b4b4140c4b794c2e1e121de Mon Sep 17 00:00:00 2001
From: zyy <zyy@email.com>
Date: Mon, 09 Feb 2026 15:21:44 +0800
Subject: [PATCH] 平仓

---
 src/main/java/com/nq/service/impl/UserPositionServiceImpl.java |  258 ++++++++++++++++++++++++++++-----------------------
 1 files changed, 142 insertions(+), 116 deletions(-)

diff --git a/src/main/java/com/nq/service/impl/UserPositionServiceImpl.java b/src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
index 7265221..1f635c4 100644
--- a/src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
@@ -35,6 +35,7 @@
 
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.sql.Timestamp;
 import java.time.LocalDateTime;
 import java.time.ZoneId;
@@ -137,105 +138,107 @@
         SiteProduct siteProduct = iSiteProductService.getProductSetting();
 
         User user = this.iUserService.getCurrentRefreshUser(request);
-        if (siteProduct.getRealNameDisplay() && user.getIsActive() != 2) {
-            return ServerResponse.createByErrorMsg("订单失败,请先实名认证", request);
-        }
-        // 手续费率
-        BigDecimal siteSettingBuyFee = new BigDecimal(iStockConfigServices.queryByKey(EConfigKey.BUY_HANDLING_CHARGE.getCode()).getCValue()) ;
+        synchronized (user.getId()){
+            if (siteProduct.getRealNameDisplay() && user.getIsActive() != 2) {
+                return ServerResponse.createByErrorMsg("订单失败,请先实名认证", request);
+            }
+            // 手续费率
+            BigDecimal siteSettingBuyFee = new BigDecimal(iStockConfigServices.queryByKey(EConfigKey.BUY_HANDLING_CHARGE.getCode()).getCValue()) ;
 
-        if (siteProduct.getRealNameDisplay() && user.getIsLock().intValue() == 1) {
-            return ServerResponse.createByErrorMsg("订单失败,帐户已被锁定", request);
-        }
+            if (siteProduct.getRealNameDisplay() && user.getIsLock().intValue() == 1) {
+                return ServerResponse.createByErrorMsg("订单失败,帐户已被锁定", request);
+            }
 
-        Stock stock = stockMapper.selectByPrimaryKey(stockId);
-        if (stock == null) {
-            return ServerResponse.createByErrorMsg("订单失败,股票代码不存在", request);
-        }
-        //判断股票是否在可交易时间段
-        Boolean b = tradingHourService.timeCheck(stock.getStockCode());
-        if (!b) {
-            return ServerResponse.createByErrorMsg("订单失败,不在交易时间之内", request);
-        }
+            Stock stock = stockMapper.selectByPrimaryKey(stockId);
+            if (stock == null) {
+                return ServerResponse.createByErrorMsg("订单失败,股票代码不存在", request);
+            }
+            //判断股票是否在可交易时间段
+            Boolean b = tradingHourService.timeCheck(stock.getStockCode());
+            if (!b) {
+                return ServerResponse.createByErrorMsg("订单失败,不在交易时间之内", request);
+            }
 
 
-       StockConfig mainBuyConfig =  iStockConfigServices.queryByKey(EConfigKey.MIN_BUY.getCode());
+            StockConfig mainBuyConfig =  iStockConfigServices.queryByKey(EConfigKey.MIN_BUY.getCode());
 
-        if(buyNum<Integer.parseInt(mainBuyConfig.getCValue())){
-            return ServerResponse.createByErrorMsg("最低购买数量"+mainBuyConfig.getCValue(), request);
-        }
+            if(buyNum<Integer.parseInt(mainBuyConfig.getCValue())){
+                return ServerResponse.createByErrorMsg("最低购买数量"+mainBuyConfig.getCValue(), request);
+            }
 
-        UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId(stock.getStockType(), user.getId());
-        StockConfig maxBuyConfig =  iStockConfigServices.queryByKey(EConfigKey.MAX_BUY.getCode());
-        if(buyNum<Integer.parseInt(mainBuyConfig.getCValue())){
-            return ServerResponse.createByErrorMsg("最高购买数量"+maxBuyConfig.getCValue(), request);
-        }
-        if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){
-            return ServerResponse.createByErrorMsg("请先缴清待补资金", request);
-        }
-        if (stock.getIsLock() != 0) {
-            return ServerResponse.createByErrorMsg("订单失败,股票被锁定", request);
-        }
+            UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId(stock.getStockType(), user.getId());
+            StockConfig maxBuyConfig =  iStockConfigServices.queryByKey(EConfigKey.MAX_BUY.getCode());
+            if(buyNum<Integer.parseInt(mainBuyConfig.getCValue())){
+                return ServerResponse.createByErrorMsg("最高购买数量"+maxBuyConfig.getCValue(), request);
+            }
+            if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){
+                return ServerResponse.createByErrorMsg("请先缴清待补资金", request);
+            }
+            if (stock.getIsLock() != 0) {
+                return ServerResponse.createByErrorMsg("订单失败,股票被锁定", request);
+            }
 
-        if (!priceServices.isLimitUpBuy(stock.getStockCode())) {
-            return ServerResponse.createByErrorMsg("暂无配额", request);
-        }
+            if (!priceServices.isLimitUpBuy(stock.getStockCode())) {
+                return ServerResponse.createByErrorMsg("暂无配额", request);
+            }
 
-        //股票类型 现价 数据源的处理
-        BigDecimal nowPrice = priceServices.getNowPrice(stock.getStockCode());
+            //股票类型 现价 数据源的处理
+            BigDecimal nowPrice = priceServices.getNowPrice(stock.getStockCode());
 
-        if (nowPrice.compareTo(new BigDecimal("0")) == 0) {
-            return ServerResponse.createByErrorMsg("报价0,请稍后再试", request);
-        }
+            if (nowPrice.compareTo(new BigDecimal("0")) == 0) {
+                return ServerResponse.createByErrorMsg("报价0,请稍后再试", request);
+            }
 
-        BigDecimal buyAmt = nowPrice.multiply(new BigDecimal(buyNum)).divide(new BigDecimal(lever));
-        BigDecimal orderFree = siteSettingBuyFee.multiply(buyAmt);
+            BigDecimal buyAmt = nowPrice.multiply(new BigDecimal(buyNum)).divide(new BigDecimal(lever), 5, RoundingMode.HALF_UP);
+            BigDecimal orderFree = siteSettingBuyFee.multiply(buyAmt);
 
-        BigDecimal   fundratio = new BigDecimal(user.getFundRatio()).divide(new BigDecimal(100));
-        BigDecimal availableBalance =  fundratio.multiply(userAssets.getAvailableBalance());
-        if (availableBalance.compareTo(buyAmt.add(orderFree)) < 0) {
-            return ServerResponse.createByErrorMsg("订单失败,配资不足", request);
-        }
-        UserPosition userPosition = new UserPosition();
-        if (profitTarget != null && profitTarget.compareTo(new BigDecimal("0")) > 0) {
-            userPosition.setProfitTargetPrice(profitTarget);
-        }
-        if (stopTarget != null && stopTarget.compareTo(new BigDecimal("0")) > 0) {
-            userPosition.setStopTargetPrice(stopTarget);
-        }
-        userPosition.setPositionType(user.getAccountType());
-        userPosition.setPositionSn(KeyUtils.getUniqueKey());
-        userPosition.setUserId(user.getId());
-        userPosition.setNickName(user.getRealName());
-        userPosition.setAgentId(user.getAgentId());
-        userPosition.setStockCode(stock.getStockCode());
-        userPosition.setStockName(stock.getStockName());
-        userPosition.setStockGid(stock.getStockType());
-        userPosition.setStockSpell(stock.getStockSpell());
-        userPosition.setBuyOrderId(GeneratePosition.getPositionId());
-        userPosition.setBuyOrderTime(new Date());
-        userPosition.setBuyOrderPrice(nowPrice);
-        userPosition.setOrderDirection((buyType.intValue() == 0) ? "买涨" : "买跌");
-        userPosition.setOrderNum(buyNum);
-        if (stock.getStockPlate() != null) {
-            userPosition.setStockPlate(stock.getStockPlate());
-        }
-        userPosition.setIsLock(Integer.valueOf(0));
-        userPosition.setOrderLever(lever);
-        userPosition.setOrderTotalPrice(buyAmt);
-        // 手续费
+            BigDecimal   fundratio = new BigDecimal(String.valueOf(user.getFundRatio().isEmpty() ? 100 : user.getFundRatio())).divide(new BigDecimal(100));
+            BigDecimal availableBalance =  fundratio.multiply(userAssets.getAvailableBalance());
+            if (availableBalance.compareTo(buyAmt.add(orderFree)) < 0) {
+                return ServerResponse.createByErrorMsg("订单失败,配资不足", request);
+            }
+            UserPosition userPosition = new UserPosition();
+            if (profitTarget != null && profitTarget.compareTo(new BigDecimal("0")) > 0) {
+                userPosition.setProfitTargetPrice(profitTarget);
+            }
+            if (stopTarget != null && stopTarget.compareTo(new BigDecimal("0")) > 0) {
+                userPosition.setStopTargetPrice(stopTarget);
+            }
+            userPosition.setPositionType(user.getAccountType());
+            userPosition.setPositionSn(KeyUtils.getUniqueKey());
+            userPosition.setUserId(user.getId());
+            userPosition.setNickName(user.getRealName());
+            userPosition.setAgentId(user.getAgentId());
+            userPosition.setStockCode(stock.getStockCode());
+            userPosition.setStockName(stock.getStockName());
+            userPosition.setStockGid(stock.getStockType());
+            userPosition.setStockSpell(stock.getStockSpell());
+            userPosition.setBuyOrderId(GeneratePosition.getPositionId());
+            userPosition.setBuyOrderTime(new Date());
+            userPosition.setBuyOrderPrice(nowPrice);
+            userPosition.setOrderDirection((buyType.intValue() == 0) ? "买涨" : "买跌");
+            userPosition.setOrderNum(buyNum);
+            if (stock.getStockPlate() != null) {
+                userPosition.setStockPlate(stock.getStockPlate());
+            }
+            userPosition.setIsLock(Integer.valueOf(0));
+            userPosition.setOrderLever(lever);
+            userPosition.setOrderTotalPrice(buyAmt);
+            // 手续费
 
-        userPosition.setOrderFee(orderFree);
-        userPosition.setOrderSpread(BigDecimal.ZERO);
-        userPosition.setSpreadRatePrice(BigDecimal.ZERO);
-        BigDecimal profit_and_lose = new BigDecimal("0");
-        userPosition.setProfitAndLose(profit_and_lose);
-        userPosition.setAllProfitAndLose(profit_and_lose.add(orderFree));
-        userPosition.setOrderStayDays(Integer.valueOf(0));
-        userPosition.setOrderStayFee(BigDecimal.ZERO);
-        userPositionMapper.insert(userPosition);
-        iUserAssetsServices.availablebalanceChange(stock.getStockType(), user.getId(), EUserAssets.BUY, buyAmt.negate(), "", "");
-        iUserAssetsServices.availablebalanceChange(stock.getStockType(), user.getId(), EUserAssets.HANDLING_CHARGE, orderFree, "", "");
-        return ServerResponse.createBySuccessMsg("下单成功", request);
+            userPosition.setOrderFee(orderFree);
+            userPosition.setOrderSpread(BigDecimal.ZERO);
+            userPosition.setSpreadRatePrice(BigDecimal.ZERO);
+            BigDecimal profit_and_lose = new BigDecimal("0");
+            userPosition.setProfitAndLose(profit_and_lose);
+            userPosition.setAllProfitAndLose(profit_and_lose.add(orderFree));
+            userPosition.setOrderStayDays(Integer.valueOf(0));
+            userPosition.setOrderStayFee(BigDecimal.ZERO);
+            userPositionMapper.insert(userPosition);
+            iUserAssetsServices.availablebalanceChange(stock.getStockType(), user.getId(), EUserAssets.BUY, buyAmt.negate(), "", "");
+            iUserAssetsServices.availablebalanceChange(stock.getStockType(), user.getId(), EUserAssets.HANDLING_CHARGE, orderFree, "", "");
+            return ServerResponse.createBySuccessMsg("下单成功", request);
+        }
     }
 
 
@@ -293,9 +296,19 @@
             return ServerResponse.createByErrorMsg("平仓失败,订单不存在");
         }
         User user = this.userMapper.selectById(userPosition.getUserId());
+        if (user.getIsLock() == 1) {
+            return ServerResponse.createByErrorMsg("账户已被限制交易");
+        }
         if (user == null) {
             return ServerResponse.createByErrorMsg("平仓失败,用户不存在");
         }
+        UserAssets userAssets = userAssetsMapper.selectOne(new LambdaQueryWrapper<UserAssets>()
+                .eq(UserAssets::getUserId, userPosition.getUserId())
+                .eq(UserAssets::getAccectType, "JP")
+        );
+        /*if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){
+            return ServerResponse.createByErrorMsg("用户待补资金未补齐,禁止平仓");
+        }*/
         if (userPosition.getSellOrderId() != null) {
             return ServerResponse.createByErrorMsg("平仓失败, 订单已平仓");
         }
@@ -314,16 +327,21 @@
         BigDecimal sellOrderTotel = nowPrice.multiply(new BigDecimal(userPosition.getOrderNum()));
         BigDecimal xsPrice = sellOrderTotel.multiply(siitteBuyFee);
         userPositionMapper.updateById(userPosition);
-        userAssetsServices.availablebalanceChange(stock.getStockType(),
+
+        PositionProfitVO profitVO = UserPointUtil.getPositionProfitVO(userPosition, priceServices.getNowPrice(userPosition.getStockCode()));
+        /*userAssetsServices.availablebalanceChange(stock.getStockType(), userPosition.getUserId(), EUserAssets.CLOSE_POSITION,
+                profitVO.getAllProfitAndLose(), "", "");*/
+
+        //从保证金里计算盈亏
+        BigDecimal returnAmt = userPosition.getOrderTotalPrice().add(profitVO.getAllProfitAndLose());
+
+        userAssetsServices.availablebalanceSell(stock.getStockType(),
                 userPosition.getUserId(), EUserAssets.CLOSE_POSITION_RETURN_SECURITY_DEPOSIT,
-                userPosition.getOrderTotalPrice(), "", "");
+                returnAmt, userPosition.getOrderTotalPrice());
         userAssetsServices.availablebalanceChange(stock.getStockType(),
                 userPosition.getUserId(), EUserAssets.HANDLING_CHARGE,
                 xsPrice, "", "");
 
-        PositionProfitVO profitVO = UserPointUtil.getPositionProfitVO(userPosition, priceServices.getNowPrice(userPosition.getStockCode()));
-        userAssetsServices.availablebalanceChange(stock.getStockType(), userPosition.getUserId(), EUserAssets.CLOSE_POSITION,
-                profitVO.getAllProfitAndLose(), "", "");
         return ServerResponse.createBySuccessMsg("平仓成功!");
     }
 
@@ -332,18 +350,24 @@
     public ServerResponse sell(String positionSn, int doType, Integer number,HttpServletRequest request) {
         UserPosition userPosition = this.userPositionMapper.findPositionBySn(positionSn);
         if(null == number || number <= 0 || number > userPosition.getOrderNum()){
-            return ServerResponse.createByErrorMsg("请输入正确的平仓数", request);
+            String msg = "请输入正确的平仓数";
+            if(request.getHeader("lang").equals("ja")){
+                msg  ="正しい決済価格を入力してください";
+                return ServerResponse.createByErrorMsg(msg);
+            }else{
+                return ServerResponse.createByErrorMsg(msg, request);
+            }
         }
         // 手续费率
         BigDecimal siitteBuyFee = new BigDecimal(iStockConfigServices.queryByKey(EConfigKey.SELL_HANDLING_CHARGE.getCode()).getCValue());
 
         UserAssets userAssets = userAssetsMapper.selectOne(new LambdaQueryWrapper<UserAssets>()
                 .eq(UserAssets::getUserId, userPosition.getUserId())
-                .eq(UserAssets::getAccectType, "IN")
+                .eq(UserAssets::getAccectType, "JP")
         );
-        if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){
+        /*if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){
             return ServerResponse.createByErrorMsg("请先缴清待补资金", request);
-        }
+        }*/
         StockSubscribe stockSubscribe = stockSubscribeMapper.selectOne(new LambdaQueryWrapper<StockSubscribe>()
                 .eq(StockSubscribe::getCode, userPosition.getStockCode()));
         if (null != stockSubscribe && DateUtil.date().before(stockSubscribe.getListDate())) {
@@ -370,6 +394,9 @@
             return ServerResponse.createByErrorMsg("平仓失败,订单不存在", request);
         }
         User user = this.userMapper.selectById(userPosition.getUserId());
+        if (user.getIsLock() == 1) {
+            return ServerResponse.createByErrorMsg("账户已被限制交易", request);
+        }
         if (user == null) {
             return ServerResponse.createByErrorMsg("平仓失败,用户不存在", request);
         }
@@ -394,17 +421,16 @@
             position.setId(null);
             position.setPositionSn(KeyUtils.getUniqueKey());
             position.setOrderNum(number);
-            position.setOrderTotalPrice(position.getBuyOrderPrice().multiply(new BigDecimal(number)));
+            position.setOrderTotalPrice(position.getBuyOrderPrice().multiply(new BigDecimal(number)).divide(new BigDecimal(position.getOrderLever()), 5, RoundingMode.HALF_UP));
             position.setBuyOrderId(GeneratePosition.getPositionId());
             //修改拆分订单手续费
             BigDecimal BuyFee = new BigDecimal(iStockConfigServices.queryByKey(EConfigKey.BUY_HANDLING_CHARGE.getCode()).getCValue());
-            BigDecimal buyPrice = position.getBuyOrderPrice().multiply(new BigDecimal(position.getOrderNum()));
-            BigDecimal xsPrice = buyPrice.multiply(BuyFee);
+            BigDecimal xsPrice = position.getOrderTotalPrice().multiply(BuyFee);
             position.setOrderFee(xsPrice);
 
             //修改原订单
             userPosition.setOrderNum(userPosition.getOrderNum()-number);
-            userPosition.setOrderTotalPrice(userPosition.getBuyOrderPrice().multiply(new BigDecimal(userPosition.getOrderNum())));
+            userPosition.setOrderTotalPrice(userPosition.getBuyOrderPrice().multiply(new BigDecimal(userPosition.getOrderNum())).divide(new BigDecimal(position.getOrderLever()), 5, RoundingMode.HALF_UP));
             userPosition.setOrderFee(userPosition.getOrderFee().subtract(position.getOrderFee()));
             userPositionMapper.insert(position);
             userPositionMapper.updateById(userPosition);
@@ -423,20 +449,20 @@
         BigDecimal xsPrice = sellOrderTotel.multiply(siitteBuyFee);
         userPosition.setOrderFee(userPosition.getOrderFee().add(xsPrice));
         userPositionMapper.updateById(userPosition);
-        userAssetsServices.availablebalanceChange(stock.getStockType(),
+        PositionProfitVO profitVO = UserPointUtil.getPositionProfitVO(userPosition, priceServices.getNowPrice(userPosition.getStockCode()));
+        /*userAssetsServices.availablebalanceChange(stock.getStockType(), userPosition.getUserId(), EUserAssets.CLOSE_POSITION,
+                profitVO.getAllProfitAndLose(), "", "");*/
+
+        //从保证金里计算盈亏
+        BigDecimal returnAmt = userPosition.getOrderTotalPrice().add(profitVO.getAllProfitAndLose());
+
+        userAssetsServices.availablebalanceSell(stock.getStockType(),
                 userPosition.getUserId(),
                 EUserAssets.CLOSE_POSITION_RETURN_SECURITY_DEPOSIT,
-                userPosition.getOrderTotalPrice(), "", "");
+                returnAmt, userPosition.getOrderTotalPrice());
         userAssetsServices.availablebalanceChange(stock.getStockType(),
                 userPosition.getUserId(), EUserAssets.HANDLING_CHARGE,
                 xsPrice, "", "");
-
-        PositionProfitVO profitVO = UserPointUtil.getPositionProfitVO(userPosition,
-                priceServices.getNowPrice(userPosition.getStockCode()));
-
-        userAssetsServices.availablebalanceChange(stock.getStockType(),
-                userPosition.getUserId(), EUserAssets.CLOSE_POSITION,
-                profitVO.getAllProfitAndLose(), "", "");
         return ServerResponse.createBySuccessMsg("平仓成功!", request);
     }
 
@@ -1322,7 +1348,7 @@
 //        StringBuffer gid = new StringBuffer();
 //        gid.append(stockSubscribe.getStockType()!=null?stockSubscribe.getStockType():"");
 //        gid.append(userStockSubscribe.getNewCode()!=null?userStockSubscribe.getNewCode():"stock code invaild");
-        userPosition.setStockGid(stock.getStockType());
+        userPosition.setStockGid("JP");
         userPosition.setBuyOrderId(GeneratePosition.getPositionId());
         userPosition.setBuyOrderTime(new Date());
         userPosition.setBuyOrderPrice(userStockSubscribe.getBuyPrice());
@@ -1376,12 +1402,12 @@
         userPosition.setNewId(stockSubscribe.getNewlistId());
         int ret = 0;
         ret = this.userPositionMapper.insert(userPosition);
-        UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId("IN", userPosition.getUserId());
+        UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId("JP", userPosition.getUserId());
         if(null == userAssets){
             return ServerResponse.createByErrorMsg("新股转持仓失败");
         }
         userAssetsMapper.updateById(userAssets);
-        iUserAssetsServices.availablebalanceChange("IN", userAssets.getUserId(), EUserAssets.HANDLING_CHARGE, buy_fee_amt, "", "");
+        iUserAssetsServices.availablebalanceChange("JP", userAssets.getUserId(), EUserAssets.HANDLING_CHARGE, buy_fee_amt, "", "");
         if (ret > 0) {
             userStockSubscribe.setStatus(5);
             userStockSubscribeMapper.update1(userStockSubscribe);
@@ -1675,7 +1701,7 @@
         if (siteProduct.getRealNameDisplay() && user.getIsLock().intValue() == 1) {
             return ServerResponse.createByErrorMsg("Order failed, account has been locked");
         }
-        UserAssets userAssets = userAssetsServices.assetsByTypeAndUserId("IN", user.getId());
+        UserAssets userAssets = userAssetsServices.assetsByTypeAndUserId("JP", user.getId());
         if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){
             return ServerResponse.createByErrorMsg("请先缴清待补资金", request);
         }
@@ -1725,8 +1751,8 @@
         UserPosition userPosition = getUserPosition(dzId,num, user, stockDz, nowPrice, stock, buyAmt);
         userPositionMapper.insert(userPosition);
         BigDecimal buy_fee_amt = siteSettingBuyFee.multiply(buyAmt);
-        userAssetsServices.availablebalanceChange(EStockType.IN.getCode(), user.getId(), EUserAssets.BUY, buyAmt.negate(),"","");
-        iUserAssetsServices.availablebalanceChange("IN", userAssets.getUserId(), EUserAssets.HANDLING_CHARGE, buy_fee_amt, "", "");
+        userAssetsServices.availablebalanceChange(EStockType.JP.getCode(), user.getId(), EUserAssets.BUY, buyAmt.negate(),"","");
+        iUserAssetsServices.availablebalanceChange("JP", userAssets.getUserId(), EUserAssets.HANDLING_CHARGE, buy_fee_amt, "", "");
         return ServerResponse.createBySuccess("购买成功", request);
     }
 
@@ -1784,7 +1810,7 @@
             for (UserPosition position : list) {
                 UserAssets userAssets = userAssetsMapper.selectOne(new LambdaQueryWrapper<UserAssets>()
                         .eq(UserAssets::getUserId, position.getUserId())
-                        .eq(UserAssets::getAccectType, "IN")
+                        .eq(UserAssets::getAccectType, "JP")
                 );
                 if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){
                     continue;

--
Gitblit v1.9.3