linwe
2024-07-12 2f2115a19277620bb7d9ac4af1e3bfd7830d2e6c
limit 是空时候,全表查询了,会导致内存溢出 默认设置20
2 files modified
12 ■■■■■ changed files
src/main/java/org/springblade/modules/house/service/impl/HouseholdServiceImpl.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/vo/HouseholdVO.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/house/service/impl/HouseholdServiceImpl.java
@@ -812,10 +812,12 @@
        List<HouseholdVO> householdVOS = baseMapper.selectHouseholdList(household);
        // 遍历
        for (HouseholdVO householdVO : householdVOS) {
            if (householdVO.getHouseholdLabelList().size() > 0) {
                List<String> labelNameList = householdVO.getHouseholdLabelList().stream().map(householdLabelVO -> householdLabelVO.getLabelName())
                    .collect(Collectors.toList());
                householdVO.setLabelName(String.join(",", labelNameList));
            List<HouseholdLabelVO> householdLabelList = householdVO.getHouseholdLabelList();
            if (!householdLabelList.isEmpty()) {
                String labelName = householdLabelList.stream()
                    .map(HouseholdLabelVO::getLabelName)
                    .collect(Collectors.joining(","));
                householdVO.setLabelName(labelName);
            }
        }
        // 返回
src/main/java/org/springblade/modules/house/vo/HouseholdVO.java
@@ -172,7 +172,7 @@
    /**
     * 取值数
     */
    private Integer limit;
    private Integer limit = 20;
    @ApiModelProperty(value = "未成年 1:否 2:是", example = "")
    private Integer minors;