From aaea4819b873c5ca7b9be1a87af173ee2015a12a Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期四, 25 一月 2024 14:52:24 +0800 Subject: [PATCH] 开发业务接口 --- server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java index 15ba46b..8ba0cf6 100644 --- a/server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java +++ b/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"); -- Gitblit v1.9.3