zyy
2025-08-25 7cdd4ed05b4a4c3d45b653205d76470500764d9b
src/main/java/com/nq/controller/protol/UserController.java
@@ -1,9 +1,7 @@
package com.nq.controller.protol;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.google.common.collect.Maps;
import com.google.gson.Gson;
import com.nq.common.ServerResponse;
import com.nq.enums.EStockType;
import com.nq.pojo.*;
@@ -20,13 +18,10 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.nq.utils.translate.GoogleTranslateUtil;
import com.nq.vo.stock.UserStockSubscribeAddIn;
import org.apache.ibatis.annotations.Property;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -45,12 +40,6 @@
    IFileUploadService iFileUploadService;
    @Autowired
    IUserIndexPositionService iUserIndexPositionService;
    @Autowired
    IUserFuturesPositionService iUserFuturesPositionService;
    @Autowired
    IUserStockSubscribeService iUserStockSubscribeService;
    @Autowired
    IStockSubscribeService iStockSubscribeService;
@@ -61,16 +50,10 @@
    IRateServices rateServices;
    @Autowired
    IUserRechargeService iUserRechargeService;
    @Autowired
    PayServiceImpl payService;
    @Autowired
    IApplyLeverServices iApplyLeverServices;
    @Autowired
    IUserWithdrawService iUserWithdrawService;
    private static final ThreadLocal<Boolean> orderCreated = ThreadLocal.withInitial(() -> false);
    private final Lock lock = new ReentrantLock();
@@ -267,8 +250,8 @@
    @RequestMapping({"auth.do"})
    @ResponseBody
    public ServerResponse auth(String realName, String idCard,String vaildNumber ,String img1key, String img2key, String img3key, HttpServletRequest request) {
        return this.iUserService.auth(realName, idCard, vaildNumber,img1key, img2key, img3key, request);
    public ServerResponse auth(String realName, String idCard, String realType,String vaildNumber ,String img1key, String img2key, String img3key, HttpServletRequest request) {
        return this.iUserService.auth(realName, idCard, realType, vaildNumber,img1key, img2key, img3key, request);
    }
    //图片上传
@@ -347,6 +330,17 @@
        return this.iUserStockSubscribeService.getOneSubscribeByUserId(type, status, request);
    }
    /*新股申购-用户新股申购数据分页*/
    @RequestMapping({"getOneSubscribeByUserIdPage.do"})
    @ResponseBody
    public ServerResponse getOneSubscribeByUserIdPage(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
                                                  @RequestParam(value = "pageSize", defaultValue = "5") int pageSize,
                                                  @RequestParam(value ="type",required = false)String type,
                                                  @RequestParam(value ="status",required = false)Integer status,
                                                  HttpServletRequest request) {
        return this.iUserStockSubscribeService.getOneSubscribeByUserIdPage(pageNum, pageSize, type, status, request);
    }
    /*新股申购-用户提交金额*/
    @RequestMapping({"submitSubscribe.do"})
    @ResponseBody
@@ -358,6 +352,9 @@
    @ResponseBody
    public ServerResponse transfer(@RequestParam("fromType") String fromType, @RequestParam("toType") String toType,
                                   @RequestParam("amt") String amt,  HttpServletRequest request) {
        if (fromType.equals(toType)) {
            return ServerResponse.createByErrorMsg("货币类型不能相同", request);
        }
        return  iUserService.transfer(fromType, toType, amt,request);
    }
@@ -434,7 +431,8 @@
    @RequestMapping({"thirdPartyRecharge.do"})
    @ResponseBody
    public ServerResponse thirdPartyRecharge(@RequestParam("tradeAmoun") String tradeAmoun,@RequestParam("type") Integer type,HttpServletRequest request) {
        payLock.lock();
        return ServerResponse.createByErrorMsg("尊敬的会员您好,充值请联系客服", request);
        /*payLock.lock();
        try {
            if (payCreated.get()) {
                return ServerResponse.createByErrorMsg("当前充值人数过多,请稍后重试", request);
@@ -457,7 +455,7 @@
        }  finally{
            payLock.unlock();
            payCreated.set(false);
        }
        }*/
    }
    // 判断字符串是否是整数且大于100
    public static boolean isIntegerGreaterThan100(String str) {