Commit 2df1d160 authored by cq990612's avatar cq990612

优化代码结构

parent 904e6b74
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
LEFT JOIN work_user_project up ON p.id = up.project_id LEFT JOIN work_user_project up ON p.id = up.project_id
LEFT JOIN work_user u on u.id = up.user_id LEFT JOIN work_user u on u.id = up.user_id
<where> <where>
<if test="deptAndManager !=0"> <if test="deptAndManager >0">
<if test="null !=type"> <if test="null !=type">
AND p.type = #{type} AND p.type = #{type}
</if> </if>
......
...@@ -222,13 +222,28 @@ public class WorkProjectServiceImpl implements WorkProjectService { ...@@ -222,13 +222,28 @@ public class WorkProjectServiceImpl implements WorkProjectService {
if (LevelRankEnum.DEPARTMENT_LEVEL.getRank().equals(userRoleLevelDto.getRank())||LevelRankEnum.CENTRAL_LEVEL.getRank().equals(userRoleLevelDto.getRank())) { if (LevelRankEnum.DEPARTMENT_LEVEL.getRank().equals(userRoleLevelDto.getRank())||LevelRankEnum.CENTRAL_LEVEL.getRank().equals(userRoleLevelDto.getRank())) {
deptAndManager++; deptAndManager++;
} }
if (LevelRankEnum.DEPARTMENT_LEVEL.getRank().equals(userRoleLevelDto.getRank())) {
if (null !=gmpv.getDeptId() && !user.getDeptId().equals(gmpv.getDeptId())) {
int isCentre = 0;
for (UserRoleLevelDto roleLevelDto : roleUserLevel) {
if (LevelEnum.PROJECT_MANAGER.getLevelName().equals(roleLevelDto.getLevelName()) ) {
if (LevelRankEnum.CENTRAL_LEVEL.getRank().equals(roleLevelDto.getRank())) {
isCentre++;
}
}
}
if (isCentre == 0) {
deptAndManager -= 10;
}
}
}
} }
} }
if (projectIndex == 0) { if (projectIndex == 0) {
user.setId(null); user.setId(null);
} }
System.out.println("deptAndManager = " + deptAndManager);
int page = gmpv.getPage() == null ? 1 : gmpv.getPage(); int page = gmpv.getPage() == null ? 1 : gmpv.getPage();
int pageSize = gmpv.getPageSize() == null ? 10 : gmpv.getPageSize(); int pageSize = gmpv.getPageSize() == null ? 10 : gmpv.getPageSize();
Integer isConclusion = gmpv.getIsConclusion(); Integer isConclusion = gmpv.getIsConclusion();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment