提现相关JAVA代码鉴赏

上一篇 / 下一篇  2020-09-08 11:02:00 / 个人分类:JAVA

//判断用户是否设置过支付密码
boolean isExists = accountBusiness.existPaymentCode(userId);
if (!isExists) {
model.addAttribute("retUrl", "/u/account/withdraw/index");
return super.getRedirectUrl("/u/account/security/paymentCode");
}
//获得用户钱包余额
Account account = accountBusiness.getAccountByUserId(userId);
model.addAttribute("withdrawAmount", account.getWithdrawAmount());
//获得用户今日还可提现的次数
Integer withdrawCount = withdrawBusiness.getLastWithdrawCount(userId);
model.addAttribute("withdrawCount", withdrawCount);
//获得用户绑定的银行卡列表
List<BankCard> cardList = bankCardBusiness.findWithdrawCardListByUserId(userId);
if (cardList.size() == 0) {
return "/m/trade/account/withdraw/no-bankcard";
}
model.addAttribute("cardList", cardList);
// 增加提现时间限制
if (withdrawBusiness.hasWithdrawTimeLimet()) {
Map<String, Boolean> map = withdrawBusiness.isWithdrawTime();
model.addAttribute("checkTime", map.get("checkTime"));
//判断节假日
ResultBase<HolidayActivity> holidayRs = holidayActivityBusiness.getHolidayInfo();
model.addAttribute("checkHolidayTime", holidayRs.isSuccess());
if (holidayRs.isSuccess()) {
model.addAttribute("holidayMsg", holidayRs.getBusinessObj().getMarkedWords());
}
}else {
model.addAttribute("checkTime", true);
model.addAttribute("checkHolidayTime",false);
}
String showTitle = "2万";
model.addAttribute("showFlagValue", ConstantsUtil.WITHDRAW_VALUE); // /默认0表示没有阀值
WithdrawRule rule = withdrawBusiness.getWithdrawRuleByAttribute(ConstantsUtil.WITHDRAW_RULE_AUDIT);
if (rule != null && rule.getValue() != null && NumberUtils.isNumber(rule.getValue())) {  //查询阀值
Long value = Long.valueOf(rule.getValue()); //查询是以分为单位
model.addAttribute("showFlagValue",value); //获取阀值 以分为单位
if(value % (100*10000) == 0 ){ //可以转成万元
showTitle = (value/(100*10000)) +"万";
}else if(value % 100 == 0){ //可以转元
showTitle = (value/100) +"元";
}else{ //直接显示分
DecimalFormat df = new DecimalFormat("##0.00");
showTitle = df.format(value/100.0) + "元";
}
}
model.addAttribute("showTitle", showTitle);
model.addAttribute("errMsg", errMsg);
return "/m/trade/account/withdraw/withdraw";
}

TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

Open Toolbar