浏览代码

fix: 批量任务审核-查询任务类型树

lixuesong 3 年之前
父节点
当前提交
7afb360c52

+ 21 - 22
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmDeptTaskTypeConfigServiceImpl.java

@@ -275,7 +275,7 @@ public class WmDeptTaskTypeConfigServiceImpl extends ServiceImpl<WmDeptTaskTypeC
 					.eq(WmDeptTaskTypeConfig::getDeptId, ancestorDeptRelation.getAncestor()));
 			List<WmDeptTaskTypeConfigJsonDTO> ancestorConfigJsonDTOList = JSON.parseArray(ancestorDeptTaskTypeConfig.getTaskTypeJson(), WmDeptTaskTypeConfigJsonDTO.class);
 			ancestorConfigTaskTypeIdList = ancestorConfigJsonDTOList.stream()
-					.filter(configJsonDTO -> configJsonDTO.getQualifiedTask())
+					.filter(configJsonDTO -> configJsonDTO.getQualifiedTask() && configJsonDTO.getAssociateLower())
 					.map(WmDeptTaskTypeConfigJsonDTO::getTaskTypeName)
 					.collect(Collectors.toList());
 		}
@@ -380,11 +380,12 @@ public class WmDeptTaskTypeConfigServiceImpl extends ServiceImpl<WmDeptTaskTypeC
 				// 转换为key value形式
 				if (StringUtils.isNotBlank(taskTypeName)) {
 					filterAncestorConfigList = ancestorConfigJsonDTOList.stream()
-							.filter(configJsonDTO -> configJsonDTO.getTaskTypeName().equals(taskTypeName) && configJsonDTO.getQualifiedTask())
+							.filter(configJsonDTO -> configJsonDTO.getTaskTypeName().equals(taskTypeName)
+									&& configJsonDTO.getQualifiedTask() && configJsonDTO.getAssociateLower())
 							.collect(Collectors.toList());
 				} else {
 					filterAncestorConfigList = ancestorConfigJsonDTOList.stream()
-							.filter(configJsonDTO -> configJsonDTO.getQualifiedTask())
+							.filter(configJsonDTO -> configJsonDTO.getQualifiedTask() && configJsonDTO.getAssociateLower())
 							.collect(Collectors.toList());
 				}
 			}
@@ -426,25 +427,23 @@ public class WmDeptTaskTypeConfigServiceImpl extends ServiceImpl<WmDeptTaskTypeC
 				// 关联了上级企业的包的任务 条件
 				if (CollectionUtil.isNotEmpty(finalFilterAncestorConfigList)) {
 					for (WmDeptTaskTypeConfigJsonDTO configJsonDTO : finalFilterAncestorConfigList) {
-						if (configJsonDTO.getAssociateLower()) {
-							// 用户类型
-							List<String> typeIdList = new ArrayList<>();
-							if (configJsonDTO.getZbdbStatusEnable() && configJsonDTO.getZbdbStatusSelect()) {
-								typeIdList.add("4");
-							}
-							if (configJsonDTO.getYydbStatusEnable() && configJsonDTO.getYydbStatusSelect()) {
-								typeIdList.add("3");
-							}
-							if (CollectionUtil.isNotEmpty(typeIdList)) {
-								wrapper.or(wrapper2 -> {
-									wrapper2.eq("t.task_type_id", configJsonDTO.getTaskTypeId());
-									wrapper2.eq("t.dept_id", deptId);
-									wrapper2.in("p.typeid", typeIdList);
-									wrapper2.isNotNull("p.relation_score_id");
-								});
-							} else {
-								wrapper.or(wrapper2 -> wrapper2.ne("1", "1"));
-							}
+						// 用户类型
+						List<String> typeIdList = new ArrayList<>();
+						if (configJsonDTO.getZbdbStatusEnable() && configJsonDTO.getZbdbStatusSelect()) {
+							typeIdList.add("4");
+						}
+						if (configJsonDTO.getYydbStatusEnable() && configJsonDTO.getYydbStatusSelect()) {
+							typeIdList.add("3");
+						}
+						if (CollectionUtil.isNotEmpty(typeIdList)) {
+							wrapper.or(wrapper2 -> {
+								wrapper2.eq("t.task_type_id", configJsonDTO.getTaskTypeId());
+								wrapper2.eq("t.dept_id", deptId);
+								wrapper2.in("p.typeid", typeIdList);
+								wrapper2.isNotNull("p.relation_score_id");
+							});
+						} else {
+							wrapper.or(wrapper2 -> wrapper2.ne("1", "1"));
 						}
 					}
 				}