Browse Source

feat: 优化对账提示拼接方法

hejq 7 years ago
parent
commit
36f9062ca7

+ 3 - 5
src/main/java/com/uas/platform/b2b/service/impl/PurchaseApCheckServiceImpl.java

@@ -1012,11 +1012,9 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
             tableNameSet.forEach(tableName -> {
                 Set<Long> sourceIdSet = getSourceIdSet(checkItemList, tableName);
                 List<PurchaseApCheckItem> itemList = this.findBySourceTableAndSourceIdIn(tableName, sourceIdSet);
-                itemList.forEach(item -> {
-                    if (disableStatus.equals(item.getApCheck().getCheckStatus())) {
-                        alters.add(item.getInoutno());
-                    }
-                });
+                alters.addAll(itemList.stream().filter(item -> disableStatus.equals(item.getApCheck().getCheckStatus()))
+                    .map(PurchaseApCheckItem::getInoutno)
+                    .collect(Collectors.toSet()));
             });
             if (!CollectionUtil.isEmpty(alters)) {
                 throw new IllegalOperatorException("订单" + new ModelMap("alters", alters) + "存在未对账的单据,请先进行对账!");