Browse Source

我的项目

zyh
小久哥 3 years ago
parent
commit
63761c9d3a
  1. 17
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java

17
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.enums.TaskStatus;
import cn.iocoder.yudao.module.farm.service.task.TaskService; 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.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.dal.mysql.CpUser.CpUserMapper;
import cn.iocoder.yudao.module.system.service.CpUser.CpUserService; 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.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -66,11 +68,9 @@ public class ProjectServiceImpl implements ProjectService {
@Resource @Resource
private CpUserMapper cpUserMapper; private CpUserMapper cpUserMapper;
@Resource @Resource
private AreaMapper areaMapper;
@Resource
private TaskCateMapper taskCateMapper;
@Resource
private TaskService taskService; private TaskService taskService;
@Resource
private AdminUserService adminUserService;
@Override @Override
public Long createProject(ProjectCreateReqVO createReqVO) { public Long createProject(ProjectCreateReqVO createReqVO) {
@ -154,8 +154,13 @@ public class ProjectServiceImpl implements ProjectService {
} }
if (ObjectUtil.isNotEmpty(pageDTO.getMyProject()) && pageDTO.getMyProject()){ if (ObjectUtil.isNotEmpty(pageDTO.getMyProject()) && pageDTO.getMyProject()){
//查看我参与的项目 AdminUserDO adminUser = adminUserService.getUser(getLoginUserId());
queryWrapperX.last(" and JSON_CONTAINS(members, '"+ getLoginUserId()+"') OR creator = "+ getLoginUserId()); CpUserDO user = cpUserMapper.selectOne(Wrappers.<CpUserDO>lambdaQuery().eq(CpUserDO::getUserId, adminUser.getUsername()));
if (ObjectUtil.isNotEmpty(user)){
//查看我参与或创建的项目
queryWrapperX.last(" and (JSON_CONTAINS(members, '"+ user.getId()+"') or creator = " + getLoginUserId() +")") ;
}
} }
List<ProjectDO> list = projectMapper.selectList(queryWrapperX); List<ProjectDO> list = projectMapper.selectList(queryWrapperX);

Loading…
Cancel
Save