|
@@ -83,6 +83,9 @@ public class KnowledgeServiceImpl extends SuperServiceImpl<KnowledgeMapper, Know
|
|
|
@Autowired
|
|
|
private MessageService messageService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private KnowledgeApproveServiceImpl knowledgeApproveService;
|
|
|
+
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -94,11 +97,7 @@ public class KnowledgeServiceImpl extends SuperServiceImpl<KnowledgeMapper, Know
|
|
|
* 查询全部维基知识
|
|
|
*/
|
|
|
public List<Knowledge> findAllWiki(String categoryId) {
|
|
|
- QueryWrapper<Knowledge> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("CATEGORY_ID", categoryId);
|
|
|
- queryWrapper.eq("TYPE", 2);
|
|
|
- queryWrapper.eq("APPROVAL_STATUS",5);
|
|
|
- List<Knowledge> knowledgeWikiList = knowledgeMapper.selectList(queryWrapper);
|
|
|
+ List<Knowledge> knowledgeWikiList = knowledgeMapper.findAllWiki(categoryId);
|
|
|
return knowledgeWikiList;
|
|
|
}
|
|
|
|
|
@@ -252,7 +251,17 @@ public class KnowledgeServiceImpl extends SuperServiceImpl<KnowledgeMapper, Know
|
|
|
OsUserDto osUserDto = userService.queryOsUserDto(userService.queryLoginUser());
|
|
|
String sequenceCode = osUserDto.getSequenceCode();
|
|
|
String slyGrade = osUserDto.getSlyGrade();
|
|
|
- String deptId = osUserDto.getDeptId();
|
|
|
+ List<String> deptAuthority = knowledgeApproveMapper.deptAuthority(userService.queryLoginUser());
|
|
|
+ boolean flags = false;
|
|
|
+ if (StringUtils.isNotEmpty((String)organizationIdMap.get("organizationId"))){
|
|
|
+ for (int i = 0; i < deptAuthority.size(); i++) {
|
|
|
+ if (deptAuthority.get(i).contains((String)organizationIdMap.get("organizationId"))){
|
|
|
+ flags = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //String deptId = osUserDto.getDeptId();
|
|
|
// 如果知识最终审核通过,判断组织架构/职系/职等是否符合(前台判断)
|
|
|
if (knowledge.getOrganizationId() == null){
|
|
|
addCountViews(osUserDto.getUserId(),pkId);
|
|
@@ -270,7 +279,7 @@ public class KnowledgeServiceImpl extends SuperServiceImpl<KnowledgeMapper, Know
|
|
|
if (organizationIdMap.get("organizationId") != null && organizationIdMap.get("gradeId") == null &&
|
|
|
organizationIdMap.get("gradeLevelId") == null){
|
|
|
// 比较当前用户的组织架构是否符合条件
|
|
|
- if (deptId.equals(organizationIdMap.get("organizationId"))){
|
|
|
+ if (flags){
|
|
|
// 符合条件,增加点击量
|
|
|
knowledgeVo.setIsOrganizationId(0);
|
|
|
addCountViews(osUserDto.getUserId(),pkId);
|
|
@@ -317,7 +326,7 @@ public class KnowledgeServiceImpl extends SuperServiceImpl<KnowledgeMapper, Know
|
|
|
// 如果职等为空,组织架构id,职系不为空
|
|
|
if (organizationIdMap.get("organizationId") != null && organizationIdMap.get("gradeId") != null &&
|
|
|
organizationIdMap.get("gradeLevelId") == null){
|
|
|
- if (deptId.equals(organizationIdMap.get("organizationId")) && sequenceCode.equals(organizationIdMap.get("gradeId"))){
|
|
|
+ if (flags && sequenceCode.equals(organizationIdMap.get("gradeId"))){
|
|
|
// 符合条件,增加点击量
|
|
|
knowledgeVo.setIsOrganizationId(0);
|
|
|
addCountViews(osUserDto.getUserId(),pkId);
|
|
@@ -332,7 +341,7 @@ public class KnowledgeServiceImpl extends SuperServiceImpl<KnowledgeMapper, Know
|
|
|
// 如果职系为空,组织架构id,职等不为空
|
|
|
if (organizationIdMap.get("organizationId") != null && organizationIdMap.get("gradeId") == null &&
|
|
|
organizationIdMap.get("gradeLevelId") != null){
|
|
|
- if (deptId.equals(organizationIdMap.get("organizationId")) && slyGrade.equals(organizationIdMap.get("gradeLevelId"))){
|
|
|
+ if (flags && slyGrade.equals(organizationIdMap.get("gradeLevelId"))){
|
|
|
// 符合条件,增加点击量
|
|
|
knowledgeVo.setIsOrganizationId(0);
|
|
|
addCountViews(osUserDto.getUserId(),pkId);
|
|
@@ -362,7 +371,7 @@ public class KnowledgeServiceImpl extends SuperServiceImpl<KnowledgeMapper, Know
|
|
|
// 如果组织架构id,职系,职等都不为空
|
|
|
if (organizationIdMap.get("organizationId") != null && organizationIdMap.get("gradeId") != null &&
|
|
|
organizationIdMap.get("gradeLevelId") != null){
|
|
|
- if (deptId.equals(organizationIdMap.get("organizationId")) &&
|
|
|
+ if (flags &&
|
|
|
sequenceCode.equals(organizationIdMap.get("gradeId")) &&
|
|
|
slyGrade.equals(organizationIdMap.get("gradeLevelId"))){
|
|
|
knowledgeVo.setIsOrganizationId(0);
|
|
@@ -395,6 +404,130 @@ public class KnowledgeServiceImpl extends SuperServiceImpl<KnowledgeMapper, Know
|
|
|
e.setOperatorName(userService.queryUser(e.getUpdateBy()).getFullName());
|
|
|
Map<String, Object> map = userService.querySexAndPhoto(e.getCreateBy());
|
|
|
e.setParams(map);
|
|
|
+
|
|
|
+ // 解析组织架构/职系/职等数据
|
|
|
+ Map<String, Object> organizationIdMap = new HashMap<>();
|
|
|
+ if (StringUtils.isNotEmpty(e.getOrganizationId())){
|
|
|
+ List<Map> mapList = JSON.parseArray(e.getOrganizationId(), Map.class);
|
|
|
+ for (int i = 0; i < mapList.size(); i++) {
|
|
|
+ Map maps = mapList.get(i);
|
|
|
+ maps.forEach((k,v) -> organizationIdMap.put((String) k,v));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 获取当前登录人的组织架构/职系/职等数据
|
|
|
+ OsUserDto osUserDto = userService.queryOsUserDto(userService.queryLoginUser());
|
|
|
+ String sequenceCode = osUserDto.getSequenceCode();
|
|
|
+ String slyGrade = osUserDto.getSlyGrade();
|
|
|
+ List<String> deptAuthority = knowledgeApproveMapper.deptAuthority(userService.queryLoginUser());
|
|
|
+ boolean flags = false;
|
|
|
+ if (StringUtils.isNotEmpty((String)organizationIdMap.get("organizationId"))){
|
|
|
+ for (int i = 0; i < deptAuthority.size(); i++) {
|
|
|
+ if (deptAuthority.get(i).contains((String)organizationIdMap.get("organizationId"))){
|
|
|
+ flags = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 如果知识最终审核通过,判断组织架构/职系/职等是否符合(前台判断)
|
|
|
+ if (e.getOrganizationId() == null){
|
|
|
+ e.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 如果职系,职等,组织架构id全部为空
|
|
|
+ if (organizationIdMap.get("organizationId") == null && organizationIdMap.get("gradeId") == null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") == null){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ e.setIsOrganizationId(0);
|
|
|
+ }
|
|
|
+ // 如果职系,职等为空,组织架构id不为空
|
|
|
+ if (organizationIdMap.get("organizationId") != null && organizationIdMap.get("gradeId") == null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") == null){
|
|
|
+ // 比较当前用户的组织架构是否符合条件
|
|
|
+ if (flags){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ e.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ e.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果组织架构id,职等为空,职系不为空
|
|
|
+ if (organizationIdMap.get("organizationId") == null && organizationIdMap.get("gradeId") != null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") == null){
|
|
|
+ // 比较当前用户的职系是否符合条件
|
|
|
+ if (sequenceCode.equals(organizationIdMap.get("gradeId"))){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ e.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ e.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果组织架构id,职系为空,职等不为空
|
|
|
+ if (organizationIdMap.get("organizationId") == null && organizationIdMap.get("gradeId") == null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") != null){
|
|
|
+ // 比较当前用户的职系是否符合条件
|
|
|
+ if (slyGrade.equals(organizationIdMap.get("gradeLevelId"))){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ e.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ e.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果职等为空,组织架构id,职系不为空
|
|
|
+ if (organizationIdMap.get("organizationId") != null && organizationIdMap.get("gradeId") != null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") == null){
|
|
|
+ if (flags && sequenceCode.equals(organizationIdMap.get("gradeId"))){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ e.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ e.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果职系为空,组织架构id,职等不为空
|
|
|
+ if (organizationIdMap.get("organizationId") != null && organizationIdMap.get("gradeId") == null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") != null){
|
|
|
+ if (flags && slyGrade.equals(organizationIdMap.get("gradeLevelId"))){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ e.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ e.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果组织架构id为空,职系,职等不为空
|
|
|
+ if (organizationIdMap.get("organizationId") == null && organizationIdMap.get("gradeId") != null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") != null){
|
|
|
+ if (sequenceCode.equals(organizationIdMap.get("gradeId")) && slyGrade.equals(organizationIdMap.get("gradeLevelId"))){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ e.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ e.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果组织架构id,职系,职等都不为空
|
|
|
+ if (organizationIdMap.get("organizationId") != null && organizationIdMap.get("gradeId") != null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") != null){
|
|
|
+ if (flags &&
|
|
|
+ sequenceCode.equals(organizationIdMap.get("gradeId")) &&
|
|
|
+ slyGrade.equals(organizationIdMap.get("gradeLevelId"))){
|
|
|
+ e.setIsOrganizationId(0);
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ e.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
return page;
|
|
|
}
|
|
@@ -503,6 +636,8 @@ public class KnowledgeServiceImpl extends SuperServiceImpl<KnowledgeMapper, Know
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //结果集
|
|
|
+ List<KnowledgeVo> resultList = new ArrayList<>();
|
|
|
// 放入知识分类信息
|
|
|
List<KnowledgeVo> collect = knowledgeVoArrayList.stream().
|
|
|
sorted((t1, t2) -> t2.getCreateTime().compareTo(t1.getCreateTime())).collect(Collectors.toList());
|
|
@@ -510,14 +645,24 @@ public class KnowledgeServiceImpl extends SuperServiceImpl<KnowledgeMapper, Know
|
|
|
String categoryId = e.getCategoryId();
|
|
|
KnowledgeCategoryAdminVo knowledgeCategoryAdminVo = knowledgeCategoryService.findAllParentByCategoryId(categoryId);
|
|
|
e.setKnowledgeCategoryAdminVo(knowledgeCategoryAdminVo);
|
|
|
+ // 判断当前登录人是否可以审核每一条知识
|
|
|
+ String userNo = userService.queryLoginUsername();
|
|
|
+ String userId = userService.queryLoginUser();
|
|
|
+ //部门权限字符串
|
|
|
+ List<String> deptAuthority = knowledgeApproveMapper.deptAuthority(userId);
|
|
|
+ boolean flag = false;
|
|
|
+ for (int i = 0; i < deptAuthority.size(); i++) {
|
|
|
+ if (deptAuthority.get(i).contains(e.getApproverId())){
|
|
|
+ flag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 如果有权限
|
|
|
+ if(e.getApproverId().equals(userNo) || flag){
|
|
|
+ resultList.add(e);
|
|
|
+ }
|
|
|
});
|
|
|
-
|
|
|
- // 判断当前登录人是否可以审核每一条知识
|
|
|
- String userNo = userService.queryLoginUsername();
|
|
|
- String deptId = userService.queryLoginUserDeptId();
|
|
|
- List<KnowledgeVo> collectResult = collect.stream().
|
|
|
- filter(e -> e.getApproverId().equals(userNo) || e.getApproverId().equals(deptId)).collect(Collectors.toList());
|
|
|
- Page pages = PageListUtils.getPages(filter.getPage().getCurrent(), filter.getPage().getSize(), collectResult);
|
|
|
+ Page pages = PageListUtils.getPages(filter.getPage().getCurrent(), filter.getPage().getSize(), resultList);
|
|
|
return pages;
|
|
|
}
|
|
|
|
|
@@ -541,6 +686,129 @@ public class KnowledgeServiceImpl extends SuperServiceImpl<KnowledgeMapper, Know
|
|
|
g.setKnowledgeCategoryAdminVo(knowledgeCategoryAdminVos);
|
|
|
Map<String, Object> maps = userService.querySexAndPhoto(g.getCreateBy());
|
|
|
g.setParams(maps);
|
|
|
+ // 解析组织架构/职系/职等数据
|
|
|
+ Map<String, Object> organizationIdMap = new HashMap<>();
|
|
|
+ if (StringUtils.isNotEmpty(g.getOrganizationId())){
|
|
|
+ List<Map> mapList = JSON.parseArray(g.getOrganizationId(), Map.class);
|
|
|
+ for (int i = 0; i < mapList.size(); i++) {
|
|
|
+ Map mapLists = mapList.get(i);
|
|
|
+ mapLists.forEach((k,v) -> organizationIdMap.put((String) k,v));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 获取当前登录人的组织架构/职系/职等数据
|
|
|
+ OsUserDto osUserDto = userService.queryOsUserDto(userService.queryLoginUser());
|
|
|
+ String sequenceCode = osUserDto.getSequenceCode();
|
|
|
+ String slyGrade = osUserDto.getSlyGrade();
|
|
|
+ List<String> deptAuthority = knowledgeApproveMapper.deptAuthority(userService.queryLoginUser());
|
|
|
+ boolean flags = false;
|
|
|
+ if (StringUtils.isNotEmpty((String)organizationIdMap.get("organizationId"))){
|
|
|
+ for (int i = 0; i < deptAuthority.size(); i++) {
|
|
|
+ if (deptAuthority.get(i).contains((String)organizationIdMap.get("organizationId"))){
|
|
|
+ flags = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 如果知识最终审核通过,判断组织架构/职系/职等是否符合(前台判断)
|
|
|
+ if (g.getOrganizationId() == null){
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 如果职系,职等,组织架构id全部为空
|
|
|
+ if (organizationIdMap.get("organizationId") == null && organizationIdMap.get("gradeId") == null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") == null){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ }
|
|
|
+ // 如果职系,职等为空,组织架构id不为空
|
|
|
+ if (organizationIdMap.get("organizationId") != null && organizationIdMap.get("gradeId") == null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") == null){
|
|
|
+ // 比较当前用户的组织架构是否符合条件
|
|
|
+ if (flags){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ g.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果组织架构id,职等为空,职系不为空
|
|
|
+ if (organizationIdMap.get("organizationId") == null && organizationIdMap.get("gradeId") != null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") == null){
|
|
|
+ // 比较当前用户的职系是否符合条件
|
|
|
+ if (sequenceCode.equals(organizationIdMap.get("gradeId"))){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ g.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果组织架构id,职系为空,职等不为空
|
|
|
+ if (organizationIdMap.get("organizationId") == null && organizationIdMap.get("gradeId") == null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") != null){
|
|
|
+ // 比较当前用户的职系是否符合条件
|
|
|
+ if (slyGrade.equals(organizationIdMap.get("gradeLevelId"))){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ g.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果职等为空,组织架构id,职系不为空
|
|
|
+ if (organizationIdMap.get("organizationId") != null && organizationIdMap.get("gradeId") != null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") == null){
|
|
|
+ if (flags && sequenceCode.equals(organizationIdMap.get("gradeId"))){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ g.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果职系为空,组织架构id,职等不为空
|
|
|
+ if (organizationIdMap.get("organizationId") != null && organizationIdMap.get("gradeId") == null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") != null){
|
|
|
+ if (flags && slyGrade.equals(organizationIdMap.get("gradeLevelId"))){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ g.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果组织架构id为空,职系,职等不为空
|
|
|
+ if (organizationIdMap.get("organizationId") == null && organizationIdMap.get("gradeId") != null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") != null){
|
|
|
+ if (sequenceCode.equals(organizationIdMap.get("gradeId")) && slyGrade.equals(organizationIdMap.get("gradeLevelId"))){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ g.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果组织架构id,职系,职等都不为空
|
|
|
+ if (organizationIdMap.get("organizationId") != null && organizationIdMap.get("gradeId") != null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") != null){
|
|
|
+ if (flags &&
|
|
|
+ sequenceCode.equals(organizationIdMap.get("gradeId")) &&
|
|
|
+ slyGrade.equals(organizationIdMap.get("gradeLevelId"))){
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ g.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
return page;
|
|
|
} else {
|
|
@@ -554,6 +822,128 @@ public class KnowledgeServiceImpl extends SuperServiceImpl<KnowledgeMapper, Know
|
|
|
g.setKnowledgeCategoryAdminVo(knowledgeCategoryAdminVos);
|
|
|
Map<String, Object> maps = userService.querySexAndPhoto(g.getCreateBy());
|
|
|
g.setParams(maps);
|
|
|
+ // 解析组织架构/职系/职等数据
|
|
|
+ Map<String, Object> organizationIdMap = new HashMap<>();
|
|
|
+ if (StringUtils.isNotEmpty(g.getOrganizationId())){
|
|
|
+ List<Map> mapList = JSON.parseArray(g.getOrganizationId(), Map.class);
|
|
|
+ for (int i = 0; i < mapList.size(); i++) {
|
|
|
+ Map mapLists = mapList.get(i);
|
|
|
+ mapLists.forEach((k,v) -> organizationIdMap.put((String) k,v));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 获取当前登录人的组织架构/职系/职等数据
|
|
|
+ OsUserDto osUserDto = userService.queryOsUserDto(userService.queryLoginUser());
|
|
|
+ String sequenceCode = osUserDto.getSequenceCode();
|
|
|
+ String slyGrade = osUserDto.getSlyGrade();
|
|
|
+ List<String> deptAuthority = knowledgeApproveMapper.deptAuthority(userService.queryLoginUser());
|
|
|
+ boolean flags = false;
|
|
|
+ if (StringUtils.isNotEmpty((String)organizationIdMap.get("organizationId"))){
|
|
|
+ for (int i = 0; i < deptAuthority.size(); i++) {
|
|
|
+ if (deptAuthority.get(i).contains((String)organizationIdMap.get("organizationId"))){
|
|
|
+ flags = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 如果知识最终审核通过,判断组织架构/职系/职等是否符合(前台判断)
|
|
|
+ if (g.getOrganizationId() == null){
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 如果职系,职等,组织架构id全部为空
|
|
|
+ if (organizationIdMap.get("organizationId") == null && organizationIdMap.get("gradeId") == null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") == null){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ }
|
|
|
+ // 如果职系,职等为空,组织架构id不为空
|
|
|
+ if (organizationIdMap.get("organizationId") != null && organizationIdMap.get("gradeId") == null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") == null){
|
|
|
+ // 比较当前用户的组织架构是否符合条件
|
|
|
+ if (flags){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ g.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果组织架构id,职等为空,职系不为空
|
|
|
+ if (organizationIdMap.get("organizationId") == null && organizationIdMap.get("gradeId") != null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") == null){
|
|
|
+ // 比较当前用户的职系是否符合条件
|
|
|
+ if (sequenceCode.equals(organizationIdMap.get("gradeId"))){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ g.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果组织架构id,职系为空,职等不为空
|
|
|
+ if (organizationIdMap.get("organizationId") == null && organizationIdMap.get("gradeId") == null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") != null){
|
|
|
+ // 比较当前用户的职系是否符合条件
|
|
|
+ if (slyGrade.equals(organizationIdMap.get("gradeLevelId"))){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ g.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果职等为空,组织架构id,职系不为空
|
|
|
+ if (organizationIdMap.get("organizationId") != null && organizationIdMap.get("gradeId") != null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") == null){
|
|
|
+ if (flags && sequenceCode.equals(organizationIdMap.get("gradeId"))){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ g.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果职系为空,组织架构id,职等不为空
|
|
|
+ if (organizationIdMap.get("organizationId") != null && organizationIdMap.get("gradeId") == null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") != null){
|
|
|
+ if (flags && slyGrade.equals(organizationIdMap.get("gradeLevelId"))){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ g.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果组织架构id为空,职系,职等不为空
|
|
|
+ if (organizationIdMap.get("organizationId") == null && organizationIdMap.get("gradeId") != null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") != null){
|
|
|
+ if (sequenceCode.equals(organizationIdMap.get("gradeId")) && slyGrade.equals(organizationIdMap.get("gradeLevelId"))){
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ g.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果组织架构id,职系,职等都不为空
|
|
|
+ if (organizationIdMap.get("organizationId") != null && organizationIdMap.get("gradeId") != null &&
|
|
|
+ organizationIdMap.get("gradeLevelId") != null){
|
|
|
+ if (flags &&
|
|
|
+ sequenceCode.equals(organizationIdMap.get("gradeId")) &&
|
|
|
+ slyGrade.equals(organizationIdMap.get("gradeLevelId"))){
|
|
|
+ g.setIsOrganizationId(0);
|
|
|
+ // 符合条件,增加点击量
|
|
|
+ } else {
|
|
|
+ // 没有权限(不增加点击量)
|
|
|
+ g.setIsOrganizationId(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
return page;
|
|
|
}
|
|
@@ -577,27 +967,46 @@ public class KnowledgeServiceImpl extends SuperServiceImpl<KnowledgeMapper, Know
|
|
|
for (int i = 0; i < value.size(); i++) {
|
|
|
// 判断审批结果是否为null(如果审批结果没有null,证明审批已结束;如果等于0,证明审批没通过)
|
|
|
if (value.get(i).getResult() == null) {
|
|
|
+ value.get(i).setApprovalsFirst(knowledgeApproveMapper.selectById(value.get(i).getApproveId()));
|
|
|
if (i != 0) {
|
|
|
// 如果不是第一条数据,取前一条数据的审批时间
|
|
|
Date approvalTime = value.get(i - 1).getApprovalTime();
|
|
|
value.get(i).setApprovalTime(approvalTime);
|
|
|
- // 把该记录加到结果集中
|
|
|
- knowledgeVoArrayList.add(value.get(i));
|
|
|
- break;
|
|
|
}
|
|
|
+ // 把该记录加到结果集中
|
|
|
+ knowledgeVoArrayList.add(value.get(i));
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- String userNo = userService.queryLoginUsername();
|
|
|
- String deptId = userService.queryLoginUserDeptId();
|
|
|
- List<KnowledgeVo> collectResult = knowledgeVoArrayList.stream().
|
|
|
- filter(e -> e.getApproverId().equals(userNo) || e.getApproverId().equals(deptId)).collect(Collectors.toList());
|
|
|
- if (collectResult.size() >= 99){
|
|
|
+
|
|
|
+ //结果集
|
|
|
+ List<KnowledgeVo> resultList = new ArrayList<>();
|
|
|
+ // 放入知识分类信息
|
|
|
+ knowledgeVoArrayList.forEach(e -> {
|
|
|
+ // 判断当前登录人是否可以审核每一条知识
|
|
|
+ String userNo = userService.queryLoginUsername();
|
|
|
+ String userId = userService.queryLoginUser();
|
|
|
+ //部门权限字符串
|
|
|
+ List<String> deptAuthority = knowledgeApproveMapper.deptAuthority(userId);
|
|
|
+ boolean flag = false;
|
|
|
+ for (int i = 0; i < deptAuthority.size(); i++) {
|
|
|
+ if (deptAuthority.get(i).contains(e.getApproverId())){
|
|
|
+ flag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 如果有权限
|
|
|
+ if(e.getApproverId().equals(userNo) || flag){
|
|
|
+ resultList.add(e);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (resultList.size() >= 99){
|
|
|
return 99;
|
|
|
- } else if (collectResult.size() <= 0){
|
|
|
+ } else if (resultList.size() <= 0){
|
|
|
return 0;
|
|
|
}else {
|
|
|
- return collectResult.size();
|
|
|
+ return resultList.size();
|
|
|
}
|
|
|
}
|
|
|
|