| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yami.trading.bean.constans.UserConstants; |
| | | import com.yami.trading.bean.model.*; |
| | | import com.yami.trading.bean.rate.domain.ExchangeRate; |
| | | import com.yami.trading.bean.syspara.domain.Syspara; |
| | | import com.yami.trading.bean.syspara.dto.SysparasDto; |
| | | import com.yami.trading.bean.user.dto.AgentUserDto; |
| | |
| | | import com.yami.trading.service.OnlineUserService; |
| | | import com.yami.trading.service.WalletService; |
| | | import com.yami.trading.service.data.DataService; |
| | | import com.yami.trading.service.rate.ExchangeRateService; |
| | | import com.yami.trading.service.syspara.SysparaService; |
| | | import com.yami.trading.service.system.LogService; |
| | | import com.yami.trading.service.user.*; |
| | |
| | | @Autowired |
| | | WalletLogService walletLogService; |
| | | |
| | | @Autowired |
| | | ExchangeRateService exchangeRateService; |
| | | |
| | | /** |
| | | * UserCode生成并发锁 |
| | | */ |
| | |
| | | |
| | | @Override |
| | | public Page<UserDto> listUser(Page page, List<String> roleNames, String userCode, String userName, |
| | | String userMail, String userMobile, List<String> checkedList) { |
| | | String userMail, String userMobile, List<String> checkedList, String recomUserName) { |
| | | |
| | | Page<UserDto> userDtoPage = baseMapper.listUser(page, roleNames, userCode, userName, userMail, userMobile, checkedList); |
| | | Page<UserDto> userDtoPage = baseMapper.listUser(page, roleNames, userCode, userName, userMail, userMobile, checkedList, recomUserName); |
| | | |
| | | // 提现限制流水开启后,提现判断用的用户当前流水是使用UserData表的当日流水1还是使用Party表里的用户当前流水2 |
| | | String withdraw_limit_open_use_type = this.sysparaService.find("withdraw_limit_open_use_type").getSvalue(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Page<UserDataDto> listUserAndRecom(Page page, List<String> roleNames, String userCode, String userName, String lastIp, List<String> checkedList, String userMail, String userMobile) { |
| | | public Page<UserDataDto> listUserAndRecom(Page page, List<String> roleNames, String userCode, String userName, String lastIp, List<String> checkedList, String userMail, String userMobile, String recomUserName) { |
| | | return baseMapper.listUserAndRecom(page, roleNames, userCode, |
| | | userName, lastIp, checkedList, userMail, userMobile); |
| | | userName, lastIp, checkedList, userMail, userMobile, recomUserName); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public void saveResetCreateOrder(String partyId, double money_revise, String safeword, String operator_name, String reset_type, String ip, String coin_type) { |
| | | |
| | | if (money_revise == 0 || coin_type == "") { |
| | | if (money_revise == 0 || coin_type.equalsIgnoreCase("")) { |
| | | return; |
| | | } |
| | | |
| | | if ("usdt".equals(coin_type)) { |
| | | if ("usdt".equalsIgnoreCase(coin_type) || "eur".equalsIgnoreCase(coin_type) || "gbp".equalsIgnoreCase(coin_type)) { |
| | | // 交易所修改usdt |
| | | //到账金额 |
| | | double toAmt = money_revise; |
| | | if (!coin_type.equalsIgnoreCase("usdt")) { |
| | | ExchangeRate exchangeRate = exchangeRateService.findBy(ExchangeRate.IN, coin_type.toUpperCase()); |
| | | if (exchangeRate == null) { |
| | | throw new YamiShopBindException("汇率未设置!"); |
| | | } |
| | | BigDecimal amt = BigDecimal.valueOf(money_revise).divide(exchangeRate.getRata(), 8, RoundingMode.HALF_UP); |
| | | money_revise = amt.doubleValue(); |
| | | } |
| | | |
| | | User party = getById(partyId); |
| | | // if (party!=null&&!Constants.SECURITY_ROLE_GUEST.equals(party.getRolename())) { |
| | |
| | | MoneyLog moneyLog = new MoneyLog(); |
| | | moneyLog.setCategory(Constants.MONEYLOG_CATEGORY_COIN); |
| | | moneyLog.setAmountBefore(new BigDecimal(amount_before)); |
| | | moneyLog.setAmount(new BigDecimal(money_revise)); |
| | | moneyLog.setAmountAfter(new BigDecimal(Arith.add(wallet.getMoney().doubleValue(), money_revise))); |
| | | moneyLog.setAmount(new BigDecimal(toAmt)); |
| | | moneyLog.setAmountAfter(BigDecimal.valueOf(Arith.add(amount_before, money_revise))); |
| | | moneyLog.setUserId(partyId); |
| | | moneyLog.setWalletType(Constants.WALLET); |
| | | moneyLog.setWalletType(coin_type.toUpperCase()); |
| | | moneyLog.setContent_type(Constants.MONEYLOG_CONTENT_RECHARGE); |
| | | moneyLog.setContentType(Constants.MONEYLOG_CONTENT_RECHARGE); |
| | | moneyLog.setCreateTime(new Date()); |
| | |
| | | if (!user.isGoogleAuthBind()) { |
| | | throw new YamiShopBindException("用户谷歌验证码未绑定!"); |
| | | } |
| | | GoogleAuthenticator ga = new GoogleAuthenticator(); |
| | | /*GoogleAuthenticator ga = new GoogleAuthenticator(); |
| | | ga.setWindowSize(5); |
| | | long t = System.currentTimeMillis(); |
| | | boolean flag = ga.check_code(user.getGoogleAuthSecret(), Long.valueOf(googleAuthCode), t); |
| | |
| | | } |
| | | if (!passwordEncoder.matches(loginSafeword, user.getSafePassword())) { |
| | | throw new YamiShopBindException("登录人资金密码错误"); |
| | | } |
| | | }*/ |
| | | user.setGoogleAuthBind(false); |
| | | user.setGoogleAuthSecret(""); |
| | | updateById(user); |