miniui 批量保存控制器方法

@RequestMapping(value = "/match_save", method = RequestMethod.POST)
@ResponseBody//表示响应的主体。即不需要VIEW展现层模块,直接显示到客户端的内容。
public void match_save(HttpServletRequest request,
HttpServletResponse response) throws Exception {
String json = request.getParameter("data");
ArrayList rows = (ArrayList) JSON.Decode(json);
String match_id = "";
String m_index = "";
String issue_no = "";
String lotteryType;
String league_name = "";
String home_team = "";
String guest_team = "";
String final_score = "";
String lose_rate = "";
String half_score = "";
String deuce_rate = "";
String win_rate = "";
String match_time = "";


for (int i = 0, l = rows.size(); i < l; i++) {
HashMap row = (HashMap) rows.get(i);


match_id = row.get("match_id") != null ? row.get("match_id")
.toString() : "";
issue_no = row.get("issue_no") != null ? row.get("issue_no")
.toString() : "";
m_index = row.get("m_index") != null ? row.get("m_index")
.toString() : "";
league_name = row.get("league_name") != null ? row.get(
"league_name").toString() : "";
lotteryType = row.get("lottery_type").toString();


home_team = row.get("home_team") != null ? row.get("home_team")
.toString() : "";


guest_team = row.get("guest_team") != null ? row.get("guest_team")
.toString() : "";
final_score = row.get("final_score") != null ? row.get(
"final_score").toString() : "";
half_score = row.get("half_score") != null ? row.get("half_score")
.toString() : "";
win_rate = row.get("win_rate") != null ? row.get("win_rate")
.toString() : "";
deuce_rate = row.get("deuce_rate") != null ? row.get("deuce_rate")
.toString() : "";
lose_rate = row.get("lose_rate") != null ? row.get("lose_rate")
.toString() : "";
match_time = row.get("match_time") != null ? row.get("match_time")
.toString() : "";
Match match = new Match();
match.setMatch_id(Integer.parseInt(match_id));
match.setIssue_no(issue_no);
match.setLottery_type(LotteryType.valueOf(lotteryType));
match.setM_index(Integer.parseInt(m_index));
match.setLeague_name(league_name);
match.setHome_team(home_team);
match.setGuest_team(guest_team);
match.setFinal_score(final_score);
match.setHalf_score(half_score);
match.setWin_rate(win_rate);
match.setDeuce_rate(deuce_rate);
match.setLose_rate(lose_rate);
match.setMatch_time(DateUtil.StringToDate_YYYY_MM_DD_HH_MM_SS(match_time));
footBallManager.saveMatch(match);


}
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值