|
@@ -97,6 +97,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
|
|
|
private JSONObject userObj = null;
|
|
|
private final static String ACCOUNT = "account";
|
|
|
+ private final static String UNIT = "unit";
|
|
|
private final static String PLAN = "plan";
|
|
|
private final static String CREATIVE = "creative";
|
|
|
|
|
@@ -401,9 +402,9 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
- } else if ("group".equals(ruleBase.getRuleDimension())) {
|
|
|
+ } else if (UNIT.equals(ruleBase.getRuleDimension())) {
|
|
|
groupDatas = getOKData(groupDatas, dimensionData, ruleBase, indicator, threshold);
|
|
|
- if (Check.isNull(targetDatas)) {
|
|
|
+ if (Check.isNull(groupDatas)) {
|
|
|
if (!Check.isNull(accountDatas)) {
|
|
|
accountDatas = null;
|
|
|
}
|
|
@@ -474,6 +475,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
}
|
|
|
JSONObject user = getUserByAccountId(accountId);
|
|
|
StringJoiner creativeJoiner = new StringJoiner(",");
|
|
|
+ StringJoiner unitJoiner = new StringJoiner(",");
|
|
|
StringJoiner planJoiner = new StringJoiner(",");
|
|
|
StringJoiner isNullCreativeJoiner = new StringJoiner(",");
|
|
|
StringJoiner isNullPlanJoiner = new StringJoiner(",");
|
|
@@ -515,6 +517,15 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
creativeJoiner = new StringJoiner(",");
|
|
|
creativeJoiner.add(obj.getString("creativeId"));
|
|
|
}
|
|
|
+ } else if (!Check.isNull(obj.getLong("unitId"))) {
|
|
|
+ if (unitJoiner.toString().getBytes().length <= 1800) {
|
|
|
+ unitJoiner.add(obj.getString("unitId"));
|
|
|
+ } else {
|
|
|
+ String msg = MatchLogic.getMessage(ruleGroup.getGroupName(), accountId, accountName, UNIT, unitJoiner.toString(), isNull);
|
|
|
+ sendMsg(msg, ruleGroup, user, UNIT, unitJoiner.toString(), accountId, mediaType);
|
|
|
+ unitJoiner = new StringJoiner(",");
|
|
|
+ unitJoiner.add(obj.getString("unitId"));
|
|
|
+ }
|
|
|
} else if (!Check.isNull(obj.getLong("planId"))) {
|
|
|
if (planJoiner.toString().getBytes().length <= 1800) {
|
|
|
planJoiner.add(obj.getString("planId"));
|
|
@@ -534,6 +545,10 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
String creativeMsg = MatchLogic.getMessage(ruleGroup.getGroupName(), accountId, accountName, CREATIVE, creativeJoiner.toString(), false);
|
|
|
sendMsg(creativeMsg, ruleGroup, user, CREATIVE, creativeJoiner.toString(), accountId, mediaType);
|
|
|
}
|
|
|
+ if (!Check.isNull(unitJoiner.toString())) {
|
|
|
+ String creativeMsg = MatchLogic.getMessage(ruleGroup.getGroupName(), accountId, accountName, UNIT, unitJoiner.toString(), false);
|
|
|
+ sendMsg(creativeMsg, ruleGroup, user, UNIT, unitJoiner.toString(), accountId, mediaType);
|
|
|
+ }
|
|
|
if (!Check.isNull(planJoiner.toString())) {
|
|
|
String planMsg = MatchLogic.getMessage(ruleGroup.getGroupName(), accountId, accountName, PLAN, planJoiner.toString(), false);
|
|
|
sendMsg(planMsg, ruleGroup, user, PLAN, planJoiner.toString(), accountId, mediaType);
|
|
@@ -600,9 +615,11 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
send.setGroupId(ruleGroup.getId());
|
|
|
send.setGroupName(ruleGroup.getGroupName());
|
|
|
if (CREATIVE.equals(type)) {
|
|
|
- send.setRuleDimension(CREATIVE);
|
|
|
+ send.setRuleDimension(type);
|
|
|
} else if (PLAN.equals(type)) {
|
|
|
- send.setRuleDimension(PLAN);
|
|
|
+ send.setRuleDimension(type);
|
|
|
+ } else if (UNIT.equals(type)) {
|
|
|
+ send.setRuleDimension(type);
|
|
|
} else {
|
|
|
send.setRuleDimension(ACCOUNT);
|
|
|
}
|
|
@@ -651,6 +668,11 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
|
if (!(boolean) updateMap.get("success")) {
|
|
|
msg = msg.replace(id, id + "(F)");
|
|
|
}
|
|
|
+ } else if (UNIT.equals(type)) {
|
|
|
+ updateMap = kuaiShouUpdateService.updateUnitStatus(token.getAccessToken(), accountId, Long.valueOf(id), NoEn.NO2.valueInt(), userId);
|
|
|
+ if (!(boolean) updateMap.get("success")) {
|
|
|
+ msg = msg.replace(id, id + "(F)");
|
|
|
+ }
|
|
|
} else if (PLAN.equals(type)) {
|
|
|
updateMap = kuaiShouUpdateService.updateCampaignStatus(token.getAccessToken(), accountId, Long.valueOf(id), NoEn.NO2.valueInt(), userId);
|
|
|
if (!(boolean) updateMap.get("success")) {
|