码迷,mamicode.com
首页 > 其他好文 > 详细

马拉松参赛人员显示(瞬逝版)

时间:2017-03-30 20:43:42      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:equals   getc   ++   eof   system   etc   方法   append   list   

service层代码如下:

// 马拉松参赛成员列表
public List<JoinMarathonView> joinMarathonList() {
List<JoinMarathonView> marathonjoinAllList = joinMarathonDao.getNamesByMarathon();//包含唯一mberid的集合
List<Marathon> allCityList =joinMarathonDao.getAllCity();
List<JoinMarathonView> allAwardList =joinMarathonDao.getAllAward();

for (JoinMarathonView coreofonelist : marathonjoinAllList) { //加城市

//List<String> listcitysnew1 = new ArrayList<String>();
StringBuilder citystr = new StringBuilder();
int count = 0;
for(Marathon allcityone : allCityList){
if(allcityone.getMemberId().equals(coreofonelist.getMemberId())){
//listcitysnew1.add(allcityone.getCity());
citystr.append(allcityone.getCity());
citystr.append(",");
count++;
}
}
//coreofonelist.setCity(listcitysnew1.toString().replace("[", "").replace("]", ""));
System.out.println(citystr);
coreofonelist.setCity(citystr.toString());
coreofonelist.setCount(count);
}//一个大循环结束

for (JoinMarathonView coreofonelist : marathonjoinAllList) { //加奖项
StringBuilder str = new StringBuilder();
for(JoinMarathonView allawardone : allAwardList){
if(allawardone.getMemberId().equals(coreofonelist.getMemberId())){
String addaward = allawardone.getName() + "x" + allawardone.getCount() + "(" + allawardone.getMemo() + ")";
str.append(addaward);
}
}
System.out.println(str);
coreofonelist.setAward(str.toString());
}//第二个大循环结束
return marathonjoinAllList;
}//方法结束

马拉松参赛人员显示(瞬逝版)

标签:equals   getc   ++   eof   system   etc   方法   append   list   

原文地址:http://www.cnblogs.com/zz-3m23d-begining/p/6648325.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!