Browse Source

2025-03-26

master
qiezi 10 months ago
parent
commit
b64663bf37
  1. 28
      src/main/java/com/spring/modules/project/service/impl/ProjectServiceImpl.java
  2. 7
      src/main/resources/mapper/project/ProjectDao.xml

28
src/main/java/com/spring/modules/project/service/impl/ProjectServiceImpl.java

@ -47,13 +47,13 @@ public class ProjectServiceImpl implements ProjectService {
@Override @Override
public PageUtils projectInfoSearch(PlmProjectInfoData inData){ public PageUtils projectInfoSearch(PlmProjectInfoData inData){
List<Long> list = sysRoleService.findRoleIdByUsername(inData.getUserName(),1);
// 超级管理员角色 ID 1
// 判断用户是否是超级管理员
if (!list.isEmpty()){
// 存在角色编码为1的 即存在超级管理员
inData.setRoleId(1);
}
// List<Long> list = sysRoleService.findRoleIdByUsername(inData.getUserName(),1);
// // 超级管理员角色 ID 1
// // 判断用户是否是超级管理员
// if (!list.isEmpty()){
// // 存在角色编码为1的 即存在超级管理员
// inData.setRoleId(1);
// }
IPage<PlmProjectInfoData> resultList = this.projectDao.projectInfoSearch( IPage<PlmProjectInfoData> resultList = this.projectDao.projectInfoSearch(
new Page<PlmProjectInfoData>(inData.getPage(), inData.getLimit()), inData); new Page<PlmProjectInfoData>(inData.getPage(), inData.getLimit()), inData);
@ -66,15 +66,15 @@ public class ProjectServiceImpl implements ProjectService {
String projectName, String projectName,
String customerId){ String customerId){
SysUserEntity user = (SysUserEntity)SecurityUtils.getSubject().getPrincipal();
List<Long> list = sysRoleService.findRoleIdByUsername(user.getUsername(),1);
// 超级管理员角色 ID 1
// 判断用户是否是超级管理员
if (!list.isEmpty()){
// SysUserEntity user = (SysUserEntity)SecurityUtils.getSubject().getPrincipal();
// List<Long> list = sysRoleService.findRoleIdByUsername(user.getUsername(),1);
// // 超级管理员角色 ID 1
// // 判断用户是否是超级管理员
// if (!list.isEmpty()){
//
// }
return projectDao.selectProjectInfoList(site,projectId,projectName,customerId); return projectDao.selectProjectInfoList(site,projectId,projectName,customerId);
} }
return projectDao.selectProjectInfoListSys(site,projectId,projectName,user.getUsername(),customerId);
}
@Override @Override
public List<PlmOperatorData> searchOperatorWithSite(PlmOperatorData data){ public List<PlmOperatorData> searchOperatorWithSite(PlmOperatorData data){

7
src/main/resources/mapper/project/ProjectDao.xml

@ -104,7 +104,10 @@
<if test="query.projectOwnerName != null and query.projectOwnerName != ''"> <if test="query.projectOwnerName != null and query.projectOwnerName != ''">
AND dbo.get_projectTeamName(site,project_id,'owner') like #{query.projectOwnerName} AND dbo.get_projectTeamName(site,project_id,'owner') like #{query.projectOwnerName}
</if> </if>
<if test="query.roleId != 1">
<!-- <if test="query.roleId != 1">-->
<!-- AND project_id in ( select project_id from AccessProject where site=#{query.site} and username=#{query.userName} and searchFlag='Y' )-->
<!-- </if>-->
<if test="query.userName != null and query.userName != '' and query.userName != 'admin'">
AND project_id in ( select project_id from AccessProject where site=#{query.site} and username=#{query.userName} and searchFlag='Y' ) AND project_id in ( select project_id from AccessProject where site=#{query.site} and username=#{query.userName} and searchFlag='Y' )
</if> </if>
<if test="query.priority != null and query.priority != ''"> <if test="query.priority != null and query.priority != ''">
@ -742,7 +745,7 @@ update_by,update_date,priority,site,id,project_desc,customer_remark,remark,need_
productSet productSet
FROM plm_project_info FROM plm_project_info
<where> <where>
AND project_id in ( select project_id from AccessProject where site=#{site} and username=#{username} and searchFlag='Y' )
<!-- AND project_id in ( select project_id from AccessProject where site=#{site} and username=#{username} and searchFlag='Y' )-->
<if test="site != null and site != ''"> <if test="site != null and site != ''">
AND site = #{site} AND site = #{site}
</if> </if>

Loading…
Cancel
Save