|
@@ -199,10 +199,20 @@ public class ScanResultActivity extends BaseActivity implements ScanResultView {
|
199
|
199
|
problemsList = dataResultRfid.getProblems();
|
200
|
200
|
|
201
|
201
|
// Function mapping data problem by Group
|
202
|
|
- List<DataGroup> groupList = Stream.of(problemsList)
|
203
|
|
- .map(v -> v.getDataDocumentType().getGroup())
|
204
|
|
- .distinctBy(DataGroup::getId)
|
205
|
|
- .collect(Collectors.toList());
|
|
202
|
+ List<DataGroup> groupList = new ArrayList<>();
|
|
203
|
+ groupList.clear();
|
|
204
|
+
|
|
205
|
+ // Search if all data problem document not have any group
|
|
206
|
+ if (!dataResultRfid.getPassed()) {
|
|
207
|
+ if (Stream.of(problemsList).allMatch(v -> v.getDataDocumentType().getGroup() == null)) {
|
|
208
|
+ groupList.add(new DataGroup(1, "No Group", "No Group Document", true));
|
|
209
|
+ } else {
|
|
210
|
+ groupList = Stream.of(problemsList)
|
|
211
|
+ .map(v -> v.getDataDocumentType().getGroup())
|
|
212
|
+ .distinctBy(DataGroup::getId)
|
|
213
|
+ .collect(Collectors.toList());
|
|
214
|
+ }
|
|
215
|
+ }
|
206
|
216
|
|
207
|
217
|
adapter.updateGroupList(groupList);
|
208
|
218
|
adapter.updateProblemList(problemsList);
|