Commit 8dd6a782 by zhouhaibao

feat(strategy): 添加媒体ID支持并优化条件变量查询

- 在动作快照中添加mediaIds字段存储
- 实现元条件变量缓存查询替代直接名称匹配
- 重构条件变量名称获取逻辑使用流式处理
- 更新动作类型描述为更精确的目标客户群消息发送
1 parent 45eff26d
......@@ -288,6 +288,7 @@ public class SopStrategySnapshotCacheService {
}
actionMapItem.put("content", content);
actionMapItem.put("jumpUrl", action.getJumpUrl());
actionMapItem.put("mediaIds", action.getMediaIds());
actionMapItem.put("bgColor", action.getBgColor());
actionMapItem.put("materialJson", action.getMaterialJson());
actionMapItem.put("intervalPx", action.getIntervalPx());
......@@ -402,9 +403,16 @@ public class SopStrategySnapshotCacheService {
}
private Map<String, Object> buildConditionSnapshot(SopStrategyCondition condition) {
List<SopStrategyMetaConditionVariable> variables = metaConditionVariableMapper.selectByStatus(1);
Map<String, Object> conditionMap = new LinkedHashMap<>();
conditionMap.put("variableCode", condition.getVariableCode());
conditionMap.put("variableName", condition.getVariableName());
List<SopStrategyMetaConditionVariable> collect = variables.stream()
.filter(v -> v.getVariableCode().equals(condition.getVariableCode())).collect(
Collectors.toList());
if (collect.size() > 0) {
conditionMap.put("variableName",collect.get(0).getVariableName());
}
conditionMap.put("valueType", condition.getValueType());
conditionMap.put("operator", condition.getOperator());
conditionMap.put("operatorDesc", getOperatorDesc(condition.getOperator()));
......@@ -467,7 +475,7 @@ public class SopStrategySnapshotCacheService {
private String getActionTypeName(Integer actionType) {
if (actionType == null) return "";
switch (actionType) {
case 1: return "发送消息";
case 1: return "向目标客户群发送消息";
default: return "";
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!