修复查询可开票历史订单的数据展示逻辑,将从小到大变成了从大到小
This commit is contained in:
parent
75ce6fa59f
commit
1f25942aab
@ -316,10 +316,23 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
|
|||||||
allGroupingRecords.put(monitor, split);
|
allGroupingRecords.put(monitor, split);
|
||||||
//存放至包装类中
|
//存放至包装类中
|
||||||
Set<String> keys = allGroupingRecords.keySet();
|
Set<String> keys = allGroupingRecords.keySet();
|
||||||
|
|
||||||
|
//对key进行反向排序,保证封装的数据是反着的
|
||||||
|
ArrayList<String> tempKeyList = new ArrayList<>();
|
||||||
|
for (String key : keys) {
|
||||||
|
tempKeyList.add(key);
|
||||||
|
}
|
||||||
|
// 创建一个游标在迭代器末尾的迭代器
|
||||||
|
ListIterator<String> stringListIterator = tempKeyList.listIterator(tempKeyList.size());
|
||||||
|
// 然后反向遍历
|
||||||
|
ArrayList<String> keyList = new ArrayList<>();
|
||||||
|
while (stringListIterator.hasPrevious()) {
|
||||||
|
keyList.add(stringListIterator.previous());
|
||||||
|
}
|
||||||
ArrayList<ItemsDTO> itemsDTOS = new ArrayList<>();
|
ArrayList<ItemsDTO> itemsDTOS = new ArrayList<>();
|
||||||
//定义一个计数器,只要前3个月的记录
|
//定义一个计数器,只要前3个月的记录
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (String key : keys) {
|
for (String key : keyList) {
|
||||||
count++;
|
count++;
|
||||||
if (count == 4) {
|
if (count == 4) {
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user