| | |
| | | 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.*; |
| | |
| | | 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; |
| | |
| | | IFileUploadService iFileUploadService; |
| | | |
| | | @Autowired |
| | | IUserIndexPositionService iUserIndexPositionService; |
| | | |
| | | @Autowired |
| | | IUserFuturesPositionService iUserFuturesPositionService; |
| | | |
| | | @Autowired |
| | | IUserStockSubscribeService iUserStockSubscribeService; |
| | | @Autowired |
| | | IStockSubscribeService iStockSubscribeService; |
| | |
| | | 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(); |
| | |
| | | |
| | | @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); |
| | | } |
| | | |
| | | //图片上传 |
| | |
| | | return ServerResponse.createBySuccess(fileMap); |
| | | } |
| | | return serverResponse; |
| | | } |
| | | |
| | | /** |
| | | * 新股列表 |
| | | * @param pageNum |
| | | * @param pageSize |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping({"getStockSubscribeList.do"}) |
| | | @ResponseBody |
| | | public ServerResponse getStockSubscribeList(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum, |
| | | @RequestParam(value = "pageSize", defaultValue = "5") int pageSize, |
| | | HttpServletRequest request) { |
| | | return this.iStockSubscribeService.listPageInfo(pageNum, pageSize, request); |
| | | } |
| | | |
| | | |
| | |
| | | /*新股申购-用户新股申购数据*/ |
| | | @RequestMapping({"getOneSubscribeByUserId.do"}) |
| | | @ResponseBody |
| | | public ServerResponse getOneSubscribeByUserId(@RequestParam(value ="type",required = false)String type, HttpServletRequest request) { |
| | | return this.iUserStockSubscribeService.getOneSubscribeByUserId(type,request); |
| | | public ServerResponse getOneSubscribeByUserId(@RequestParam(value ="type",required = false)String type, |
| | | @RequestParam(value ="status",required = false)Integer status, |
| | | HttpServletRequest request) { |
| | | 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); |
| | | } |
| | | |
| | | /*新股申购-用户提交金额*/ |
| | |
| | | @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); |
| | | } |
| | | |
| | |
| | | @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); |
| | |
| | | } finally{ |
| | | payLock.unlock(); |
| | | payCreated.set(false); |
| | | } |
| | | }*/ |
| | | } |
| | | // 判断字符串是否是整数且大于100 |
| | | public static boolean isIntegerGreaterThan100(String str) { |