Browse Source

修复虚拟角色不显示问题

recovery
ma 4 years ago
parent
commit
f604328272
  1. 13
      tall/src/main/java/com/ccsens/tall/persist/dao/SysProjectDao.java
  2. 14
      tall/src/main/java/com/ccsens/tall/service/ProRoleService.java
  3. 49
      tall/src/main/resources/mapper_dao/ProRoleDao.xml
  4. 14
      tall/src/main/resources/mapper_dao/SysProjectDao.xml

13
tall/src/main/java/com/ccsens/tall/persist/dao/SysProjectDao.java

@ -2,10 +2,7 @@ package com.ccsens.tall.persist.dao;
import com.ccsens.tall.bean.dto.LwbsDto;
import com.ccsens.tall.bean.po.SysProject;
import com.ccsens.tall.bean.vo.ChartVo;
import com.ccsens.tall.bean.vo.LwbsVo;
import com.ccsens.tall.bean.vo.PluginVo;
import com.ccsens.tall.bean.vo.ProjectVo;
import com.ccsens.tall.bean.vo.*;
import com.ccsens.tall.persist.mapper.SysProjectMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@ -79,4 +76,12 @@ public interface SysProjectDao extends SysProjectMapper{
* @return
*/
ProjectVo.RoleInfo selectProjectInfoByProAndMem(Long roleId);
/**
* 查询未添加的项目虚拟角色
* @param projectId
* @param listBeforeId
* @return
*/
List<RoleVo.JueSeByProId> selectProjectRoleNoAdd(@Param("projectId") Long projectId,@Param("listBeforeId") List<Long> listBeforeId);
}

14
tall/src/main/java/com/ccsens/tall/service/ProRoleService.java

@ -852,6 +852,7 @@ public class ProRoleService implements IProRoleService {
}
}
//查询未添加的角色
List<RoleVo.JueSeByProId> listNoAddRoles = new ArrayList<>();
List<RoleVo.JueSeByProId> listAfter=proRoleDao.queryRoleShowslistBefore(param.getParam().getProjectId(),listBeforeId);
for (int i = 0; i < listAfter.size(); i++) {
//是否项目经理
@ -868,8 +869,19 @@ public class ProRoleService implements IProRoleService {
listAfter.get(i).setMine(false);
}
}
listNoAddRoles.add(listAfter.get(i));
}
jueSeByProIdLists.setListAfter(listAfter);
//查询未添加的虚拟项目角色
List<RoleVo.JueSeByProId> listAfter1 = projectDao.selectProjectRoleNoAdd(param.getParam().getProjectId(),listBeforeId);
if (CollectionUtil.isNotEmpty(listAfter1)){
for (RoleVo.JueSeByProId projectRole : listAfter1) {
projectRole.setProjectRole(1);
projectRole.setRelevanceProjectId(projectRole.getId());
projectRole.setRelevanceProjectName(projectRole.getName());
listNoAddRoles.add(projectRole);
}
}
jueSeByProIdLists.setListAfter(listNoAddRoles);
jueSeByProIdLists.setListBefore(listBefor);
return jueSeByProIdLists;
}

49
tall/src/main/resources/mapper_dao/ProRoleDao.xml

@ -354,23 +354,42 @@
and tpmrs.member_id=#{memberId}
order by tpmrs.sequence
</select>
<!-- <select id="queryRoleShowslistBefore" resultType="com.ccsens.tall.bean.vo.RoleVo$JueSeByProId">-->
<!-- select-->
<!-- id,name,sequence-->
<!-- from t_pro_role tpr-->
<!-- where tpr.rec_status=0-->
<!-- and tpr.project_id=#{param1}-->
<!-- and tpr.parent_id !=0-->
<!-- and (SELECT name FROM t_pro_role pr WHERE tpr.parent_id = pr.id) in ('PM','Member')-->
<!-- and tpr.name not IN('观众', 'MVP')-->
<!-- <if test="param2!=null and param2.size>0">-->
<!-- and tpr.id not in-->
<!-- <foreach collection="param2" item="id" separator="," open="(" close=")">-->
<!-- #{id}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- order by tpr.sequence-->
<!-- </select>-->
<select id="queryRoleShowslistBefore" resultType="com.ccsens.tall.bean.vo.RoleVo$JueSeByProId">
select
id,name,sequence
from t_pro_role tpr
where tpr.rec_status=0
and tpr.project_id=#{param1}
and tpr.parent_id !=0
and (SELECT name FROM t_pro_role pr WHERE tpr.parent_id = pr.id) in ('PM','Member')
and tpr.name not IN('观众', 'MVP')
<if test="param2!=null and param2.size>0">
and tpr.id not in
<foreach collection="param2" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</if>
order by tpr.sequence
select
id,name,sequence
from t_pro_role tpr
where tpr.rec_status=0
and tpr.project_id=#{param1}
and tpr.parent_id !=0
and (SELECT name FROM t_pro_role pr WHERE tpr.parent_id = pr.id) in ('PM','Member')
and tpr.name not IN('观众', 'MVP')
<if test="param2!=null and param2.size>0">
and tpr.id not in
<foreach collection="param2" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</if>
order by tpr.sequence
</select>
<select id="getPmByByProjectId" resultType="java.lang.Long">
SELECT
id

14
tall/src/main/resources/mapper_dao/SysProjectDao.xml

@ -634,4 +634,18 @@
id = #{roleId}
AND rec_status =0
</select>
<select id="selectProjectRoleNoAdd" resultType="com.ccsens.tall.bean.vo.RoleVo$JueSeByProId">
SELECT
sp.id AS id,
sp. NAME AS NAME
FROM
t_sys_project AS sp
WHERE
sp.parent_id = #{projectId}
AND sp.id NOT IN
<foreach collection="listBeforeId" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</select>
</mapper>
Loading…
Cancel
Save