数组分成若干个数组
public static final List<Long[]> makeVchIdsArrayGroup(Long[] vchIds) {
// 将凭证ID数组分成若干个凭证ID数组。
List<Long[]> vchIdsArrayList = new ArrayList<Long[]>();
if (vchIds.length >= 900) {
int n = 0;
Long[][] vchIdsLong = new Long[vchIds.length / 900][900];
for (int i = 0; i < vchIds.length / 900; i++) {
for (int m = i * 900; m < 900 * (i + 1); m++) {
if (n > 899) {
n = 0;
}
vchIdsLong[i][n++] = vchIds[m];
}
vchIdsArrayList.add(vchIdsLong[i]);
}
// 获得余下的凭证ID;
if (vchIds.length % 900 != 0) {
int k = 0;
Long[] vchIds_Long = new Long[vchIds.length % 900];
for (int i = vchIds.length / 900 * 900; i < vchIds.length; i++) {
vchIds_Long[k++] = vchIds[i];
}
vchIdsArrayList.add(vchIds_Long);
}
} else {
vchIdsArrayList.add(vchIds);
}
return vchIdsArrayList;
}