| | |
| | | package com.nq.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | |
| | | } |
| | | |
| | | |
| | | User dbuser = this.userMapper.findByPhone(phone); |
| | | User dbuser = this.userMapper.selectOne(new LambdaQueryWrapper<User>().eq(User::getPhone,phone).last( " limit 1")); |
| | | if (dbuser != null) { |
| | | return ServerResponse.createByErrorMsg("Registration failed, the mobile phone number has been registered"); |
| | | } |
| | |
| | | if(formAssets.getAvailableBalance().compareTo(amtBig)<0){ |
| | | return ServerResponse.createByErrorMsg("Insufficient amount"); |
| | | } |
| | | SiteSetting siteSetting = iSiteSettingService.getSiteSetting(); |
| | | userAssetsServices.availablebalanceChange(fromType,user.getId(), EUserAssets.TRANSFER,amtBig.negate(),"",""); |
| | | |
| | | if(fromType.equals(EStockType.MAS.getCode())){ |
| | | amtBig = amtBig.divide(siteSetting.getExchangeRate(), BigDecimal.ROUND_CEILING); |
| | | }else{ |
| | | amtBig = amtBig.multiply(siteSetting.getExchangeRate()); |
| | | } |
| | | userAssetsServices.availablebalanceChange(toType,user.getId(),EUserAssets.TRANSFER,amtBig,"",""); |
| | | return ServerResponse.createBySuccess(); |
| | | } |