Ver Fonte

Merge remote-tracking branch 'origin/master'

yumeng há 4 anos atrás
pai
commit
6d89ae3e52

+ 3 - 2
module-alarm/src/main/java/cn/com/ctop/alarm/modules/constant/MatchLogic.java

@@ -38,8 +38,9 @@ public class MatchLogic {
                 return false;
             }
             if (Check.isNull(value) || "[]".equals(value)) {
-                obj.put("isNull", true);
-                return true;
+                //洗出的数据为空的时候不报警,若想报警则改成true
+                obj.put("isNull", false);
+                return false;
             }
             obj.put("isNull", false);
             if ("number".equals(type)) {

+ 8 - 7
module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/impl/RuleGroupServiceImpl.java

@@ -37,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -297,7 +298,9 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
             if (ACCOUNT.equals(ruleBase.getRuleDimension())) {
                 JSONObject accountEntity = dimensionData.getJSONObject(0);
                 if (MatchLogic.matchCondition(indicator, ruleBase.getRuleCondition(), threshold, accountEntity.getString(ruleBase.getIndicatorCode()), accountEntity)) {
-                    accountDatas.add(accountEntity);
+                    if (Check.isNull(accountDatas)) {
+                        accountDatas.add(accountEntity);
+                    }
                 } else {
                     if (!Check.isNull(accountDatas)) {
                         accountDatas = null;
@@ -387,7 +390,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
         if (!Check.isNull(ruleDatas)) {
             JSONArray okData = new JSONArray();
             for (int i = 0; i < ruleDatas.size(); i++) {
-                JSONObject targetEntity = dimensionData.getJSONObject(i);
+                JSONObject targetEntity = ruleDatas.getJSONObject(i);
                 String value = targetEntity.getString(ruleBase.getIndicatorCode());
                 if (MatchLogic.matchCondition(indicator, ruleBase.getRuleCondition(), threshold, value, targetEntity)) {
                     okData.add(targetEntity);
@@ -524,17 +527,14 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
             } else if ("TEL".equals(sendType)) {
 
             } else {
-//                for (int i = 0; i < 10000000; i++) {
-//                    sendMessageService.sendMessage("1b3deb8258e84df994f1371a51cfc14a", msg + i);
-//                    Thread.sleep(2000);
-//                }
+//                sendMessageService.sendMessage("1b3deb8258e84df994f1371a51cfc14a", msg);
                 sendMessageService.sendMessage(user.getString("id"), msg);
                 Thread.sleep(200);
             }
             if (!Check.isNull(msg)) {
                 AlarmEventSend send = new AlarmEventSend();
                 send.setUserId(user.getString("id"));
-                send.setAlarmDetail(msg.replace("<br/>", ""));
+                send.setAlarmDetail(msg.replace("<br/>", ""));
                 send.setAlarmStatus(NoEn.NO1.valueStr());
                 send.setGroupId(ruleGroup.getId());
                 send.setGroupName(ruleGroup.getGroupName());
@@ -545,6 +545,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
                 } else {
                     send.setRuleDimension(ACCOUNT);
                 }
+                send.setCreateTime(new Date());
                 alarmEventSendMapper.insert(send);
             }
         } catch (Exception e) {

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/utils/KuaishouInterfaceConstant.java

@@ -127,7 +127,7 @@ public class KuaishouInterfaceConstant {
     /**
      * 获取人群包接口
      */
-    public static final String POPULATION_LIST = "/rest/openapi/v1/dmp/population/list";
+    public static final String POPULATION_LIST = "/rest/openapi/v2/dmp/population/list";
 
     /**
      * 删除人群包接口

+ 10 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ReportServiceImpl.java

@@ -189,6 +189,16 @@ public class ReportServiceImpl implements IReportService {
             ruleDataPlan.setAccountName(allocation.getAuthName());
             ByteDanceAdvertisePlan plan = advertiserDataService.getSinglePlanById(token,ruleDataPlan.getId()+"");
             if(null!=plan){
+                String status = plan.getToutiaoStatus();
+                String optStatus = plan.getOptStatus();
+                if(null == optStatus||optStatus.equals("AD_STATUS_DISABLE")||optStatus.trim().equals("")){
+                    continue;
+                }
+                if(null == status||status.trim().equals("")||status.equals("AD_STATUS_DISABLE")
+                        ||status.equals("AD_STATUS_DONE")||status.equals("AD_STATUS_AUDIT_DENY")||status.equals("AD_STATUS_BALANCE_EXCEED")
+                        ||status.equals("AD_STATUS_CAMPAIGN_DISABLE")||status.equals("AD_STATUS_CAMPAIGN_EXCEED")||status.equals("AD_STATUS_DELETE")){
+                    continue;
+                }
                 ruleDataPlan.setBudget(plan.getBudget());
                 ruleDataPlan.setDownloadUrl(plan.getDownloadUrl());
                 ruleDataPlan.setExternalUrl(plan.getExternalUrl());