liujie
2025-08-11 7c9f5fc33099083e0e1f5afcaad86546293bd08d
update
1个文件已修改
55 ■■■■ 已修改文件
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbCompanyServiceImpl.java 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbCompanyServiceImpl.java
@@ -25,6 +25,7 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.function.Consumer;
import java.util.stream.Collectors;
/**
@@ -92,10 +93,6 @@
            queryWrapper.in(TbCompany::getCompanyCategory, query.getCompanyCategorys());
        }
        if (query.getRegisteredCapitals() != null && query.getRegisteredCapitals().size() > 0) {
            queryWrapper.in(TbCompany::getRegisteredCapital, query.getRegisteredCapitals());
        }
        if (query.getCompanyIndustryIds() != null && query.getCompanyIndustryIds().size() > 0) {
            queryWrapper.in(TbCompany::getCompanyIndustryId, query.getCompanyIndustryIds());
@@ -126,13 +123,48 @@
        if (query.getHaveSoftWorks() != null) {
            queryWrapper.eq(TbCompany::getHaveSoftWorks, query.getHaveSoftWorks());
        }
        if (query.getMoneySort() != null && query.getMoneySort() == 1) {
            queryWrapper.orderByDesc(TbCompany::getSaleMoney);
        } else if (query.getMoneySort() != null && query.getMoneySort() == 2) {
            queryWrapper.orderByAsc(TbCompany::getSaleMoney);
        } else {
            queryWrapper.orderByDesc(TbCompany::getCreateTime);
        String sql="";
        if (query.getRegisteredCapitals() != null && query.getRegisteredCapitals().size() > 0) {
            List<String> registeredCapitals = query.getRegisteredCapitals();
            sql += " and (";
            boolean first = true;
            for (String registeredCapital : registeredCapitals) {
                if (!first) {
                    sql += " OR ";
        }
                switch (registeredCapital) {
                    case "10W以下":
                        sql += " (registered_capital between 0 and 10)";
                        break;
                    case "10-50W以下":
                        sql += " (registered_capital between 10 and 50)";
                        break;
                    case "50-100W以下":
                        sql += " (registered_capital between 50 and 100)";
                        break;
                    case "100-500W以下":
                        sql += " (registered_capital between 100 and 501)";
                        break;
                    case "500-1000W以下":
                        sql += " (registered_capital between 500 and 1000)";
                        break;
                    case "1000W以上":
                        sql += " (registered_capital >= 1000)";
                        break;
                }
                first = false;
            }
            sql += ")";
        }
        if (query.getMoneySort() != null && query.getMoneySort() == 1) {
            sql += " ORDER BY sale_money DESC";
        } else if (query.getMoneySort() != null && query.getMoneySort() == 2) {
            sql += " ORDER BY sale_money ASC";
        } else {
            sql += " ORDER BY create_time DESC";
        }
        queryWrapper.last(sql);
        Page<TbCompany> companyPage = this.baseMapper.selectPage(page, queryWrapper);
        if (companyPage.getRecords().isEmpty()) {
            return page1;
@@ -234,6 +266,7 @@
        map.put("completed", list.stream().filter(e -> e.getStatus() == 5).count() + list.stream().filter(e -> e.getStatus() == 6).count());
        return map;
    }
    @Override
    public CompanyDetailVo companyDetail(String companyId, Long userId) {
        CompanyDetailVo companyDetailVo = new CompanyDetailVo();
@@ -307,8 +340,6 @@
                }
            }
        }
        return companyDetailVo;