//比较两个list
public static List getDiffrent(List list1, List list2){
List diff = new ArrayList();
String temp1 = list1.toString ().replaceAll ("[\[\]]", “,”).replaceAll ("\s+", “”);
String temp2 = list2.toString ().replaceAll ("[\[\]]", “,”).replaceAll ("\s+", “”);
String result1 = “”;
System.out.println(“list2.size”+list2.size());
for ( int i = 0; i < list2.size (); i++ )
{
if (temp1.indexOf ("," + list2.get (i).getBinother()+ “,”) == -1)
{
System.out.println(“list2.get (i).getBinother()”+list2.get (i).getBinother());
// result1 += list2.get (i) + “,”;
kaigongdan kaigongdan = new kaigongdan();
kaigongdan.setLotno(list2.get (i).getLotno());
kaigongdan.setVolume(list2.get (i).getVolume());
kaigongdan.setBin_other(list2.get (i).getBin_other());
kaigongdan.setBinother(list2.get (i).getBinother());
diff.add(kaigongdan);
}
}
//diff.add(result1);
return diff;
}