| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.google.gson.Gson; |
| | | import com.nq.dao.*; |
| | | import com.nq.enums.EConfigKey; |
| | | import com.nq.enums.EStockType; |
| | | import com.nq.enums.EUserAssets; |
| | | import com.nq.pojo.*; |
| | |
| | | return ServerResponse.createByErrorMsg("最小提现金额:" + siteSetting.getWithMinAmt(),request); |
| | | } |
| | | |
| | | boolean b = getServerResponse(); |
| | | boolean b = getServerResponse(accsetType); |
| | | if (!b) { |
| | | return ServerResponse.createByErrorMsg("提现失败,当前时间已停止提现", request); |
| | | } |
| | |
| | | userWithdraw.setWithStatus(Integer.valueOf(0)); |
| | | BigDecimal withfee = siteSetting.getWithFeePercent().multiply(new BigDecimal(amt)).add(new BigDecimal(siteSetting.getWithFeeSingle().intValue())); |
| | | userWithdraw.setWithFee(withfee); |
| | | userWithdraw.setAccsetType(accsetType); |
| | | int insertCount = this.userWithdrawMapper.insert(userWithdraw); |
| | | if (insertCount > 0) { |
| | | return ServerResponse.createBySuccessMsg("提现成功",request); |
| | |
| | | |
| | | } |
| | | |
| | | private boolean getServerResponse() { |
| | | StockTimeSetting stockTimeSetting = stockTimeSettingMapper.selectOne(new QueryWrapper<StockTimeSetting>().eq("accets_type", EStockType.getDefault().getCode())); |
| | | private boolean getServerResponse(String accsetType) { |
| | | StockTimeSetting stockTimeSetting = stockTimeSettingMapper.selectOne(new QueryWrapper<StockTimeSetting>().eq("accets_type", EUserAssets.WITHDRAW.getCode())); |
| | | if (stockTimeSetting == null) { |
| | | return false; |
| | | } |