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);