111
k94314517
2024-01-22 c8ad6f13c0e9cbff9a0763bc50c86576449f6e03
server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -448,7 +448,7 @@
        if(model == null ||Constants.equalsInteger(model.getIsdeleted(),Constants.ONE)){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        MPJLambdaWrapper<CompanySolution> csWrapper = new MPJLambdaWrapper<>();
        /*MPJLambdaWrapper<CompanySolution> csWrapper = new MPJLambdaWrapper<>();
        csWrapper.selectAll(CompanySolution.class);
        csWrapper.selectAs(Solutions::getName,CompanySolution::getSolutionName);
        csWrapper.leftJoin(Solutions.class,Solutions::getId,CompanySolution::getSolutionBaseId);
@@ -456,7 +456,7 @@
        csWrapper.eq(CompanySolution::getIsdeleted,Constants.ZERO);
        csWrapper.orderByAsc(CompanySolution::getSortnum);
        model.setSolutionList(companySolutionJoinMapper.selectJoinList(CompanySolution.class,csWrapper));
*/
        initImgData(model);
        return model;
    }
@@ -609,7 +609,12 @@
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        if(pageWrap.getModel().getQueryFlag() == 0){
            //只能看权限范围内
            queryWrapper.exists("select b.id from company_permission b where b.user_id="+user.getId()+" and b.isdeleted=0 and b.company_id=company.id");
            if(user.getCompanyIdList() == null || user.getCompanyIdList().size() == 0){
                queryWrapper.lambda().eq(Company::getId,-1);//设置无效访问
            }else {
                queryWrapper.lambda().in(Company::getId, user.getCompanyIdList());
            }
//            queryWrapper.exists("select b.id from company_permission b where b.user_id="+user.getId()+" and b.isdeleted=0 and b.company_id=company.id");
        } else if (pageWrap.getModel().getQueryFlag() == 1) {
            //查詢是否有查看權限
            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");