| | |
| | | return ServerResponse.createByErrorMsg("余额不足",request); |
| | | } |
| | | userAssetsServices.availablebalanceChange(fromType,user.getId(), EUserAssets.TRANSFER,amtBig.negate(),fromType+"/"+toType,""); |
| | | amtBig = rateServices.currencyRate(EStockType.getEStockTypeByCode(fromType),EStockType.getEStockTypeByCode(toType)).multiply(amtBig); |
| | | if(fromType.equals("US")){ |
| | | amtBig = (new BigDecimal(83.5)).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(); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | 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"); |
| | | } |
| | |
| | | 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); |
| | |
| | | user.setIsActive(Integer.valueOf(0)); |
| | | user.setRegTime(new Date()); |
| | | user.setUserPwd(SymmetricCryptoUtil.encryptPassword(pwd)); |
| | | user.setLever("1"); |
| | | if (accountType.intValue() == 1) { |
| | | user.setNickName("模拟用户"); |
| | | } |