From 99a1938775ebbde2cb6a93128beac22bdb975570 Mon Sep 17 00:00:00 2001 From: dx <1242347652@qq.com> Date: Tue, 25 Feb 2025 14:34:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enterprise/vo/EnterprisePageReqVO.java | 1 + .../mysql/enterprise/EnterpriseMapper.java | 6 +++ .../system/job/TaskSendStartMessageJob.java | 4 +- .../enterprise/EnterpriseServiceImpl.java | 25 +++---------- .../mapper/enterprise/EnterpriseMapper.xml | 37 +++++++++++++++++++ 5 files changed, 51 insertions(+), 22 deletions(-) create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/enterprise/EnterpriseMapper.xml diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterprisePageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterprisePageReqVO.java index d48de4f..7da1f7c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterprisePageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterprisePageReqVO.java @@ -91,4 +91,5 @@ public class EnterprisePageReqVO extends PageParam { private List tagList; + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprise/EnterpriseMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprise/EnterpriseMapper.java index 551e673..5a60ee5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprise/EnterpriseMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprise/EnterpriseMapper.java @@ -6,8 +6,12 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO; +import cn.iocoder.yudao.module.system.dal.dataobject.taskinfo.TaskInfoDO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; import cn.iocoder.yudao.module.system.controller.admin.enterprise.vo.*; +import org.apache.ibatis.annotations.Param; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser; import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId; @@ -67,4 +71,6 @@ public interface EnterpriseMapper extends BaseMapperX { .inIfPresent(EnterpriseDO::getId,reqVO.getIds()) .orderByDesc(EnterpriseDO::getId)); } + + IPage getAppPage(Page page, @Param("params") EnterprisePageReqVO pageReqVO); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.java index c350bf0..e972608 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.java @@ -78,7 +78,7 @@ public class TaskSendStartMessageJob implements JobHandler { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(EnterpriseInspectionsDO::getTaskId, x.getId()); List enterpriseInspectionsDOList = enterpriseInspectionsMapper.selectList(wrapper); - if(enterpriseInspectionsDOList!=null && enterpriseInspectionsDOList.size() > 0){ + if(enterpriseInspectionsDOList!=null && enterpriseInspectionsDOList.size() > 0) { List list = new ArrayList<>(); for (EnterpriseInspectionsDO enterpriseInspectionsDO : enterpriseInspectionsDOList) { //站内信发送通知 @@ -96,8 +96,6 @@ public class TaskSendStartMessageJob implements JobHandler { } enterpriseInspectionsMapper.updateBatch(list); } - - } }); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java index 757f156..3fe9620 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java @@ -24,6 +24,8 @@ import cn.iocoder.yudao.module.system.service.permission.RoleService; import cn.iocoder.yudao.module.system.service.user.AdminUserService; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.tomcat.jni.FileInfo; import org.checkerframework.checker.units.qual.A; import org.springframework.stereotype.Service; @@ -240,27 +242,12 @@ public class EnterpriseServiceImpl implements EnterpriseService { pageReqVO.setDepartmentId(typeVO.getValue()); } - final PageResult enterpriseDOPageResult = enterpriseMapper.selectPage(pageReqVO); + Page page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); + final IPage appPage = enterpriseMapper.getAppPage(page, pageReqVO); + + return new PageResult<>(appPage.getRecords(), appPage.getTotal()); - if (pageReqVO.getTagList() != null && pageReqVO.getTagList().size() > 0) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.in(EnterpriseTagDO::getTagId, pageReqVO.getTagList()); - List enterpriseTagDOList = enterpriseTagMapper.selectList(wrapper); - //根据enterpriseTagDOList 筛选 - List enterpriseDOList = new ArrayList<>(); - for (EnterpriseDO enterpriseDO : enterpriseDOPageResult.getList()) { - for (EnterpriseTagDO enterpriseTagDO : enterpriseTagDOList) { - if (enterpriseTagDO.getEnterpriseId().equals(enterpriseDO.getId())) { - enterpriseDOList.add(enterpriseDO); - break; - } - } - } - enterpriseDOPageResult.setList(enterpriseDOList); - enterpriseDOPageResult.setTotal(Long.valueOf(enterpriseDOList.size())); - } - return enterpriseDOPageResult; } //审核状态 @Override diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/enterprise/EnterpriseMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/enterprise/EnterpriseMapper.xml new file mode 100644 index 0000000..0f23eca --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/enterprise/EnterpriseMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + +