Explorar el Código

处理报价方案过滤 能源类型 使用性质 车辆种类的问题

lixiaolong hace 2 meses
padre
commit
d81d1f6cab

+ 10 - 1
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlSchemeServiceImpl.java

@@ -644,7 +644,16 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
                 eq(PtlScheme::getProductId, productId).eq(PtlScheme::getIsDelete, 0));
                 eq(PtlScheme::getProductId, productId).eq(PtlScheme::getIsDelete, 0));
         Map<String, PtlScheme> collectPtlSchemes = ptlSchemes.stream().collect(Collectors.toMap(PtlScheme::getId, Function.identity()));
         Map<String, PtlScheme> collectPtlSchemes = ptlSchemes.stream().collect(Collectors.toMap(PtlScheme::getId, Function.identity()));
         AssertionUtils.isFail(collectPtlSchemes.isEmpty(), "没有可报价的方案配置信息");
         AssertionUtils.isFail(collectPtlSchemes.isEmpty(), "没有可报价的方案配置信息");
-        schemeResultVo.getSchemes().stream().filter(s -> !collectPtlSchemes.containsKey(s.getId()));
+        List<String> schemeInfoIds = new ArrayList<>();
+        for (SchemeResultVo.SchemeInfoVo schemeInfo : schemeResultVo.getSchemes()) {
+            schemeInfoIds.add(schemeInfo.getId());
+        }
+        List<PtlSchemeInfo> ptlSchemeInfos = ptlSchemeInfoMapper.selectList(new LambdaQueryWrapper<PtlSchemeInfo>().in(PtlSchemeInfo::getId, schemeInfoIds));
+        List<String> schemeIds = new ArrayList<>();
+        for (PtlSchemeInfo ptlSchemeInfo : ptlSchemeInfos) {
+            schemeIds.add(ptlSchemeInfo.getSchemeId());
+        }
+        schemeResultVo.getSchemes().removeIf(s -> !schemeIds.contains(s.getId()));
         return schemeResultVo;
         return schemeResultVo;
     }
     }