| | |
| | | @Autowired |
| | | IStockConfigServices iStockConfigServices; |
| | | |
| | | @Autowired |
| | | UserAssetsMapper userAssetsMapper; |
| | | |
| | | @Transactional |
| | | public ServerResponse outMoney(String amt, String with_Pwd,String accsetType,HttpServletRequest request) throws Exception { |
| | |
| | | if (user.getIsLogin().intValue() == 1) { |
| | | return ServerResponse.createByErrorMsg("用户被锁定",request); |
| | | } |
| | | if (StringUtils.isBlank(user.getRealName()) || StringUtils.isBlank(user.getIdCard())) { |
| | | if (user.getIsActive() != 2) { |
| | | return ServerResponse.createByErrorMsg("未实名认证",request); |
| | | } |
| | | UserBank userBank = this.iUserBankService.findUserBankByUserId(user.getId()); |
| | |
| | | userWithdraw.setWithStatus(Integer.valueOf(0)); |
| | | BigDecimal withfee = siteSetting.getWithFeePercent().multiply(new BigDecimal(amt)).add(new BigDecimal(siteSetting.getWithFeeSingle().intValue())); |
| | | userWithdraw.setWithFee(withfee); |
| | | userWithdraw.setAssetsType(accsetType); |
| | | int insertCount = this.userWithdrawMapper.insert(userWithdraw); |
| | | if (insertCount > 0) { |
| | | return ServerResponse.createBySuccessMsg("提现成功",request); |
| | |
| | | User user = this.userMapper.selectById(userWithdraw.getUserId()); |
| | | |
| | | |
| | | int updateUserCount = this.userMapper.updateById(user); |
| | | UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId("JP", user.getId()); |
| | | if (userAssets == null) { |
| | | return ServerResponse.createByErrorMsg("用户资金账户不存在"); |
| | | } |
| | | userAssets.setAvailableBalance(userAssets.getAvailableBalance().add(userWithdraw.getWithAmt())); |
| | | int updateUserCount = userAssetsMapper.updateById(userAssets); |
| | | |
| | | if (updateUserCount > 0) { |
| | | |
| | |
| | | if (user == null) { |
| | | return ServerResponse.createByErrorMsg("用户不存在"); |
| | | } |
| | | int updateCount = this.userMapper.updateById(user); |
| | | UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId("JP", user.getId()); |
| | | if (userAssets == null) { |
| | | return ServerResponse.createByErrorMsg("用户资金账户不存在"); |
| | | } |
| | | userAssets.setAvailableBalance(userAssets.getAvailableBalance().add(userWithdraw.getWithAmt())); |
| | | int updateCount = userAssetsMapper.updateById(userAssets); |
| | | if (updateCount > 0) { |
| | | log.info("提现失败,返还用户资金成功!"); |
| | | } else { |