Commit 5b731da3 by tiger

清理执行次数

1 parent fe0e451c
...@@ -31,11 +31,10 @@ public class SopInstExecuteJobHandler { ...@@ -31,11 +31,10 @@ public class SopInstExecuteJobHandler {
SopStruct sop = sopService.loadSop(instId); SopStruct sop = sopService.loadSop(instId);
// 创建执行批次 // 创建执行批次
if (sop.getInst().getInstStatus() == 1) {
SopInstBatch batch = sopService.createBatch(sop.getInst()); SopInstBatch batch = sopService.createBatch(sop.getInst());
sop.setBatch(batch); sop.setBatch(batch);
}
// 重置节点执行次数
sopService.resetNodeDailyCount(sop);
// 创建所有节点任务 // 创建所有节点任务
SopXxlJobUtil.initSopNodesJob(sop); SopXxlJobUtil.initSopNodesJob(sop);
......
...@@ -176,6 +176,9 @@ public class SopService { ...@@ -176,6 +176,9 @@ public class SopService {
instMapper.updateInstBatchNo(sopInst.getInstId(), batch.getBatchNo(), batch.getSnapshot()); instMapper.updateInstBatchNo(sopInst.getInstId(), batch.getBatchNo(), batch.getSnapshot());
// 重置节点执行次数
instNodeMapper.resetInstNodeDailyCount(sopInst.getInstId());
return batch; return batch;
} }
...@@ -202,13 +205,15 @@ public class SopService { ...@@ -202,13 +205,15 @@ public class SopService {
instBatchMapper.updateByPrimaryKey(batch); instBatchMapper.updateByPrimaryKey(batch);
} }
// 过期机制
if (sopInst.getExpireTime() != null && sopInst.getExpireTime().before(new Date())) {
sopInst.setInstStatus((byte) -1);
}
instMapper.updateByPrimaryKey(sopInst); // 更新快照 instMapper.updateByPrimaryKey(sopInst); // 更新快照
instNodeMapper.updateByPrimaryKey(node); // 更新执行次数 instNodeMapper.updateByPrimaryKey(node); // 更新执行次数
} }
public void resetNodeDailyCount(SopStruct sop) {
instNodeMapper.resetInstNodeDailyCount(sop.getInst().getInstId());
}
/** 从实例倒推出模板,主要用于开发阶段 */ /** 从实例倒推出模板,主要用于开发阶段 */
@Transactional @Transactional
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!