k94314517
2024-04-09 71e2d06dfa28d3bd60b0d9fa6d6c7ff32884a1a9
server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -783,8 +783,11 @@
        company.setIsdeleted(Constants.ZERO);
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        if(Constants.equalsInteger(company.getType(),Constants.ONE)){
                return new ArrayList<>();
        }else  {
            if(Constants.equalsInteger(user.getType(),Constants.TWO)){
                //如果是商户
                wrapper.lambda().exists("select c.id from company_solution c where c.isdeleted=0 and c.shop_id=company.id");//设置无效访问
        }else {
            //如果查询企业数据
            if(company.getQueryFlag() == 0){
@@ -799,7 +802,7 @@
                wrapper.select("*,(select count(1) from company_permission b where b.user_id="+company.getUserId()+" and b.isdeleted=0 and b.company_id=company.id) as hasPerimission");
            }
        }
        }
        return companyMapper.selectList(wrapper);
    }
@@ -812,6 +815,10 @@
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        if(Constants.formatIntegerNum(pageWrap.getModel().getType()) == Constants.ONE) {
        }else{
            if(Constants.equalsInteger(user.getType(),Constants.TWO)){
                //如果是商户
                queryWrapper.lambda().exists("select c.id from company_solution c where c.isdeleted=0 and c.shop_id=company.id");//设置无效访问
        }else{
            //如果查询企业数据,只能看权限范围内
            if(pageWrap.getModel().getQueryFlag() == 0){
@@ -827,6 +834,9 @@
                queryWrapper.select("*,(select count(1) from company_permission b where b.user_id="+user.getId()+" and b.isdeleted=0 and b.company_id=company.id) as hasPerimission");
            }
        }
        }
        if (pageWrap.getModel().getId() != null) {
            queryWrapper.lambda().eq(Company::getId, pageWrap.getModel().getId());
        }