| | |
| | | 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; |
| | |
| | | |
| | | |
| | | @Resource |
| | | MoneyLogMapper mapper; |
| | | |
| | | @Resource |
| | | UserPositionMapper userPositionMapper; |
| | | @Resource |
| | | SiteAmtTransLogMapper siteAmtTransLogMapper; |
| | |
| | | } |
| | | |
| | | |
| | | 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(); |
| | | } |
| | |
| | | userMapper.updateUserAmt(amt, user_id); |
| | | } |
| | | |
| | | // @Override |
| | | // public ServerResponse queryMyOption(String code, HttpServletRequest request) { |
| | | // User user = getCurrentUser(request); |
| | | // |
| | | // if (user == null) { |
| | | // return ServerResponse.createBySuccessMsg("請先登錄"); |
| | | // } |
| | | // String stockcode = code; |
| | | // if(code.contains("hf")){ |
| | | // stockcode = code.split("_")[1].toString(); |
| | | // } |
| | | // stockcode = stockcode.replace("sh","").replace("sz","").replace("bj",""); |
| | | // return this.iStockOptionService.isOption(user.getId(), stockcode); |
| | | // } |
| | | |
| | | @Override |
| | | public ServerResponse queryMyOption(String code, HttpServletRequest request) { |
| | | User user = getCurrentUser(request); |
| | | |
| | | return this.iStockOptionService.isOption(user.getId(), code); |
| | | } |
| | | |
| | | @Override |
| | | public ServerResponse getMoenyLog(String type,HttpServletRequest request) { |
| | | User user = getCurrentUser(request); |
| | | QueryWrapper<MoneyLog> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("type",type); |
| | | queryWrapper.eq("user_id",user.getId()); |
| | | return ServerResponse.createBySuccess(mapper.selectList(queryWrapper)); |
| | | } |
| | | |
| | | } |
| | | |