应急处置ncc
All checks were successful
local-test分支构建docker并发布运行 / Docker-Build (push) Successful in 1m23s
All checks were successful
local-test分支构建docker并发布运行 / Docker-Build (push) Successful in 1m23s
This commit is contained in:
parent
a051e6d8a1
commit
3005199df1
@ -1,9 +1,12 @@
|
||||
package club.joylink.xiannccda.dto.fq;
|
||||
|
||||
import club.joylink.xiannccda.entity.FaultQuery;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.google.common.collect.Lists;
|
||||
import java.security.PublicKey;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
@ -18,15 +21,25 @@ public class FaultQueryNcc {
|
||||
|
||||
public FaultQueryNcc(String typeName, List<FaultQuery> fqList) {
|
||||
this.nccTypeName = typeName;
|
||||
Map<String, List<String>> dataMapList = fqList.stream().collect(Collectors.groupingBy(FaultQuery::getFaultDriverShower, Collectors.mapping(FaultQuery::getResultMsg, Collectors.toList())));
|
||||
Map<String, List<FaultQuery>> dataMapList = fqList.stream().collect(Collectors.groupingBy(FaultQuery::getFaultDriverShower, Collectors.collectingAndThen(Collectors.toList(), lists -> {
|
||||
lists.sort(Comparator.comparingLong(FaultQuery::getId));
|
||||
return lists;
|
||||
})));
|
||||
List<NccData> tl = Lists.newArrayList();
|
||||
dataMapList.forEach((k, v) -> {
|
||||
tl.add(new NccData(k, v));
|
||||
NccData nd = new NccData(k, v.stream().map(FaultQuery::getResultMsg).collect(Collectors.toList()));
|
||||
nd.setOrderId(v.get(0).getId());
|
||||
tl.add(nd);
|
||||
});
|
||||
this.orderId = fqList.get(0).getId();
|
||||
|
||||
tl.sort(Comparator.comparingLong(NccData::getOrderId));
|
||||
this.nccData = tl;
|
||||
}
|
||||
|
||||
private String nccTypeName;
|
||||
@JsonIgnore
|
||||
private Long orderId;
|
||||
private List<NccData> nccData;
|
||||
|
||||
@Data
|
||||
@ -42,6 +55,8 @@ public class FaultQueryNcc {
|
||||
this.datas = datas;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
private Long orderId;
|
||||
private String action;
|
||||
private List<String> datas;
|
||||
}
|
||||
|
@ -85,6 +85,7 @@ public class FaultQueryRepository extends ServiceImpl<FaultQueryMapper, FaultQue
|
||||
typeMapList.forEach((k, v) -> {
|
||||
nccList.add(new FaultQueryNcc(k, v));
|
||||
});
|
||||
Collections.sort(nccList, Comparator.comparingLong(FaultQueryNcc::getOrderId));
|
||||
return nccList;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user