1
zj
2024-05-07 03d23a8e13ca4cfabad8ee72006eeacbb553e8f0
1
5 files modified
26 ■■■■ changed files
src/main/java/com/nq/controller/agent/AgentController.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/controller/agent/AgentUserController.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/controller/backend/AdminUserController.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/service/IUserService.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/nq/service/impl/UserServiceImpl.java 12 ●●●● patch | view | raw | blame | history
src/main/java/com/nq/controller/agent/AgentController.java
@@ -82,8 +82,8 @@
    //添加用户管理 账户信息
    @RequestMapping({"addSimulatedAccount.do"})
    @ResponseBody
    public ServerResponse addSimulatedAccount(HttpServletRequest request,@RequestParam("agentId") Integer agentId, @RequestParam("phone") String phone, @RequestParam("amt") String amt, @RequestParam("accountType") Integer accountType, @RequestParam("pwd") String pwd) {
        return this.iUserService.addSimulatedAccount(agentId, phone, pwd, amt, accountType, request);
    public ServerResponse addSimulatedAccount(HttpServletRequest request,@RequestParam("agentId") Integer agentId, @RequestParam("phone") String phone, @RequestParam("accountType") Integer accountType, @RequestParam("pwd") String pwd) {
        return this.iUserService.addSimulatedAccount(agentId, phone, pwd, accountType, request);
    }
    //查询股票统计指定时间内,代理客户(已平仓)的交易盈亏
src/main/java/com/nq/controller/agent/AgentUserController.java
@@ -61,8 +61,8 @@
    //添加用户列表 用户信息
    @RequestMapping({"addSimulatedAccount.do"})
    @ResponseBody
    public ServerResponse addSimulatedAccount(HttpServletRequest request, @RequestParam(value = "agentId", required = false) Integer agentId, @RequestParam("phone") String phone, @RequestParam("amt") String amt, @RequestParam("accountType") Integer accountType, @RequestParam("pwd") String pwd) {
        return this.iUserService.addSimulatedAccount(agentId, phone, pwd, amt, accountType, request);
    public ServerResponse addSimulatedAccount(HttpServletRequest request, @RequestParam(value = "agentId", required = false) Integer agentId, @RequestParam("phone") String phone,@RequestParam("accountType") Integer accountType, @RequestParam("pwd") String pwd) {
        return this.iUserService.addSimulatedAccount(agentId, phone, pwd, accountType, request);
    }
    @RequestMapping({"authByAdmin.do"})
src/main/java/com/nq/controller/backend/AdminUserController.java
@@ -72,8 +72,8 @@
    //添加用户列表 用户信息
    @RequestMapping({"addSimulatedAccount.do"})
    @ResponseBody
    public ServerResponse addSimulatedAccount(HttpServletRequest request, @RequestParam(value = "agentId", required = false) Integer agentId, @RequestParam("phone") String phone, @RequestParam("amt") String amt, @RequestParam("accountType") Integer accountType, @RequestParam("pwd") String pwd) {
        return this.iUserService.addSimulatedAccount(agentId, phone, pwd, amt, accountType, request);
    public ServerResponse addSimulatedAccount(HttpServletRequest request, @RequestParam(value = "agentId", required = false) Integer agentId, @RequestParam("phone") String phone,  @RequestParam("accountType") Integer accountType, @RequestParam("pwd") String pwd) {
        return this.iUserService.addSimulatedAccount(agentId, phone, pwd, accountType, request);
    }
    @RequestMapping({"authByAdmin.do"})
src/main/java/com/nq/service/IUserService.java
@@ -60,7 +60,7 @@
  ServerResponse listByAgent(String paramString1, String paramString2, Integer paramInteger1, Integer paramInteger2, int paramInt1, int paramInt2, HttpServletRequest paramHttpServletRequest);
  ServerResponse addSimulatedAccount(Integer paramInteger1, String paramString1, String paramString2, String paramString3, Integer paramInteger2, HttpServletRequest paramHttpServletRequest);
  ServerResponse addSimulatedAccount(Integer paramInteger1, String paramString1, String paramString2, Integer paramInteger2, HttpServletRequest paramHttpServletRequest);
  ServerResponse listByAdmin(String paramString1, String paramString2, Integer paramInteger1, Integer paramInteger2, int paramInt1, int paramInt2, HttpServletRequest paramHttpServletRequest);
src/main/java/com/nq/service/impl/UserServiceImpl.java
@@ -629,7 +629,11 @@
            return ServerResponse.createByErrorMsg("余额不足",request);
        }
        userAssetsServices.availablebalanceChange(fromType,user.getId(), EUserAssets.TRANSFER,amtBig.negate(),fromType+"/"+toType,"");
        if(fromType.equals("US")){
            amtBig = (new BigDecimal(7.35)).multiply(amtBig);
        }else{
        amtBig = rateServices.currencyRate(EStockType.getEStockTypeByCode(fromType),EStockType.getEStockTypeByCode(toType)).multiply(amtBig);
        }
        userAssetsServices.availablebalanceChange(toType,user.getId(),EUserAssets.TRANSFER,amtBig.setScale(5,RoundingMode.HALF_DOWN),fromType+"/"+toType,"");
        return ServerResponse.createBySuccess();
    }
@@ -755,7 +759,7 @@
    }
    public ServerResponse addSimulatedAccount(Integer agentId, String phone, String pwd, String amt, Integer accountType, HttpServletRequest request) {
    public ServerResponse addSimulatedAccount(Integer agentId, String phone, String pwd,Integer accountType, HttpServletRequest request) {
        if (StringUtils.isBlank(phone) || StringUtils.isBlank(pwd)) {
            return ServerResponse.createByErrorMsg("The parameter cannot be null");
        }
@@ -766,11 +770,6 @@
            return ServerResponse.createByErrorMsg("The phone number is registered");
        }
        if ((new BigDecimal(amt)).compareTo(new BigDecimal("200000")) == 1) {
            return ServerResponse.createByErrorMsg("The phone number is registered");
        }
        amt = "0";   //代理后台添加用户时金额默认为0
        User user = new User();
        user.setAccountType(accountType);
        user.setPhone(phone);
@@ -779,6 +778,7 @@
        user.setIsActive(Integer.valueOf(0));
        user.setRegTime(new Date());
        user.setUserPwd(SymmetricCryptoUtil.encryptPassword(pwd));
        user.setLever("1");
        if (accountType.intValue() == 1) {
            user.setNickName("模拟用户");
        }