| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil withdrawal(Double money, String code, String name, Integer uid) throws Exception { |
| | | public ResultUtil withdrawal(Double money, String code, String name, Integer uid, Integer language) throws Exception { |
| | | language = userInfoService.queryLanguage(uid, language); |
| | | if(money.compareTo(0D) <= 0){ |
| | | return ResultUtil.error("提现金额必须大于0"); |
| | | return ResultUtil.error(language == 1 ? "提现金额必须大于0" : language == 2 ? "Withdrawal amount must be greater than 0" : "Le montant du retrait doit être supérieur à 0"); |
| | | } |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | if(null == userInfo.getBalance()){ |
| | | return ResultUtil.error("账户没有余额,不能提现"); |
| | | return ResultUtil.error(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient account balance" : "Solde de compte insuffisant"); |
| | | } |
| | | if(userInfo.getBalance().compareTo(money) < 0){ |
| | | return ResultUtil.error("提现金额必须小于账户余额"); |
| | | return ResultUtil.error(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient account balance" : "Solde de compte insuffisant"); |
| | | } |
| | | |
| | | Withdrawal withdrawal = new Withdrawal(); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryWithdrawal(Integer uid, Integer pageNum, Integer size) throws Exception { |
| | | public List<Map<String, Object>> queryWithdrawal(Integer uid, Integer pageNum, Integer size, Integer language) throws Exception { |
| | | pageNum = (pageNum - 1) * size; |
| | | return withdrawalMapper.queryWithdrawal(uid, 1, pageNum, size); |
| | | String name = language == 1 ? "银行卡提现" : language == 2 ? "Bank card withdrawal" : "Retrait par carte bancaire"; |
| | | List<Map<String, Object>> list = withdrawalMapper.queryWithdrawal(uid, 1, pageNum, size); |
| | | for (Map<String, Object> map : list) { |
| | | map.put("name", name); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |