Sfoglia il codice sorgente

run表记录触发数

zhaotx 7 mesi fa
parent
commit
2eb13fbc2e

+ 1 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/entity/ZtPolicyRunInfo.java

@@ -16,7 +16,7 @@ public class ZtPolicyRunInfo {
     private Date startTime;
     private Date endTime;
     private Integer triggered;
+    private Integer triggerNum;
     private Integer resultStatus;
     private String errorMessage;
-    private String configSnapshotJson;
 }

+ 2 - 2
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/mapper/xml/ZtPolicyMapper.xml

@@ -50,9 +50,9 @@
     </insert>
     <insert id="insertPolicyRunRecord">
         insert into deepthink.zt_policy_run
-            (run_id, policy_config_id, scheduled_time, result_status, config_snapshot_json)
+            (run_id, policy_config_id, scheduled_time, result_status, trigger_num)
         values
-            (#{runId}, #{policyConfigId}, #{scheduledTime}, 0, #{configSnapshotJson})
+            (#{runId}, #{policyConfigId}, #{scheduledTime}, 0, #{triggerNum})
     </insert>
     <insert id="insertActionLog">
             insert into deepthink.zt_policy_action_log

+ 2 - 2
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/ZtPolicyRunServiceImpl.java

@@ -78,7 +78,6 @@ public class ZtPolicyRunServiceImpl implements IZtPolicyRunService {
         ztPolicyRunInfo.setPolicyConfigId(policyId);
         ztPolicyRunInfo.setScheduledTime(new Date());
         ztPolicyRunInfo.setStartTime(new Date());
-        ztPolicyRunInfo.setConfigSnapshotJson(JSONObject.toJSONString(policy));
         ztPolicyConfigMapper.insertPolicyRunRecord(ztPolicyRunInfo);
 
         List<ZtPolicyCondition> conditions = policy.getConditions();
@@ -310,7 +309,8 @@ public class ZtPolicyRunServiceImpl implements IZtPolicyRunService {
             ztPolicyConfigMapper.updatePolicyRunRecord(ztPolicyRunInfo);
             return;
         }else {
-            ztPolicyRunInfo.setTriggered(0);
+            ztPolicyRunInfo.setTriggered(1);
+            ztPolicyRunInfo.setTriggerNum(executeTargetList.size());
             ztPolicyConfigMapper.updatePolicyRunRecord(ztPolicyRunInfo);
         }