标签: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