From 15e588eb6a7549ecd2aaffb45e67f11e68354eb6 Mon Sep 17 00:00:00 2001 From: k94314517 <8417338+k94314517@user.noreply.gitee.com> Date: 星期一, 05 二月 2024 18:22:19 +0800 Subject: [PATCH] 111 --- server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java | 40 +++++++++++++++++++++++++++++++++++++--- 1 files changed, 37 insertions(+), 3 deletions(-) diff --git a/server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java index d87ceeb..ec4927b 100644 --- a/server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java +++ b/server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java @@ -14,6 +14,7 @@ import com.doumee.dao.business.join.SolutionWorktypeJoinMapper; import com.doumee.dao.business.join.SolutionsJoinMapper; import com.doumee.dao.business.model.*; +import com.doumee.service.business.CompanyService; import com.doumee.service.business.SolutionsService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; @@ -185,11 +186,13 @@ ); solutionsMapper.update(null,new UpdateWrapper<Solutions>() .lambda() + .ne(Solutions::getId,newModel.getId()) .eq(Solutions::getBaseId,solutions.getId()) .eq(Solutions::getDataType,Constants.TWO) .set(Solutions::getDataType,Constants.ONE) + .set(StringUtils.isNotBlank(solutions.getSignKeyword()),Solutions::getSignKeyword,solutions.getSignKeyword()) ); - //澶勭悊宸ヤ綔淇℃伅锛屾柊澧炴渶鏂扮殑锛屽悓鏃朵骇鐢熷巻鍙茬増鏈� + //澶勭悊宸ョ淇℃伅锛屾柊澧炴渶鏂扮殑锛屽悓鏃朵骇鐢熷巻鍙茬増鏈� dealWorkType(solutions,newModel,solutions.getWorktypeIdList(),false); } @@ -229,7 +232,12 @@ } @Override public Solutions findById(Integer id) { - Solutions model = solutionsMapper.selectById(id); + MPJLambdaWrapper<Solutions> queryWrapper = new MPJLambdaWrapper<>(); + queryWrapper.selectAll(Solutions.class); + queryWrapper.selectAs(Insurance::getName,Solutions::getInsuranceName); + queryWrapper.leftJoin(Insurance.class,Insurance::getId,Solutions::getInsuranceId); + queryWrapper.eq(Solutions::getId,id); + Solutions model = solutionsJoinMapper.selectJoinOne(Solutions.class,queryWrapper); if(model == null || !Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){ throw new BusinessException(ResponseStatus.DATA_EMPTY ); } @@ -254,7 +262,10 @@ @Override public List<Solutions> findList(Solutions solutions) { solutions.setIsdeleted(Constants.ZERO); - solutions.setDataType(Constants.TWO); + solutions.setStatus(Constants.ZERO); + if(solutions.getDataType() == null){ + solutions.setDataType(Constants.TWO); + } QueryWrapper<Solutions> wrapper = new QueryWrapper<>(solutions); return solutionsMapper.selectList(wrapper); } @@ -368,6 +379,7 @@ } } PageData<Solutions> pageData = PageData.from(solutionsJoinMapper.selectJoinPage(page,Solutions.class, queryWrapper)); + return pageData; } @Override @@ -399,6 +411,28 @@ return PageData.from(solutionsMapper.selectPage(page, queryWrapper)); } + + @Override + public List<Solutions> findListForCompany() { + LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); + List<Solutions> solutionsList = solutionsJoinMapper.selectJoinList(Solutions.class,new MPJLambdaWrapper<Solutions>() + .selectAll(Solutions.class) + .leftJoin(CompanySolution.class,CompanySolution::getSolutionBaseId,Solutions::getId) + .eq(Solutions::getIsdeleted,Constants.ZERO) + .eq(Solutions::getDataType,Constants.TWO) + .eq(CompanySolution::getIsdeleted,Constants.ZERO) + .eq(CompanySolution::getCompanyId,user.getCompanyId()) + .orderByAsc(Solutions::getSortnum) + ); + return solutionsList; + } + + + + + + + @Override public long count(Solutions solutions) { QueryWrapper<Solutions> wrapper = new QueryWrapper<>(solutions); -- Gitblit v1.9.3