2a13fc3d05c012766eb677cb0486e6dcf9ed1bf2..6404cb07e5281cfd901267c4fd560ba89bd5e2fd
2024-09-04 zj
Merge remote-tracking branch 'origin/ysz' into ysz
6404cb diff | tree
2024-09-04 zj
1
677c87 diff | tree
4 files modified
14 ■■■■■ changed files
src/main/java/com/nq/controller/protol/UserController.java 3 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/service/IUserPositionService.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/nq/service/impl/UserPositionServiceImpl.java 6 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/service/impl/UserPurchaseApplicationServiceImpl.java 3 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/controller/protol/UserController.java
@@ -114,7 +114,6 @@
                              @RequestParam("buyNum") Integer buyNum,
                              @RequestParam("buyType") Integer buyType,
                              @RequestParam("lever") Integer lever,
                              @RequestParam(value = "password",required = false) String password,
                              @RequestParam(value = "profitTarget",required = false)
                                  BigDecimal profitTarget,@RequestParam(value = "stopLoss",required = false) BigDecimal stopLoss, HttpServletRequest request) {
        buyLock.lock();
@@ -123,7 +122,7 @@
                return ServerResponse.createByErrorMsg("当前下单人数过多,请稍后重试", request);
            }
            buyOrderCreated.set(true);
            return this.iUserPositionService.buy(stockId, buyNum, buyType, lever,profitTarget,stopLoss, password,request,null);
            return this.iUserPositionService.buy(stockId, buyNum, buyType, lever,profitTarget,stopLoss,request,null);
        } catch (Exception e) {
            return ServerResponse.createByErrorMsg("订单异常,请稍后重试", request);
        }  finally{
src/main/java/com/nq/service/IUserPositionService.java
@@ -13,7 +13,7 @@
public interface IUserPositionService {
  ServerResponse buy(Integer paramInteger1, Integer paramInteger2, Integer paramInteger3,
                     Integer paramInteger4,BigDecimal paramInteger5,BigDecimal paramInteger6,String password,HttpServletRequest paramHttpServletRequest,Integer userId) ;
                     Integer paramInteger4,BigDecimal paramInteger5,BigDecimal paramInteger6,HttpServletRequest paramHttpServletRequest,Integer userId) ;
  
  ServerResponse sell(String paramString, int paramInt);
  ServerResponse sell(String paramString,Integer closeNumber, int paramInt,  HttpServletRequest request);
src/main/java/com/nq/service/impl/UserPositionServiceImpl.java
@@ -361,7 +361,7 @@
        UserAssets userAssets = userAssetsMapper.selectOne(new LambdaQueryWrapper<UserAssets>()
                .eq(UserAssets::getUserId, userPosition.getUserId())
                .eq(UserAssets::getAccectType, "MAS")
                .eq(UserAssets::getAccectType, "IN")
        );
        if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){
            return ServerResponse.createByErrorMsg("请先缴清待补资金", request);
@@ -1615,7 +1615,7 @@
        if (siteProduct.getRealNameDisplay() && user.getIsLock().intValue() == 1) {
            return ServerResponse.createByErrorMsg("Order failed, account has been locked");
        }
        UserAssets userAssets = userAssetsServices.assetsByTypeAndUserId("MAS", user.getId());
        UserAssets userAssets = userAssetsServices.assetsByTypeAndUserId("IN", user.getId());
        if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){
            return ServerResponse.createByErrorMsg("请先缴清待补资金", request);
        }
@@ -1703,7 +1703,7 @@
            for (UserPosition position : list) {
                UserAssets userAssets = userAssetsMapper.selectOne(new LambdaQueryWrapper<UserAssets>()
                        .eq(UserAssets::getUserId, position.getUserId())
                        .eq(UserAssets::getAccectType, "MAS")
                        .eq(UserAssets::getAccectType, "IN")
                );
                if(userAssets.getAmountToBeCovered().compareTo(BigDecimal.ZERO) > 0){
                    continue;
src/main/java/com/nq/service/impl/UserPurchaseApplicationServiceImpl.java
@@ -74,8 +74,7 @@
            //购买
            Stock stock = stockMapper.findStockByCode(purchaseApplication.getStockCode());
            ServerResponse serverResponse = userPositionService.buy(stock.getId(),purchaseApplication.getBuyNum(),
                    purchaseApplication.getBuyType(),purchaseApplication.getLever(),purchaseApplication.getProfitTarget(),purchaseApplication.getStopTarget(),
            "",request,purchaseApplication.getUserId());
                    purchaseApplication.getBuyType(),purchaseApplication.getLever(),purchaseApplication.getProfitTarget(),purchaseApplication.getStopTarget(), request,purchaseApplication.getUserId());
            if(serverResponse.getStatus() == ResponseCode.SUCCESS.getCode()){
                this.purchaseApplicationMapper.updateById(purchaseApplication);
                this.siteTaskLogMapper.insert(siteTaskLog);