jiangping
2024-01-25 aaea4819b873c5ca7b9be1a87af173ee2015a12a
server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -25,6 +25,7 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -43,6 +44,8 @@
@Service
public class CompanyServiceImpl implements CompanyService {
    @Value("${debug_model}")
    private boolean debugModel;
    @Autowired
    private CompanyMapper companyMapper;
    @Autowired
@@ -221,8 +224,11 @@
            ||StringUtils.isBlank(company.getEmail())){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        //手机验证码校验
        SmsEmailServiceImpl.isCaptcheValide(smsEmailMapper,company.getPhone(),company.getCaptche());
        if(!debugModel){
            //手机验证码校验
            SmsEmailServiceImpl.isCaptcheValide(smsEmailMapper,company.getPhone(),company.getCaptche());
        }
    }
@@ -448,7 +454,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 +462,7 @@
        csWrapper.eq(CompanySolution::getIsdeleted,Constants.ZERO);
        csWrapper.orderByAsc(CompanySolution::getSortnum);
        model.setSolutionList(companySolutionJoinMapper.selectJoinList(CompanySolution.class,csWrapper));
*/
        initImgData(model);
        return model;
    }
@@ -609,7 +615,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");