From 63761c9d3a6943a0a51968d558e320cc250eb240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E4=B9=85=E5=93=A5?= <787952492@qq.com> Date: Tue, 14 Jun 2022 13:43:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E7=9A=84=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/project/ProjectServiceImpl.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java index d228fb5a..0c46a649 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java @@ -19,8 +19,10 @@ import cn.iocoder.yudao.module.farm.dal.mysql.taskCate.TaskCateMapper; import cn.iocoder.yudao.module.farm.enums.TaskStatus; import cn.iocoder.yudao.module.farm.service.task.TaskService; import cn.iocoder.yudao.module.system.dal.dataobject.CpUser.CpUserDO; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.dal.mysql.CpUser.CpUserMapper; import cn.iocoder.yudao.module.system.service.CpUser.CpUserService; +import cn.iocoder.yudao.module.system.service.user.AdminUserService; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -66,11 +68,9 @@ public class ProjectServiceImpl implements ProjectService { @Resource private CpUserMapper cpUserMapper; @Resource - private AreaMapper areaMapper; - @Resource - private TaskCateMapper taskCateMapper; - @Resource private TaskService taskService; + @Resource + private AdminUserService adminUserService; @Override public Long createProject(ProjectCreateReqVO createReqVO) { @@ -154,8 +154,13 @@ public class ProjectServiceImpl implements ProjectService { } if (ObjectUtil.isNotEmpty(pageDTO.getMyProject()) && pageDTO.getMyProject()){ - //查看我参与的项目 - queryWrapperX.last(" and JSON_CONTAINS(members, '"+ getLoginUserId()+"') OR creator = "+ getLoginUserId()); + AdminUserDO adminUser = adminUserService.getUser(getLoginUserId()); + CpUserDO user = cpUserMapper.selectOne(Wrappers.lambdaQuery().eq(CpUserDO::getUserId, adminUser.getUsername())); + if (ObjectUtil.isNotEmpty(user)){ + //查看我参与或创建的项目 + queryWrapperX.last(" and (JSON_CONTAINS(members, '"+ user.getId()+"') or creator = " + getLoginUserId() +")") ; + } + } List list = projectMapper.selectList(queryWrapperX);