| | |
| | | import com.stylefeng.guns.modular.system.model.Withdrawal; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.service.IWithdrawalService; |
| | | import com.stylefeng.guns.modular.system.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.Tingg.TinggPayoutUtil; |
| | | import com.stylefeng.guns.modular.system.util.Tingg.model.AuthStatus; |
| | |
| | | public ResultUtil withdrawal(Double money, Integer uid, String remark, Integer language) throws Exception { |
| | | language = userInfoService.queryLanguage(uid, language); |
| | | if(money.compareTo(0D) <= 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"); |
| | | return ResultUtil.error(language == 1 ? "提现金额必须大于0" : language == 2 ? "Withdrawal amount must be greater than zero." : "Le montant du retrait doit être supérieur à zéro."); |
| | | } |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | if(null == userInfo.getBalance()){ |
| | | return ResultUtil.error(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient account balance" : "Solde de compte insuffisant"); |
| | | return ResultUtil.error(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient balance" : "Solde insuffisant"); |
| | | } |
| | | if(userInfo.getBalance().compareTo(money) < 0){ |
| | | return ResultUtil.error(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient account balance" : "Solde de compte insuffisant"); |
| | | return ResultUtil.error(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient balance" : "Solde insuffisant"); |
| | | } |
| | | |
| | | Withdrawal withdrawal = new Withdrawal(); |
| | |
| | | List<Map<String, Object>> list = withdrawalMapper.queryWithdrawal(uid, 1, pageNum, size); |
| | | for (Map<String, Object> map : list) { |
| | | map.put("name", name + map.get("code")); |
| | | if(null != map.get("insertTime")){ |
| | | String insertTime = map.get("insertTime").toString(); |
| | | map.put("insertTime", DateUtil.conversionFormat(language, insertTime)); |
| | | } |
| | | } |
| | | return list; |
| | | } |