UserKitingAction.java
2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package com.cjs.site.action.user.fund;
import java.util.Map;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.cjs.site.biz.user.fund.FundBiz;
import com.cjs.site.biz.user.fund.UserKitingBiz;
import com.cjs.site.dao.user.account.ClientInfoDao;
import com.cjs.site.dao.user.fund.UserKitingDao;
import com.cjs.site.util.lang.StringUtil;
import com.cjs.site.util.web.ActionUtil;
import com.cjs.site.util.web.PageUtils;
import com.cjs.site.util.web.Token;
/**
* 客户提现
*
* @author tongyufu
*
*/
@Controller
@RequestMapping("/user")
public class UserKitingAction {
@Autowired
private FundBiz fundBiz;
@Autowired
private UserKitingBiz userKitingBiz;
@Autowired
private ClientInfoDao clientInfoDao;
@Autowired
private UserKitingDao userKitingDao;
/**提现*/
@Token(save = true, group = "kiting")
@RequestMapping(value = "kiting", method = RequestMethod.GET)
public String kiting(@RequestParam Map<String, Object> params, Model model) {
String userId = ActionUtil.getUser().getClient_id();
Map<String, String> bank = clientInfoDao.queryForPnr(userId);
//String bankAccount = bank.get("BANK_ACCOUNT");
//bank.put("BANK_ACCOUNT", StringUtil.replace(4, 4, bankAccount, "*"));
String clientName = bank.get("CLIENT_NAME").toString();
clientName = "*" + clientName.substring(1);
bank.put("CLIENT_NAME", clientName);
model.addAttribute("bank", bank);
model.addAttribute("balance", fundBiz.balanceSelf(userId));
if (StringUtil.isBlank(params.get("_limit"))) {
params.put("_limit", 10);
}
PageUtils.processPage(params);
model.addAttribute("orders", userKitingBiz.search(params));
params.put("_total", userKitingDao.searchTotal(ActionUtil.getUser().getClient_id()));
model.addAttribute("params", params);
model.addAttribute("subBranch", userKitingBiz.querySubBranch());
return "user/fund/kiting.jsp";
}
/**提现*/
@Token(remove = true, group = "kiting")
@RequestMapping(value = "kiting", method = RequestMethod.POST)
public String kiting(@RequestParam("subBranch") String subBranch,
@RequestParam("amount") Double amount,
@RequestParam("validCode") String validCode, HttpSession session,
RedirectAttributes atts) {
atts.addFlashAttribute("message",
userKitingBiz.kiting(subBranch, amount, validCode, session));
return "redirect:/user/kiting";
}
}