Browse Source

fix: 批量任务审核

lixuesong 3 years ago
parent
commit
71c65e6cad

+ 9 - 10
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmDeptTaskTypeConfigController.java

@@ -87,8 +87,7 @@ public class WmDeptTaskTypeConfigController {
 			List<WmDeptTaskTypeConfigJsonDTO> configJsonDTOList =
 			List<WmDeptTaskTypeConfigJsonDTO> configJsonDTOList =
 					JSON.parseArray(deptTaskTypeConfig.getTaskTypeJson(), WmDeptTaskTypeConfigJsonDTO.class);
 					JSON.parseArray(deptTaskTypeConfig.getTaskTypeJson(), WmDeptTaskTypeConfigJsonDTO.class);
 			configJsonDTOList.forEach(configJsonDTO -> {
 			configJsonDTOList.forEach(configJsonDTO -> {
-				if (configJsonDTO.getQualifiedTask() || configJsonDTO.getZbdbStatusSelect() || configJsonDTO.getYydbStatusSelect()
-						|| configJsonDTO.getAssociateLower()) {
+				if (configJsonDTO.getQualifiedTask()) {
 					configed.set(true);
 					configed.set(true);
 				}
 				}
 			});
 			});
@@ -105,12 +104,12 @@ public class WmDeptTaskTypeConfigController {
 			if (ancestorDeptTaskTypeConfig != null) {
 			if (ancestorDeptTaskTypeConfig != null) {
 				List<WmDeptTaskTypeConfigJsonDTO> ancestorConfigJsonDTOList =
 				List<WmDeptTaskTypeConfigJsonDTO> ancestorConfigJsonDTOList =
 						JSON.parseArray(ancestorDeptTaskTypeConfig.getTaskTypeJson(), WmDeptTaskTypeConfigJsonDTO.class);
 						JSON.parseArray(ancestorDeptTaskTypeConfig.getTaskTypeJson(), WmDeptTaskTypeConfigJsonDTO.class);
-				ancestorConfigJsonDTOList.forEach(configJsonDTO -> {
-					if (configJsonDTO.getQualifiedTask() || configJsonDTO.getZbdbStatusSelect() || configJsonDTO.getYydbStatusSelect()
-							|| configJsonDTO.getAssociateLower()) {
-						configed.set(true);
-					}
-				});
+				ancestorConfigJsonDTOList.stream()
+						.forEach(configJsonDTO -> {
+							if (configJsonDTO.getQualifiedTask() && configJsonDTO.getAssociateLower()) {
+								configed.set(true);
+							}
+						});
 			}
 			}
 		}
 		}
 		resultMap.put("config", configed.get());
 		resultMap.put("config", configed.get());
@@ -120,9 +119,9 @@ public class WmDeptTaskTypeConfigController {
 	/**
 	/**
 	 * 根据企业的任务类型配置查询任务列表
 	 * 根据企业的任务类型配置查询任务列表
 	 *
 	 *
-	 * @param page 分页参数
+	 * @param page         分页参数
 	 * @param taskTypeName 任务类型名称
 	 * @param taskTypeName 任务类型名称
-	 * @param taskStatus 任务状态
+	 * @param taskStatus   任务状态
 	 * @return
 	 * @return
 	 */
 	 */
 	@GetMapping("/list-task")
 	@GetMapping("/list-task")

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

@@ -419,34 +419,32 @@ public class WmDeptTaskTypeConfigServiceImpl extends ServiceImpl<WmDeptTaskTypeC
 								wrapper2.isNull("p.relation_score_id");
 								wrapper2.isNull("p.relation_score_id");
 							});
 							});
 						} else {
 						} else {
-							wrapper.or(wrapper2 -> {
-								wrapper2.ne("1", "1");
-							});
+							wrapper.or(wrapper2 -> wrapper2.ne("1", "1"));
 						}
 						}
 					}
 					}
 				}
 				}
 				// 关联了上级企业的包的任务 条件
 				// 关联了上级企业的包的任务 条件
 				if (CollectionUtil.isNotEmpty(finalFilterAncestorConfigList)) {
 				if (CollectionUtil.isNotEmpty(finalFilterAncestorConfigList)) {
 					for (WmDeptTaskTypeConfigJsonDTO configJsonDTO : finalFilterAncestorConfigList) {
 					for (WmDeptTaskTypeConfigJsonDTO configJsonDTO : finalFilterAncestorConfigList) {
-						// 用户类型
-						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");
-							});
+						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"));
+							}
 						}
 						}
 					}
 					}
 				}
 				}