/**
* 去重
*
* @param orderList
* @return
* @author jqlin
*/
private static List removeDuplicateOrder(List orderList) {
Set set = new TreeSet(new Comparator() {
@Override
public int compare(ansVo a, ansVo b) {
// 字符串则按照asicc码升序排列
return a.getId().compareTo(b.getId());
}
});
set.addAll(orderList);
return new ArrayList(set);
}
//按照多个字段去重
private static ArrayList removeDuplicateBussinessname(List returnAllList) {
Set set = new TreeSet(new Comparator() {
@Override
public int compare(Map o1, Map o2) {
int compareToResult = 1;// ==0表示重复
// 字符串则按照asicc码升序排列
if ((CustomString.GetMapValue(o1, "name").equals(CustomString.GetMapValue(o2, "name")))
&& (CustomString.GetMapValue(o1, "wdata").equals(CustomString.GetMapValue(o2, "wdata")))
&&( CustomString.GetMapValue(o1, "wtime").equals(CustomString.GetMapValue(o2, "wtime")))
&& (CustomString.GetMapValue(o1, "wsec").equals(CustomString.GetMapValue(o2, "wsec"))))
{
compareToResult = 0;
}
return compareToResult;
}
});
set.addAll(returnAllList);
return new ArrayList(set);
}