try {
Preconditions.checkState(!CollectionUtils.isEmpty(ksMoveInOrderDTOS), "param is empty");
final Set<String> set = ksMoveInOrderBinDTOS.stream().map(KsMoveInOrderBinDTO::getKsBinCode).collect(Collectors.toSet());
final Set<String> set1 = ksMoveInOrderBinDTOS.stream().map(KsMoveInOrderBinDTO -> KsMoveInOrderBinDTO.getKsBinCode()).collect(Collectors.toSet());
// KsMoveInOrderBinDTO::getKsBinCode 等价于 KsMoveInOrderBinDTO -> KsMoveInOrderBinDTO.getKsBinCode()
Preconditions.checkState(set.size() == ksMoveInOrderDTOS.size(),"同一批次料箱编码重复");
ksMoveInOrderDTOS.forEach(v -> {
ValidateService moveInOrderValidateService = (ValidateService) applicationContext.getBean(moveInValidateServiceName);
moveInOrderValidateService.doValidate(v);
});
} catch (Exception e) {
throw new DataValidateException(e.getMessage());
}
关于Java新特性 ::