|
@@ -74,6 +74,12 @@ public class WmDeptTaskTypeConfigServiceImpl extends ServiceImpl<WmDeptTaskTypeC
|
|
|
|
|
|
private final WmDaAgentMapper wmDaAgentMapper;
|
|
private final WmDaAgentMapper wmDaAgentMapper;
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 兼职学术专员启用的任务类型
|
|
|
|
+ */
|
|
|
|
+ private final String[] ENABLE_ZBDB_STATUS_ARR = {"医院拜访", "商业公司拜访", "药店拜访", "电子名片分享", "产品相册分享", "学术信息交流",
|
|
|
|
+ "受众打开产品相册", "受众阅读文章"};
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 任务类型Map
|
|
* 任务类型Map
|
|
*/
|
|
*/
|
|
@@ -145,6 +151,11 @@ public class WmDeptTaskTypeConfigServiceImpl extends ServiceImpl<WmDeptTaskTypeC
|
|
.eq(WmTaskType::getTaskTypeLevel, "1")
|
|
.eq(WmTaskType::getTaskTypeLevel, "1")
|
|
.eq(WmTaskType::getTaskTypeName, configJsonDTO.getTaskTypeName()));
|
|
.eq(WmTaskType::getTaskTypeName, configJsonDTO.getTaskTypeName()));
|
|
configJsonDTO.setTaskTypeId(baseTaskType.getId());
|
|
configJsonDTO.setTaskTypeId(baseTaskType.getId());
|
|
|
|
+ // 判断并确保兼职任务类型未启用时不可选中
|
|
|
|
+ if (!ArrayUtil.contains(ENABLE_ZBDB_STATUS_ARR, configJsonDTO.getTaskTypeName())) {
|
|
|
|
+ configJsonDTO.setZbdbStatusEnable(false);
|
|
|
|
+ configJsonDTO.setZbdbStatusSelect(false);
|
|
|
|
+ }
|
|
});
|
|
});
|
|
if (count <= 0) {
|
|
if (count <= 0) {
|
|
// 新增
|
|
// 新增
|
|
@@ -177,8 +188,6 @@ public class WmDeptTaskTypeConfigServiceImpl extends ServiceImpl<WmDeptTaskTypeC
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public WmDeptTaskTypeConfigDTO getDeptTaskTypeConfig(Integer deptId) {
|
|
public WmDeptTaskTypeConfigDTO getDeptTaskTypeConfig(Integer deptId) {
|
|
- String[] enableZbdbStatusArr = {"医院拜访", "商业公司拜访", "药店拜访", "电子名片分享", "产品相册分享", "学术信息交流",
|
|
|
|
- "受众打开产品相册", "受众阅读文章"};
|
|
|
|
// 查询出当前dept对应的药企/代理商id
|
|
// 查询出当前dept对应的药企/代理商id
|
|
String durgentId = null;
|
|
String durgentId = null;
|
|
SysDept dept = sysDeptMapper.selectById(deptId);
|
|
SysDept dept = sysDeptMapper.selectById(deptId);
|
|
@@ -229,7 +238,7 @@ public class WmDeptTaskTypeConfigServiceImpl extends ServiceImpl<WmDeptTaskTypeC
|
|
deptTaskTypeConfigJsonDTO.setTaskTypeId(taskType.getId());
|
|
deptTaskTypeConfigJsonDTO.setTaskTypeId(taskType.getId());
|
|
deptTaskTypeConfigJsonDTO.setTaskTypeName(taskType.getTaskTypeName());
|
|
deptTaskTypeConfigJsonDTO.setTaskTypeName(taskType.getTaskTypeName());
|
|
deptTaskTypeConfigJsonDTO.setScore(taskType.getScore());
|
|
deptTaskTypeConfigJsonDTO.setScore(taskType.getScore());
|
|
- if (ArrayUtil.contains(enableZbdbStatusArr, taskType.getTaskTypeName())) {
|
|
|
|
|
|
+ if (ArrayUtil.contains(ENABLE_ZBDB_STATUS_ARR, taskType.getTaskTypeName())) {
|
|
deptTaskTypeConfigJsonDTO.setZbdbStatusEnable(true);
|
|
deptTaskTypeConfigJsonDTO.setZbdbStatusEnable(true);
|
|
} else {
|
|
} else {
|
|
deptTaskTypeConfigJsonDTO.setZbdbStatusEnable(false);
|
|
deptTaskTypeConfigJsonDTO.setZbdbStatusEnable(false);
|
|
@@ -355,11 +364,13 @@ public class WmDeptTaskTypeConfigServiceImpl extends ServiceImpl<WmDeptTaskTypeC
|
|
JSON.parseArray(deptTaskTypeConfig.getTaskTypeJson(), WmDeptTaskTypeConfigJsonDTO.class);
|
|
JSON.parseArray(deptTaskTypeConfig.getTaskTypeJson(), WmDeptTaskTypeConfigJsonDTO.class);
|
|
if (StringUtils.isNotBlank(taskTypeName)) {
|
|
if (StringUtils.isNotBlank(taskTypeName)) {
|
|
filterConfigJsonDTOList = configJsonDTOList.stream()
|
|
filterConfigJsonDTOList = configJsonDTOList.stream()
|
|
- .filter(configJsonDTO -> configJsonDTO.getTaskTypeName().equals(taskTypeName) && configJsonDTO.getQualifiedTask())
|
|
|
|
|
|
+ .filter(configJsonDTO -> configJsonDTO.getTaskTypeName().equals(taskTypeName) && configJsonDTO.getQualifiedTask()
|
|
|
|
+ && (configJsonDTO.getYydbStatusSelect() || configJsonDTO.getZbdbStatusSelect()))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
} else {
|
|
} else {
|
|
filterConfigJsonDTOList = configJsonDTOList.stream()
|
|
filterConfigJsonDTOList = configJsonDTOList.stream()
|
|
- .filter(configJsonDTO -> configJsonDTO.getQualifiedTask())
|
|
|
|
|
|
+ .filter(configJsonDTO -> configJsonDTO.getQualifiedTask()
|
|
|
|
+ && (configJsonDTO.getYydbStatusSelect() || configJsonDTO.getZbdbStatusSelect()))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -381,11 +392,13 @@ public class WmDeptTaskTypeConfigServiceImpl extends ServiceImpl<WmDeptTaskTypeC
|
|
if (StringUtils.isNotBlank(taskTypeName)) {
|
|
if (StringUtils.isNotBlank(taskTypeName)) {
|
|
filterAncestorConfigList = ancestorConfigJsonDTOList.stream()
|
|
filterAncestorConfigList = ancestorConfigJsonDTOList.stream()
|
|
.filter(configJsonDTO -> configJsonDTO.getTaskTypeName().equals(taskTypeName)
|
|
.filter(configJsonDTO -> configJsonDTO.getTaskTypeName().equals(taskTypeName)
|
|
- && configJsonDTO.getQualifiedTask() && configJsonDTO.getAssociateLower())
|
|
|
|
|
|
+ && configJsonDTO.getQualifiedTask() && configJsonDTO.getAssociateLower()
|
|
|
|
+ && (configJsonDTO.getYydbStatusSelect() || configJsonDTO.getZbdbStatusSelect()))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
} else {
|
|
} else {
|
|
filterAncestorConfigList = ancestorConfigJsonDTOList.stream()
|
|
filterAncestorConfigList = ancestorConfigJsonDTOList.stream()
|
|
- .filter(configJsonDTO -> configJsonDTO.getQualifiedTask() && configJsonDTO.getAssociateLower())
|
|
|
|
|
|
+ .filter(configJsonDTO -> configJsonDTO.getQualifiedTask() && configJsonDTO.getAssociateLower()
|
|
|
|
+ && (configJsonDTO.getYydbStatusSelect() || configJsonDTO.getZbdbStatusSelect()))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -406,22 +419,18 @@ public class WmDeptTaskTypeConfigServiceImpl extends ServiceImpl<WmDeptTaskTypeC
|
|
for (WmDeptTaskTypeConfigJsonDTO configJsonDTO : finalFilterConfigJsonDTOList) {
|
|
for (WmDeptTaskTypeConfigJsonDTO configJsonDTO : finalFilterConfigJsonDTOList) {
|
|
// 用户类型
|
|
// 用户类型
|
|
List<String> typeIdList = new ArrayList<>();
|
|
List<String> typeIdList = new ArrayList<>();
|
|
- if (configJsonDTO.getZbdbStatusEnable() && configJsonDTO.getZbdbStatusSelect()) {
|
|
|
|
|
|
+ if (configJsonDTO.getZbdbStatusSelect()) {
|
|
typeIdList.add("4");
|
|
typeIdList.add("4");
|
|
}
|
|
}
|
|
- if (configJsonDTO.getYydbStatusEnable() && configJsonDTO.getYydbStatusSelect()) {
|
|
|
|
|
|
+ if (configJsonDTO.getYydbStatusSelect()) {
|
|
typeIdList.add("3");
|
|
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.isNull("p.relation_score_id");
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- wrapper.or(wrapper2 -> wrapper2.ne("1", "1"));
|
|
|
|
- }
|
|
|
|
|
|
+ wrapper.or(wrapper2 -> {
|
|
|
|
+ wrapper2.eq("t.task_type_id", configJsonDTO.getTaskTypeId());
|
|
|
|
+ wrapper2.eq("t.dept_id", deptId);
|
|
|
|
+ wrapper2.in("p.typeid", typeIdList);
|
|
|
|
+ wrapper2.isNull("p.relation_score_id");
|
|
|
|
+ });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 关联了上级企业的包的任务 条件
|
|
// 关联了上级企业的包的任务 条件
|
|
@@ -435,16 +444,12 @@ public class WmDeptTaskTypeConfigServiceImpl extends ServiceImpl<WmDeptTaskTypeC
|
|
if (configJsonDTO.getYydbStatusEnable() && configJsonDTO.getYydbStatusSelect()) {
|
|
if (configJsonDTO.getYydbStatusEnable() && configJsonDTO.getYydbStatusSelect()) {
|
|
typeIdList.add("3");
|
|
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"));
|
|
|
|
- }
|
|
|
|
|
|
+ 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");
|
|
|
|
+ });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|