|
@@ -213,7 +213,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
for (int i = 0; i < dimensionData.size(); i++) {
|
|
|
JSONObject obj = dimensionData.getJSONObject(i);
|
|
|
String value = obj.getString(ruleBase.getIndicatorCode());
|
|
|
- if (MatchLogic.matchCondition(indicator.getString("dataType"), ruleBase.getRuleCondition(), threshold, value)) {
|
|
|
+ if (MatchLogic.matchCondition(indicator.getString("dataType"), ruleBase.getRuleCondition(), threshold, value, obj)) {
|
|
|
sendMsg(ruleGroup, obj, type, accountName);
|
|
|
}
|
|
|
}
|
|
@@ -232,6 +232,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
* @param indicators 指标数据
|
|
|
* @param matchData 匹配数据
|
|
|
* @param type 媒体类型 1:头条2:快手
|
|
|
+ * @param accountName 账户名称
|
|
|
* @return void
|
|
|
* @throws
|
|
|
* @author ZHAOXA
|
|
@@ -260,7 +261,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
return;
|
|
|
}
|
|
|
JSONObject accountEntity = dimensionData.getJSONObject(0);
|
|
|
- if (MatchLogic.matchCondition(dataType, ruleBase.getRuleCondition(), threshold, accountEntity.getString(ruleBase.getIndicatorCode()))) {
|
|
|
+ if (MatchLogic.matchCondition(dataType, ruleBase.getRuleCondition(), threshold, accountEntity.getString(ruleBase.getIndicatorCode()), accountEntity)) {
|
|
|
accountDatas.add(accountEntity);
|
|
|
} else {
|
|
|
log.warn("匹配规则组({}),账户维度数据不符合直接跳过", ruleGroup.getId());
|
|
@@ -313,7 +314,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
for (int i = 0; i < ruleDatas.size(); i++) {
|
|
|
JSONObject targetEntity = dimensionData.getJSONObject(i);
|
|
|
String value = targetEntity.getString(ruleBase.getIndicatorCode());
|
|
|
- if (MatchLogic.matchCondition(type, ruleBase.getRuleCondition(), threshold, value)) {
|
|
|
+ if (MatchLogic.matchCondition(type, ruleBase.getRuleCondition(), threshold, value, targetEntity)) {
|
|
|
okData.add(targetEntity);
|
|
|
}
|
|
|
}
|
|
@@ -322,7 +323,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
for (int i = 0; i < dimensionData.size(); i++) {
|
|
|
JSONObject targetEntity = dimensionData.getJSONObject(i);
|
|
|
String value = targetEntity.getString(ruleBase.getIndicatorCode());
|
|
|
- if (MatchLogic.matchCondition(type, ruleBase.getRuleCondition(), threshold, value)) {
|
|
|
+ if (MatchLogic.matchCondition(type, ruleBase.getRuleCondition(), threshold, value, targetEntity)) {
|
|
|
ruleDatas.add(targetEntity);
|
|
|
}
|
|
|
}
|
|
@@ -335,6 +336,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
* @param ruleGroup 达标的规则组对象
|
|
|
* @param obj 达标数据对象
|
|
|
* @param type 1:头条2:快手
|
|
|
+ * @param isNull 查询的值为空
|
|
|
* @return void
|
|
|
* @throws
|
|
|
* @author ZHAOXA
|
|
@@ -353,7 +355,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
}
|
|
|
type 1:头条2:快手
|
|
|
}*/
|
|
|
- String msg = MatchLogic.getMsg(ruleGroup, user, accountId, planId, creativeId, isPause, accountName);
|
|
|
+ String msg = MatchLogic.getMsg(ruleGroup, user, obj, isPause, accountName);
|
|
|
String sendType = ruleGroup.getSendType();
|
|
|
if ("SMS".equals(sendType)) {
|
|
|
|
|
@@ -495,7 +497,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
try {
|
|
|
Map<Long, Object> returnMap = new HashMap<>();
|
|
|
List<RuleTemplate> ruleTemplates = ruleTemplateMapper.selectByMap(null);
|
|
|
- ruleTemplates.forEach(tem -> {
|
|
|
+ for (RuleTemplate tem : ruleTemplates) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
QueryWrapper<RuleGroup> groupWrapper = new QueryWrapper<>();
|
|
|
groupWrapper.eq("template_id", tem.getId());
|
|
@@ -508,6 +510,8 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
group.setRuleBaseList(ruleBaseMapper.selectList(baseWrapper));
|
|
|
}
|
|
|
map.put("isCopy", copyGroups);
|
|
|
+ groupWrapper = new QueryWrapper<>();
|
|
|
+ groupWrapper.eq("template_id", tem.getId());
|
|
|
groupWrapper.eq("is_copy", NoEn.NO0.valueInt());
|
|
|
List<RuleGroup> notCopyGroups = ruleGroupMapper.selectList(groupWrapper);
|
|
|
for (RuleGroup group : notCopyGroups) {
|
|
@@ -519,7 +523,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
map.put("notCopy", notCopyGroups);
|
|
|
map.put("type", tem.getMediaType());
|
|
|
returnMap.put(tem.getId(), map);
|
|
|
- });
|
|
|
+ }
|
|
|
return returnMap;
|
|
|
} catch (Exception e) {
|
|
|
log.error("获取模板规则组集合异常", e);
|