Bladeren bron

fix: 企业审核限制只查询配置了的任务

lixuesong 2 jaren geleden
bovenliggende
commit
7a8220b286

+ 12 - 26
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmReportServiceImpl.java

@@ -548,18 +548,10 @@ public class WmReportServiceImpl extends ServiceImpl<WmReportMapper, WmReport> i
 				// 查询该企业当前任务类型下 的任务类型配置数据
 				List<WmDeptTaskTypeConfigJsonDTO> configJsonDTOList =
 						JSON.parseArray(deptTaskTypeConfig.getTaskTypeJson(), WmDeptTaskTypeConfigJsonDTO.class);
-				if (StringUtils.isNotBlank(taskTypeName)) {
-					filterConfigJsonDTOList = configJsonDTOList.stream()
-							.filter(configJsonDTO -> configJsonDTO.getTaskTypeName().equals(taskTypeName) && configJsonDTO.getQualifiedTask()
-									&& (configJsonDTO.getYydbStatusSelect() || configJsonDTO.getZbdbStatusSelect()))
-							.collect(Collectors.toList());
-				} else {
-					filterConfigJsonDTOList = configJsonDTOList.stream()
-							.filter(configJsonDTO -> configJsonDTO.getQualifiedTask()
-									&& (configJsonDTO.getYydbStatusSelect() || configJsonDTO.getZbdbStatusSelect()))
-							.collect(Collectors.toList());
-				}
-			}
+				filterConfigJsonDTOList = configJsonDTOList.stream()
+						.filter(configJsonDTO -> configJsonDTO.getQualifiedTask())
+						.collect(Collectors.toList());
+		}
 
 			// 查询上级的deptId
 			SysDeptRelation ancestorDeptRelation = sysDeptRelationMapper.selectOne(Wrappers.<SysDeptRelation>lambdaQuery()
@@ -575,18 +567,9 @@ public class WmReportServiceImpl extends ServiceImpl<WmReportMapper, WmReport> i
 					List<WmDeptTaskTypeConfigJsonDTO> ancestorConfigJsonDTOList =
 							JSON.parseArray(ancestorDeptTaskTypeConfig.getTaskTypeJson(), WmDeptTaskTypeConfigJsonDTO.class);
 					// 转换为key value形式
-					if (StringUtils.isNotBlank(taskTypeName)) {
-						filterAncestorConfigList = ancestorConfigJsonDTOList.stream()
-								.filter(configJsonDTO -> configJsonDTO.getTaskTypeName().equals(taskTypeName)
-										&& configJsonDTO.getQualifiedTask() && configJsonDTO.getAssociateLower()
-										&& (configJsonDTO.getYydbStatusSelect() || configJsonDTO.getZbdbStatusSelect()))
-								.collect(Collectors.toList());
-					} else {
-						filterAncestorConfigList = ancestorConfigJsonDTOList.stream()
-								.filter(configJsonDTO -> configJsonDTO.getQualifiedTask() && configJsonDTO.getAssociateLower()
-										&& (configJsonDTO.getYydbStatusSelect() || configJsonDTO.getZbdbStatusSelect()))
-								.collect(Collectors.toList());
-					}
+					filterAncestorConfigList = ancestorConfigJsonDTOList.stream()
+							.filter(configJsonDTO -> configJsonDTO.getQualifiedTask() && configJsonDTO.getAssociateLower())
+							.collect(Collectors.toList());
 				}
 			}
 			// 任务配置为空,则直接返回空page
@@ -683,8 +666,11 @@ public class WmReportServiceImpl extends ServiceImpl<WmReportMapper, WmReport> i
 				if (!deptId.equals(Integer.parseInt(scorePackage.getSendPackageDeptId())) && StrUtil.isNotBlank(scorePackage.getRelationScoreId())) {
 					// 不是则继续查询父级包
 					WmScorePackage pScorePackage = wmScorePackageService.getById(scorePackage.getRelationScoreId());
-					if (deptId.equals(Integer.parseInt(pScorePackage.getSendPackageDeptId()))) {
-						map.put("scorePackageName", pScorePackage.getScorePackageName());
+					map.put("scorePackageName", pScorePackage.getScorePackageName());
+					if (!deptId.equals(Integer.parseInt(pScorePackage.getSendPackageDeptId())) && StrUtil.isNotBlank(pScorePackage.getRelationScoreId())) {
+						// 不是则再继续查询父级包
+						WmScorePackage ppScorePackage = wmScorePackageService.getById(pScorePackage.getRelationScoreId());
+						map.put("scorePackageName", ppScorePackage.getScorePackageName());
 					}
 				}
 				return map;